flowcommerce 0.2.40 → 0.2.41

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: 19b9488d1584681608258d0cef0ca67247127ae4
4
- data.tar.gz: 32cef782749086cfd60253f5e5c213a346388e61
3
+ metadata.gz: 695d9dbc8e0bfd3b7a6296f83d69b45f2318bf32
4
+ data.tar.gz: e2acab12aa851b59f5e0d76d7ec9e9bda5cf35fa
5
5
  SHA512:
6
- metadata.gz: 989e1e7280086432e5cf75b5e5243f6c39f2b8b5b3a5f2414fb6cec4e4c5c2a91a04f23dedc9786ee3fd19324ea32fa74129d8b5b878550a6cc4e299d02b30c9
7
- data.tar.gz: 37e029ad48c293923074862d9f5e341cc800b430b1a15611af394b24d0aad991d0fbb0794db47cd6ac00621947fac7f1c8c754390e6793209f80473de399533e
6
+ metadata.gz: 9b2fe5b78d80b325b9773a186d880e5804820dc5ffd39f78fe64d94d86fb625884cf546abc5ba6a17ec46a43834e01a6140e167ab176eb5747f54369107f74cf
7
+ data.tar.gz: 044f7df50f12243072644d6d1e0ce31a1090222786fc4956cd51e0940bef08e5b6b84578a356064a72640799d0ed2c653f4d1d5fa52c89bf4bbe700dda5de3d7
@@ -1,6 +1,6 @@
1
1
  # Generated by API Builder - https://www.apibuilder.io
2
2
  # Service version: 0.3.65
3
- # apibuilder:0.12.61 https://app.apibuilder.io/flow/api/0.3.93/ruby_client
3
+ # apibuilder:0.12.61 https://app.apibuilder.io/flow/api/0.3.99/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.61 https://app.apibuilder.io/flow/api/0.3.93/ruby_client' unless defined?(Constants::USER_AGENT)
28
+ USER_AGENT = 'apibuilder:0.12.61 https://app.apibuilder.io/flow/api/0.3.99/ruby_client' unless defined?(Constants::USER_AGENT)
29
29
  VERSION = '0.3.65' unless defined?(Constants::VERSION)
30
30
  VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
31
31
 
@@ -276,6 +276,10 @@ module Io
276
276
  @tracking_labels ||= ::Io::Flow::V0::Clients::TrackingLabels.new(self)
277
277
  end
278
278
 
279
+ def transit_windows
280
+ @transit_windows ||= ::Io::Flow::V0::Clients::TransitWindows.new(self)
281
+ end
282
+
279
283
  def webhooks
280
284
  @webhooks ||= ::Io::Flow::V0::Clients::Webhooks.new(self)
281
285
  end
@@ -1076,8 +1080,16 @@ module Io
1076
1080
  nil
1077
1081
  end
1078
1082
 
1079
- # Creates a free shipping promotion to the order, automatically applying it to
1080
- # the order if the order meets the defined promotion trigger.
1083
+ def put_cancellations_by_number(organization, number, order_cancellation_form)
1084
+ HttpClient::Preconditions.assert_class('organization', organization, String)
1085
+ HttpClient::Preconditions.assert_class('number', number, String)
1086
+ (x = order_cancellation_form; x.is_a?(::Io::Flow::V0::Models::OrderCancellationForm) ? x : ::Io::Flow::V0::Models::OrderCancellationForm.new(x))
1087
+ r = @client.request("/#{CGI.escape(organization)}/orders/#{CGI.escape(number)}/cancellations").with_json(order_cancellation_form.to_json).put
1088
+ ::Io::Flow::V0::Models::Order.new(r)
1089
+ end
1090
+
1091
+ # Creates a free shipping promotion for this order, automatically applying it
1092
+ # to the order if the order meets the defined promotion trigger.
1081
1093
  def put_promotions_and_free_shipping_by_number_and_key(organization, number, key, free_shipping_order_promotion_form, incoming={})
