flowcommerce 0.2.22 → 0.2.23

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b24a2aaf4591d550b27c6f24b5a9b255f019893f
4
- data.tar.gz: f288de1afd0c711175f670b8cbadda5102e64ff6
3
+ metadata.gz: 9ba3abdf0ee7ed05bcb8bde4697d2ae58705e4b7
4
+ data.tar.gz: 70e9d6313114f9aeb9200e47ad473b4bce4639b9
5
5
  SHA512:
6
- metadata.gz: 6307c5cf4fb5d05c80aacc0e1d13f6345efa295b86d81ff6fc024c00b5f106d0ef48973da94c70f8713072ea701b4e65edb4a3b0659d8c3182a20df28b632ff3
7
- data.tar.gz: 1f986fa66391215571b5e8095199506907281697c809f2c4651f54c690b23be42a336271101a3f7a691b583730c8a4c6233c0eb1ecf0a5945551cb551185e02c
6
+ metadata.gz: 72908f7d0c1037638bfaa2f2d0de33cfa4316cc1b48d9abff64994c032272ca42e2a07017fb366cd6e1b108fe5b0caa6ffd9a430e34f85f022b04d595486e0d5
7
+ data.tar.gz: 3e2ba0e3169b27ddcb22a1e8c652f5f9b76f766fb3422b9136049a65ae848c57c212953b9059e1589e15e2d6383c107bc8fc9924df272436c12d83ecf09840a2
@@ -1,6 +1,6 @@
1
1
  # Generated by API Builder - https://www.apibuilder.io
2
2
  # Service version: 0.3.50
3
- # apibuilder:0.12.20 https://app.apibuilder.io/flow/api/0.3.50/ruby_client
3
+ # apibuilder:0.12.38 https://app.apibuilder.io/flow/api/0.3.57/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 = 'apibuilder:0.12.20 https://app.apibuilder.io/flow/api/0.3.50/ruby_client' unless defined?(Constants::USER_AGENT)
28
+ USER_AGENT = 'apibuilder:0.12.38 https://app.apibuilder.io/flow/api/0.3.57/ruby_client' unless defined?(Constants::USER_AGENT)
29
29
  VERSION = '0.3.50' unless defined?(Constants::VERSION)
30
30
  VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
31
31
 
@@ -5569,68 +5569,6 @@ module Io
5569
5569
 
5570
5570
  end
5571
5571
 
5572
- class ExpandablePayment
5573
-
5574
- module Types
5575
- PAYMENT_PAYPAL = 'payment_paypal' unless defined?(PAYMENT_PAYPAL)
5576
- PAYMENT_REFERENCE = 'payment_reference' unless defined?(PAYMENT_REFERENCE)
5577
- end
5578
-
5579
- attr_reader :discriminator
5580
-
5581
- def initialize(incoming={})
5582
- opts = HttpClient::Helper.symbolize_keys(incoming)
5583
- HttpClient::Preconditions.require_keys(opts, [:discriminator], 'ExpandablePayment')
5584
- @discriminator = HttpClient::Preconditions.assert_class('discriminator', opts.delete(:discriminator), String)
5585
- end
5586
-
5587
- def subtype_to_hash
5588
- raise 'Cannot serialize an instance of expandable_payment directly - must use one of the specific types: payment_paypal, payment_reference'
5589
- end
5590
-
5591
- def to_hash
5592
- subtype_to_hash.merge(:discriminator => @discriminator)
5593
- end
5594
-
5595
- def ExpandablePayment.from_json(hash)
5596
- HttpClient::Preconditions.assert_class('hash', hash, Hash)
5597
- discriminator = HttpClient::Helper.symbolize_keys(hash)[:discriminator].to_s.strip
5598
- if discriminator.empty?
5599
- raise "Union type[expandable_payment] requires a field named 'discriminator'"
5600
- end
5601
- case discriminator
5602
- when Types::PAYMENT_PAYPAL; PaymentPaypal.new(hash)
5603
- when Types::PAYMENT_REFERENCE; PaymentReference.new(hash)
5604
- else ExpandablePaymentUndefinedType.new(:discriminator => discriminator)
5605
- end
5606
- end
5607
-
5608
- end
5609
-
5610
- class ExpandablePaymentUndefinedType < ExpandablePayment
5611
-
5612
- attr_reader :name
5613
-
5614
- def initialize(incoming={})
5615
- super(:discriminator => 'undefined_type')
5616
- opts = HttpClient::Helper.symbolize_keys(incoming)
5617
- @name = HttpClient::Preconditions.assert_class('name', opts.delete(:discriminator), String)
5618
- end
5619
-
5620
- def subtype_to_hash
5621
- raise 'Unable to serialize undefined type to json'
5622
- end
5623
-
5624
- def copy(incoming={})
5625
- raise 'Operation not supported for undefined type'
5626
- end
5627
-
5628
- def to_hash
5629
- raise 'Operation not supported for undefined type'
5630
- end
5631
-
5632
- end
5633
-
5634
5572
  # A subcatalog can be represented with just it's ID, or the entire model
