flowcommerce 0.1.12 → 0.1.13

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: 36f93a0c8d7bb391183ac22007181c5e977b01bd
4
- data.tar.gz: b7837eb6ab71b2aeed4357751f84d040004f1e5c
3
+ metadata.gz: b4c5d76da0b4c4a21fb928c421f39b83f821e984
4
+ data.tar.gz: 6b0e607065fa30ae82bb601b44b3e4ac05890759
5
5
  SHA512:
6
- metadata.gz: f7bbb7ce03c6ad1f23040a8a2c00f48540ffde81ecceb93105caceacde346e2e0b06e321c94f4d306edb07d021a31fc0721e86bf16ffddd05ddbb083e90f15e7
7
- data.tar.gz: 0645962cecbf26911e66328cfac6cbf5acd823090d7788e4b4ca58b1c3d17897cd6052d54081b574d6f1ec2bffca8693b9981b2233439af098f23ba994719505
6
+ metadata.gz: 7aa831b6123a8e318d14195bb5663412e5a9421715ff9164bdd4e4b633a4de07b3b778f793582a7dda5f74515ace1940599a180abfe3c947683fd3820e23acae
7
+ data.tar.gz: d04dc34bbebc3683bda43cb3a106dbc3505c3883a13773e442f16896069005b0a4165c0a607eeb5f18db4af2c65a11c82ce187f09a252b1c48dbc75e053e79b0
@@ -1,6 +1,6 @@
1
1
  # Generated by apidoc - http://www.apidoc.me
2
- # Service version: 0.2.44
3
- # apidoc:0.11.51 http://www.apidoc.me/flow/api/0.2.44/ruby_client
2
+ # Service version: 0.2.46
3
+ # apidoc:0.11.51 http://www.apidoc.me/flow/api/0.2.45/ruby_client
4
4
 
5
5
  require 'cgi'
6
6
  require 'net/http'
@@ -25,8 +25,8 @@ 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.51 http://www.apidoc.me/flow/api/0.2.44/ruby_client' unless defined?(Constants::USER_AGENT)
29
- VERSION = '0.2.44' unless defined?(Constants::VERSION)
28
+ USER_AGENT = 'apidoc:0.11.51 http://www.apidoc.me/flow/api/0.2.45/ruby_client' unless defined?(Constants::USER_AGENT)
29
+ VERSION = '0.2.46' unless defined?(Constants::VERSION)
30
30
  VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
31
31
 
32
32
  end
@@ -157,6 +157,10 @@ module Io
157
157
  @hs6 ||= ::Io::Flow::V0::Clients::Hs6.new(self)
158
158
  end
159
159
 
160
+ def hs_codes
161
+ @hs_codes ||= ::Io::Flow::V0::Clients::HsCodes.new(self)
162
+ end
163
+
160
164
  def authorizations
161
165
  @authorizations ||= ::Io::Flow::V0::Clients::Authorizations.new(self)
162
166
  end
@@ -348,14 +352,10 @@ module Io
348
352
 
349
353
  # Order-level price details allocated using a strategy among individual order
350
354
  # item units.
351
- def get(organization, number, incoming={})
355
+ def get(organization, number)
352
356
  HttpClient::Preconditions.assert_class('organization', organization, String)
353
357
  HttpClient::Preconditions.assert_class('number', number, String)
354
- opts = HttpClient::Helper.symbolize_keys(incoming)
355
- query = {
356
- :strategy => (x = (x = opts.delete(:strategy); x.nil? ? "equal" : x); x.is_a?(::Io::Flow::V0::Models::AllocationStrategy) ? x : ::Io::Flow::V0::Models::AllocationStrategy.apply(x)).value
357
- }.delete_if { |k, v| v.nil? }
358
- r = @client.request("/#{CGI.escape(organization)}/orders/allocations/#{CGI.escape(number)}").with_query(query).get
358
+ r = @client.request("/#{CGI.escape(organization)}/orders/allocations/#{CGI.escape(number)}").get
359
359
  ::Io::Flow::V0::Models::Allocation.new(r)
360
360
  end
361
361
 
@@ -1931,6 +1931,36 @@ module Io
1931
1931
 
1932
1932
  end
1933
1933
 