1082
1094
  HttpClient::Preconditions.assert_class('organization', organization, String)
1083
1095
  HttpClient::Preconditions.assert_class('number', number, String)
@@ -1102,6 +1114,14 @@ module Io
1102
1114
  ::Io::Flow::V0::Models::Order.new(r)
1103
1115
  end
1104
1116
 
1117
+ def put_updates_by_number(organization, number, order_update_form)
1118
+ HttpClient::Preconditions.assert_class('organization', organization, String)
1119
+ HttpClient::Preconditions.assert_class('number', number, String)
1120
+ (x = order_update_form; x.is_a?(::Io::Flow::V0::Models::OrderUpdateForm) ? x : ::Io::Flow::V0::Models::OrderUpdateForm.new(x))
1121
+ r = @client.request("/#{CGI.escape(organization)}/orders/#{CGI.escape(number)}/updates").with_json(order_update_form.to_json).put
1122
+ ::Io::Flow::V0::Models::Order.new(r)
1123
+ end
1124
+
1105
1125
  # Returns information about a specific order using an identifier number
1106
1126
  def get_identifier_by_identifier_number(organization, identifier_number, incoming={})
1107
1127
  HttpClient::Preconditions.assert_class('organization', organization, String)
@@ -1316,24 +1336,24 @@ module Io
1316
1336
  end
1317
1337
 
1318
1338
  # Returns information about a specific organization.
1319
- def get_by_id(id)
1320
- HttpClient::Preconditions.assert_class('id', id, String)
1321
- r = @client.request("/organizations/#{CGI.escape(id)}").get
1339
+ def get_by_organization_id(organization_id)
1340
+ HttpClient::Preconditions.assert_class('organization_id', organization_id, String)
1341
+ r = @client.request("/organizations/#{CGI.escape(organization_id)}").get
1322
1342
  ::Io::Flow::V0::Models::Organization.new(r)
1323
1343
  end
1324
1344
 
1325
1345
  # Update or create an organization with the specified id.
1326
- def put_by_id(id, organization_put_form)
1327
- HttpClient::Preconditions.assert_class('id', id, String)
1346
+ def put_by_organization_id(organization_id, organization_put_form)
1347
+ HttpClient::Preconditions.assert_class('organization_id', organization_id, String)
1328
1348
  (x = organization_put_form; x.is_a?(::Io::Flow::V0::Models::OrganizationPutForm) ? x : ::Io::Flow::V0::Models::OrganizationPutForm.new(x))
1329
- r = @client.request("/organizations/#{CGI.escape(id)}").with_json(organization_put_form.to_json).put
1349
+ r = @client.request("/organizations/#{CGI.escape(organization_id)}").with_json(organization_put_form.to_json).put
1330
1350
  ::Io::Flow::V0::Models::Organization.new(r)
1331
1351
  end
1332
1352
 
1333
1353
  # Delete the organization with this id
1334
- def delete_by_id(id)
1335
- HttpClient::Preconditions.assert_class('id', id, String)
1336
- r = @client.request("/organizations/#{CGI.escape(id)}").delete
1354
+ def delete_by_organization_id(organization_id)
1355
+ HttpClient::Preconditions.assert_class('organization_id', organization_id, String)
1356
+ r = @client.request("/organizations/#{CGI.escape(organization_id)}").delete
1337
1357
  nil
1338
1358
  end
1339
1359
 
@@ -1351,14 +1371,6 @@ module Io
1351
1371
  r.map { |x| ::Io::Flow::V0::Models::RegionSetting.new(x) }
1352
1372
  end
1353
1373
 
1354
- # Removes the setting for this region for a specific organization
1355
- def delete_settings_and_regions_by_organization_id_and_id(organization_id, id)
1356
- HttpClient::Preconditions.assert_class('organization_id', organization_id, String)
1357
- HttpClient::Preconditions.assert_class('id', id, String)
1358
- r = @client.request("/organizations/#{CGI.escape(organization_id)}/settings/regions/#{CGI.escape(id)}").delete
1359
- nil
1360
- end
1361
-
1362
1374
  # Updates or creates a region setting for a specific organization