5635
5573
  class ExpandableSubcatalog
5636
5574
 
@@ -7206,19 +7144,20 @@ module Io
7206
7144
  end
7207
7145
 
7208
7146
  def AuthorizationStatus.ALL
7209
- @@all ||= [AuthorizationStatus.pending, AuthorizationStatus.pending_call_bank, AuthorizationStatus.authorized, AuthorizationStatus.declined, AuthorizationStatus.voided]
7147
+ @@all ||= [AuthorizationStatus.pending, AuthorizationStatus.expired, AuthorizationStatus.authorized, AuthorizationStatus.review, AuthorizationStatus.declined, AuthorizationStatus.voided]
7210
7148
  end
7211
7149
 
7212
- # If an immediate response is not available, the state will be 'pending' - this
7213
- # usually indicates fraud review requires additional time / verification (or a
7214
- # potential network issue with the issuing bank)
7150
+ # If an immediate response is not available, the state will be 'pending'. For
7151
+ # example, online payment methods like AliPay or PayPal will have a status of
7152
+ # 'pending' until the user completes the payment. Pending authorizations expire
7153
+ # if the user does not complete the payment in a timely fashion.
7215
7154
  def AuthorizationStatus.pending
7216
7155
  @@_pending ||= AuthorizationStatus.new('pending')
7217
7156
  end
7218
7157
 
7219
- # Bank is requesting consumer contact them directly to authorize the transaction
7220
- def AuthorizationStatus.pending_call_bank
7221
- @@_pending_call_bank ||= AuthorizationStatus.new('pending_call_bank')
7158
+ # Authorization has expired.
7159
+ def AuthorizationStatus.expired
7160
+ @@_expired ||= AuthorizationStatus.new('expired')
7222
7161
  end
7223
7162
 
7224
7163
  # Authorization was successful
@@ -7226,6 +7165,13 @@ module Io
7226
7165
  @@_authorized ||= AuthorizationStatus.new('authorized')
7227
7166
  end
7228
7167
 
7168
+ # If an immediate response is not available, the state will be 'review' - this
7169
+ # usually indicates fraud review requires additional time / verification (or a
7170
+ # potential network issue with the issuing bank)
7171
+ def AuthorizationStatus.review
7172
+ @@_review ||= AuthorizationStatus.new('review')
7173
+ end
7174
+
7229
7175
  # Indicates the authorization has been declined by the issuing bank. See the
7230
7176
  # authorization decline code for more details as to the reason for decline.
7231
7177
  def AuthorizationStatus.declined
@@ -7456,7 +7402,7 @@ module Io
7456
7402
  end
7457
7403
 
7458
7404
  def CardErrorCode.ALL
7459
- @@all ||= [CardErrorCode.invalid_address, CardErrorCode.invalid_name, CardErrorCode.invalid_number, CardErrorCode.invalid_expiration, CardErrorCode.avs, CardErrorCode.cvv, CardErrorCode.fraud, CardErrorCode.unknown]
7405
+ @@all ||= [CardErrorCode.invalid_address, CardErrorCode.invalid_name, CardErrorCode.invalid_number, CardErrorCode.invalid_expiration, CardErrorCode.invalid_token_type, CardErrorCode.avs, CardErrorCode.cvv, CardErrorCode.fraud, CardErrorCode.unknown]
7460
7406
  end
7461
7407
 
7462
7408
  # Invalid billing address
@@ -7479,6 +7425,11 @@ module Io
7479
7425
  @@_invalid_expiration ||= CardErrorCode.new('invalid_expiration')
7480
7426
  end
7481
7427
 
7428
+ # Cannot create a permanent card via an unauthorized request
7429
+ def CardErrorCode.invalid_token_type
7430
+ @@_invalid_token_type ||= CardErrorCode.new('invalid_token_type')
7431
+ end
7432
+
7482
7433
  # Declined due to avs mismatch
7483
7434
  def CardErrorCode.avs