1934
+ class HsCodes
1935
+
1936
+ def initialize(client)
1937
+ @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
1938
+ end
1939
+
1940
+ # Search harmonization codes. Always paginated.
1941
+ def get(incoming={})
1942
+ opts = HttpClient::Helper.symbolize_keys(incoming)
1943
+ query = {
1944
+ :code => (x = opts.delete(:code); x.nil? ? nil : HttpClient::Preconditions.assert_class('code', x, Array).map { |v| HttpClient::Preconditions.assert_class('code', v, String) }),
1945
+ :parent => (x = opts.delete(:parent); x.nil? ? nil : HttpClient::Preconditions.assert_class('parent', x, String)),
1946
+ :has_parent => (x = opts.delete(:has_parent); x.nil? ? nil : HttpClient::Preconditions.assert_boolean('has_parent', x)),
1947
+ :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
1948
+ :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
1949
+ :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "code" : x), String)
1950
+ }.delete_if { |k, v| v.nil? }
1951
+ r = @client.request("/harmonization/codes").with_query(query).get
1952
+ r.map { |x| ::Io::Flow::V0::Models::HsCode.new(x) }
1953
+ end
1954
+
1955
+ # Returns information about a specific harmonization code.
1956
+ def get_by_code(code)
1957
+ HttpClient::Preconditions.assert_class('code', code, String)
1958
+ r = @client.request("/harmonization/codes/#{CGI.escape(code)}").get
1959
+ ::Io::Flow::V0::Models::HsCode.new(r)
1960
+ end
1961
+
1962
+ end
1963
+
1934
1964
  class Authorizations
1935
1965
 
1936
1966
  def initialize(client)
@@ -5089,53 +5119,6 @@ module Io
5089
5119
 
5090
5120
  end
5091
5121
 
5092
- class AllocationStrategy
5093
-
5094
- attr_reader :value
5095
-
5096
- def initialize(value)
5097
- @value = HttpClient::Preconditions.assert_class('value', value, String)
5098
- end
5099
-
5100
- # Returns the instance of AllocationStrategy for this value, creating a new instance for an unknown value
5101
- def AllocationStrategy.apply(value)
5102
- if value.instance_of?(AllocationStrategy)
5103
- value
5104
- else
5105
- HttpClient::Preconditions.assert_class_or_nil('value', value, String)
5106
- value.nil? ? nil : (from_string(value) || AllocationStrategy.new(value))
5107
- end
5108
- end
5109
-
5110
- # Returns the instance of AllocationStrategy for this value, or nil if not found
5111
- def AllocationStrategy.from_string(value)
5112
- HttpClient::Preconditions.assert_class('value', value, String)
5113
- AllocationStrategy.ALL.find { |v| v.value == value }
5114
- end
5115
-
5116
- def AllocationStrategy.ALL
5117
- @@all ||= [AllocationStrategy.equal, AllocationStrategy.proportional]
5118
- end
5119
-
5120
- # Distribution of order-specific (freight, insurance) order-level price details
5121
- # is done evenly regardless of item unit value, and equally across all items
5122
- def AllocationStrategy.equal
5123
- @@_equal ||= AllocationStrategy.new('equal')
5124
- end
5125
-
5126
- # Distribution of order-specific (freight, insurance) order-level price details
5127
- # among units based on inidividual unit values as a proportion of the item
5128
- # subtotal
5129
- def AllocationStrategy.proportional
5130
- @@_proportional ||= AllocationStrategy.new('proportional')
5131
- end
5132
-
5133
- def to_hash
5134
- value
5135
- end
5136
-
5137
- end
5138
-
5139
5122
  class AuthorizationDeclineCode
5140
5123
 
5141
5124
  attr_reader :value
@@ -7778,7 +7761,19 @@ module Io
7778
7761
  end
7779
7762
 
7780
7763
  def UnitOfTime.ALL
7781
- @@all ||= [UnitOfTime.day, UnitOfTime.hour, UnitOfTime.minute]
7764
+ @@all ||= [UnitOfTime.year, UnitOfTime.month, UnitOfTime.week, UnitOfTime.day, UnitOfTime.hour, UnitOfTime.minute]
7765
+ end
7766
+
7767
+ def UnitOfTime.year
7768
+ @@_year ||= UnitOfTime.new('year')
7769
+ end
7770
+
7771
+ def UnitOfTime.month
7772
+ @@_month ||= UnitOfTime.new('month')
7773
+ end
7774
+
7775
+ def UnitOfTime.week
7776
+ @@_week ||= UnitOfTime.new('week')
7782
7777
  end