1363
1375
  def put_settings_and_regions_by_organization_id_and_region(organization_id, region, region_setting_form)
1364
1376
  HttpClient::Preconditions.assert_class('organization_id', organization_id, String)
@@ -1368,6 +1380,14 @@ module Io
1368
1380
  ::Io::Flow::V0::Models::RegionSetting.new(r)
1369
1381
  end
1370
1382
 
1383
+ # Removes the setting for this region for a specific organization
1384
+ def delete_settings_and_regions_by_organization_id_and_region(organization_id, region)
1385
+ HttpClient::Preconditions.assert_class('organization_id', organization_id, String)
1386
+ HttpClient::Preconditions.assert_class('region', region, String)
1387
+ r = @client.request("/organizations/#{CGI.escape(organization_id)}/settings/regions/#{CGI.escape(region)}").delete
1388
+ nil
1389
+ end
1390
+
1371
1391
  # Returns the list of enabled countries based on the region settings for a
1372
1392
  # specific organization
1373
1393
  def get_settings_and_regions_and_countries_and_available_by_organization_id(organization_id)
@@ -3067,6 +3087,14 @@ module Io
3067
3087
  r.map { |x| ::Io::Flow::V0::Models::Manifest.new(x) }
3068
3088
  end
3069
3089
 
3090
+ # Creates a new manifest/carrier BOL with specific tracking numbers
3091
+ def post(organization, manifest_form)
3092
+ HttpClient::Preconditions.assert_class('organization', organization, String)
3093
+ (x = manifest_form; x.is_a?(::Io::Flow::V0::Models::ManifestForm) ? x : ::Io::Flow::V0::Models::ManifestForm.new(x))
3094
+ r = @client.request("/#{CGI.escape(organization)}/manifests").with_json(manifest_form.to_json).post
3095
+ ::Io::Flow::V0::Models::Manifest.new(r)
3096
+ end
3097
+
3070
3098
  def get_by_id(organization, id)
3071
3099
  HttpClient::Preconditions.assert_class('organization', organization, String)
3072
3100
  HttpClient::Preconditions.assert_class('id', id, String)
@@ -3077,24 +3105,13 @@ module Io
3077
3105
  # Generates a new manifest with all outstanding labels and redirects to a
3078
3106
  # downloadable PDF of carrier-generated manifest or bill of lading (BOL). If
3079
3107
  # no outstanding labels, this will generate a 422 error.
3080
- def get_type_and_all(organization, incoming={})
3108
+ def get_services_and_outstanding_by_service(organization, service)
3081
3109
  HttpClient::Preconditions.assert_class('organization', organization, String)
3082
- opts = HttpClient::Helper.symbolize_keys(incoming)
3083
- query = {
3084
- :service => HttpClient::Preconditions.assert_class('service', opts.delete(:service), String)
3085
- }.delete_if { |k, v| v.nil? }
3086
- r = @client.request("/#{CGI.escape(organization)}/manifests/type/all").with_query(query).get
3110
+ HttpClient::Preconditions.assert_class('service', service, String)
3111
+ r = @client.request("/#{CGI.escape(organization)}/manifests/services/#{CGI.escape(service)}/outstanding").get
3087
3112
  r
3088
3113
  end
3089
3114
 
3090
- # Generate a new manifest/carrier BOL with specific tracking numbers
3091
- def post_type_and_list(organization, manifest_form)
3092
- HttpClient::Preconditions.assert_class('organization', organization, String)
3093
- (x = manifest_form; x.is_a?(::Io::Flow::V0::Models::ManifestForm) ? x : ::Io::Flow::V0::Models::ManifestForm.new(x))
3094
- r = @client.request("/#{CGI.escape(organization)}/manifests/type/list").with_json(manifest_form.to_json).post
3095
- ::Io::Flow::V0::Models::Manifest.new(r)
3096
- end
3097
-
3098
3115
  end