7484
7435
  @@_avs ||= CardErrorCode.new('avs')
@@ -7650,7 +7601,7 @@ module Io
7650
7601
  end
7651
7602
 
7652
7603
  def CreditPaymentErrorCode.ALL
7653
- @@all ||= [CreditPaymentErrorCode.generic_error, CreditPaymentErrorCode.invalid_order_number, CreditPaymentErrorCode.invalid_currency, CreditPaymentErrorCode.invalid_description, CreditPaymentErrorCode.duplicate, CreditPaymentErrorCode.amount_must_be_positive, CreditPaymentErrorCode.amount_exceeds_balance]
7604
+ @@all ||= [CreditPaymentErrorCode.generic_error, CreditPaymentErrorCode.invalid_order_number, CreditPaymentErrorCode.invalid_currency, CreditPaymentErrorCode.invalid_description, CreditPaymentErrorCode.duplicate, CreditPaymentErrorCode.amount_must_be_positive, CreditPaymentErrorCode.amount_exceeds_balance, CreditPaymentErrorCode.insufficient_amount]
7654
7605
  end
7655
7606
 
7656
7607
  def CreditPaymentErrorCode.generic_error
@@ -7688,6 +7639,12 @@ module Io
7688
7639
  @@_amount_exceeds_balance ||= CreditPaymentErrorCode.new('amount_exceeds_balance')
7689
7640
  end
7690
7641
 
7642
+ # Indicates the provided credit amount exceeds the maximum amount of applicable
7643
+ # credit
7644
+ def CreditPaymentErrorCode.insufficient_amount
7645
+ @@_insufficient_amount ||= CreditPaymentErrorCode.new('insufficient_amount')
7646
+ end
7647
+
7691
7648
  def to_hash
7692
7649
  value
7693
7650
  end
@@ -10830,6 +10787,52 @@ module Io
10830
10787
 
10831
10788
  end
10832
10789
 
10790
+ class TokenType
10791
+
10792
+ attr_reader :value
10793
+
10794
+ def initialize(value)
10795
+ @value = HttpClient::Preconditions.assert_class('value', value, String)
10796
+ end
10797
+
10798
+ # Returns the instance of TokenType for this value, creating a new instance for an unknown value
10799
+ def TokenType.apply(value)
10800
+ if value.instance_of?(TokenType)
10801
+ value
10802
+ else
10803
+ HttpClient::Preconditions.assert_class_or_nil('value', value, String)
10804
+ value.nil? ? nil : (from_string(value) || TokenType.new(value))
10805
+ end
10806
+ end
10807
+
10808
+ # Returns the instance of TokenType for this value, or nil if not found
10809
+ def TokenType.from_string(value)
10810
+ HttpClient::Preconditions.assert_class('value', value, String)
10811
+ TokenType.ALL.find { |v| v.value == value }
10812
+ end
10813
+
10814
+ def TokenType.ALL
10815
+ @@all ||= [TokenType.permanent, TokenType.one_time]
10816
+ end
10817
+
10818
+ # Create a permanent token for the card (stored up until normal purge interval)
10819
+ def TokenType.permanent
10820
+ @@_permanent ||= TokenType.new('permanent')
10821
+ end
10822
+
10823
+ # Create a one time token for the card. This token can be used to either
10824
+ # authorized payment or later exchange for a permanent token. Once used, this
10825
+ # token cannot be used for future activity.
10826
+ def TokenType.one_time
10827
+ @@_one_time ||= TokenType.new('one_time')
10828
+ end
10829
+
10830
+ def to_hash
10831
+ value
10832
+ end
10833
+
10834
+ end
10835
+
10833
10836
  class TrackingNumberType
10834
10837
 
10835
10838
  attr_reader :value
@@ -12611,6 +12614,36 @@ module Io
12611
12614
 
12612
12615
  end
12613
12616
 