7783
7778
 
7784
7779
  def UnitOfTime.day
@@ -8070,17 +8065,17 @@ module Io
8070
8065
 
8071
8066
  class AccountOrdersExportType < ExportType
8072
8067
 
8073
- attr_reader :payment_reference, :transaction_summary_id, :created_on_or_after, :created_after, :created_on_or_before, :created_before
8068
+ attr_reader :payment_reference, :transaction_summary_id, :transaction_date_on_or_after, :transaction_date_after, :transaction_date_on_or_before, :transaction_date_before
8074
8069
 
8075
8070
  def initialize(incoming={})
8076
8071
  super(:discriminator => ExportType::Types::ACCOUNT_ORDERS_EXPORT_TYPE)
8077
8072
  opts = HttpClient::Helper.symbolize_keys(incoming)
8078
8073
  @payment_reference = (x = opts.delete(:payment_reference); x.nil? ? nil : HttpClient::Preconditions.assert_class('payment_reference', x, String))
8079
8074
  @transaction_summary_id = (x = opts.delete(:transaction_summary_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('transaction_summary_id', x, String))
8080
- @created_on_or_after = (x = opts.delete(:created_on_or_after); x.nil? ? nil : HttpClient::Preconditions.assert_class('created_on_or_after', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
8081
- @created_after = (x = opts.delete(:created_after); x.nil? ? nil : HttpClient::Preconditions.assert_class('created_after', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
8082
- @created_on_or_before = (x = opts.delete(:created_on_or_before); x.nil? ? nil : HttpClient::Preconditions.assert_class('created_on_or_before', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
8083
- @created_before = (x = opts.delete(:created_before); x.nil? ? nil : HttpClient::Preconditions.assert_class('created_before', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
8075
+ @transaction_date_on_or_after = (x = opts.delete(:transaction_date_on_or_after); x.nil? ? nil : HttpClient::Preconditions.assert_class('transaction_date_on_or_after', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
8076
+ @transaction_date_after = (x = opts.delete(:transaction_date_after); x.nil? ? nil : HttpClient::Preconditions.assert_class('transaction_date_after', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
8077
+ @transaction_date_on_or_before = (x = opts.delete(:transaction_date_on_or_before); x.nil? ? nil : HttpClient::Preconditions.assert_class('transaction_date_on_or_before', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
8078
+ @transaction_date_before = (x = opts.delete(:transaction_date_before); x.nil? ? nil : HttpClient::Preconditions.assert_class('transaction_date_before', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
8084
8079
  end
8085
8080
 
8086
8081
  def to_json
@@ -8095,10 +8090,10 @@ module Io
8095
8090
  {
8096
8091
  :payment_reference => payment_reference,
8097
8092
  :transaction_summary_id => transaction_summary_id,
8098
- :created_on_or_after => created_on_or_after,
8099
- :created_after => created_after,
8100
- :created_on_or_before => created_on_or_before,
8101
- :created_before => created_before
8093
+ :transaction_date_on_or_after => transaction_date_on_or_after,
8094
+ :transaction_date_after => transaction_date_after,
8095
+ :transaction_date_on_or_before => transaction_date_on_or_before,
8096
+ :transaction_date_before => transaction_date_before
8102
8097
  }
8103
8098
  end
8104
8099
 
@@ -8106,17 +8101,17 @@ module Io
8106
8101
 
8107
8102
  class AccountTransactionsExportType < ExportType
8108
8103
 
8109
- attr_reader :payment_reference, :transaction_summary_id, :created_on_or_after, :created_after, :created_on_or_before, :created_before
8104
+ attr_reader :payment_reference, :transaction_summary_id, :date_on_or_after, :date_after, :date_on_or_before, :date_before
8110
8105
 
8111
8106
  def initialize(incoming={})
8112
8107
  super(:discriminator => ExportType::Types::ACCOUNT_TRANSACTIONS_EXPORT_TYPE)
8113
8108
  opts = HttpClient::Helper.symbolize_keys(incoming)
8114
8109
  @payment_reference = (x = opts.delete(:payment_reference); x.nil? ? nil : HttpClient::Preconditions.assert_class('payment_reference', x, String))
8115
8110
  @transaction_summary_id = (x = opts.delete(:transaction_summary_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('transaction_summary_id', x, String))
8116
- @created_on_or_after = (x = opts.delete(:created_on_or_after); x.nil? ? nil : HttpClient::Preconditions.assert_class('created_on_or_after', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
8117
- @created_after = (x = opts.delete(:created_after); x.nil? ? nil : HttpClient::Preconditions.assert_class('created_after', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
8118
- @created_on_or_before = (x = opts.delete(:created_on_or_before); x.nil? ? nil : HttpClient::Preconditions.assert_class('created_on_or_before', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
8119
- @created_before = (x = opts.delete(:created_before); x.nil? ? nil : HttpClient::Preconditions.assert_class('created_before', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
8111
+ @date_on_or_after = (x = opts.delete(:date_on_or_after); x.nil? ? nil : HttpClient::Preconditions.assert_class('date_on_or_after', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
8112
+ @date_after = (x = opts.delete(:date_after); x.nil? ? nil : HttpClient::Preconditions.assert_class('date_after', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
8113
+ @date_on_or_before = (x = opts.delete(:date_on_or_before); x.nil? ? nil : HttpClient::Preconditions.assert_class('date_on_or_before', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
8114
+ @date_before = (x = opts.delete(:date_before); x.nil? ? nil : HttpClient::Preconditions.assert_class('date_before', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
8120
8115
  end
8121
8116
 
8122
8117
  def to_json
@@ -8131,10 +8126,10 @@ module Io
8131
8126
  {
8132
8127
  :payment_reference => payment_reference,
8133
8128
  :transaction_summary_id => transaction_summary_id,
8134
- :created_on_or_after => created_on_or_after,
8135
- :created_after => created_after,
8136
- :created_on_or_before => created_on_or_before,
8137
- :created_before => created_before
8129
+ :date_on_or_after => date_on_or_after,
8130
+ :date_after => date_after,
8131
+ :date_on_or_before => date_on_or_before,
8132
+ :date_before => date_before
8138
8133
  }
8139
8134
  end
8140
8135
 
@@ -8284,14 +8279,14 @@ module Io
8284
8279
 
8285
8280
  class Allocation
8286
8281
 
8287
- attr_reader :order, :base_currency, :target_currency, :items
8282
+ attr_reader :order, :currency, :total, :items
8288
8283
 
8289
8284
  def initialize(incoming={})
8290
8285
  opts = HttpClient::Helper.symbolize_keys(incoming)
8291
- HttpClient::Preconditions.require_keys(opts, [:order, :base_currency, :target_currency, :items], 'Allocation')
8286
+ HttpClient::Preconditions.require_keys(opts, [:order, :currency, :total, :items], 'Allocation')
8292
8287
  @order = (x = opts.delete(:order); x.is_a?(::Io::Flow::V0::Models::OrderReference) ? x : ::Io::Flow::V0::Models::OrderReference.new(x))
8293
- @base_currency = HttpClient::Preconditions.assert_class('base_currency', opts.delete(:base_currency), String)
8294
- @target_currency = HttpClient::Preconditions.assert_class('target_currency', opts.delete(:target_currency), String)
8288
+ @currency = (x = opts.delete(:currency); x.is_a?(::Io::Flow::V0::Models::AllocationCurrencies) ? x : ::Io::Flow::V0::Models::AllocationCurrencies.new(x))
8289
+ @total = (x = opts.delete(:total); x.is_a?(::Io::Flow::V0::Models::AllocationTotals) ? x : ::Io::Flow::V0::Models::AllocationTotals.new(x))
8295
8290
  @items = HttpClient::Preconditions.assert_class('items', opts.delete(:items), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::AllocationItem) ? x : ::Io::Flow::V0::Models::AllocationItem.new(x)) }
8296
8291
  end
8297
8292
 
@@ -8306,23 +8301,51 @@ module Io
8306
8301
  def to_hash
8307
8302
  {
8308
8303
  :order => order.to_hash,
8309
- :base_currency => base_currency,
8310
- :target_currency => target_currency,
8304
+ :currency => currency.to_hash,
8305
+ :total => total.to_hash,
8311
8306
  :items => items.map { |o| o.to_hash }
8312
8307
  }
8313
8308
  end
8314
8309
 
8315
8310
  end
8316
8311
 
8312
+ class AllocationCurrencies
8313
+
8314
+ attr_reader :base, :target
8315
+
8316
+ def initialize(incoming={})
8317
+ opts = HttpClient::Helper.symbolize_keys(incoming)
8318
+ HttpClient::Preconditions.require_keys(opts, [:base, :target], 'AllocationCurrencies')
8319
+ @base = HttpClient::Preconditions.assert_class('base', opts.delete(:base), String)
8320
+ @target = HttpClient::Preconditions.assert_class('target', opts.delete(:target), String)
8321
+ end
8322
+
8323
+ def to_json
8324
+ JSON.dump(to_hash)
8325
+ end
8326
+
8327
+ def copy(incoming={})
8328
+ AllocationCurrencies.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
8329
+ end
8330
+
8331
+ def to_hash
8332
+ {
8333
+ :base => base,
8334
+ :target => target
8335
+ }
8336
+ end
8337
+
8338
+ end
8339
+
8317
8340
  class AllocationDetail
8318
8341
 
8319
- attr_reader :base, :key, :target, :components
8342
+ attr_reader :key, :base, :target, :components
8320
8343
 
8321
8344
  def initialize(incoming={})
8322
8345
  opts = HttpClient::Helper.symbolize_keys(incoming)
8323
- HttpClient::Preconditions.require_keys(opts, [:base, :key, :target, :components], 'AllocationDetail')
8324
- @base = HttpClient::Preconditions.assert_class('base', HttpClient::Helper.to_big_decimal(opts.delete(:base)), BigDecimal)
8346
+ HttpClient::Preconditions.require_keys(opts, [:key, :base, :target, :components], 'AllocationDetail')
8325
8347
  @key = (x = opts.delete(:key); x.is_a?(::Io::Flow::V0::Models::OrderPriceDetailKey) ? x : ::Io::Flow::V0::Models::OrderPriceDetailKey.apply(x))
8348
+ @base = HttpClient::Preconditions.assert_class('base', HttpClient::Helper.to_big_decimal(opts.delete(:base)), BigDecimal)
8326
8349
  @target = HttpClient::Preconditions.assert_class('target', HttpClient::Helper.to_big_decimal(opts.delete(:target)), BigDecimal)
8327
8350
  @components = HttpClient::Preconditions.assert_class('components', opts.delete(:components), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::AllocationDetailComponent) ? x : ::Io::Flow::V0::Models::AllocationDetailComponent.new(x)) }
8328
8351
  end
@@ -8337,8 +8360,8 @@ module Io
8337
8360
 
8338
8361
  def to_hash
8339
8362
  {
8340
- :base => base,
8341
8363
  :key => key.value,
8364
+ :base => base,
8342
8365
  :target => target,
8343
8366
  :components => components.map { |o| o.to_hash }
8344
8367
  }
@@ -8348,13 +8371,13 @@ module Io
8348
8371
 
8349
8372
  class AllocationDetailComponent
8350
8373
 
8351
- attr_reader :base, :key, :target
8374
+ attr_reader :key, :base, :target
8352
8375
 
8353
8376
  def initialize(incoming={})
8354
8377
  opts = HttpClient::Helper.symbolize_keys(incoming)
8355
- HttpClient::Preconditions.require_keys(opts, [:base, :key, :target], 'AllocationDetailComponent')
8356
- @base = HttpClient::Preconditions.assert_class('base', HttpClient::Helper.to_big_decimal(opts.delete(:base)), BigDecimal)
8378
+ HttpClient::Preconditions.require_keys(opts, [:key, :base, :target], 'AllocationDetailComponent')
8357
8379
  @key = (x = opts.delete(:key); x.is_a?(::Io::Flow::V0::Models::OrderPriceDetailComponentKey) ? x : ::Io::Flow::V0::Models::OrderPriceDetailComponentKey.apply(x))
8380
+ @base = HttpClient::Preconditions.assert_class('base', HttpClient::Helper.to_big_decimal(opts.delete(:base)), BigDecimal)
8358
8381
  @target = HttpClient::Preconditions.assert_class('target', HttpClient::Helper.to_big_decimal(opts.delete(:target)), BigDecimal)
8359
8382
  end
8360
8383
 
@@ -8368,8 +8391,8 @@ module Io
8368
8391
 
8369
8392
  def to_hash
8370
8393
  {
8371
- :base => base,
8372
8394
  :key => key.value,
8395
+ :base => base,
8373
8396
  :target => target
8374
8397
  }
8375
8398
  end
@@ -8378,13 +8401,13 @@ module Io
8378
8401
 
8379
8402
  class AllocationItem
8380
8403
 
8381
- attr_reader :base, :number, :target, :details
8404
+ attr_reader :number, :base, :target, :details
8382
8405
 
8383
8406
  def initialize(incoming={})
8384
8407
  opts = HttpClient::Helper.symbolize_keys(incoming)
8385
- HttpClient::Preconditions.require_keys(opts, [:base, :number, :target, :details], 'AllocationItem')
8386
- @base = HttpClient::Preconditions.assert_class('base', HttpClient::Helper.to_big_decimal(opts.delete(:base)), BigDecimal)
8408
+ HttpClient::Preconditions.require_keys(opts, [:number, :base, :target, :details], 'AllocationItem')
8387
8409
  @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
8410
+ @base = HttpClient::Preconditions.assert_class('base', HttpClient::Helper.to_big_decimal(opts.delete(:base)), BigDecimal)
8388
8411
  @target = HttpClient::Preconditions.assert_class('target', HttpClient::Helper.to_big_decimal(opts.delete(:target)), BigDecimal)
8389
8412
  @details = HttpClient::Preconditions.assert_class('details', opts.delete(:details), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::AllocationDetail) ? x : ::Io::Flow::V0::Models::AllocationDetail.new(x)) }
8390
8413
  end
@@ -8399,8 +8422,8 @@ module Io
8399
8422
 
8400
8423
  def to_hash
8401
8424
  {
8402
- :base => base,
8403
8425
  :number => number,
8426
+ :base => base,
8404
8427
  :target => target,
8405
8428
  :details => details.map { |o| o.to_hash }
8406
8429
  }
@@ -8408,6 +8431,34 @@ module Io
8408
8431
 
8409
8432
  end
8410
8433
 
8434
+ class AllocationTotals
8435
+
8436
+ attr_reader :target, :base
8437
+
8438
+ def initialize(incoming={})
8439
+ opts = HttpClient::Helper.symbolize_keys(incoming)
8440
+ HttpClient::Preconditions.require_keys(opts, [:target, :base], 'AllocationTotals')
8441
+ @target = HttpClient::Preconditions.assert_class('target', HttpClient::Helper.to_big_decimal(opts.delete(:target)), BigDecimal)
8442
+ @base = HttpClient::Preconditions.assert_class('base', HttpClient::Helper.to_big_decimal(opts.delete(:base)), BigDecimal)
8443
+ end
8444
+
8445
+ def to_json
8446
+ JSON.dump(to_hash)
8447
+ end
8448
+
8449
+ def copy(incoming={})
8450
+ AllocationTotals.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
8451
+ end
8452
+
8453
+ def to_hash
8454
+ {
8455
+ :target => target,
8456
+ :base => base
8457
+ }
8458
+ end
8459
+
8460
+ end
8461
+
8411
8462
  # Rule outcome where shipping surfaced in quote is actual cost plus a predefined
8412
8463
  # margin price
8413
8464
  class AmountMargin < TierRuleOutcome
@@ -10320,7 +10371,7 @@ module Io
10320
10371
  # range and cost
10321
10372
  class DeliveryOption
10322
10373
 
10323
- attr_reader :id, :cost, :delivered_duty, :price, :service, :tier, :window
10374
+ attr_reader :id, :cost, :delivered_duty, :price, :service, :tier, :window, :weight
10324
10375
 
10325
10376
  def initialize(incoming={})
10326
10377
  opts = HttpClient::Helper.symbolize_keys(incoming)
@@ -10332,6 +10383,7 @@ module Io
10332
10383
  @service = (x = opts.delete(:service); x.is_a?(::Io::Flow::V0::Models::ServiceSummary) ? x : ::Io::Flow::V0::Models::ServiceSummary.new(x))
10333
10384
  @tier = (x = opts.delete(:tier); x.is_a?(::Io::Flow::V0::Models::TierSummary) ? x : ::Io::Flow::V0::Models::TierSummary.new(x))
10334
10385
  @window = (x = opts.delete(:window); x.is_a?(::Io::Flow::V0::Models::DatetimeRange) ? x : ::Io::Flow::V0::Models::DatetimeRange.new(x))
10386
+ @weight = (x = opts.delete(:weight); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::OptionWeightEstimates) ? x : ::Io::Flow::V0::Models::OptionWeightEstimates.new(x)))
10335
10387
  end
10336
10388
 
10337
10389
  def to_json
@@ -10350,7 +10402,8 @@ module Io
10350
10402
  :price => price.to_hash,
10351
10403
  :service => service.to_hash,
10352
10404
  :tier => tier.to_hash,
10353
- :window => window.to_hash
10405
+ :window => window.to_hash,
10406
+ :weight => weight.nil? ? nil : weight.to_hash
10354
10407
  }
10355
10408
  end
10356
10409
 
@@ -12484,6 +12537,37 @@ module Io
12484
12537
 
12485
12538
  end
12486
12539
 
12540
+ # Harmonized System codes.
12541
+ class HsCode
12542
+
12543
+ attr_reader :code, :parent, :description
12544
+
12545
+ def initialize(incoming={})
12546
+ opts = HttpClient::Helper.symbolize_keys(incoming)
12547
+ HttpClient::Preconditions.require_keys(opts, [:code], 'HsCode')
12548
+ @code = HttpClient::Preconditions.assert_class('code', opts.delete(:code), String)
12549
+ @parent = (x = opts.delete(:parent); x.nil? ? nil : HttpClient::Preconditions.assert_class('parent', x, String))
12550
+ @description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
12551
+ end
12552
+
12553
+ def to_json
12554
+ JSON.dump(to_hash)
12555
+ end
12556
+
12557
+ def copy(incoming={})
12558
+ HsCode.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
12559
+ end
12560
+
12561
+ def to_hash
12562
+ {
12563
+ :code => code,
12564
+ :parent => parent,
12565
+ :description => description
12566
+ }
12567
+ end
12568
+
12569
+ end
12570
+
12487
12571
  # The URL to an image, with optional tags. Flow Commerce primarily uses images
12488
12572
  # to enhance the administrative tools (e.g. showing an item image in console)
12489
12573
  class Image
@@ -14969,6 +15053,34 @@ module Io
14969
15053
 
14970
15054
  end
14971
15055
 
15056
+ class OptionWeightEstimates
15057
+
15058
+ attr_reader :gravitational, :dimensional
15059
+
15060
+ def initialize(incoming={})
15061
+ opts = HttpClient::Helper.symbolize_keys(incoming)
15062
+ HttpClient::Preconditions.require_keys(opts, [:gravitational, :dimensional], 'OptionWeightEstimates')
15063
+ @gravitational = (x = opts.delete(:gravitational); x.is_a?(::Io::Flow::V0::Models::Measurement) ? x : ::Io::Flow::V0::Models::Measurement.new(x))
15064
+ @dimensional = (x = opts.delete(:dimensional); x.is_a?(::Io::Flow::V0::Models::Measurement) ? x : ::Io::Flow::V0::Models::Measurement.new(x))
15065
+ end
15066
+
15067
+ def to_json
15068
+ JSON.dump(to_hash)
15069
+ end
15070
+
15071
+ def copy(incoming={})
15072
+ OptionWeightEstimates.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
15073
+ end
15074
+
15075
+ def to_hash
15076
+ {
15077
+ :gravitational => gravitational.to_hash,
15078
+ :dimensional => dimensional.to_hash
15079
+ }
15080
+ end
15081
+
15082
+ end
15083
+
14972
15084
  # Flags to indicate whether a feature is enabled/disabled on a particular model
14973
15085
  # (e.g. show/do not show attribute as a column in harmonization table view of
14974
15086
  # items)
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.1.12
4
+ version: 0.1.13
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-12-06 00:00:00.000000000 Z
11
+ date: 2016-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json