3099
3116
 
3100
3117
  class Quotes
@@ -3668,6 +3685,27 @@ module Io
3668
3685
 
3669
3686
  end
3670
3687
 
3688
+ class TransitWindows
3689
+
3690
+ def initialize(client)
3691
+ @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
3692
+ end
3693
+
3694
+ def get(organization, incoming={})
3695
+ HttpClient::Preconditions.assert_class('organization', organization, String)
3696
+ opts = HttpClient::Helper.symbolize_keys(incoming)
3697
+ query = {
3698
+ :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
3699
+ :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
3700
+ :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
3701
+ :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
3702
+ }.delete_if { |k, v| v.nil? }
3703
+ r = @client.request("/#{CGI.escape(organization)}/transit-windows").with_query(query).get
3704
+ r.map { |x| ::Io::Flow::V0::Models::TransitWindow.new(x) }
3705
+ end
3706
+
3707
+ end
3708
+
3671
3709
  class Webhooks
3672
3710
 
3673
3711
  def initialize(client)
@@ -9432,51 +9470,6 @@ module Io
9432
9470
 
9433
9471
  end
9434
9472
 
9435
- class ManifestType
9436
-
9437
- attr_reader :value
9438
-
9439
- def initialize(value)
9440
- @value = HttpClient::Preconditions.assert_class('value', value, String)
9441
- end
9442
-
9443
- # Returns the instance of ManifestType for this value, creating a new instance for an unknown value
9444
- def ManifestType.apply(value)
9445
- if value.instance_of?(ManifestType)
9446
- value
9447
- else
9448
- HttpClient::Preconditions.assert_class_or_nil('value', value, String)
9449
- value.nil? ? nil : (from_string(value) || ManifestType.new(value))
9450
- end
9451
- end
9452
-
9453
- # Returns the instance of ManifestType for this value, or nil if not found
9454
- def ManifestType.from_string(value)
9455
- HttpClient::Preconditions.assert_class('value', value, String)
9456
- ManifestType.ALL.find { |v| v.value == value }
9457
- end
9458
-
9459
- def ManifestType.ALL
9460
- @@all ||= [ManifestType.all, ManifestType.list]
9461
- end
9462
-
9463
- # Manifest all open shipping labels that are not part of a manifest yet for the
9464
- # organization and carrier service
9465
- def ManifestType.all
9466
- @@_all ||= ManifestType.new('all')
9467
- end
9468
-
9469
- # Manifest only the list of specified labels
9470
- def ManifestType.list
9471
- @@_list ||= ManifestType.new('list')
9472
- end
9473
-
9474
- def to_hash
9475
- value
9476
- end
9477
-
9478
- end
9479
-
9480
9473
  class MarginType
9481
9474
 
9482
9475
  attr_reader :value
@@ -15887,7 +15880,7 @@ module Io
15887
15880
  # Represents a simple model of duties that apply to a given item / trade lane.
15888
15881
  class Duty
15889
15882
 
15890
- attr_reader :rate, :components, :deminimis
15883
+ attr_reader :rate, :components, :deminimis, :name
15891
15884
 
15892
15885
  def initialize(incoming={})
15893
15886
  opts = HttpClient::Helper.symbolize_keys(incoming)
@@ -15895,6 +15888,7 @@ module Io
15895
15888
  @rate = HttpClient::Preconditions.assert_class('rate', HttpClient::Helper.to_big_decimal(opts.delete(:rate)), BigDecimal)
15896
15889
  @components = HttpClient::Preconditions.assert_class('components', opts.delete(:components), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::LevyComponent) ? x : ::Io::Flow::V0::Models::LevyComponent.apply(x)) }