12617
+ class CaptureError
12618
+
12619
+ attr_reader :code, :messages, :decline_code
12620
+
12621
+ def initialize(incoming={})
12622
+ opts = HttpClient::Helper.symbolize_keys(incoming)
12623
+ HttpClient::Preconditions.require_keys(opts, [:messages, :decline_code], 'CaptureError')
12624
+ @code = (x = (x = opts.delete(:code); x.nil? ? "generic_error" : x); x.is_a?(::Io::Flow::V0::Models::GenericErrorCode) ? x : ::Io::Flow::V0::Models::GenericErrorCode.apply(x))
12625
+ @messages = HttpClient::Preconditions.assert_class('messages', opts.delete(:messages), Array).map { |v| HttpClient::Preconditions.assert_class('messages', v, String) }
12626
+ @decline_code = (x = opts.delete(:decline_code); x.is_a?(::Io::Flow::V0::Models::CaptureDeclineCode) ? x : ::Io::Flow::V0::Models::CaptureDeclineCode.apply(x))
12627
+ end
12628
+
12629
+ def to_json
12630
+ JSON.dump(to_hash)
12631
+ end
12632
+
12633
+ def copy(incoming={})
12634
+ CaptureError.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
12635
+ end
12636
+
12637
+ def to_hash
12638
+ {
12639
+ :code => code.value,
12640
+ :messages => messages,
12641
+ :decline_code => decline_code.value
12642
+ }
12643
+ end
12644
+
12645
+ end
12646
+
12614
12647
  # Capture actually transfers funds. You can capture as many times as you'd like
12615
12648
  # up until the total amount of the authorization has been captured or the
12616
12649
  # authorization otherwise becomes unavailable (e.g. expires).
@@ -12960,7 +12993,7 @@ module Io
12960
12993
 
12961
12994
  end
12962
12995
 
12963
- # Details for why a card was declined
12996
+ # Details for why a card was not created
12964
12997
  class CardError
12965
12998
 
12966
12999
  attr_reader :code, :messages, :avs, :cvv
@@ -12995,7 +13028,7 @@ module Io
12995
13028
 
12996
13029
  class CardForm
12997
13030
 
12998
- attr_reader :number, :cipher, :expiration_month, :expiration_year, :name, :cvv, :address, :ip, :challenge_text, :challenge_cipher
13031
+ attr_reader :number, :cipher, :expiration_month, :expiration_year, :name, :cvv, :address, :ip, :challenge_text, :challenge_cipher, :token_type
12999
13032
 
13000
13033
  def initialize(incoming={})
13001
13034
  opts = HttpClient::Helper.symbolize_keys(incoming)
@@ -13010,6 +13043,7 @@ module Io
13010
13043
  @ip = (x = opts.delete(:ip); x.nil? ? nil : HttpClient::Preconditions.assert_class('ip', x, String))
13011
13044
  @challenge_text = (x = opts.delete(:challenge_text); x.nil? ? nil : HttpClient::Preconditions.assert_class('challenge_text', x, String))
13012
13045
  @challenge_cipher = (x = opts.delete(:challenge_cipher); x.nil? ? nil : HttpClient::Preconditions.assert_class('challenge_cipher', x, String))
13046
+ @token_type = (x = opts.delete(:token_type); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::TokenType) ? x : ::Io::Flow::V0::Models::TokenType.apply(x)))
13013
13047
  end
13014
13048
 
13015
13049
  def to_json
@@ -13031,7 +13065,8 @@ module Io
13031
13065
  :address => address.nil? ? nil : address.to_hash,
13032
13066
  :ip => ip,
13033
13067
  :challenge_text => challenge_text,
13034
- :challenge_cipher => challenge_cipher
13068
+ :challenge_cipher => challenge_cipher,
13069
+ :token_type => token_type.nil? ? nil : token_type.value
13035
13070
  }
13036
13071
  end
13037
13072
 
@@ -14104,7 +14139,7 @@ module Io
14104
14139
  @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
14105
14140
  @description = HttpClient::Preconditions.assert_class('description', opts.delete(:description), String)
14106
14141
  @value = (x = opts.delete(:value); x.is_a?(::Io::Flow::V0::Models::PriceWithBase) ? x : ::Io::Flow::V0::Models::PriceWithBase.new(x))
14107
- @original = (x = opts.delete(:original); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x))
14142
+ @original = (x = opts.delete(:original); x.is_a?(::Io::Flow::V0::Models::OriginalPrices) ? x : ::Io::Flow::V0::Models::OriginalPrices.new(x))
14108
14143
  @attributes = HttpClient::Preconditions.assert_class('attributes', opts.delete(:attributes), Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h }
14109
14144
  end
14110
14145
 
@@ -14162,15 +14197,16 @@ module Io
14162
14197
 
14163
14198
  class CreditPaymentForm
14164
14199
 
14165
- attr_reader :order_number, :key, :description, :amount, :currency, :attributes
14200
+ attr_reader :order_number, :key, :description, :amount, :max, :currency, :attributes
14166
14201
 
14167
14202
  def initialize(incoming={})
