flowcommerce 0.0.89 → 0.0.90

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2dff6b4af897fb53665eaa50b51565c457526e8e
4
- data.tar.gz: 618b252e53f31651d1845b44e015787183d419ca
3
+ metadata.gz: 236cabf874c2c1fa7b885f1e4da31f732a7e1fac
4
+ data.tar.gz: 53aa8b47c295e6dd0c97640bab0204c575b892b1
5
5
  SHA512:
6
- metadata.gz: 6c10b96a306147fb8bb2361ba57d05633042e0743ab38c0ad5bae8bc08609d0aa5bf3cfce2f8fad6102acb2c3988398720f457a36b69bf7bbfe714218b9fa884
7
- data.tar.gz: 2add23e2c4dfc9fc04078ddcd9c1b730d3226864d71cc58fc2482a1e236df5c55d65566317bec17c8f4485057f3113b1ba3e1436d7e5da18d829522c78152f62
6
+ metadata.gz: f10e53238169a8120d52b6449b55cabd70bb3d265fb2065f4f16375d583127d9923c3a9eeeaff7ab05334f37f06e4438661449d164825831cd939300abee5ad7
7
+ data.tar.gz: 7d4c859684a3afb6aa01f6bdce026a9575989e05f71017d705dbb18a5a85972af55a632835a80e19455e6fedc5d123ed8d8145f3d88a59129c1fc7822806bcb4
@@ -1,6 +1,6 @@
1
1
  # Generated by apidoc - http://www.apidoc.me
2
2
  # Service version: 0.1.77
3
- # apidoc:0.11.49 http://www.apidoc.me/flow/api/0.2.0/ruby_client
3
+ # apidoc:0.11.49 http://www.apidoc.me/flow/api/0.2.3/ruby_client
4
4
 
5
5
  require 'cgi'
6
6
  require 'net/http'
@@ -25,7 +25,7 @@ module Io
25
25
 
26
26
  BASE_URL = 'https://api.flow.io' unless defined?(Constants::BASE_URL)
27
27
  NAMESPACE = 'io.flow.v0' unless defined?(Constants::NAMESPACE)
28
- USER_AGENT = 'apidoc:0.11.49 http://www.apidoc.me/flow/api/0.2.0/ruby_client' unless defined?(Constants::USER_AGENT)
28
+ USER_AGENT = 'apidoc:0.11.49 http://www.apidoc.me/flow/api/0.2.3/ruby_client' unless defined?(Constants::USER_AGENT)
29
29
  VERSION = '0.1.77' unless defined?(Constants::VERSION)
30
30
  VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
31
31
 