15897
15890
  @deminimis = (x = opts.delete(:deminimis); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Deminimis) ? x : ::Io::Flow::V0::Models::Deminimis.from_json(x)))
15891
+ @name = (x = opts.delete(:name); x.nil? ? nil : HttpClient::Preconditions.assert_class('name', x, String))
15898
15892
  end
15899
15893
 
15900
15894
  def to_json
@@ -15909,7 +15903,8 @@ module Io
15909
15903
  {
15910
15904
  :rate => rate,
15911
15905
  :components => components.map { |o| o.value },
15912
- :deminimis => deminimis.nil? ? nil : deminimis.to_hash
15906
+ :deminimis => deminimis.nil? ? nil : deminimis.to_hash,
15907
+ :name => name
15913
15908
  }
15914
15909
  end
15915
15910
 
@@ -16444,64 +16439,6 @@ module Io
16444
16439
 
16445
16440
  end
16446
16441
 
16447
- # Represents a single experiment / test (e.g. for an incremental rollout or AB
16448
- # Test)
16449
- class Experiment
16450
-
16451
- attr_reader :id, :key
16452
-
16453
- def initialize(incoming={})
16454
- opts = HttpClient::Helper.symbolize_keys(incoming)
16455
- HttpClient::Preconditions.require_keys(opts, [:id, :key], 'Experiment')
16456
- @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
16457
- @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
16458
- end
16459
-
16460
- def to_json
16461
- JSON.dump(to_hash)
16462
- end
16463
-
16464
- def copy(incoming={})
16465
- Experiment.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
16466
- end
16467
-
16468
- def to_hash
16469
- {
16470
- :id => id,
16471
- :key => key
16472
- }
16473
- end
16474
-
16475
- end
16476
-
16477
- # Represents a single instance of an experiment (e.g. page request) resulting in
16478
- # a decision as to the status of a given experiment
16479
- class ExperimentStatus
16480
-
16481
- attr_reader :enabled
16482
-
16483
- def initialize(incoming={})
16484
- opts = HttpClient::Helper.symbolize_keys(incoming)
16485
- HttpClient::Preconditions.require_keys(opts, [:enabled], 'ExperimentStatus')
16486
- @enabled = HttpClient::Preconditions.assert_boolean('enabled', opts.delete(:enabled))
16487
- end
16488
-
16489
- def to_json
16490
- JSON.dump(to_hash)
16491
- end
16492
-
16493
- def copy(incoming={})
16494
- ExperimentStatus.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
16495
- end
16496
-
16497
- def to_hash
16498
- {
16499
- :enabled => enabled
16500
- }
16501
- end
16502
-
16503
- end
16504
-
16505
16442
  # The month and year at which a card expires
16506
16443
  class Expiration
16507
16444
 
@@ -20476,13 +20413,12 @@ module Io
20476
20413
  # carrier for shipping
20477
20414
  class Manifest
20478
20415
 
20479
- attr_reader :id, :type, :timestamp, :shipping_labels, :pdf, :service
20416
+ attr_reader :id, :timestamp, :shipping_labels, :pdf, :service
20480
20417
 
20481
20418
  def initialize(incoming={})
20482
20419
  opts = HttpClient::Helper.symbolize_keys(incoming)
20483
- HttpClient::Preconditions.require_keys(opts, [:id, :type, :timestamp, :shipping_labels], 'Manifest')
20420
+ HttpClient::Preconditions.require_keys(opts, [:id, :timestamp, :shipping_labels], 'Manifest')
20484
20421
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
20485
- @type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::ManifestType) ? x : ::Io::Flow::V0::Models::ManifestType.apply(x))
20486
20422
  @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
20487
20423
  @shipping_labels = HttpClient::Preconditions.assert_class('shipping_labels', opts.delete(:shipping_labels), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::ShippingLabelSummary) ? x : ::Io::Flow::V0::Models::ShippingLabelSummary.new(x)) }
20488
20424
  @pdf = (x = opts.delete(:pdf); x.nil? ? nil : HttpClient::Preconditions.assert_class('pdf', x, String))