14168
14203
  opts = HttpClient::Helper.symbolize_keys(incoming)
14169
- HttpClient::Preconditions.require_keys(opts, [:order_number, :description, :amount, :currency], 'CreditPaymentForm')
14204
+ HttpClient::Preconditions.require_keys(opts, [:order_number, :description, :amount, :max, :currency], 'CreditPaymentForm')
14170
14205
  @order_number = HttpClient::Preconditions.assert_class('order_number', opts.delete(:order_number), String)
14171
14206
  @key = (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, String))
14172
14207
  @description = HttpClient::Preconditions.assert_class('description', opts.delete(:description), String)
14173
14208
  @amount = HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(opts.delete(:amount)), BigDecimal)
14209
+ @max = HttpClient::Preconditions.assert_class('max', HttpClient::Helper.to_big_decimal(opts.delete(:max)), BigDecimal)
14174
14210
  @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
14175
14211
  @attributes = (x = opts.delete(:attributes); x.nil? ? nil : HttpClient::Preconditions.assert_class('attributes', x, Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h })
14176
14212
  end
@@ -14189,6 +14225,7 @@ module Io
14189
14225
  :key => key,
14190
14226
  :description => description,
14191
14227
  :amount => amount,
14228
+ :max => max,
14192
14229
  :currency => currency,
14193
14230
  :attributes => attributes.nil? ? nil : attributes
14194
14231
  }
@@ -14198,15 +14235,16 @@ module Io
14198
14235
 
14199
14236
  class CreditPaymentPutForm
14200
14237
 
14201
- attr_reader :order_number, :description, :amount, :currency, :attributes
14238
+ attr_reader :order_number, :description, :amount, :currency, :max, :attributes
14202
14239
 
14203
14240
  def initialize(incoming={})
14204
14241
  opts = HttpClient::Helper.symbolize_keys(incoming)
14205
- HttpClient::Preconditions.require_keys(opts, [:order_number, :description, :amount, :currency], 'CreditPaymentPutForm')
14242
+ HttpClient::Preconditions.require_keys(opts, [:order_number, :description, :amount, :currency, :max], 'CreditPaymentPutForm')
14206
14243
  @order_number = HttpClient::Preconditions.assert_class('order_number', opts.delete(:order_number), String)
14207
14244
  @description = HttpClient::Preconditions.assert_class('description', opts.delete(:description), String)
14208
14245
  @amount = HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(opts.delete(:amount)), BigDecimal)
14209
14246
  @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
14247
+ @max = HttpClient::Preconditions.assert_class('max', HttpClient::Helper.to_big_decimal(opts.delete(:max)), BigDecimal)
14210
14248
  @attributes = (x = opts.delete(:attributes); x.nil? ? nil : HttpClient::Preconditions.assert_class('attributes', x, Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h })
14211
14249
  end
14212
14250
 
@@ -14224,6 +14262,7 @@ module Io
14224
14262
  :description => description,
14225
14263
  :amount => amount,
14226
14264
  :currency => currency,
14265
+ :max => max,
14227
14266
  :attributes => attributes.nil? ? nil : attributes
14228
14267
  }
14229
14268
  end
@@ -14684,13 +14723,14 @@ module Io
14684
14723
 
14685
14724
  class DeliveryWindow
14686
14725
 
14687
- attr_reader :from, :to, :label
14726
+ attr_reader :from, :to, :timezone, :label
14688
14727
 
14689
14728
  def initialize(incoming={})
14690
14729
  opts = HttpClient::Helper.symbolize_keys(incoming)
14691
14730
  HttpClient::Preconditions.require_keys(opts, [:from, :to], 'DeliveryWindow')
14692
14731
  @from = HttpClient::Preconditions.assert_class('from', HttpClient::Helper.to_date_time_iso8601(opts.delete(:from)), DateTime)
14693
14732
  @to = HttpClient::Preconditions.assert_class('to', HttpClient::Helper.to_date_time_iso8601(opts.delete(:to)), DateTime)
14733
+ @timezone = (x = opts.delete(:timezone); x.nil? ? nil : HttpClient::Preconditions.assert_class('timezone', x, String))
14694
14734
  @label = (x = opts.delete(:label); x.nil? ? nil : HttpClient::Preconditions.assert_class('label', x, String))
14695
14735
  end
14696
14736
 
@@ -14706,6 +14746,7 @@ module Io
14706
14746
  {
14707
14747
  :from => from,
14708
14748
  :to => to,
14749
+ :timezone => timezone,
14709
14750
  :label => label
14710
14751
  }