@@ -3672,6 +3672,8 @@ module Io
3672
3672
  query = {
3673
3673
  :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
3674
3674
  :token => (x = opts.delete(:token); x.nil? ? nil : HttpClient::Preconditions.assert_class('token', x, String)),
3675
+ :organization => (x = opts.delete(:organization); x.nil? ? nil : HttpClient::Preconditions.assert_class('organization', x, String)),
3676
+ :partner => (x = opts.delete(:partner); x.nil? ? nil : HttpClient::Preconditions.assert_class('partner', x, String)),
3675
3677
  :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
3676
3678
  :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
3677
3679
  :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
@@ -3714,7 +3716,7 @@ module Io
3714
3716
  def post_authentications(token_authentication_form)
3715
3717
  HttpClient::Preconditions.assert_class('token_authentication_form', token_authentication_form, ::Io::Flow::V0::Models::TokenAuthenticationForm)
3716
3718
  r = @client.request("/tokens/authentications").with_json(token_authentication_form.to_json).post
3717
- ::Io::Flow::V0::Models::LegacyTokenReference.new(r)
3719
+ ::Io::Flow::V0::Models::TokenReference.from_json(r)
3718
3720
  end
3719
3721
 
3720
3722
  # Preferred method to validate a token if valid for a given partner, obtaining
@@ -4942,6 +4944,68 @@ module Io
4942
4944
 
4943
4945
  end
4944
4946
 
4947
+ class TokenReference
4948
+
4949
+ module Types
4950
+ LEGACY_TOKEN_REFERENCE = 'legacy_token_reference' unless defined?(LEGACY_TOKEN_REFERENCE)
4951
+ ORGANIZATION_TOKEN_REFERENCE = 'organization_token_reference' unless defined?(ORGANIZATION_TOKEN_REFERENCE)
4952
+ PARTNER_TOKEN_REFERENCE = 'partner_token_reference' unless defined?(PARTNER_TOKEN_REFERENCE)
4953
+ end
4954
+
4955
+ def initialize(incoming={})
4956
+ opts = HttpClient::Helper.symbolize_keys(incoming)
4957
+ HttpClient::Preconditions.require_keys(opts, [:name], 'TokenReference')
4958
+ @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
4959
+ end
4960
+
4961
+ def subtype_to_hash
4962
+ raise 'Cannot serialize an instance of token_reference directly - must use one of the specific types: legacy_token_reference, organization_token_reference, partner_token_reference'
4963
+ end
4964
+
4965
+ def to_hash
4966
+ subtype_to_hash.merge(:discriminator => @name)
4967
+ end
4968
+
4969
+ def TokenReference.from_json(hash)
4970
+ HttpClient::Preconditions.assert_class('hash', hash, Hash)
4971
+ discriminator = HttpClient::Helper.symbolize_keys(hash)[:discriminator].to_s.strip
4972
+ if discriminator.empty?
4973
+ raise "Union type[token_reference] requires a field named 'discriminator'"
4974
+ end
4975
+ case discriminator
4976
+ when Types::LEGACY_TOKEN_REFERENCE; LegacyTokenReference.new(hash)
4977
+ when Types::ORGANIZATION_TOKEN_REFERENCE; OrganizationTokenReference.new(hash)
4978
+ when Types::PARTNER_TOKEN_REFERENCE; PartnerTokenReference.new(hash)
4979
+ else TokenReferenceUndefinedType.new(:name => discriminator)
4980
+ end
4981
+ end
4982
+
4983
+ end
4984
+
4985
+ class TokenReferenceUndefinedType < TokenReference
4986
+
4987
+ attr_reader :name
4988
+
4989
+ def initialize(incoming={})
4990
+ super(:name => 'undefined_type')
4991
+ opts = HttpClient::Helper.symbolize_keys(incoming)
4992
+ @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
4993
+ end
4994
+
4995
+ def subtype_to_hash
4996
+ raise 'Unable to serialize undefined type to json'
4997
+ end
4998
+
4999
+ def copy(incoming={})
5000
+ raise 'Operation not supported for undefined type'
5001
+ end
5002
+
5003
+ def to_hash
5004
+ raise 'Operation not supported for undefined type'
5005
+ end
5006
+
5007
+ end
5008
+
4945
5009
  class AdjustmentReasonKey
4946
5010
 
4947
5011
  attr_reader :value
@@ -5348,17 +5412,13 @@ module Io
5348
5412
  end
5349
5413
 
5350
5414
  def CardType.ALL
5351
- @@all ||= [CardType.american_express, CardType.ban_contact, CardType.cartes_bancaires, CardType.china_union_pay, CardType.dankort, CardType.diners_club, CardType.discover, CardType.jcb, CardType.maestro, CardType.mastercard, CardType.visa]
5415
+ @@all ||= [CardType.american_express, CardType.cartes_bancaires, CardType.china_union_pay, CardType.dankort, CardType.diners_club, CardType.discover, CardType.jcb, CardType.maestro, CardType.mastercard, CardType.visa]
5352
5416
  end
5353
5417
 
5354
5418
  def CardType.american_express
5355
5419
  @@_american_express ||= CardType.new('american_express')
5356
5420
  end
5357
5421
 
5358
- def CardType.ban_contact
5359
- @@_ban_contact ||= CardType.new('ban_contact')
5360
- end
5361
-
5362
5422
  def CardType.cartes_bancaires
5363
5423
  @@_cartes_bancaires ||= CardType.new('cartes_bancaires')
5364
5424
  end
@@ -13240,11 +13300,12 @@ module Io
13240
13300
  end
13241
13301
 
13242
13302
  # Summary data for a given token
13243
- class LegacyTokenReference
13303
+ class LegacyTokenReference < TokenReference
13244
13304
 
13245
13305
  attr_reader :id, :user
13246
13306
 
13247
13307
  def initialize(incoming={})
13308
+ super(:name => TokenReference::Types::LEGACY_TOKEN_REFERENCE)
13248
13309
  opts = HttpClient::Helper.symbolize_keys(incoming)
13249
13310
  HttpClient::Preconditions.require_keys(opts, [:id, :user], 'LegacyTokenReference')
13250
13311
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
@@ -13256,10 +13317,10 @@ module Io
13256
13317
  end
13257
13318
 
13258
13319
  def copy(incoming={})
13259
- LegacyTokenReference.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
13320
+ LegacyTokenReference.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
13260
13321
  end
13261
13322
 
13262
- def to_hash
13323
+ def subtype_to_hash
13263
13324
  {
13264
13325
  :id => id,
13265
13326
  :user => user.to_hash
@@ -15179,15 +15240,17 @@ module Io
15179
15240
  end
15180
15241
 
15181
15242
  # Summary data for a given token
15182
- class OrganizationTokenReference
15243
+ class OrganizationTokenReference < TokenReference
15183
15244
 
15184
- attr_reader :id, :organization, :user
15245
+ attr_reader :id, :organization, :environment, :user
15185
15246
 
15186
15247
  def initialize(incoming={})
15248
+ super(:name => TokenReference::Types::ORGANIZATION_TOKEN_REFERENCE)
15187
15249
  opts = HttpClient::Helper.symbolize_keys(incoming)
15188
- HttpClient::Preconditions.require_keys(opts, [:id, :organization, :user], 'OrganizationTokenReference')
15250
+ HttpClient::Preconditions.require_keys(opts, [:id, :organization, :environment, :user], 'OrganizationTokenReference')
15189
15251
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
15190
15252
  @organization = (x = opts.delete(:organization); x.is_a?(::Io::Flow::V0::Models::OrganizationReference) ? x : ::Io::Flow::V0::Models::OrganizationReference.new(x))
15253
+ @environment = (x = opts.delete(:environment); x.is_a?(::Io::Flow::V0::Models::Environment) ? x : ::Io::Flow::V0::Models::Environment.apply(x))
15191
15254
  @user = (x = opts.delete(:user); x.is_a?(::Io::Flow::V0::Models::UserReference) ? x : ::Io::Flow::V0::Models::UserReference.new(x))
15192
15255
  end
15193
15256
 
@@ -15196,13 +15259,14 @@ module Io
15196
15259
  end
15197
15260
 
15198
15261
  def copy(incoming={})
15199
- OrganizationTokenReference.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
15262
+ OrganizationTokenReference.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
15200
15263
  end
15201
15264
 
15202
- def to_hash
15265
+ def subtype_to_hash
15203
15266
  {
15204
15267
  :id => id,
15205
15268
  :organization => organization.to_hash,
15269
+ :environment => environment.value,
15206
15270
  :user => user.to_hash
15207
15271
  }
15208
15272
  end
@@ -15311,6 +15375,32 @@ module Io
15311
15375
 
15312
15376
  end
15313
15377
 
15378
+ class PartnerReference
15379
+
15380
+ attr_reader :id
15381
+
15382
+ def initialize(incoming={})
15383
+ opts = HttpClient::Helper.symbolize_keys(incoming)
15384
+ HttpClient::Preconditions.require_keys(opts, [:id], 'PartnerReference')
15385
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
15386
+ end
15387
+
15388
+ def to_json
15389
+ JSON.dump(to_hash)
15390
+ end
15391
+
15392
+ def copy(incoming={})
15393
+ PartnerReference.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
15394
+ end
15395
+
15396
+ def to_hash
15397
+ {
15398
+ :id => id
15399
+ }
15400
+ end
15401
+
15402
+ end
15403
+
15314
15404
  # All of the metadata associated with a given token.
15315
15405
  class PartnerToken < Token
15316
15406
 
@@ -15321,7 +15411,7 @@ module Io
15321
15411
  opts = HttpClient::Helper.symbolize_keys(incoming)
15322
15412
  HttpClient::Preconditions.require_keys(opts, [:id, :partner, :user, :environment, :partial, :created_at], 'PartnerToken')
15323
15413
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
15324
- @partner = HttpClient::Preconditions.assert_class('partner', opts.delete(:partner), String)
15414
+ @partner = (x = opts.delete(:partner); x.is_a?(::Io::Flow::V0::Models::PartnerReference) ? x : ::Io::Flow::V0::Models::PartnerReference.new(x))
15325
15415
  @user = (x = opts.delete(:user); x.is_a?(::Io::Flow::V0::Models::UserReference) ? x : ::Io::Flow::V0::Models::UserReference.new(x))
15326
15416
  @environment = (x = opts.delete(:environment); x.is_a?(::Io::Flow::V0::Models::Environment) ? x : ::Io::Flow::V0::Models::Environment.apply(x))
15327
15417
  @partial = HttpClient::Preconditions.assert_class('partial', opts.delete(:partial), String)
@@ -15340,7 +15430,7 @@ module Io
15340
15430
  def subtype_to_hash
15341
15431
  {
15342
15432
  :id => id,
15343
- :partner => partner,
15433
+ :partner => partner.to_hash,
15344
15434
  :user => user.to_hash,
15345
15435
  :environment => environment.value,
15346
15436
  :partial => partial,
@@ -15385,15 +15475,17 @@ module Io
15385
15475
  end
15386
15476
 
15387
15477
  # Summary data for a given token
15388
- class PartnerTokenReference
15478
+ class PartnerTokenReference < TokenReference
15389
15479
 
15390
- attr_reader :id, :partner, :user
15480
+ attr_reader :id, :partner, :environment, :user
15391
15481
 
15392
15482
  def initialize(incoming={})
15483
+ super(:name => TokenReference::Types::PARTNER_TOKEN_REFERENCE)
15393
15484
  opts = HttpClient::Helper.symbolize_keys(incoming)
15394
- HttpClient::Preconditions.require_keys(opts, [:id, :partner, :user], 'PartnerTokenReference')
15485
+ HttpClient::Preconditions.require_keys(opts, [:id, :partner, :environment, :user], 'PartnerTokenReference')
15395
15486
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
15396
- @partner = HttpClient::Preconditions.assert_class('partner', opts.delete(:partner), String)
15487
+ @partner = (x = opts.delete(:partner); x.is_a?(::Io::Flow::V0::Models::PartnerReference) ? x : ::Io::Flow::V0::Models::PartnerReference.new(x))
15488
+ @environment = (x = opts.delete(:environment); x.is_a?(::Io::Flow::V0::Models::Environment) ? x : ::Io::Flow::V0::Models::Environment.apply(x))
15397
15489
  @user = (x = opts.delete(:user); x.is_a?(::Io::Flow::V0::Models::UserReference) ? x : ::Io::Flow::V0::Models::UserReference.new(x))
15398
15490
  end
15399
15491
 
@@ -15402,13 +15494,14 @@ module Io
15402
15494
  end
15403
15495
 
15404
15496
  def copy(incoming={})
15405
- PartnerTokenReference.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
15497
+ PartnerTokenReference.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
15406
15498
  end
15407
15499
 
15408
- def to_hash
15500
+ def subtype_to_hash
15409
15501
  {
15410
15502
  :id => id,
15411
- :partner => partner,
15503
+ :partner => partner.to_hash,
15504
+ :environment => environment.value,
15412
15505
  :user => user.to_hash
15413
15506
  }
15414
15507
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flowcommerce
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.89
4
+ version: 0.0.90
5
5
  platform: ruby
6
6
  authors:
7
7
  - Flow Commerce, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-14 00:00:00.000000000 Z
11
+ date: 2016-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json