@@ -20500,7 +20436,6 @@ module Io
20500
20436
  def to_hash
20501
20437
  {
20502
20438
  :id => id,
20503
- :type => type.value,
20504
20439
  :timestamp => timestamp,
20505
20440
  :shipping_labels => shipping_labels.map { |o| o.to_hash },
20506
20441
  :pdf => pdf,
@@ -20512,12 +20447,11 @@ module Io
20512
20447
 
20513
20448
  class ManifestForm
20514
20449
 
20515
- attr_reader :tracking_number_type, :tracking_numbers, :service
20450
+ attr_reader :tracking_numbers, :service
20516
20451
 
20517
20452
  def initialize(incoming={})
20518
20453
  opts = HttpClient::Helper.symbolize_keys(incoming)
20519
- HttpClient::Preconditions.require_keys(opts, [:tracking_number_type, :tracking_numbers], 'ManifestForm')
20520
- @tracking_number_type = (x = opts.delete(:tracking_number_type); x.is_a?(::Io::Flow::V0::Models::TrackingNumberType) ? x : ::Io::Flow::V0::Models::TrackingNumberType.apply(x))
20454
+ HttpClient::Preconditions.require_keys(opts, [:tracking_numbers], 'ManifestForm')
20521
20455
  @tracking_numbers = HttpClient::Preconditions.assert_class('tracking_numbers', opts.delete(:tracking_numbers), Array).map { |v| HttpClient::Preconditions.assert_class('tracking_numbers', v, String) }
20522
20456
  @service = (x = opts.delete(:service); x.nil? ? nil : HttpClient::Preconditions.assert_class('service', x, String))
20523
20457
  end
@@ -20532,7 +20466,6 @@ module Io
20532
20466
 
20533
20467
  def to_hash
20534
20468
  {
20535
- :tracking_number_type => tracking_number_type.value,
20536
20469
  :tracking_numbers => tracking_numbers,
20537
20470
  :service => service
20538
20471
  }
@@ -21450,6 +21383,33 @@ module Io
21450
21383
 
21451
21384
  end
21452
21385
 
21386
+ # An order cancellation form will update all item quantities to 0. The
21387
+ # implementation is a convenience method that wraps an order_update_form
21388
+ class OrderCancellationForm
21389
+
21390
+ attr_reader :attributes
21391
+
21392
+ def initialize(incoming={})
21393
+ opts = HttpClient::Helper.symbolize_keys(incoming)
21394
+ @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 })
21395
+ end
21396
+
21397
+ def to_json
21398
+ JSON.dump(to_hash)
21399
+ end
21400
+
21401
+ def copy(incoming={})
21402
+ OrderCancellationForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
21403
+ end
21404
+
21405
+ def to_hash
21406
+ {
21407
+ :attributes => attributes.nil? ? nil : attributes
21408
+ }
21409
+ end
21410
+
21411
+ end
21412
+
21453
21413
  class OrderDeleted < Event
21454
21414
 
21455
21415
  attr_reader :event_id, :timestamp, :organization, :number
@@ -21855,6 +21815,34 @@ module Io
21855
21815
 
21856
21816
  end
21857
21817
 
21818
+ class OrderLineUpdateForm
21819
+
21820
+ attr_reader :item_number, :quantity
21821
+
21822
+ def initialize(incoming={})
21823
+ opts = HttpClient::Helper.symbolize_keys(incoming)
21824
+ HttpClient::Preconditions.require_keys(opts, [:item_number, :quantity], 'OrderLineUpdateForm')
21825
+ @item_number = HttpClient::Preconditions.assert_class('item_number', opts.delete(:item_number), String)
21826
+ @quantity = HttpClient::Preconditions.assert_class('quantity', opts.delete(:quantity), Integer)
21827
+ end
21828
+
21829
+ def to_json
21830
+ JSON.dump(to_hash)
21831
+ end
21832
+
21833
+ def copy(incoming={})
21834
+ OrderLineUpdateForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
21835
+ end
21836
+
21837
+ def to_hash
21838
+ {
21839
+ :item_number => item_number,
21840
+ :quantity => quantity
21841
+ }
21842
+ end
21843
+
21844
+ end
21845
+
21858
21846
  # An Order Payment represents an individual payment applied to an order. The