14711
14752
  end
@@ -18949,7 +18990,7 @@ module Io
18949
18990
 
18950
18991
  class Local
18951
18992
 
18952
- attr_reader :experience, :prices, :rates, :spot_rates, :status, :attributes
18993
+ attr_reader :experience, :prices, :rates, :spot_rates, :status, :attributes, :price_attributes
18953
18994
 
18954
18995
  def initialize(incoming={})
18955
18996
  opts = HttpClient::Helper.symbolize_keys(incoming)
@@ -18959,7 +19000,8 @@ module Io
18959
19000
  @rates = HttpClient::Preconditions.assert_class('rates', opts.delete(:rates), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::Rate) ? x : ::Io::Flow::V0::Models::Rate.new(x)) }
18960
19001
  @spot_rates = HttpClient::Preconditions.assert_class('spot_rates', opts.delete(:spot_rates), Array).map { |v| HttpClient::Preconditions.assert_class('spot_rates', HttpClient::Helper.to_object(v), Hash) }
18961
19002
  @status = (x = (x = opts.delete(:status); x.nil? ? "included" : x); x.is_a?(::Io::Flow::V0::Models::SubcatalogItemStatus) ? x : ::Io::Flow::V0::Models::SubcatalogItemStatus.apply(x))
18962
- @attributes = (x = opts.delete(:attributes); x.nil? ? nil : HttpClient::Preconditions.assert_class('attributes', HttpClient::Helper.to_object(x), Hash))
19003
+ @attributes = (x = opts.delete(:attributes); x.nil? ? nil : HttpClient::Preconditions.assert_class('attributes', x, Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h })
19004
+ @price_attributes = (x = opts.delete(:price_attributes); x.nil? ? nil : HttpClient::Preconditions.assert_class('price_attributes', x, Hash).inject({}) { |h, d| h[d[0]] = (x = d[1]; x.is_a?(::Io::Flow::V0::Models::PriceWithBase) ? x : ::Io::Flow::V0::Models::PriceWithBase.new(x)); h })
18963
19005
  end
18964
19006
 
18965
19007
  def to_json
@@ -18977,7 +19019,8 @@ module Io
18977
19019
  :rates => rates.map { |o| o.to_hash },
18978
19020
  :spot_rates => spot_rates,
18979
19021
  :status => status.value,
18980
- :attributes => attributes
19022
+ :attributes => attributes.nil? ? nil : attributes,
19023
+ :price_attributes => price_attributes.nil? ? nil : price_attributes.inject({}) { |hash, o| hash[o[0]] = o[1].nil? ? nil : o[1].to_hash; hash }
18981
19024
  }
18982
19025
  end
18983
19026
 
@@ -19150,6 +19193,35 @@ module Io
19150
19193
 
19151
19194
  end
19152
19195
 
19196
+ # Represents a specific localized price
19197
+ class LocalizedCachePrice
19198
+
19199
+ attr_reader :key, :price
19200
+
19201
+ def initialize(incoming={})
19202
+ opts = HttpClient::Helper.symbolize_keys(incoming)
19203
+ HttpClient::Preconditions.require_keys(opts, [:key, :price], 'LocalizedCachePrice')
19204
+ @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
19205
+ @price = (x = opts.delete(:price); x.is_a?(::Io::Flow::V0::Models::PriceWithBase) ? x : ::Io::Flow::V0::Models::PriceWithBase.new(x))
19206
+ end
19207
+
19208
+ def to_json
19209
+ JSON.dump(to_hash)
19210
+ end
19211
+
19212
+ def copy(incoming={})
19213
+ LocalizedCachePrice.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
19214
+ end
19215
+
19216
+ def to_hash
19217
+ {
19218
+ :key => key,
19219
+ :price => price.to_hash
19220
+ }
19221
+ end
19222
+
19223
+ end
19224
+
19153
19225
  class LocalizedItemDeleted < Event
19154
19226
 
19155
19227
  attr_reader :event_id, :timestamp, :organization, :number, :catalog
@@ -19493,6 +19565,35 @@ module Io
19493
19565
 
19494
19566
  end
19495
19567
 
19568
+ # Pricing information of a localized item
19569
+ class LocalizedPricing
19570
+
19571
+ attr_reader :prices, :includes
19572
+
19573
+ def initialize(incoming={})
19574
+ opts = HttpClient::Helper.symbolize_keys(incoming)
19575
+ HttpClient::Preconditions.require_keys(opts, [:prices], 'LocalizedPricing')
19576
+ @prices = HttpClient::Preconditions.assert_class('prices', opts.delete(:prices), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::LocalizedCachePrice) ? x : ::Io::Flow::V0::Models::LocalizedCachePrice.new(x)) }
19577
+ @includes = (x = opts.delete(:includes); x.nil? ? nil : HttpClient::Preconditions.assert_class('includes', x, String))
19578
+ end
19579
+
19580
+ def to_json
19581
+ JSON.dump(to_hash)
19582
+ end
19583
+
19584
+ def copy(incoming={})
19585
+ LocalizedPricing.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
19586
+ end
19587
+
19588
+ def to_hash
19589
+ {
19590
+ :prices => prices.map { |o| o.to_hash },
19591
+ :includes => includes
19592
+ }
19593
+ end
19594
+
19595
+ end
19596
+
19496
19597
  class LocalizedTotal < LocalizedPrice
19497
19598
 
19498
19599
  attr_reader :currency, :amount, :label, :base
@@ -20141,10 +20242,10 @@ module Io
20141
20242
  def initialize(incoming={})
20142
20243
  super(:discriminator => Authorization::Types::ONLINE_AUTHORIZATION)
20143
20244
  opts = HttpClient::Helper.symbolize_keys(incoming)
20144
- HttpClient::Preconditions.require_keys(opts, [:id, :key, :payment, :amount, :currency, :customer, :attributes, :result, :created_at], 'OnlineAuthorization')
20245
+ HttpClient::Preconditions.require_keys(opts, [:id, :key, :amount, :currency, :customer, :attributes, :result, :created_at], 'OnlineAuthorization')
20145
20246
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
20146
20247
  @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
20147
- @payment = (x = opts.delete(:payment); x.is_a?(::Io::Flow::V0::Models::ExpandablePayment) ? x : ::Io::Flow::V0::Models::ExpandablePayment.from_json(x))
20248
+ @payment = (x = opts.delete(:payment); x.nil? ? nil : HttpClient::Preconditions.assert_class('payment', HttpClient::Helper.to_object(x), Hash))
20148
20249
  @amount = HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(opts.delete(:amount)), BigDecimal)
20149
20250
  @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
20150
20251
  @customer = (x = opts.delete(:customer); x.is_a?(::Io::Flow::V0::Models::Customer) ? x : ::Io::Flow::V0::Models::Customer.new(x))
@@ -20168,7 +20269,7 @@ module Io
20168
20269
  {
20169
20270
  :id => id,
20170
20271
  :key => key,
20171
- :payment => payment.to_hash,
20272
+ :payment => payment,
20172
20273
  :amount => amount,
20173
20274
  :currency => currency,
20174
20275
  :customer => customer.to_hash,
@@ -21709,6 +21810,35 @@ module Io
21709
21810
 
21710
21811
  end
21711
21812
 
21813
+ # Model representing original and max values and currencies.
21814
+ class OriginalPrices
21815
+
21816
+ attr_reader :value, :max
21817
+
21818
+ def initialize(incoming={})
21819
+ opts = HttpClient::Helper.symbolize_keys(incoming)
21820
+ HttpClient::Preconditions.require_keys(opts, [:value, :max], 'OriginalPrices')
21821
+ @value = (x = opts.delete(:value); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x))
21822
+ @max = (x = opts.delete(:max); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x))
21823
+ end
21824
+
21825
+ def to_json
21826
+ JSON.dump(to_hash)
21827
+ end
21828
+
21829
+ def copy(incoming={})
21830
+ OriginalPrices.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
21831
+ end
21832
+
21833
+ def to_hash
21834
+ {
21835
+ :value => value.to_hash,
21836
+ :max => max.to_hash
21837
+ }
21838
+ end
21839
+
21840
+ end
21841
+
21712
21842
  # Describes the outgoing feed constructed by Flow
21713
21843
  class OutgoingFeed
21714
21844
 
@@ -22178,12 +22308,12 @@ module Io
22178
22308
  end
22179
22309
 
22180
22310
  # Represents on line payment
22181
- class PaymentPaypal < ExpandablePayment
22311
+ class PaymentPaypal < Payment
22182
22312
 
22183
22313
  attr_reader :id, :order, :amount, :currency, :paypal
22184
22314
 
22185
22315
  def initialize(incoming={})
22186
- super(:discriminator => ExpandablePayment::Types::PAYMENT_PAYPAL)
22316
+ super(:discriminator => Payment::Types::PAYMENT_PAYPAL)
22187
22317
  opts = HttpClient::Helper.symbolize_keys(incoming)