21859
21847
  # type of the payment can be used to further lookup transaction level detail
21860
21848
  class OrderPayment
@@ -22063,6 +22051,33 @@ module Io
22063
22051
 
22064
22052
  end
22065
22053
 
22054
+ class OrderUpdateForm
22055
+
22056
+ attr_reader :lines, :attributes
22057
+
22058
+ def initialize(incoming={})
22059
+ opts = HttpClient::Helper.symbolize_keys(incoming)
22060
+ @lines = (x = opts.delete(:lines); x.nil? ? nil : HttpClient::Preconditions.assert_class('lines', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::OrderLineUpdateForm) ? x : ::Io::Flow::V0::Models::OrderLineUpdateForm.new(x)) })
22061
+ @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 })
22062
+ end
22063
+
22064
+ def to_json
22065
+ JSON.dump(to_hash)
22066
+ end
22067
+
22068
+ def copy(incoming={})
22069
+ OrderUpdateForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
22070
+ end
22071
+
22072
+ def to_hash
22073
+ {
22074
+ :lines => lines.nil? ? nil : lines.map { |o| o.to_hash },
22075
+ :attributes => attributes.nil? ? nil : attributes
22076
+ }
22077
+ end
22078
+
22079
+ end
22080
+
22066
22081
  class OrderUpserted < Event
22067
22082
 
22068
22083
  attr_reader :event_id, :timestamp, :organization, :number, :environment, :experience_id, :expires_at, :customer, :selections, :items, :destination, :deliveries, :prices, :payments, :discount, :delivered_duty, :total, :created_at, :updated_at, :submitted_at, :lines, :attributes
@@ -28809,6 +28824,40 @@ module Io
28809
28824
 
28810
28825
  end
28811
28826
 
28827
+ class TransitWindow
28828
+
28829
+ attr_reader :service_id, :origin_country, :destination_country, :from, :to
28830
+
28831
+ def initialize(incoming={})
28832
+ opts = HttpClient::Helper.symbolize_keys(incoming)
28833
+ HttpClient::Preconditions.require_keys(opts, [:service_id, :origin_country, :destination_country, :from, :to], 'TransitWindow')
28834
+ @service_id = HttpClient::Preconditions.assert_class('service_id', opts.delete(:service_id), String)
28835
+ @origin_country = HttpClient::Preconditions.assert_class('origin_country', opts.delete(:origin_country), String)
28836
+ @destination_country = HttpClient::Preconditions.assert_class('destination_country', opts.delete(:destination_country), String)
28837
+ @from = HttpClient::Preconditions.assert_class('from', opts.delete(:from), String)
28838
+ @to = HttpClient::Preconditions.assert_class('to', opts.delete(:to), String)
28839
+ end
28840
+
28841
+ def to_json
28842
+ JSON.dump(to_hash)
28843
+ end
28844
+
28845
+ def copy(incoming={})
28846
+ TransitWindow.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
28847
+ end
28848
+
28849
+ def to_hash
28850
+ {
28851
+ :service_id => service_id,
28852
+ :origin_country => origin_country,
28853
+ :destination_country => destination_country,
28854
+ :from => from,
28855
+ :to => to
28856
+ }
28857
+ end
28858
+
28859
+ end
28860
+
28812
28861
  # Export for items that require harmonization.
28813
28862
  class UnharmonizedItemExportType < ExportType
28814
28863
 
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.2.40
4
+ version: 0.2.41
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-10-01 00:00:00.000000000 Z
11
+ date: 2017-10-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json