22188
22318
  HttpClient::Preconditions.require_keys(opts, [:id, :amount, :currency, :paypal], 'PaymentPaypal')
22189
22319
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
@@ -22240,12 +22370,11 @@ module Io
22240
22370
 
22241
22371
  end
22242
22372
 
22243
- class PaymentReference < ExpandablePayment
22373
+ class PaymentReference
22244
22374
 
22245
22375
  attr_reader :id
22246
22376
 
22247
22377
  def initialize(incoming={})
22248
- super(:discriminator => ExpandablePayment::Types::PAYMENT_REFERENCE)
22249
22378
  opts = HttpClient::Helper.symbolize_keys(incoming)
22250
22379
  HttpClient::Preconditions.require_keys(opts, [:id], 'PaymentReference')
22251
22380
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
@@ -22256,10 +22385,10 @@ module Io
22256
22385
  end
22257
22386
 
22258
22387
  def copy(incoming={})
22259
- PaymentReference.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
22388
+ PaymentReference.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
22260
22389
  end
22261
22390
 
22262
- def subtype_to_hash
22391
+ def to_hash
22263
22392
  {
22264
22393
  :id => id
22265
22394
  }
@@ -27022,20 +27151,14 @@ module Io
27022
27151
 
27023
27152
  end
27024
27153
 
27025
- # Combines HS10 export and catalog item export for items that require
27026
- # harmonization.
27154
+ # Export for items that require harmonization.
27027
27155
  class UnharmonizedItemExportType < ExportType
27028
27156
 
27029
- attr_reader :origin, :destination, :numbers, :has_codes, :has_origins, :sort
27157
+ attr_reader :sort
27030
27158
 
27031
27159
  def initialize(incoming={})
27032
27160
  super(:discriminator => ExportType::Types::UNHARMONIZED_ITEM_EXPORT_TYPE)
27033
27161
  opts = HttpClient::Helper.symbolize_keys(incoming)
27034
- @origin = (x = opts.delete(:origin); x.nil? ? nil : HttpClient::Preconditions.assert_class('origin', x, String))
27035
- @destination = (x = opts.delete(:destination); x.nil? ? nil : HttpClient::Preconditions.assert_class('destination', x, String))
27036
- @numbers = (x = opts.delete(:numbers); x.nil? ? nil : HttpClient::Preconditions.assert_class('numbers', x, Array).map { |v| HttpClient::Preconditions.assert_class('numbers', v, String) })
27037
- @has_codes = (x = opts.delete(:has_codes); x.nil? ? nil : HttpClient::Preconditions.assert_boolean('has_codes', x))
27038
- @has_origins = (x = opts.delete(:has_origins); x.nil? ? nil : HttpClient::Preconditions.assert_boolean('has_origins', x))
27039
27162
  @sort = (x = opts.delete(:sort); x.nil? ? nil : HttpClient::Preconditions.assert_class('sort', x, String))
27040
27163
  end
27041
27164
 
@@ -27049,11 +27172,6 @@ module Io
27049
27172
 
27050
27173
  def subtype_to_hash
27051
27174
  {
27052
- :origin => origin,
27053
- :destination => destination,
27054
- :numbers => numbers.nil? ? nil : numbers,
27055
- :has_codes => has_codes,
27056
- :has_origins => has_origins,
27057
27175
  :sort => sort
27058
27176
  }
27059
27177
  end
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flowcommerce
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.22
4
+ version: 0.2.23
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: 2017-07-16 00:00:00.000000000 Z
11
+ date: 2017-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bigdecimal
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  description: Native ruby client for the Flow REST API. Detailed information at https://app.apibuilder.io/flow/api
@@ -59,17 +59,17 @@ require_paths:
59
59
  - lib
60
60
  required_ruby_version: !ruby/object:Gem::Requirement
61
61
  requirements:
62
- - - ">="
62
+ - - '>='
63
63
  - !ruby/object:Gem::Version
64
64
  version: '0'
65
65
  required_rubygems_version: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - ">="
67
+ - - '>='
68
68
  - !ruby/object:Gem::Version
69
69
  version: '0'
70
70
  requirements: []
71
71
  rubyforge_project:
72
- rubygems_version: 2.6.11
72
+ rubygems_version: 2.0.14.1
73
73
  signing_key:
74
74
  specification_version: 4
75
75
  summary: Native ruby client for the Flow REST API.