flowcommerce 0.0.15 → 0.0.16

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: 2334859615c65a95b45875136703c82018969671
4
- data.tar.gz: 655d89a828e23e90bacdf3c5cebac037bcdda5d2
3
+ metadata.gz: d1b54a0158f4db7cbccdd47dffb072e187e110fb
4
+ data.tar.gz: a9537d307a6e22a11305f5d7223021b683f3120a
5
5
  SHA512:
6
- metadata.gz: 24ab338e6e0538e457cd09077a43fb7567340b51b1261920a2ae7fcbaf1a294969c205c9b3815a57c745d2d7714167781207411d244a8e9ff2a96f028cf79300
7
- data.tar.gz: 9125cfb4472b653e8f00d49daf4e30d346e6bf0b128ae8105bd0d95b29a4328bd9488ceb3cb617b5acf14546ecafbe9322f5c4a1954bc9126769a8c91c4775d1
6
+ metadata.gz: b3eec40129a9f30ba2b49aa789f032cc91cfe40386ac5fb355c8a6bce4eae608312ea17aa2b50dfb33c914d7c09db8c90a68b4a222a2aea02cbbc18a9de6213b
7
+ data.tar.gz: 4adcc2ee574bc9053f621bd0c6cb6fc678e3844116cb333dd70d07d9b461c6becac2c2b00b160829e5bebb868f78c320db6bd7281c7c300093ec080e88c86e50
@@ -1,6 +1,6 @@
1
1
  # Generated by apidoc - http://www.apidoc.me
2
- # Service version: 0.0.51
3
- # apidoc:0.11.32 http://www.apidoc.me/flow/api/0.0.51/ruby_client
2
+ # Service version: 0.0.53
3
+ # apidoc:0.11.32 http://www.apidoc.me/flow/api/0.0.53/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.32 http://www.apidoc.me/flow/api/0.0.51/ruby_client' unless defined?(Constants::USER_AGENT)
29
- VERSION = '0.0.51' unless defined?(Constants::VERSION)
28
+ USER_AGENT = 'apidoc:0.11.32 http://www.apidoc.me/flow/api/0.0.53/ruby_client' unless defined?(Constants::USER_AGENT)
29
+ VERSION = '0.0.53' unless defined?(Constants::VERSION)
30
30
  VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
31
31
 
32
32
  end
@@ -77,6 +77,10 @@ module Io
77
77
  @items ||= ::Io::Flow::V0::Clients::Items.new(self)
78
78
  end
79
79
 
80
+ def orders
81
+ @orders ||= ::Io::Flow::V0::Clients::Orders.new(self)
82
+ end
83
+
80
84
  def subcatalogs
81
85
  @subcatalogs ||= ::Io::Flow::V0::Clients::Subcatalogs.new(self)
82
86
  end
@@ -85,10 +89,6 @@ module Io
85
89
  @subcatalog_items ||= ::Io::Flow::V0::Clients::SubcatalogItems.new(self)
86
90
  end
87
91
 
88
- def displays
89
- @displays ||= ::Io::Flow::V0::Clients::Displays.new(self)
90
- end
91
-
92
92
  def functions
93
93
  @functions ||= ::Io::Flow::V0::Clients::Functions.new(self)
94
94
  end
@@ -157,10 +157,6 @@ module Io
157
157
  @delivery_windows ||= ::Io::Flow::V0::Clients::DeliveryWindows.new(self)
158
158
  end
159
159
 
160
- def events
161
- @events ||= ::Io::Flow::V0::Clients::Events.new(self)
162
- end
163
-
164
160
  def inventory_rules
165
161
  @inventory_rules ||= ::Io::Flow::V0::Clients::InventoryRules.new(self)
166
162
  end
@@ -177,6 +173,10 @@ module Io
177
173
  @labels ||= ::Io::Flow::V0::Clients::Labels.new(self)
178
174
  end
179
175
 
176
+ def label_events
177
+ @label_events ||= ::Io::Flow::V0::Clients::LabelEvents.new(self)
178
+ end
179
+
180
180
  def lanes
181
181
  @lanes ||= ::Io::Flow::V0::Clients::Lanes.new(self)
182
182
  end
@@ -286,52 +286,51 @@ module Io
286
286
  @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
287
287
  end
288
288
 
289
- # Search metadata. Always paginated.
289
+ # Search attributes. Always paginated.
290
290
  def get(organization, incoming={})
291
291
  HttpClient::Preconditions.assert_class('organization', organization, String)
292
292
  opts = HttpClient::Helper.symbolize_keys(incoming)
293
293
  query = {
294
294
  :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
295
- :name => (x = opts.delete(:name); x.nil? ? nil : HttpClient::Preconditions.assert_class('name', x, Array).map { |v| HttpClient::Preconditions.assert_class('name', v, String) }),
296
- :option => (x = opts.delete(:option); x.nil? ? nil : HttpClient::Preconditions.assert_class('option', x, Array).map { |v| HttpClient::Preconditions.assert_class('option', v, String) }),
295
+ :key => (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, Array).map { |v| HttpClient::Preconditions.assert_class('key', v, String) }),
297
296
  :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
298
297
  :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
299
- :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "name" : x), String)
298
+ :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "key" : x), String)
300
299
  }.delete_if { |k, v| v.nil? }
301
300
  r = @client.request("/#{CGI.escape(organization)}/attributes").with_query(query).get
302
301
  r.map { |x| ::Io::Flow::V0::Models::Attribute.new(x) }
303
302
  end
304
303
 
305
304
  # Add attribute
306
- def post(organization, attribute)
305
+ def post(organization, attribute_form)
307
306
  HttpClient::Preconditions.assert_class('organization', organization, String)
308
- HttpClient::Preconditions.assert_class('attribute', attribute, ::Io::Flow::V0::Models::Attribute)
309
- r = @client.request("/#{CGI.escape(organization)}/attributes").with_json(attribute.to_json).post
307
+ HttpClient::Preconditions.assert_class('attribute_form', attribute_form, ::Io::Flow::V0::Models::AttributeForm)
308
+ r = @client.request("/#{CGI.escape(organization)}/attributes").with_json(attribute_form.to_json).post
310
309
  ::Io::Flow::V0::Models::Attribute.new(r)
311
310
  end
312
311
 
313
312
  # Returns information about a specific attribute.
314
- def get_by_name(organization, name)
313
+ def get_by_key(organization, key)
315
314
  HttpClient::Preconditions.assert_class('organization', organization, String)
316
- HttpClient::Preconditions.assert_class('name', name, String)
317
- r = @client.request("/#{CGI.escape(organization)}/attributes/#{CGI.escape(name)}").get
315
+ HttpClient::Preconditions.assert_class('key', key, String)
316
+ r = @client.request("/#{CGI.escape(organization)}/attributes/#{CGI.escape(key)}").get
318
317
  ::Io::Flow::V0::Models::Attribute.new(r)
319
318
  end
320
319
 
321
- # Update an attribute with the specified name, creating if it does not exist.
322
- def put_by_name(organization, name, attribute)
320
+ # Create or update an attribute with the specified key.
321
+ def put_by_key(organization, key, attribute_form)
323
322
  HttpClient::Preconditions.assert_class('organization', organization, String)
324
- HttpClient::Preconditions.assert_class('name', name, String)
325
- HttpClient::Preconditions.assert_class('attribute', attribute, ::Io::Flow::V0::Models::Attribute)
326
- r = @client.request("/#{CGI.escape(organization)}/attributes/#{CGI.escape(name)}").with_json(attribute.to_json).put
323
+ HttpClient::Preconditions.assert_class('key', key, String)
324
+ HttpClient::Preconditions.assert_class('attribute_form', attribute_form, ::Io::Flow::V0::Models::AttributeForm)
325
+ r = @client.request("/#{CGI.escape(organization)}/attributes/#{CGI.escape(key)}").with_json(attribute_form.to_json).put
327
326
  ::Io::Flow::V0::Models::Attribute.new(r)
328
327
  end
329
328
 
330
- # Delete an attribute with this name
331
- def delete_by_name(organization, name)
329
+ # Delete an attribute with the specified key.
330
+ def delete_by_key(organization, key)
332
331
  HttpClient::Preconditions.assert_class('organization', organization, String)
333
- HttpClient::Preconditions.assert_class('name', name, String)
334
- r = @client.request("/#{CGI.escape(organization)}/attributes/#{CGI.escape(name)}").delete
332
+ HttpClient::Preconditions.assert_class('key', key, String)
333
+ r = @client.request("/#{CGI.escape(organization)}/attributes/#{CGI.escape(key)}").delete
335
334
  nil
336
335
  end
337
336
 
@@ -341,7 +340,7 @@ module Io
341
340
  opts = HttpClient::Helper.symbolize_keys(incoming)
342
341
  query = {
343
342
  :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
344
- :name => (x = opts.delete(:name); x.nil? ? nil : HttpClient::Preconditions.assert_class('name', x, Array).map { |v| HttpClient::Preconditions.assert_class('name', v, String) }),
343
+ :key => (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, Array).map { |v| HttpClient::Preconditions.assert_class('key', v, String) }),
345
344
  :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
346
345
  :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
347
346
  :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
@@ -379,11 +378,11 @@ module Io
379
378
  opts = HttpClient::Helper.symbolize_keys(incoming)
380
379
  query = {
381
380
  :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
382
- :country => (x = opts.delete(:country); x.nil? ? nil : HttpClient::Preconditions.assert_class('country', x, Array).map { |v| HttpClient::Preconditions.assert_class('country', v, String) }),
383
- :currency => (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, Array).map { |v| HttpClient::Preconditions.assert_class('currency', v, String) }),
384
381
  :key => (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, Array).map { |v| HttpClient::Preconditions.assert_class('key', v, String) }),
385
- :name => (x = opts.delete(:name); x.nil? ? nil : HttpClient::Preconditions.assert_class('name', x, Array).map { |v| HttpClient::Preconditions.assert_class('name', v, String) }),
386
- :subcatalog => (x = opts.delete(:subcatalog); x.nil? ? nil : HttpClient::Preconditions.assert_class('subcatalog', x, Array).map { |v| HttpClient::Preconditions.assert_class('subcatalog', v, String) }),
382
+ :name => (x = opts.delete(:name); x.nil? ? nil : HttpClient::Preconditions.assert_class('name', x, String)),
383
+ :region => (x = opts.delete(:region); x.nil? ? nil : HttpClient::Preconditions.assert_class('region', x, String)),
384
+ :currency => (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, String)),
385
+ :subcatalog => (x = opts.delete(:subcatalog); x.nil? ? nil : HttpClient::Preconditions.assert_class('subcatalog', x, String)),
387
386
  :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
388
387
  :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
389
388
  :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "name" : x), String)
@@ -425,12 +424,13 @@ module Io
425
424
  nil
426
425
  end
427
426
 
428
- # Checkout, aggregate items and prices.
429
- def post_checkout(organization, checkout_form)
427
+ # Update the configuration of the price display for this experience.
428
+ def put_price_display_by_key(organization, key, price_display)
430
429
  HttpClient::Preconditions.assert_class('organization', organization, String)
431
- HttpClient::Preconditions.assert_class('checkout_form', checkout_form, ::Io::Flow::V0::Models::CheckoutForm)
432
- r = @client.request("/#{CGI.escape(organization)}/experiences/checkout").with_json(checkout_form.to_json).post
433
- ::Io::Flow::V0::Models::Checkout.new(r)
430
+ HttpClient::Preconditions.assert_class('key', key, String)
431
+ HttpClient::Preconditions.assert_class('price_display', price_display, ::Io::Flow::V0::Models::PriceDisplay)
432
+ r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(key)}/price_display").with_json(price_display.to_json).put
433
+ ::Io::Flow::V0::Models::Experience.new(r)
434
434
  end
435
435
 
436
436
  # Compose items and prices. Always paginated.
@@ -439,6 +439,7 @@ module Io
439
439
  opts = HttpClient::Helper.symbolize_keys(incoming)
440
440
  query = {
441
441
  :number => (x = opts.delete(:number); x.nil? ? nil : HttpClient::Preconditions.assert_class('number', x, Array).map { |v| HttpClient::Preconditions.assert_class('number', v, String) }),
442
+ :experience => (x = opts.delete(:experience); x.nil? ? nil : HttpClient::Preconditions.assert_class('experience', x, String)),
442
443
  :destination => (x = opts.delete(:destination); x.nil? ? nil : HttpClient::Preconditions.assert_class('destination', x, String)),
443
444
  :from_country => (x = opts.delete(:from_country); x.nil? ? nil : HttpClient::Preconditions.assert_class('from_country', x, String)),
444
445
  :ip => (x = opts.delete(:ip); x.nil? ? nil : HttpClient::Preconditions.assert_class('ip', x, String)),
@@ -459,7 +460,6 @@ module Io
459
460
  query = {
460
461
  :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
461
462
  :key => (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, Array).map { |v| HttpClient::Preconditions.assert_class('key', v, String) }),
462
- :name => (x = opts.delete(:name); x.nil? ? nil : HttpClient::Preconditions.assert_class('name', x, Array).map { |v| HttpClient::Preconditions.assert_class('name', v, String) }),
463
463
  :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
464
464
  :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
465
465
  :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
@@ -541,6 +541,82 @@ module Io
541
541
 
542
542
  end
543
543
 
544
+ class Orders
545
+
546
+ def initialize(client)
547
+ @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
548
+ end
549
+
550
+ # Search orders. Always paginated.
551
+ def get(organization, incoming={})
552
+ HttpClient::Preconditions.assert_class('organization', organization, String)
553
+ opts = HttpClient::Helper.symbolize_keys(incoming)
554
+ query = {
555
+ :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
556
+ :number => (x = opts.delete(:number); x.nil? ? nil : HttpClient::Preconditions.assert_class('number', x, Array).map { |v| HttpClient::Preconditions.assert_class('number', v, String) }),
557
+ :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
558
+ :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
559
+ :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
560
+ }.delete_if { |k, v| v.nil? }
561
+ r = @client.request("/#{CGI.escape(organization)}/orders").with_query(query).get
562
+ r.map { |x| ::Io::Flow::V0::Models::Order.new(x) }
563
+ end
564
+
565
+ # Create an order - the order must be booked (see bookings) before its
566
+ # expiration
567
+ def post(organization, order_form)
568
+ HttpClient::Preconditions.assert_class('organization', organization, String)
569
+ HttpClient::Preconditions.assert_class('order_form', order_form, ::Io::Flow::V0::Models::OrderForm)
570
+ r = @client.request("/#{CGI.escape(organization)}/orders").with_json(order_form.to_json).post
571
+ ::Io::Flow::V0::Models::Order.new(r)
572
+ end
573
+
574
+ # Returns information about a specific order.
575
+ def get_by_number(organization, number)
576
+ HttpClient::Preconditions.assert_class('organization', organization, String)
577
+ HttpClient::Preconditions.assert_class('number', number, String)
578
+ r = @client.request("/#{CGI.escape(organization)}/orders/#{CGI.escape(number)}").get
579
+ ::Io::Flow::V0::Models::Order.new(r)
580
+ end
581
+
582
+ # Delete an order. Note that only orders that have not yet been booked may be
583
+ # deleted.
584
+ def delete_by_number(organization, number)
585
+ HttpClient::Preconditions.assert_class('organization', organization, String)
586
+ HttpClient::Preconditions.assert_class('number', number, String)
587
+ r = @client.request("/#{CGI.escape(organization)}/orders/#{CGI.escape(number)}").delete
588
+ nil
589
+ end
590
+
591
+ # Books an order. You will get a validation error if the order has already
592
+ # expired (and a new quote could not be automatically recreated for a lower or
593
+ # same price). This method is idempotent - booking an order a second time has
594
+ # no effect.
595
+ def put_bookings_by_number(organization, number, order_booking_form)
596
+ HttpClient::Preconditions.assert_class('organization', organization, String)
597
+ HttpClient::Preconditions.assert_class('number', number, String)
598
+ HttpClient::Preconditions.assert_class('order_booking_form', order_booking_form, ::Io::Flow::V0::Models::OrderBookingForm)
599
+ r = @client.request("/#{CGI.escape(organization)}/orders/#{CGI.escape(number)}/bookings").with_json(order_booking_form.to_json).put
600
+ ::Io::Flow::V0::Models::OrderBooking.new(r)
601
+ end
602
+
603
+ # Provides visibility into recent changes of each order, including deletion
604
+ def get_versions(organization, incoming={})
605
+ HttpClient::Preconditions.assert_class('organization', organization, String)
606
+ opts = HttpClient::Helper.symbolize_keys(incoming)
607
+ query = {
608
+ :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
609
+ :number => (x = opts.delete(:number); x.nil? ? nil : HttpClient::Preconditions.assert_class('number', x, Array).map { |v| HttpClient::Preconditions.assert_class('number', v, String) }),
610
+ :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
611
+ :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
612
+ :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
613
+ }.delete_if { |k, v| v.nil? }
614
+ r = @client.request("/#{CGI.escape(organization)}/orders/versions").with_query(query).get
615
+ r.map { |x| ::Io::Flow::V0::Models::OrderVersion.new(x) }
616
+ end
617
+
618
+ end
619
+
544
620
  class Subcatalogs
545
621
 
546
622
  def initialize(client)
@@ -553,7 +629,6 @@ module Io
553
629
  opts = HttpClient::Helper.symbolize_keys(incoming)
554
630
  query = {
555
631
  :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
556
- :key => (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, Array).map { |v| HttpClient::Preconditions.assert_class('key', v, String) }),
557
632
  :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
558
633
  :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
559
634
  :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
@@ -571,130 +646,149 @@ module Io
571
646
  end
572
647
 
573
648
  # Returns information about a specific subcatalog.
574
- def get_by_key(organization, key)
649
+ def get_by_id(organization, id)
575
650
  HttpClient::Preconditions.assert_class('organization', organization, String)
576
- HttpClient::Preconditions.assert_class('key', key, String)
577
- r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(key)}").get
651
+ HttpClient::Preconditions.assert_class('id', id, String)
652
+ r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(id)}").get
578
653
  ::Io::Flow::V0::Models::Subcatalog.new(r)
579
654
  end
580
655
 
581
- # Update subcatalog with the specified key, creating if it does not exist.
582
- def put_by_key(organization, key, subcatalog_form)
656
+ # Update subcatalog with the specified id, creating if it does not exist.
657
+ def put_by_id(organization, id, subcatalog_form)
583
658
  HttpClient::Preconditions.assert_class('organization', organization, String)
584
- HttpClient::Preconditions.assert_class('key', key, String)
659
+ HttpClient::Preconditions.assert_class('id', id, String)
585
660
  HttpClient::Preconditions.assert_class('subcatalog_form', subcatalog_form, ::Io::Flow::V0::Models::SubcatalogForm)
586
- r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(key)}").with_json(subcatalog_form.to_json).put
661
+ r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(id)}").with_json(subcatalog_form.to_json).put
587
662
  ::Io::Flow::V0::Models::Subcatalog.new(r)
588
663
  end
589
664
 
590
- # Delete the subcatalog with this key
591
- def delete_by_key(organization, key)
665
+ # Delete the subcatalog with this id
666
+ def delete_by_id(organization, id)
592
667
  HttpClient::Preconditions.assert_class('organization', organization, String)
593
- HttpClient::Preconditions.assert_class('key', key, String)
594
- r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(key)}").delete
668
+ HttpClient::Preconditions.assert_class('id', id, String)
669
+ r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(id)}").delete
595
670
  nil
596
671
  end
597
672
 
598
673
  # Sync subcatalog
599
- def post_events_by_key_and_event(organization, key, event, hash)
674
+ def post_events_by_id_and_event(organization, id, event, hash)
600
675
  HttpClient::Preconditions.assert_class('organization', organization, String)
601
- HttpClient::Preconditions.assert_class('key', key, String)
676
+ HttpClient::Preconditions.assert_class('id', id, String)
602
677
  HttpClient::Preconditions.assert_class('event', event, String)
603
678
  HttpClient::Preconditions.assert_class('hash', hash, Hash)
604
- r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(key)}/events/#{CGI.escape(event)}").with_json(hash.to_json).post
679
+ r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(id)}/events/#{CGI.escape(event)}").with_json(hash.to_json).post
605
680
  nil
606
681
  end
607
682
 
683
+ # Returns information about a specific subcatalog's settings.
684
+ def get_settings_by_id(organization, id)
685
+ HttpClient::Preconditions.assert_class('organization', organization, String)
686
+ HttpClient::Preconditions.assert_class('id', id, String)
687
+ r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(id)}/settings").get
688
+ ::Io::Flow::V0::Models::SubcatalogSettings.new(r)
689
+ end
690
+
691
+ # Update subcatalog settings for the specified subcatalog.
692
+ def put_settings_by_id(organization, id, subcatalog_settings_form)
693
+ HttpClient::Preconditions.assert_class('organization', organization, String)
694
+ HttpClient::Preconditions.assert_class('id', id, String)
695
+ HttpClient::Preconditions.assert_class('subcatalog_settings_form', subcatalog_settings_form, ::Io::Flow::V0::Models::SubcatalogSettingsForm)
696
+ r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(id)}/settings").with_json(subcatalog_settings_form.to_json).put
697
+ ::Io::Flow::V0::Models::SubcatalogSettings.new(r)
698
+ end
699
+
608
700
  # Search exclusions. Always paginated.
609
- def get_exclusions_by_key(organization, key, incoming={})
701
+ def get_exclusions_by_subcatalog_id(organization, subcatalog_id, incoming={})
610
702
  HttpClient::Preconditions.assert_class('organization', organization, String)
611
- HttpClient::Preconditions.assert_class('key', key, String)
703
+ HttpClient::Preconditions.assert_class('subcatalog_id', subcatalog_id, String)
612
704
  opts = HttpClient::Helper.symbolize_keys(incoming)
613
705
  query = {
614
706
  :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
615
- :type => (x = opts.delete(:type); x.nil? ? nil : HttpClient::Preconditions.assert_class('type', x, Array).map { |v| HttpClient::Preconditions.assert_class('type', v, String) }),
707
+ :number => (x = opts.delete(:number); x.nil? ? nil : HttpClient::Preconditions.assert_class('number', x, Array).map { |v| HttpClient::Preconditions.assert_class('number', v, String) }),
616
708
  :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
617
709
  :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
618
- :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
710
+ :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "name" : x), String)
619
711
  }.delete_if { |k, v| v.nil? }
620
- r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(key)}/exclusions").with_query(query).get
621
- r.map { |x| ::Io::Flow::V0::Models::Query.new(x) }
712
+ r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(subcatalog_id)}/exclusions").with_query(query).get
713
+ r.map { |x| ::Io::Flow::V0::Models::Item.new(x) }
622
714
  end
623
715
 
624
- # Add exclusion
625
- def post_exclusions_by_key(organization, key, query_form)
716
+ # Returns information about a specific exclusion by catalog item number.
717
+ def get_exclusions_by_subcatalog_id_and_number(organization, subcatalog_id, number)
626
718
  HttpClient::Preconditions.assert_class('organization', organization, String)
627
- HttpClient::Preconditions.assert_class('key', key, String)
628
- HttpClient::Preconditions.assert_class('query_form', query_form, ::Io::Flow::V0::Models::QueryForm)
629
- r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(key)}/exclusions").with_json(query_form.to_json).post
630
- ::Io::Flow::V0::Models::Query.new(r)
719
+ HttpClient::Preconditions.assert_class('subcatalog_id', subcatalog_id, String)
720
+ HttpClient::Preconditions.assert_class('number', number, String)
721
+ r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(subcatalog_id)}/exclusions/#{CGI.escape(number)}").get
722
+ ::Io::Flow::V0::Models::Item.new(r)
631
723
  end
632
724
 
633
- # Returns information about a specific exclusion.
634
- def get_exclusions_by_key_and_id(organization, key, id)
725
+ # Add exclusion
726
+ def put_exclusions_by_subcatalog_id_and_number(organization, subcatalog_id, number, hash)
635
727
  HttpClient::Preconditions.assert_class('organization', organization, String)
636
- HttpClient::Preconditions.assert_class('key', key, String)
637
- HttpClient::Preconditions.assert_class('id', id, String)
638
- r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(key)}/exclusions/#{CGI.escape(id)}").get
639
- ::Io::Flow::V0::Models::Query.new(r)
728
+ HttpClient::Preconditions.assert_class('subcatalog_id', subcatalog_id, String)
729
+ HttpClient::Preconditions.assert_class('number', number, String)
730
+ HttpClient::Preconditions.assert_class('hash', hash, Hash)
731
+ r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(subcatalog_id)}/exclusions/#{CGI.escape(number)}").with_json(hash.to_json).put
732
+ ::Io::Flow::V0::Models::Item.new(r)
640
733
  end
641
734
 
642
- # Delete an exclusion with this id
643
- def delete_exclusions_by_key_and_id(organization, key, id)
735
+ # Delete an exclusion with this catalog item number
736
+ def delete_exclusions_by_subcatalog_id_and_number(organization, subcatalog_id, number)
644
737
  HttpClient::Preconditions.assert_class('organization', organization, String)
645
- HttpClient::Preconditions.assert_class('key', key, String)
646
- HttpClient::Preconditions.assert_class('id', id, String)
647
- r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(key)}/exclusions/#{CGI.escape(id)}").delete
738
+ HttpClient::Preconditions.assert_class('subcatalog_id', subcatalog_id, String)
739
+ HttpClient::Preconditions.assert_class('number', number, String)
740
+ r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(subcatalog_id)}/exclusions/#{CGI.escape(number)}").delete
648
741
  nil
649
742
  end
650
743
 
651
744
  # Search inclusions. Always paginated.
652
- def get_inclusions_by_key(organization, key, incoming={})
745
+ def get_inclusions_by_subcatalog_id(organization, subcatalog_id, incoming={})
653
746
  HttpClient::Preconditions.assert_class('organization', organization, String)
654
- HttpClient::Preconditions.assert_class('key', key, String)
747
+ HttpClient::Preconditions.assert_class('subcatalog_id', subcatalog_id, String)
655
748
  opts = HttpClient::Helper.symbolize_keys(incoming)
656
749
  query = {
657
750
  :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
658
- :type => (x = opts.delete(:type); x.nil? ? nil : HttpClient::Preconditions.assert_class('type', x, Array).map { |v| HttpClient::Preconditions.assert_class('type', v, String) }),
751
+ :number => (x = opts.delete(:number); x.nil? ? nil : HttpClient::Preconditions.assert_class('number', x, Array).map { |v| HttpClient::Preconditions.assert_class('number', v, String) }),
659
752
  :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
660
753
  :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
661
- :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
754
+ :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "name" : x), String)
662
755
  }.delete_if { |k, v| v.nil? }
663
- r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(key)}/inclusions").with_query(query).get
664
- r.map { |x| ::Io::Flow::V0::Models::Query.new(x) }
756
+ r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(subcatalog_id)}/inclusions").with_query(query).get
757
+ r.map { |x| ::Io::Flow::V0::Models::Item.new(x) }
665
758
  end
666
759
 
667
- # Add inclusion
668
- def post_inclusions_by_key(organization, key, query_form)
760
+ # Returns information about a specific inclusion by catalog item number.
761
+ def get_inclusions_by_subcatalog_id_and_number(organization, subcatalog_id, number)
669
762
  HttpClient::Preconditions.assert_class('organization', organization, String)
670
- HttpClient::Preconditions.assert_class('key', key, String)
671
- HttpClient::Preconditions.assert_class('query_form', query_form, ::Io::Flow::V0::Models::QueryForm)
672
- r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(key)}/inclusions").with_json(query_form.to_json).post
673
- ::Io::Flow::V0::Models::Query.new(r)
763
+ HttpClient::Preconditions.assert_class('subcatalog_id', subcatalog_id, String)
764
+ HttpClient::Preconditions.assert_class('number', number, String)
765
+ r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(subcatalog_id)}/inclusions/#{CGI.escape(number)}").get
766
+ ::Io::Flow::V0::Models::Item.new(r)
674
767
  end
675
768
 
676
- # Returns information about a specific inclusion.
677
- def get_inclusions_by_key_and_id(organization, key, id)
769
+ # Add inclusion
770
+ def put_inclusions_by_subcatalog_id_and_number(organization, subcatalog_id, number, hash)
678
771
  HttpClient::Preconditions.assert_class('organization', organization, String)
679
- HttpClient::Preconditions.assert_class('key', key, String)
680
- HttpClient::Preconditions.assert_class('id', id, String)
681
- r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(key)}/inclusions/#{CGI.escape(id)}").get
682
- ::Io::Flow::V0::Models::Query.new(r)
772
+ HttpClient::Preconditions.assert_class('subcatalog_id', subcatalog_id, String)
773
+ HttpClient::Preconditions.assert_class('number', number, String)
774
+ HttpClient::Preconditions.assert_class('hash', hash, Hash)
775
+ r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(subcatalog_id)}/inclusions/#{CGI.escape(number)}").with_json(hash.to_json).put
776
+ ::Io::Flow::V0::Models::Item.new(r)
683
777
  end
684
778
 
685
- # Delete an inclusion with this id
686
- def delete_inclusions_by_key_and_id(organization, key, id)
779
+ # Delete an inclusion with this catalog item number
780
+ def delete_inclusions_by_subcatalog_id_and_number(organization, subcatalog_id, number)
687
781
  HttpClient::Preconditions.assert_class('organization', organization, String)
688
- HttpClient::Preconditions.assert_class('key', key, String)
689
- HttpClient::Preconditions.assert_class('id', id, String)
690
- r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(key)}/inclusions/#{CGI.escape(id)}").delete
782
+ HttpClient::Preconditions.assert_class('subcatalog_id', subcatalog_id, String)
783
+ HttpClient::Preconditions.assert_class('number', number, String)
784
+ r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(subcatalog_id)}/inclusions/#{CGI.escape(number)}").delete
691
785
  nil
692
786
  end
693
787
 
694
788
  # Search queries. Always paginated.
695
- def get_queries_by_key(organization, key, incoming={})
789
+ def get_queries_by_subcatalog_id(organization, subcatalog_id, incoming={})
696
790
  HttpClient::Preconditions.assert_class('organization', organization, String)
697
- HttpClient::Preconditions.assert_class('key', key, String)
791
+ HttpClient::Preconditions.assert_class('subcatalog_id', subcatalog_id, String)
698
792
  opts = HttpClient::Helper.symbolize_keys(incoming)
699
793
  query = {
700
794
  :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
@@ -703,61 +797,43 @@ module Io
703
797
  :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
704
798
  :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
705
799
  }.delete_if { |k, v| v.nil? }
706
- r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(key)}/queries").with_query(query).get
800
+ r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(subcatalog_id)}/queries").with_query(query).get
707
801
  r.map { |x| ::Io::Flow::V0::Models::Query.new(x) }
708
802
  end
709
803
 
710
804
  # Add query
711
- def post_queries_by_key(organization, key, query_form)
805
+ def post_queries_by_subcatalog_id(organization, subcatalog_id, query_form)
712
806
  HttpClient::Preconditions.assert_class('organization', organization, String)
713
- HttpClient::Preconditions.assert_class('key', key, String)
807
+ HttpClient::Preconditions.assert_class('subcatalog_id', subcatalog_id, String)
714
808
  HttpClient::Preconditions.assert_class('query_form', query_form, ::Io::Flow::V0::Models::QueryForm)
715
- r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(key)}/queries").with_json(query_form.to_json).post
809
+ r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(subcatalog_id)}/queries").with_json(query_form.to_json).post
716
810
  ::Io::Flow::V0::Models::Query.new(r)
717
811
  end
718
812
 
719
813
  # Returns information about a specific query.
720
- def get_queries_by_key_and_id(organization, key, id)
814
+ def get_queries_by_subcatalog_id_and_id(organization, subcatalog_id, id)
721
815
  HttpClient::Preconditions.assert_class('organization', organization, String)
722
- HttpClient::Preconditions.assert_class('key', key, String)
816
+ HttpClient::Preconditions.assert_class('subcatalog_id', subcatalog_id, String)
723
817
  HttpClient::Preconditions.assert_class('id', id, String)
724
- r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(key)}/queries/#{CGI.escape(id)}").get
818
+ r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(subcatalog_id)}/queries/#{CGI.escape(id)}").get
725
819
  ::Io::Flow::V0::Models::Query.new(r)
726
820
  end
727
821
 
728
822
  # Delete a query with this id
729
- def delete_queries_by_key_and_id(organization, key, id)
823
+ def delete_queries_by_subcatalog_id_and_id(organization, subcatalog_id, id)
730
824
  HttpClient::Preconditions.assert_class('organization', organization, String)
731
- HttpClient::Preconditions.assert_class('key', key, String)
825
+ HttpClient::Preconditions.assert_class('subcatalog_id', subcatalog_id, String)
732
826
  HttpClient::Preconditions.assert_class('id', id, String)
733
- r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(key)}/queries/#{CGI.escape(id)}").delete
827
+ r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(subcatalog_id)}/queries/#{CGI.escape(id)}").delete
734
828
  nil
735
829
  end
736
830
 
737
- # Returns information about a specific subcatalog's settings.
738
- def get_settings_by_key(organization, key)
739
- HttpClient::Preconditions.assert_class('organization', organization, String)
740
- HttpClient::Preconditions.assert_class('key', key, String)
741
- r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(key)}/settings").get
742
- ::Io::Flow::V0::Models::SubcatalogSettings.new(r)
743
- end
744
-
745
- # Update subcatalog settings for the specified subcatalog.
746
- def put_settings_by_key(organization, key, subcatalog_settings_form)
747
- HttpClient::Preconditions.assert_class('organization', organization, String)
748
- HttpClient::Preconditions.assert_class('key', key, String)
749
- HttpClient::Preconditions.assert_class('subcatalog_settings_form', subcatalog_settings_form, ::Io::Flow::V0::Models::SubcatalogSettingsForm)
750
- r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(key)}/settings").with_json(subcatalog_settings_form.to_json).put
751
- ::Io::Flow::V0::Models::SubcatalogSettings.new(r)
752
- end
753
-
754
831
  # Provides visibility into recent changes of each object, including deletion
755
832
  def get_versions(organization, incoming={})
756
833
  HttpClient::Preconditions.assert_class('organization', organization, String)
757
834
  opts = HttpClient::Helper.symbolize_keys(incoming)
758
835
  query = {
759
836
  :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
760
- :key => (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, Array).map { |v| HttpClient::Preconditions.assert_class('key', v, String) }),
761
837
  :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
762
838
  :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
763
839
  :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
@@ -775,9 +851,9 @@ module Io
775
851
  end
776
852
 
777
853
  # Search subcatalog items. Always paginated.
778
- def get(organization, subcatalog, incoming={})
854
+ def get(organization, subcatalog_id, incoming={})
779
855
  HttpClient::Preconditions.assert_class('organization', organization, String)
780
- HttpClient::Preconditions.assert_class('subcatalog', subcatalog, String)
856
+ HttpClient::Preconditions.assert_class('subcatalog_id', subcatalog_id, String)
781
857
  opts = HttpClient::Helper.symbolize_keys(incoming)
782
858
  query = {
783
859
  :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
@@ -786,52 +862,52 @@ module Io
786
862
  :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
787
863
  :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "name" : x), String)
788
864
  }.delete_if { |k, v| v.nil? }
789
- r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(subcatalog)}/items").with_query(query).get
865
+ r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(subcatalog_id)}/items").with_query(query).get
790
866
  r.map { |x| ::Io::Flow::V0::Models::Item.new(x) }
791
867
  end
792
868
 
793
869
  # Add subcatalog item
794
- def post(organization, subcatalog, item_form)
870
+ def post(organization, subcatalog_id, item_form)
795
871
  HttpClient::Preconditions.assert_class('organization', organization, String)
796
- HttpClient::Preconditions.assert_class('subcatalog', subcatalog, String)
872
+ HttpClient::Preconditions.assert_class('subcatalog_id', subcatalog_id, String)
797
873
  HttpClient::Preconditions.assert_class('item_form', item_form, ::Io::Flow::V0::Models::ItemForm)
798
- r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(subcatalog)}/items").with_json(item_form.to_json).post
874
+ r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(subcatalog_id)}/items").with_json(item_form.to_json).post
799
875
  ::Io::Flow::V0::Models::Item.new(r)
800
876
  end
801
877
 
802
878
  # Returns information about specific subcatalog items.
803
- def get_by_number(organization, subcatalog, number)
879
+ def get_by_number(organization, subcatalog_id, number)
804
880
  HttpClient::Preconditions.assert_class('organization', organization, String)
805
- HttpClient::Preconditions.assert_class('subcatalog', subcatalog, String)
881
+ HttpClient::Preconditions.assert_class('subcatalog_id', subcatalog_id, String)
806
882
  HttpClient::Preconditions.assert_class('number', number, String)
807
- r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(subcatalog)}/items/#{CGI.escape(number)}").get
883
+ r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(subcatalog_id)}/items/#{CGI.escape(number)}").get
808
884
  ::Io::Flow::V0::Models::Item.new(r)
809
885
  end
810
886
 
811
887
  # Update subcatalog item with the specified number, creating if it does not
812
888
  # exist.
813
- def put_by_number(organization, subcatalog, number, item_form)
889
+ def put_by_number(organization, subcatalog_id, number, item_form)
814
890
  HttpClient::Preconditions.assert_class('organization', organization, String)
815
- HttpClient::Preconditions.assert_class('subcatalog', subcatalog, String)
891
+ HttpClient::Preconditions.assert_class('subcatalog_id', subcatalog_id, String)
816
892
  HttpClient::Preconditions.assert_class('number', number, String)
817
893
  HttpClient::Preconditions.assert_class('item_form', item_form, ::Io::Flow::V0::Models::ItemForm)
818
- r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(subcatalog)}/items/#{CGI.escape(number)}").with_json(item_form.to_json).put
894
+ r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(subcatalog_id)}/items/#{CGI.escape(number)}").with_json(item_form.to_json).put
819
895
  ::Io::Flow::V0::Models::Item.new(r)
820
896
  end
821
897
 
822
898
  # Delete the subcatalog item with this number
823
- def delete_by_number(organization, subcatalog, number)
899
+ def delete_by_number(organization, subcatalog_id, number)
824
900
  HttpClient::Preconditions.assert_class('organization', organization, String)
825
- HttpClient::Preconditions.assert_class('subcatalog', subcatalog, String)
901
+ HttpClient::Preconditions.assert_class('subcatalog_id', subcatalog_id, String)
826
902
  HttpClient::Preconditions.assert_class('number', number, String)
827
- r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(subcatalog)}/items/#{CGI.escape(number)}").delete
903
+ r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(subcatalog_id)}/items/#{CGI.escape(number)}").delete
828
904
  nil
829
905
  end
830
906
 
831
907
  # Provides visibility into recent changes of each object, including deletion
832
- def get_versions(organization, subcatalog, incoming={})
908
+ def get_versions(organization, subcatalog_id, incoming={})
833
909
  HttpClient::Preconditions.assert_class('organization', organization, String)
834
- HttpClient::Preconditions.assert_class('subcatalog', subcatalog, String)
910
+ HttpClient::Preconditions.assert_class('subcatalog_id', subcatalog_id, String)
835
911
  opts = HttpClient::Helper.symbolize_keys(incoming)
836
912
  query = {
837
913
  :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
@@ -840,86 +916,12 @@ module Io
840
916
  :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
841
917
  :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
842
918
  }.delete_if { |k, v| v.nil? }
843
- r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(subcatalog)}/items/versions").with_query(query).get
919
+ r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(subcatalog_id)}/items/versions").with_query(query).get
844
920
  r.map { |x| ::Io::Flow::V0::Models::SubcatalogVersion.new(x) }
845
921
  end
846
922
 
847
923
  end
848
924
 
849
- class Displays
850
-
851
- def initialize(client)
852
- @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
853
- end
854
-
855
- # Search displays. Always paginated.
856
- def get(organization, incoming={})
857
- HttpClient::Preconditions.assert_class('organization', organization, String)
858
- opts = HttpClient::Helper.symbolize_keys(incoming)
859
- query = {
860
- :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
861
- :key => (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, Array).map { |v| HttpClient::Preconditions.assert_class('key', v, String) }),
862
- :name => (x = opts.delete(:name); x.nil? ? nil : HttpClient::Preconditions.assert_class('name', x, Array).map { |v| HttpClient::Preconditions.assert_class('name', v, String) }),
863
- :experience => (x = opts.delete(:experience); x.nil? ? nil : HttpClient::Preconditions.assert_class('experience', x, String)),
864
- :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
865
- :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
866
- :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "name" : x), String)
867
- }.delete_if { |k, v| v.nil? }
868
- r = @client.request("/#{CGI.escape(organization)}/displays").with_query(query).get
869
- r.map { |x| ::Io::Flow::V0::Models::Display.new(x) }
870
- end
871
-
872
- # Add display
873
- def post(organization, display_form)
874
- HttpClient::Preconditions.assert_class('organization', organization, String)
875
- HttpClient::Preconditions.assert_class('display_form', display_form, ::Io::Flow::V0::Models::DisplayForm)
876
- r = @client.request("/#{CGI.escape(organization)}/displays").with_json(display_form.to_json).post
877
- ::Io::Flow::V0::Models::Display.new(r)
878
- end
879
-
880
- # Returns information about a specific display.
881
- def get_by_key(organization, key)
882
- HttpClient::Preconditions.assert_class('organization', organization, String)
883
- HttpClient::Preconditions.assert_class('key', key, String)
884
- r = @client.request("/#{CGI.escape(organization)}/displays/#{CGI.escape(key)}").get
885
- ::Io::Flow::V0::Models::Display.new(r)
886
- end
887
-
888
- # Update display with the specified key, creating if it does not exist.
889
- def put_by_key(organization, key, display_form)
890
- HttpClient::Preconditions.assert_class('organization', organization, String)
891
- HttpClient::Preconditions.assert_class('key', key, String)
892
- HttpClient::Preconditions.assert_class('display_form', display_form, ::Io::Flow::V0::Models::DisplayForm)
893
- r = @client.request("/#{CGI.escape(organization)}/displays/#{CGI.escape(key)}").with_json(display_form.to_json).put
894
- ::Io::Flow::V0::Models::Display.new(r)
895
- end
896
-
897
- # Delete the display with this key
898
- def delete_by_key(organization, key)
899
- HttpClient::Preconditions.assert_class('organization', organization, String)
900
- HttpClient::Preconditions.assert_class('key', key, String)
901
- r = @client.request("/#{CGI.escape(organization)}/displays/#{CGI.escape(key)}").delete
902
- nil
903
- end
904
-
905
- # Provides visibility into recent changes of each object, including deletion
906
- def get_versions(organization, incoming={})
907
- HttpClient::Preconditions.assert_class('organization', organization, String)
908
- opts = HttpClient::Helper.symbolize_keys(incoming)
909
- query = {
910
- :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
911
- :key => (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, Array).map { |v| HttpClient::Preconditions.assert_class('key', v, String) }),
912
- :name => (x = opts.delete(:name); x.nil? ? nil : HttpClient::Preconditions.assert_class('name', x, Array).map { |v| HttpClient::Preconditions.assert_class('name', v, String) }),
913
- :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
914
- :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
915
- :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
916
- }.delete_if { |k, v| v.nil? }
917
- r = @client.request("/#{CGI.escape(organization)}/displays/versions").with_query(query).get
918
- r.map { |x| ::Io::Flow::V0::Models::DisplayVersion.new(x) }
919
- end
920
-
921
- end
922
-
923
925
  class Functions
924
926
 
925
927
  def initialize(client)
@@ -1779,54 +1781,48 @@ module Io
1779
1781
 
1780
1782
  end
1781
1783
 
1782
- class Events
1784
+ class InventoryRules
1783
1785
 
1784
1786
  def initialize(client)
1785
1787
  @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
1786
1788
  end
1787
1789
 
1788
- def get(incoming={})
1790
+ def get(organization, incoming={})
1791
+ HttpClient::Preconditions.assert_class('organization', organization, String)
1789
1792
  opts = HttpClient::Helper.symbolize_keys(incoming)
1790
1793
  query = {
1791
1794
  :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
1792
- :organization => (x = opts.delete(:organization); x.nil? ? nil : HttpClient::Preconditions.assert_class('organization', x, String)),
1793
- :tracking_id => (x = opts.delete(:tracking_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('tracking_id', x, Array).map { |v| HttpClient::Preconditions.assert_class('tracking_id', v, String) }),
1794
- :label_id => (x = opts.delete(:label_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('label_id', x, Array).map { |v| HttpClient::Preconditions.assert_class('label_id', v, String) }),
1795
1795
  :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
1796
1796
  :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
1797
- :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String),
1798
- :expand => (x = opts.delete(:expand); x.nil? ? nil : HttpClient::Preconditions.assert_class('expand', x, Array).map { |v| HttpClient::Preconditions.assert_class('expand', v, String) })
1797
+ :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
1799
1798
  }.delete_if { |k, v| v.nil? }
1800
- r = @client.request("/events").with_query(query).get
1801
- r.map { |x| ::Io::Flow::V0::Models::Event.new(x) }
1799
+ r = @client.request("/#{CGI.escape(organization)}/inventory_rules").with_query(query).get
1800
+ r.map { |x| ::Io::Flow::V0::Models::InventoryRule.new(x) }
1802
1801
  end
1803
1802
 
1804
- def get_by_id(id, incoming={})
1805
- HttpClient::Preconditions.assert_class('id', id, String)
1806
- opts = HttpClient::Helper.symbolize_keys(incoming)
1807
- query = {
1808
- :expand => (x = opts.delete(:expand); x.nil? ? nil : HttpClient::Preconditions.assert_class('expand', x, Array).map { |v| HttpClient::Preconditions.assert_class('expand', v, String) })
1809
- }.delete_if { |k, v| v.nil? }
1810
- r = @client.request("/events/#{CGI.escape(id)}").with_query(query).get
1811
- ::Io::Flow::V0::Models::Event.new(r)
1803
+ def post(organization, inventory_rule_form)
1804
+ HttpClient::Preconditions.assert_class('organization', organization, String)
1805
+ HttpClient::Preconditions.assert_class('inventory_rule_form', inventory_rule_form, ::Io::Flow::V0::Models::InventoryRuleForm)
1806
+ r = @client.request("/#{CGI.escape(organization)}/inventory_rules").with_json(inventory_rule_form.to_json).post
1807
+ ::Io::Flow::V0::Models::InventoryRule.new(r)
1812
1808
  end
1813
1809
 
1814
- def get_versions(incoming={})
1810
+ def get_versions(organization, incoming={})
1811
+ HttpClient::Preconditions.assert_class('organization', organization, String)
1815
1812
  opts = HttpClient::Helper.symbolize_keys(incoming)
1816
1813
  query = {
1817
1814
  :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
1818
- :event_id => (x = opts.delete(:event_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('event_id', x, Array).map { |v| HttpClient::Preconditions.assert_class('event_id', v, String) }),
1819
1815
  :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
1820
1816
  :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
1821
1817
  :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
1822
1818
  }.delete_if { |k, v| v.nil? }
1823
- r = @client.request("/events/versions").with_query(query).get
1824
- r.map { |x| ::Io::Flow::V0::Models::EventVersion.new(x) }
1819
+ r = @client.request("/#{CGI.escape(organization)}/inventory_rules/versions").with_query(query).get
1820
+ r.map { |x| ::Io::Flow::V0::Models::InventoryRuleVersion.new(x) }
1825
1821
  end
1826
1822
 
1827
1823
  end
1828
1824
 
1829
- class InventoryRules
1825
+ class InventorySnapshots
1830
1826
 
1831
1827
  def initialize(client)
1832
1828
  @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
@@ -1837,19 +1833,21 @@ module Io
1837
1833
  opts = HttpClient::Helper.symbolize_keys(incoming)
1838
1834
  query = {
1839
1835
  :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
1836
+ :center => (x = opts.delete(:center); x.nil? ? nil : HttpClient::Preconditions.assert_class('center', x, Array).map { |v| HttpClient::Preconditions.assert_class('center', v, String) }),
1837
+ :item => (x = opts.delete(:item); x.nil? ? nil : HttpClient::Preconditions.assert_class('item', x, Array).map { |v| HttpClient::Preconditions.assert_class('item', v, String) }),
1840
1838
  :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
1841
1839
  :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
1842
1840
  :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
1843
1841
  }.delete_if { |k, v| v.nil? }
1844
- r = @client.request("/#{CGI.escape(organization)}/inventory_rules").with_query(query).get
1845
- r.map { |x| ::Io::Flow::V0::Models::InventoryRule.new(x) }
1842
+ r = @client.request("/#{CGI.escape(organization)}/inventory_snapshots").with_query(query).get
1843
+ r.map { |x| ::Io::Flow::V0::Models::InventorySnapshot.new(x) }
1846
1844
  end
1847
1845
 
1848
- def post(organization, inventory_rule_form)
1846
+ def get_by_id(organization, id)
1849
1847
  HttpClient::Preconditions.assert_class('organization', organization, String)
1850
- HttpClient::Preconditions.assert_class('inventory_rule_form', inventory_rule_form, ::Io::Flow::V0::Models::InventoryRuleForm)
1851
- r = @client.request("/#{CGI.escape(organization)}/inventory_rules").with_json(inventory_rule_form.to_json).post
1852
- ::Io::Flow::V0::Models::InventoryRule.new(r)
1848
+ HttpClient::Preconditions.assert_class('id', id, String)
1849
+ r = @client.request("/#{CGI.escape(organization)}/inventory_snapshots/#{CGI.escape(id)}").get
1850
+ ::Io::Flow::V0::Models::InventorySnapshot.new(r)
1853
1851
  end
1854
1852
 
1855
1853
  def get_versions(organization, incoming={})
@@ -1857,17 +1855,18 @@ module Io
1857
1855
  opts = HttpClient::Helper.symbolize_keys(incoming)
1858
1856
  query = {
1859
1857
  :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
1858
+ :inventory_snapshot => (x = opts.delete(:inventory_snapshot); x.nil? ? nil : HttpClient::Preconditions.assert_class('inventory_snapshot', x, Array).map { |v| HttpClient::Preconditions.assert_class('inventory_snapshot', v, String) }),
1860
1859
  :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
1861
1860
  :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
1862
1861
  :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
1863
1862
  }.delete_if { |k, v| v.nil? }
1864
- r = @client.request("/#{CGI.escape(organization)}/inventory_rules/versions").with_query(query).get
1865
- r.map { |x| ::Io::Flow::V0::Models::InventoryRuleVersion.new(x) }
1863
+ r = @client.request("/#{CGI.escape(organization)}/inventory_snapshots/versions").with_query(query).get
1864
+ r.map { |x| ::Io::Flow::V0::Models::InventorySnapshotVersion.new(x) }
1866
1865
  end
1867
1866
 
1868
1867
  end
1869
1868
 
1870
- class InventorySnapshots
1869
+ class InventoryUpdates
1871
1870
 
1872
1871
  def initialize(client)
1873
1872
  @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
@@ -1884,15 +1883,22 @@ module Io
1884
1883
  :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
1885
1884
  :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
1886
1885
  }.delete_if { |k, v| v.nil? }
1887
- r = @client.request("/#{CGI.escape(organization)}/inventory_snapshots").with_query(query).get
1888
- r.map { |x| ::Io::Flow::V0::Models::InventorySnapshot.new(x) }
1886
+ r = @client.request("/#{CGI.escape(organization)}/inventory_updates").with_query(query).get
1887
+ r.map { |x| ::Io::Flow::V0::Models::InventoryUpdate.new(x) }
1888
+ end
1889
+
1890
+ def post(organization, inventory_update_form)
1891
+ HttpClient::Preconditions.assert_class('organization', organization, String)
1892
+ HttpClient::Preconditions.assert_class('inventory_update_form', inventory_update_form, ::Io::Flow::V0::Models::InventoryUpdateForm)
1893
+ r = @client.request("/#{CGI.escape(organization)}/inventory_updates").with_json(inventory_update_form.to_json).post
1894
+ ::Io::Flow::V0::Models::InventoryUpdate.new(r)
1889
1895
  end
1890
1896
 
1891
1897
  def get_by_id(organization, id)
1892
1898
  HttpClient::Preconditions.assert_class('organization', organization, String)
1893
1899
  HttpClient::Preconditions.assert_class('id', id, String)
1894
- r = @client.request("/#{CGI.escape(organization)}/inventory_snapshots/#{CGI.escape(id)}").get
1895
- ::Io::Flow::V0::Models::InventorySnapshot.new(r)
1900
+ r = @client.request("/#{CGI.escape(organization)}/inventory_updates/#{CGI.escape(id)}").get
1901
+ ::Io::Flow::V0::Models::InventoryUpdate.new(r)
1896
1902
  end
1897
1903
 
1898
1904
  def get_versions(organization, incoming={})
@@ -1900,18 +1906,18 @@ module Io
1900
1906
  opts = HttpClient::Helper.symbolize_keys(incoming)
1901
1907
  query = {
1902
1908
  :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
1903
- :inventory_snapshot => (x = opts.delete(:inventory_snapshot); x.nil? ? nil : HttpClient::Preconditions.assert_class('inventory_snapshot', x, Array).map { |v| HttpClient::Preconditions.assert_class('inventory_snapshot', v, String) }),
1909
+ :inventory_update => (x = opts.delete(:inventory_update); x.nil? ? nil : HttpClient::Preconditions.assert_class('inventory_update', x, Array).map { |v| HttpClient::Preconditions.assert_class('inventory_update', v, String) }),
1904
1910
  :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
1905
1911
  :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
1906
1912
  :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
1907
1913
  }.delete_if { |k, v| v.nil? }
1908
- r = @client.request("/#{CGI.escape(organization)}/inventory_snapshots/versions").with_query(query).get
1909
- r.map { |x| ::Io::Flow::V0::Models::InventorySnapshotVersion.new(x) }
1914
+ r = @client.request("/#{CGI.escape(organization)}/inventory_updates/versions").with_query(query).get
1915
+ r.map { |x| ::Io::Flow::V0::Models::InventoryUpdateVersion.new(x) }
1910
1916
  end
1911
1917
 
1912
1918
  end
1913
1919
 
1914
- class InventoryUpdates
1920
+ class Labels
1915
1921
 
1916
1922
  def initialize(client)
1917
1923
  @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
@@ -1922,28 +1928,27 @@ module Io
1922
1928
  opts = HttpClient::Helper.symbolize_keys(incoming)
1923
1929
  query = {
1924
1930
  :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
1925
- :center => (x = opts.delete(:center); x.nil? ? nil : HttpClient::Preconditions.assert_class('center', x, Array).map { |v| HttpClient::Preconditions.assert_class('center', v, String) }),
1926
- :item => (x = opts.delete(:item); x.nil? ? nil : HttpClient::Preconditions.assert_class('item', x, Array).map { |v| HttpClient::Preconditions.assert_class('item', v, String) }),
1931
+ :tracking_id => (x = opts.delete(:tracking_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('tracking_id', x, Array).map { |v| HttpClient::Preconditions.assert_class('tracking_id', v, String) }),
1927
1932
  :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
1928
1933
  :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
1929
1934
  :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
1930
1935
  }.delete_if { |k, v| v.nil? }
1931
- r = @client.request("/#{CGI.escape(organization)}/inventory_updates").with_query(query).get
1932
- r.map { |x| ::Io::Flow::V0::Models::InventoryUpdate.new(x) }
1936
+ r = @client.request("/#{CGI.escape(organization)}/labels").with_query(query).get
1937
+ r.map { |x| ::Io::Flow::V0::Models::Label.new(x) }
1933
1938
  end
1934
1939
 
1935
- def post(organization, inventory_update_form)
1940
+ def post(organization, label_form)
1936
1941
  HttpClient::Preconditions.assert_class('organization', organization, String)
1937
- HttpClient::Preconditions.assert_class('inventory_update_form', inventory_update_form, ::Io::Flow::V0::Models::InventoryUpdateForm)
1938
- r = @client.request("/#{CGI.escape(organization)}/inventory_updates").with_json(inventory_update_form.to_json).post
1939
- ::Io::Flow::V0::Models::InventoryUpdate.new(r)
1942
+ HttpClient::Preconditions.assert_class('label_form', label_form, ::Io::Flow::V0::Models::LabelForm)
1943
+ r = @client.request("/#{CGI.escape(organization)}/labels").with_json(label_form.to_json).post
1944
+ ::Io::Flow::V0::Models::Label.new(r)
1940
1945
  end
1941
1946
 
1942
1947
  def get_by_id(organization, id)
1943
1948
  HttpClient::Preconditions.assert_class('organization', organization, String)
1944
1949
  HttpClient::Preconditions.assert_class('id', id, String)
1945
- r = @client.request("/#{CGI.escape(organization)}/inventory_updates/#{CGI.escape(id)}").get
1946
- ::Io::Flow::V0::Models::InventoryUpdate.new(r)
1950
+ r = @client.request("/#{CGI.escape(organization)}/labels/#{CGI.escape(id)}").get
1951
+ ::Io::Flow::V0::Models::Label.new(r)
1947
1952
  end
1948
1953
 
1949
1954
  def get_versions(organization, incoming={})
@@ -1951,60 +1956,62 @@ module Io
1951
1956
  opts = HttpClient::Helper.symbolize_keys(incoming)
1952
1957
  query = {
1953
1958
  :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
1954
- :inventory_update => (x = opts.delete(:inventory_update); x.nil? ? nil : HttpClient::Preconditions.assert_class('inventory_update', x, Array).map { |v| HttpClient::Preconditions.assert_class('inventory_update', v, String) }),
1959
+ :label_id => (x = opts.delete(:label_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('label_id', x, Array).map { |v| HttpClient::Preconditions.assert_class('label_id', v, String) }),
1955
1960
  :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
1956
1961
  :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
1957
1962
  :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
1958
1963
  }.delete_if { |k, v| v.nil? }
1959
- r = @client.request("/#{CGI.escape(organization)}/inventory_updates/versions").with_query(query).get
1960
- r.map { |x| ::Io::Flow::V0::Models::InventoryUpdateVersion.new(x) }
1964
+ r = @client.request("/#{CGI.escape(organization)}/labels/versions").with_query(query).get
1965
+ r.map { |x| ::Io::Flow::V0::Models::LabelVersion.new(x) }
1961
1966
  end
1962
1967
 
1963
1968
  end
1964
1969
 
1965
- class Labels
1970
+ class LabelEvents
1966
1971
 
1967
1972
  def initialize(client)
1968
1973
  @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
1969
1974
  end
1970
1975
 
1971
- def get(incoming={})
1976
+ def get(organization, incoming={})
1977
+ HttpClient::Preconditions.assert_class('organization', organization, String)
1972
1978
  opts = HttpClient::Helper.symbolize_keys(incoming)
1973
1979
  query = {
1974
1980
  :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
1975
- :organization => (x = opts.delete(:organization); x.nil? ? nil : HttpClient::Preconditions.assert_class('organization', x, String)),
1976
1981
  :tracking_id => (x = opts.delete(:tracking_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('tracking_id', x, Array).map { |v| HttpClient::Preconditions.assert_class('tracking_id', v, String) }),
1982
+ :label_id => (x = opts.delete(:label_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('label_id', x, Array).map { |v| HttpClient::Preconditions.assert_class('label_id', v, String) }),
1977
1983
  :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
1978
1984
  :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
1979
- :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
1985
+ :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String),
1986
+ :expand => (x = opts.delete(:expand); x.nil? ? nil : HttpClient::Preconditions.assert_class('expand', x, Array).map { |v| HttpClient::Preconditions.assert_class('expand', v, String) })
1980
1987
  }.delete_if { |k, v| v.nil? }
1981
- r = @client.request("/labels").with_query(query).get
1982
- r.map { |x| ::Io::Flow::V0::Models::Label.new(x) }
1983
- end
1984
-
1985
- def post(label_form)
1986
- HttpClient::Preconditions.assert_class('label_form', label_form, ::Io::Flow::V0::Models::LabelForm)
1987
- r = @client.request("/labels").with_json(label_form.to_json).post
1988
- ::Io::Flow::V0::Models::Label.new(r)
1988
+ r = @client.request("/#{CGI.escape(organization)}/label_events").with_query(query).get
1989
+ r.map { |x| ::Io::Flow::V0::Models::LabelEvent.new(x) }
1989
1990
  end
1990
1991
 
1991
- def get_by_id(id)
1992
+ def get_by_id(organization, id, incoming={})
1993
+ HttpClient::Preconditions.assert_class('organization', organization, String)
1992
1994
  HttpClient::Preconditions.assert_class('id', id, String)
1993
- r = @client.request("/labels/#{CGI.escape(id)}").get
1994
- ::Io::Flow::V0::Models::Label.new(r)
1995
+ opts = HttpClient::Helper.symbolize_keys(incoming)
1996
+ query = {
1997
+ :expand => (x = opts.delete(:expand); x.nil? ? nil : HttpClient::Preconditions.assert_class('expand', x, Array).map { |v| HttpClient::Preconditions.assert_class('expand', v, String) })
1998
+ }.delete_if { |k, v| v.nil? }
1999
+ r = @client.request("/#{CGI.escape(organization)}/label_events/#{CGI.escape(id)}").with_query(query).get
2000
+ ::Io::Flow::V0::Models::LabelEvent.new(r)
1995
2001
  end
1996
2002
 
1997
- def get_versions(incoming={})
2003
+ def get_versions(organization, incoming={})
2004
+ HttpClient::Preconditions.assert_class('organization', organization, String)
1998
2005
  opts = HttpClient::Helper.symbolize_keys(incoming)
1999
2006
  query = {
2000
2007
  :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
2001
- :label_id => (x = opts.delete(:label_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('label_id', x, Array).map { |v| HttpClient::Preconditions.assert_class('label_id', v, String) }),
2008
+ :label_event_id => (x = opts.delete(:label_event_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('label_event_id', x, Array).map { |v| HttpClient::Preconditions.assert_class('label_event_id', v, String) }),
2002
2009
  :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
2003
2010
  :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
2004
2011
  :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
2005
2012
  }.delete_if { |k, v| v.nil? }
2006
- r = @client.request("/labels/versions").with_query(query).get
2007
- r.map { |x| ::Io::Flow::V0::Models::LabelVersion.new(x) }
2013
+ r = @client.request("/#{CGI.escape(organization)}/label_events/versions").with_query(query).get
2014
+ r.map { |x| ::Io::Flow::V0::Models::LabelEventVersion.new(x) }
2008
2015
  end
2009
2016
 
2010
2017
  end
@@ -2340,32 +2347,35 @@ module Io
2340
2347
  @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
2341
2348
  end
2342
2349
 
2343
- def get(incoming={})
2350
+ def get(organization, incoming={})
2351
+ HttpClient::Preconditions.assert_class('organization', organization, String)
2344
2352
  opts = HttpClient::Helper.symbolize_keys(incoming)
2345
2353
  query = {
2346
2354
  :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
2347
- :organization => (x = opts.delete(:organization); x.nil? ? nil : HttpClient::Preconditions.assert_class('organization', x, String)),
2348
2355
  :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
2349
2356
  :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
2350
2357
  :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
2351
2358
  }.delete_if { |k, v| v.nil? }
2352
- r = @client.request("/trackings").with_query(query).get
2359
+ r = @client.request("/#{CGI.escape(organization)}/trackings").with_query(query).get
2353
2360
  r.map { |x| ::Io::Flow::V0::Models::Tracking.new(x) }
2354
2361
  end
2355
2362
 
2356
- def post(tracking_form)
2363
+ def post(organization, tracking_form)
2364
+ HttpClient::Preconditions.assert_class('organization', organization, String)
2357
2365
  HttpClient::Preconditions.assert_class('tracking_form', tracking_form, ::Io::Flow::V0::Models::TrackingForm)
2358
- r = @client.request("/trackings").with_json(tracking_form.to_json).post
2366
+ r = @client.request("/#{CGI.escape(organization)}/trackings").with_json(tracking_form.to_json).post
2359
2367
  ::Io::Flow::V0::Models::Tracking.new(r)
2360
2368
  end
2361
2369
 
2362
- def get_by_id(id)
2370
+ def get_by_id(organization, id)
2371
+ HttpClient::Preconditions.assert_class('organization', organization, String)
2363
2372
  HttpClient::Preconditions.assert_class('id', id, String)
2364
- r = @client.request("/trackings/#{CGI.escape(id)}").get
2373
+ r = @client.request("/#{CGI.escape(organization)}/trackings/#{CGI.escape(id)}").get
2365
2374
  ::Io::Flow::V0::Models::Tracking.new(r)
2366
2375
  end
2367
2376
 
2368
- def get_versions(incoming={})
2377
+ def get_versions(organization, incoming={})
2378
+ HttpClient::Preconditions.assert_class('organization', organization, String)
2369
2379
  opts = HttpClient::Helper.symbolize_keys(incoming)
2370
2380
  query = {
2371
2381
  :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
@@ -2374,7 +2384,7 @@ module Io
2374
2384
  :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
2375
2385
  :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
2376
2386
  }.delete_if { |k, v| v.nil? }
2377
- r = @client.request("/trackings/versions").with_query(query).get
2387
+ r = @client.request("/#{CGI.escape(organization)}/trackings/versions").with_query(query).get
2378
2388
  r.map { |x| ::Io::Flow::V0::Models::TrackingVersion.new(x) }
2379
2389
  end
2380
2390
 
@@ -3913,50 +3923,6 @@ module Io
3913
3923
 
3914
3924
  end
3915
3925
 
3916
- class DimensionType
3917
-
3918
- attr_reader :value
3919
-
3920
- def initialize(value)
3921
- @value = HttpClient::Preconditions.assert_class('value', value, String)
3922
- end
3923
-
3924
- # Returns the instance of DimensionType for this value, creating a new instance for an unknown value
3925
- def DimensionType.apply(value)
3926
- if value.instance_of?(DimensionType)
3927
- value
3928
- else
3929
- HttpClient::Preconditions.assert_class_or_nil('value', value, String)
3930
- value.nil? ? nil : (from_string(value) || DimensionType.new(value))
3931
- end
3932
- end
3933
-
3934
- # Returns the instance of DimensionType for this value, or nil if not found
3935
- def DimensionType.from_string(value)
3936
- HttpClient::Preconditions.assert_class('value', value, String)
3937
- DimensionType.ALL.find { |v| v.value == value }
3938
- end
3939
-
3940
- def DimensionType.ALL
3941
- @@all ||= [DimensionType.product, DimensionType.package]
3942
- end
3943
-
3944
- # The standalone dimensions of an item.
3945
- def DimensionType.product
3946
- @@_product ||= DimensionType.new('product')
3947
- end
3948
-
3949
- # The boxed dimensions of an item.
3950
- def DimensionType.package
3951
- @@_package ||= DimensionType.new('package')
3952
- end
3953
-
3954
- def to_hash
3955
- value
3956
- end
3957
-
3958
- end
3959
-
3960
3926
  class Environment
3961
3927
 
3962
3928
  attr_reader :value
@@ -4548,72 +4514,6 @@ module Io
4548
4514
 
4549
4515
  end
4550
4516
 
4551
- class Status
4552
-
4553
- attr_reader :value
4554
-
4555
- def initialize(value)
4556
- @value = HttpClient::Preconditions.assert_class('value', value, String)
4557
- end
4558
-
4559
- # Returns the instance of Status for this value, creating a new instance for an unknown value
4560
- def Status.apply(value)
4561
- if value.instance_of?(Status)
4562
- value
4563
- else
4564
- HttpClient::Preconditions.assert_class_or_nil('value', value, String)
4565
- value.nil? ? nil : (from_string(value) || Status.new(value))
4566
- end
4567
- end
4568
-
4569
- # Returns the instance of Status for this value, or nil if not found
4570
- def Status.from_string(value)
4571
- HttpClient::Preconditions.assert_class('value', value, String)
4572
- Status.ALL.find { |v| v.value == value }
4573
- end
4574
-
4575
- def Status.ALL
4576
- @@all ||= [Status.pending, Status.info_received, Status.in_transit, Status.out_for_delivery, Status.attempt_fail, Status.delivered, Status.exception, Status.expired]
4577
- end
4578
-
4579
- def Status.pending
4580
- @@_pending ||= Status.new('pending')
4581
- end
4582
-
4583
- def Status.info_received
4584
- @@_info_received ||= Status.new('info_received')
4585
- end
4586
-
4587
- def Status.in_transit
4588
- @@_in_transit ||= Status.new('in_transit')
4589
- end
4590
-
4591
- def Status.out_for_delivery
4592
- @@_out_for_delivery ||= Status.new('out_for_delivery')
4593
- end
4594
-
4595
- def Status.attempt_fail
4596
- @@_attempt_fail ||= Status.new('attempt_fail')
4597
- end
4598
-
4599
- def Status.delivered
4600
- @@_delivered ||= Status.new('delivered')
4601
- end
4602
-
4603
- def Status.exception
4604
- @@_exception ||= Status.new('exception')
4605
- end
4606
-
4607
- def Status.expired
4608
- @@_expired ||= Status.new('expired')
4609
- end
4610
-
4611
- def to_hash
4612
- value
4613
- end
4614
-
4615
- end
4616
-
4617
4517
  class Strategy
4618
4518
 
4619
4519
  attr_reader :value
@@ -4707,6 +4607,72 @@ module Io
4707
4607
 
4708
4608
  end
4709
4609
 
4610
+ class TrackingStatus
4611
+
4612
+ attr_reader :value
4613
+
4614
+ def initialize(value)
4615
+ @value = HttpClient::Preconditions.assert_class('value', value, String)
4616
+ end
4617
+
4618
+ # Returns the instance of TrackingStatus for this value, creating a new instance for an unknown value
4619
+ def TrackingStatus.apply(value)
4620
+ if value.instance_of?(TrackingStatus)
4621
+ value
4622
+ else
4623
+ HttpClient::Preconditions.assert_class_or_nil('value', value, String)
4624
+ value.nil? ? nil : (from_string(value) || TrackingStatus.new(value))
4625
+ end
4626
+ end
4627
+
4628
+ # Returns the instance of TrackingStatus for this value, or nil if not found
4629
+ def TrackingStatus.from_string(value)
4630
+ HttpClient::Preconditions.assert_class('value', value, String)
4631
+ TrackingStatus.ALL.find { |v| v.value == value }
4632
+ end
4633
+
4634
+ def TrackingStatus.ALL
4635
+ @@all ||= [TrackingStatus.pending, TrackingStatus.info_received, TrackingStatus.in_transit, TrackingStatus.out_for_delivery, TrackingStatus.attempt_fail, TrackingStatus.delivered, TrackingStatus.exception, TrackingStatus.expired]
4636
+ end
4637
+
4638
+ def TrackingStatus.pending
4639
+ @@_pending ||= TrackingStatus.new('pending')
4640
+ end
4641
+
4642
+ def TrackingStatus.info_received
4643
+ @@_info_received ||= TrackingStatus.new('info_received')
4644
+ end
4645
+
4646
+ def TrackingStatus.in_transit
4647
+ @@_in_transit ||= TrackingStatus.new('in_transit')
4648
+ end
4649
+
4650
+ def TrackingStatus.out_for_delivery
4651
+ @@_out_for_delivery ||= TrackingStatus.new('out_for_delivery')
4652
+ end
4653
+
4654
+ def TrackingStatus.attempt_fail
4655
+ @@_attempt_fail ||= TrackingStatus.new('attempt_fail')
4656
+ end
4657
+
4658
+ def TrackingStatus.delivered
4659
+ @@_delivered ||= TrackingStatus.new('delivered')
4660
+ end
4661
+
4662
+ def TrackingStatus.exception
4663
+ @@_exception ||= TrackingStatus.new('exception')
4664
+ end
4665
+
4666
+ def TrackingStatus.expired
4667
+ @@_expired ||= TrackingStatus.new('expired')
4668
+ end
4669
+
4670
+ def to_hash
4671
+ value
4672
+ end
4673
+
4674
+ end
4675
+
4710
4676
  class UnitOfMeasurement
4711
4677
 
4712
4678
  attr_reader :value
@@ -5100,16 +5066,18 @@ module Io
5100
5066
 
5101
5067
  end
5102
5068
 
5103
- # An attribute represents applicable item data made available on specific UI
5104
- # elements (e.g. require 'Brand')
5069
+ # An attribute can be configured to be used in different ways throughout Flow. A
5070
+ # common example is to identify a meaningful attribute (e.g. brand) that can
5071
+ # then be displayed throughout the Flow console.
5105
5072
  class Attribute
5106
5073
 
5107
- attr_reader :name, :options, :label
5074
+ attr_reader :id, :key, :options, :label
5108
5075
 
5109
5076
  def initialize(incoming={})
5110
5077
  opts = HttpClient::Helper.symbolize_keys(incoming)
5111
- HttpClient::Preconditions.require_keys(opts, [:name, :options], 'Attribute')
5112
- @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
5078
+ HttpClient::Preconditions.require_keys(opts, [:id, :key, :options], 'Attribute')
5079
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
5080
+ @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
5113
5081
  @options = (x = opts.delete(:options); x.is_a?(::Io::Flow::V0::Models::Options) ? x : ::Io::Flow::V0::Models::Options.new(x))
5114
5082
  @label = (x = opts.delete(:label); x.nil? ? nil : HttpClient::Preconditions.assert_class('label', x, String))
5115
5083
  end
@@ -5124,7 +5092,8 @@ module Io
5124
5092
 
5125
5093
  def to_hash
5126
5094
  {
5127
- :name => name,
5095
+ :id => id,
5096
+ :key => key,
5128
5097
  :options => options.to_hash,
5129
5098
  :label => label
5130
5099
  }
@@ -5132,17 +5101,16 @@ module Io
5132
5101
 
5133
5102
  end
5134
5103
 
5135
- # Attribtue metadata represents additional item data not configured in other top
5136
- # level fields
5137
- class AttributeMetadata
5104
+ class AttributeForm
5138
5105
 
5139
- attr_reader :key, :value
5106
+ attr_reader :key, :options, :label
5140
5107
 
5141
5108
  def initialize(incoming={})
5142
5109
  opts = HttpClient::Helper.symbolize_keys(incoming)
5143
- HttpClient::Preconditions.require_keys(opts, [:key, :value], 'AttributeMetadata')
5110
+ HttpClient::Preconditions.require_keys(opts, [:key, :options], 'AttributeForm')
5144
5111
  @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
5145
- @value = HttpClient::Preconditions.assert_class('value', opts.delete(:value), String)
5112
+ @options = (x = opts.delete(:options); x.is_a?(::Io::Flow::V0::Models::Options) ? x : ::Io::Flow::V0::Models::Options.new(x))
5113
+ @label = (x = opts.delete(:label); x.nil? ? nil : HttpClient::Preconditions.assert_class('label', x, String))
5146
5114
  end
5147
5115
 
5148
5116
  def to_json
@@ -5150,13 +5118,14 @@ module Io
5150
5118
  end
5151
5119
 
5152
5120
  def copy(incoming={})
5153
- AttributeMetadata.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
5121
+ AttributeForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
5154
5122
  end
5155
5123
 
5156
5124
  def to_hash
5157
5125
  {
5158
5126
  :key => key,
5159
- :value => value
5127
+ :options => options.to_hash,
5128
+ :label => label
5160
5129
  }
5161
5130
  end
5162
5131
 
@@ -5228,16 +5197,17 @@ module Io
5228
5197
  # capture up to the amount of the authorization.
5229
5198
  class Authorization
5230
5199
 
5231
- attr_reader :id, :reference, :card, :amount, :currency, :metadata, :shipping, :ip, :cvv, :details
5200
+ attr_reader :id, :reference, :card, :amount, :currency, :customer, :metadata, :shipping, :ip, :cvv, :details
5232
5201
 
5233
5202
  def initialize(incoming={})
5234
5203
  opts = HttpClient::Helper.symbolize_keys(incoming)
5235
- HttpClient::Preconditions.require_keys(opts, [:id, :card, :amount, :currency, :metadata, :details], 'Authorization')
5204
+ HttpClient::Preconditions.require_keys(opts, [:id, :card, :amount, :currency, :customer, :metadata, :details], 'Authorization')
5236
5205
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
5237
5206
  @reference = (x = opts.delete(:reference); x.nil? ? nil : HttpClient::Preconditions.assert_class('reference', x, String))
5238
5207
  @card = (x = opts.delete(:card); x.is_a?(::Io::Flow::V0::Models::CardReference) ? x : ::Io::Flow::V0::Models::CardReference.new(x))
5239
5208
  @amount = HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(opts.delete(:amount)), BigDecimal)
5240
5209
  @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
5210
+ @customer = (x = opts.delete(:customer); x.is_a?(::Io::Flow::V0::Models::CustomerForm) ? x : ::Io::Flow::V0::Models::CustomerForm.new(x))
5241
5211
  @metadata = HttpClient::Preconditions.assert_class('metadata', opts.delete(:metadata), Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('metadata', d[1], String); h }
5242
5212
  @shipping = (x = opts.delete(:shipping); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Location) ? x : ::Io::Flow::V0::Models::Location.new(x)))
5243
5213
  @ip = (x = opts.delete(:ip); x.nil? ? nil : HttpClient::Preconditions.assert_class('ip', x, String))
@@ -5260,6 +5230,7 @@ module Io
5260
5230
  :card => card.to_hash,
5261
5231
  :amount => amount,
5262
5232
  :currency => currency,
5233
+ :customer => customer.to_hash,
5263
5234
  :metadata => metadata,
5264
5235
  :shipping => shipping.nil? ? nil : shipping.to_hash,
5265
5236
  :ip => ip,
@@ -5336,15 +5307,16 @@ module Io
5336
5307
  # capture up to the amount of the authorization.
5337
5308
  class AuthorizationForm
5338
5309
 
5339
- attr_reader :reference, :token, :amount, :currency, :cvv, :metadata, :shipping, :ip
5310
+ attr_reader :reference, :token, :amount, :currency, :customer, :cvv, :metadata, :shipping, :ip
5340
5311
 
5341
5312
  def initialize(incoming={})
5342
5313
  opts = HttpClient::Helper.symbolize_keys(incoming)
5343
- HttpClient::Preconditions.require_keys(opts, [:token, :amount, :currency], 'AuthorizationForm')
5314
+ HttpClient::Preconditions.require_keys(opts, [:token, :amount, :currency, :customer], 'AuthorizationForm')
5344
5315
  @reference = (x = opts.delete(:reference); x.nil? ? nil : HttpClient::Preconditions.assert_class('reference', x, String))
5345
5316
  @token = HttpClient::Preconditions.assert_class('token', opts.delete(:token), String)
5346
5317
  @amount = HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(opts.delete(:amount)), BigDecimal)
5347
5318
  @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
5319
+ @customer = (x = opts.delete(:customer); x.is_a?(::Io::Flow::V0::Models::CustomerForm) ? x : ::Io::Flow::V0::Models::CustomerForm.new(x))
5348
5320
  @cvv = (x = opts.delete(:cvv); x.nil? ? nil : HttpClient::Preconditions.assert_class('cvv', x, String))
5349
5321
  @metadata = (x = opts.delete(:metadata); x.nil? ? nil : HttpClient::Preconditions.assert_class('metadata', x, Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('metadata', d[1], String); h })
5350
5322
  @shipping = (x = opts.delete(:shipping); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Location) ? x : ::Io::Flow::V0::Models::Location.new(x)))
@@ -5365,6 +5337,7 @@ module Io
5365
5337
  :token => token,
5366
5338
  :amount => amount,
5367
5339
  :currency => currency,
5340
+ :customer => customer.to_hash,
5368
5341
  :cvv => cvv,
5369
5342
  :metadata => metadata.nil? ? nil : metadata,
5370
5343
  :shipping => shipping.nil? ? nil : shipping.to_hash,
@@ -5724,12 +5697,12 @@ module Io
5724
5697
 
5725
5698
  def initialize(incoming={})
5726
5699
  opts = HttpClient::Helper.symbolize_keys(incoming)
5727
- HttpClient::Preconditions.require_keys(opts, [:id, :type, :expiration, :last4], 'Card')
5700
+ HttpClient::Preconditions.require_keys(opts, [:id, :type, :expiration, :last4, :name], 'Card')
5728
5701
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
5729
5702
  @type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::CardType) ? x : ::Io::Flow::V0::Models::CardType.apply(x))
5730
5703
  @expiration = (x = opts.delete(:expiration); x.is_a?(::Io::Flow::V0::Models::Expiration) ? x : ::Io::Flow::V0::Models::Expiration.new(x))
5731
5704
  @last4 = HttpClient::Preconditions.assert_class('last4', opts.delete(:last4), String)
5732
- @name = (x = opts.delete(:name); x.nil? ? nil : HttpClient::Preconditions.assert_class('name', x, String))
5705
+ @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
5733
5706
  @address = (x = opts.delete(:address); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Location) ? x : ::Io::Flow::V0::Models::Location.new(x)))
5734
5707
  end
5735
5708
 
@@ -6373,18 +6346,16 @@ module Io
6373
6346
 
6374
6347
  end
6375
6348
 
6376
- # Representation of information indicating landed cost and how it was derived
6377
- class Checkout
6349
+ # The actual value of the API token. This is modeled as a separate resource as
6350
+ # it is fetched only on demand.
6351
+ class Cleartext
6378
6352
 
6379
- attr_reader :id, :deliveries, :prices, :total
6353
+ attr_reader :value
6380
6354
 
6381
6355
  def initialize(incoming={})
6382
6356
  opts = HttpClient::Helper.symbolize_keys(incoming)
6383
- HttpClient::Preconditions.require_keys(opts, [:id, :deliveries, :prices, :total], 'Checkout')
6384
- @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
6385
- @deliveries = HttpClient::Preconditions.assert_class('deliveries', opts.delete(:deliveries), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::Delivery) ? x : ::Io::Flow::V0::Models::Delivery.new(x)) }
6386
- @prices = HttpClient::Preconditions.assert_class('prices', opts.delete(:prices), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::LocalizedPrice) ? x : ::Io::Flow::V0::Models::LocalizedPrice.new(x)) }
6387
- @total = (x = opts.delete(:total); x.is_a?(::Io::Flow::V0::Models::LocalizedPrice) ? x : ::Io::Flow::V0::Models::LocalizedPrice.new(x))
6357
+ HttpClient::Preconditions.require_keys(opts, [:value], 'Cleartext')
6358
+ @value = HttpClient::Preconditions.assert_class('value', opts.delete(:value), String)
6388
6359
  end
6389
6360
 
6390
6361
  def to_json
@@ -6392,29 +6363,26 @@ module Io
6392
6363
  end
6393
6364
 
6394
6365
  def copy(incoming={})
6395
- Checkout.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
6366
+ Cleartext.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
6396
6367
  end
6397
6368
 
6398
6369
  def to_hash
6399
6370
  {
6400
- :id => id,
6401
- :deliveries => deliveries.map { |o| o.to_hash },
6402
- :prices => prices.map { |o| o.to_hash },
6403
- :total => total.to_hash
6371
+ :value => value
6404
6372
  }
6405
6373
  end
6406
6374
 
6407
6375
  end
6408
6376
 
6409
- class CheckoutForm
6377
+ class Component
6410
6378
 
6411
- attr_reader :destination, :items
6379
+ attr_reader :adjustments, :levies
6412
6380
 
6413
6381
  def initialize(incoming={})
6414
6382
  opts = HttpClient::Helper.symbolize_keys(incoming)
6415
- HttpClient::Preconditions.require_keys(opts, [:destination, :items], 'CheckoutForm')
6416
- @destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::Location) ? x : ::Io::Flow::V0::Models::Location.new(x))
6417
- @items = HttpClient::Preconditions.assert_class('items', opts.delete(:items), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::Line) ? x : ::Io::Flow::V0::Models::Line.new(x)) }
6383
+ HttpClient::Preconditions.require_keys(opts, [:adjustments, :levies], 'Component')
6384
+ @adjustments = HttpClient::Preconditions.assert_class('adjustments', opts.delete(:adjustments), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::AdjustmentType) ? x : ::Io::Flow::V0::Models::AdjustmentType.apply(x)) }
6385
+ @levies = HttpClient::Preconditions.assert_class('levies', opts.delete(:levies), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::Levy) ? x : ::Io::Flow::V0::Models::Levy.apply(x)) }
6418
6386
  end
6419
6387
 
6420
6388
  def to_json
@@ -6422,55 +6390,30 @@ module Io
6422
6390
  end
6423
6391
 
6424
6392
  def copy(incoming={})
6425
- CheckoutForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
6393
+ Component.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
6426
6394
  end
6427
6395
 
6428
6396
  def to_hash
6429
6397
  {
6430
- :destination => destination.to_hash,
6431
- :items => items.map { |o| o.to_hash }
6398
+ :adjustments => adjustments.map { |o| o.value },
6399
+ :levies => levies.map { |o| o.value }
6432
6400
  }
6433
6401
  end
6434
6402
 
6435
6403
  end
6436
6404
 
6437
- # The actual value of the API token. This is modeled as a separate resource as
6438
- # it is fetched only on demand.
6439
- class Cleartext
6405
+ # Defines structured fields for a contact person. Typically used for specifying
6406
+ # contact person for an account, shipment, or organization representative
6407
+ class Contact
6440
6408
 
6441
- attr_reader :value
6409
+ attr_reader :name, :email, :phone
6442
6410
 
6443
6411
  def initialize(incoming={})
6444
6412
  opts = HttpClient::Helper.symbolize_keys(incoming)
6445
- HttpClient::Preconditions.require_keys(opts, [:value], 'Cleartext')
6446
- @value = HttpClient::Preconditions.assert_class('value', opts.delete(:value), String)
6447
- end
6448
-
6449
- def to_json
6450
- JSON.dump(to_hash)
6451
- end
6452
-
6453
- def copy(incoming={})
6454
- Cleartext.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
6455
- end
6456
-
6457
- def to_hash
6458
- {
6459
- :value => value
6460
- }
6461
- end
6462
-
6463
- end
6464
-
6465
- class Component
6466
-
6467
- attr_reader :adjustments, :levies
6468
-
6469
- def initialize(incoming={})
6470
- opts = HttpClient::Helper.symbolize_keys(incoming)
6471
- HttpClient::Preconditions.require_keys(opts, [:adjustments, :levies], 'Component')
6472
- @adjustments = HttpClient::Preconditions.assert_class('adjustments', opts.delete(:adjustments), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::AdjustmentType) ? x : ::Io::Flow::V0::Models::AdjustmentType.apply(x)) }
6473
- @levies = HttpClient::Preconditions.assert_class('levies', opts.delete(:levies), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::Levy) ? x : ::Io::Flow::V0::Models::Levy.apply(x)) }
6413
+ HttpClient::Preconditions.require_keys(opts, [:name], 'Contact')
6414
+ @name = (x = opts.delete(:name); x.is_a?(::Io::Flow::V0::Models::Name) ? x : ::Io::Flow::V0::Models::Name.new(x))
6415
+ @email = (x = opts.delete(:email); x.nil? ? nil : HttpClient::Preconditions.assert_class('email', x, String))
6416
+ @phone = (x = opts.delete(:phone); x.nil? ? nil : HttpClient::Preconditions.assert_class('phone', x, String))
6474
6417
  end
6475
6418
 
6476
6419
  def to_json
@@ -6478,30 +6421,30 @@ module Io
6478
6421
  end
6479
6422
 
6480
6423
  def copy(incoming={})
6481
- Component.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
6424
+ Contact.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
6482
6425
  end
6483
6426
 
6484
6427
  def to_hash
6485
6428
  {
6486
- :adjustments => adjustments.map { |o| o.value },
6487
- :levies => levies.map { |o| o.value }
6429
+ :name => name.to_hash,
6430
+ :email => email,
6431
+ :phone => phone
6488
6432
  }
6489
6433
  end
6490
6434
 
6491
6435
  end
6492
6436
 
6493
- # Defines structured fields for a contact person. Typically used for specifying
6494
- # contact person for an account, shipment, or organization representative
6495
- class Contact
6437
+ # Describes conversion information from a base currency to a target currency.
6438
+ class Conversion
6496
6439
 
6497
- attr_reader :name, :email, :phone
6440
+ attr_reader :base, :target, :rate
6498
6441
 
6499
6442
  def initialize(incoming={})
6500
6443
  opts = HttpClient::Helper.symbolize_keys(incoming)
6501
- HttpClient::Preconditions.require_keys(opts, [:name], 'Contact')
6502
- @name = (x = opts.delete(:name); x.is_a?(::Io::Flow::V0::Models::Name) ? x : ::Io::Flow::V0::Models::Name.new(x))
6503
- @email = (x = opts.delete(:email); x.nil? ? nil : HttpClient::Preconditions.assert_class('email', x, String))
6504
- @phone = (x = opts.delete(:phone); x.nil? ? nil : HttpClient::Preconditions.assert_class('phone', x, String))
6444
+ HttpClient::Preconditions.require_keys(opts, [:base, :target, :rate], 'Conversion')
6445
+ @base = HttpClient::Preconditions.assert_class('base', opts.delete(:base), String)
6446
+ @target = HttpClient::Preconditions.assert_class('target', opts.delete(:target), String)
6447
+ @rate = HttpClient::Preconditions.assert_class('rate', HttpClient::Helper.to_big_decimal(opts.delete(:rate)), BigDecimal)
6505
6448
  end
6506
6449
 
6507
6450
  def to_json
@@ -6509,14 +6452,14 @@ module Io
6509
6452
  end
6510
6453
 
6511
6454
  def copy(incoming={})
6512
- Contact.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
6455
+ Conversion.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
6513
6456
  end
6514
6457
 
6515
6458
  def to_hash
6516
6459
  {
6517
- :name => name.to_hash,
6518
- :email => email,
6519
- :phone => phone
6460
+ :base => base,
6461
+ :target => target,
6462
+ :rate => rate
6520
6463
  }
6521
6464
  end
6522
6465
 
@@ -6533,7 +6476,7 @@ module Io
6533
6476
  @iso_3166_2 = HttpClient::Preconditions.assert_class('iso_3166_2', opts.delete(:iso_3166_2), String)
6534
6477
  @iso_3166_3 = HttpClient::Preconditions.assert_class('iso_3166_3', opts.delete(:iso_3166_3), String)
6535
6478
  @languages = HttpClient::Preconditions.assert_class('languages', opts.delete(:languages), Array).map { |v| HttpClient::Preconditions.assert_class('languages', v, String) }
6536
- @measurement_system = (x = opts.delete(:measurement_system); x.is_a?(::Io::Flow::V0::Models::MeasurementSystem) ? x : ::Io::Flow::V0::Models::MeasurementSystem.apply(x))
6479
+ @measurement_system = HttpClient::Preconditions.assert_class('measurement_system', opts.delete(:measurement_system), String)
6537
6480
  @default_currency = (x = opts.delete(:default_currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('default_currency', x, String))
6538
6481
  end
6539
6482
 
@@ -6551,23 +6494,25 @@ module Io
6551
6494
  :iso_3166_2 => iso_3166_2,
6552
6495
  :iso_3166_3 => iso_3166_3,
6553
6496
  :languages => languages,
6554
- :measurement_system => measurement_system.value,
6497
+ :measurement_system => measurement_system,
6555
6498
  :default_currency => default_currency
6556
6499
  }
6557
6500
  end
6558
6501
 
6559
6502
  end
6560
6503
 
6561
- # ISO 4217 3-character currency code. See http://www.xe.com/iso4217.php
6504
+ # ISO 4217 3-character currency code. See
6505
+ # https://api.flow.io/reference/currencies
6562
6506
  class Currency
6563
6507
 
6564
- attr_reader :name, :iso_4217_3
6508
+ attr_reader :name, :iso_4217_3, :number_decimals
6565
6509
 
6566
6510
  def initialize(incoming={})
6567
6511
  opts = HttpClient::Helper.symbolize_keys(incoming)
6568
- HttpClient::Preconditions.require_keys(opts, [:name, :iso_4217_3], 'Currency')
6512
+ HttpClient::Preconditions.require_keys(opts, [:name, :iso_4217_3, :number_decimals], 'Currency')
6569
6513
  @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
6570
6514
  @iso_4217_3 = HttpClient::Preconditions.assert_class('iso_4217_3', opts.delete(:iso_4217_3), String)
6515
+ @number_decimals = HttpClient::Preconditions.assert_class('number_decimals', opts.delete(:number_decimals), Integer)
6571
6516
  end
6572
6517
 
6573
6518
  def to_json
@@ -6581,7 +6526,86 @@ module Io
6581
6526
  def to_hash
6582
6527
  {
6583
6528
  :name => name,
6584
- :iso_4217_3 => iso_4217_3
6529
+ :iso_4217_3 => iso_4217_3,
6530
+ :number_decimals => number_decimals
6531
+ }
6532
+ end
6533
+
6534
+ end
6535
+
6536
+ # A customer represents the actual person purchasing from you. This information
6537
+ # is needed primarily to support logistics (delivery to this person), fraud
6538
+ # management (verification of who the person id), and reporting. We also
6539
+ # recommend including your customer.number whenever possible as doing so will
6540
+ # allow Flow to link up transactions for this customer making customer service
6541
+ # easieer.
6542
+ class Customer
6543
+
6544
+ attr_reader :id, :number, :name, :phone, :email
6545
+
6546
+ def initialize(incoming={})
6547
+ opts = HttpClient::Helper.symbolize_keys(incoming)
6548
+ HttpClient::Preconditions.require_keys(opts, [:id, :name], 'Customer')
6549
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
6550
+ @number = (x = opts.delete(:number); x.nil? ? nil : HttpClient::Preconditions.assert_class('number', x, String))
6551
+ @name = (x = opts.delete(:name); x.is_a?(::Io::Flow::V0::Models::Name) ? x : ::Io::Flow::V0::Models::Name.new(x))
6552
+ @phone = (x = opts.delete(:phone); x.nil? ? nil : HttpClient::Preconditions.assert_class('phone', x, String))
6553
+ @email = (x = opts.delete(:email); x.nil? ? nil : HttpClient::Preconditions.assert_class('email', x, String))
6554
+ end
6555
+
6556
+ def to_json
6557
+ JSON.dump(to_hash)
6558
+ end
6559
+
6560
+ def copy(incoming={})
6561
+ Customer.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
6562
+ end
6563
+
6564
+ def to_hash
6565
+ {
6566
+ :id => id,
6567
+ :number => number,
6568
+ :name => name.to_hash,
6569
+ :phone => phone,
6570
+ :email => email
6571
+ }
6572
+ end
6573
+
6574
+ end
6575
+
6576
+ # A customer represents the actual person purchasing from you. This information
6577
+ # is needed primarily to support logistics (delivery to this person), fraud
6578
+ # management (verification of who the person id), and reporting. We also
6579
+ # recommend including your customer.number whenever possible as doing so will
6580
+ # allow Flow to link up transactions for this customer making customer service
6581
+ # easieer.
6582
+ class CustomerForm
6583
+
6584
+ attr_reader :number, :name, :phone, :email
6585
+
6586
+ def initialize(incoming={})
6587
+ opts = HttpClient::Helper.symbolize_keys(incoming)
6588
+ HttpClient::Preconditions.require_keys(opts, [:name], 'CustomerForm')
6589
+ @number = (x = opts.delete(:number); x.nil? ? nil : HttpClient::Preconditions.assert_class('number', x, String))
6590
+ @name = (x = opts.delete(:name); x.is_a?(::Io::Flow::V0::Models::Name) ? x : ::Io::Flow::V0::Models::Name.new(x))
6591
+ @phone = (x = opts.delete(:phone); x.nil? ? nil : HttpClient::Preconditions.assert_class('phone', x, String))
6592
+ @email = (x = opts.delete(:email); x.nil? ? nil : HttpClient::Preconditions.assert_class('email', x, String))
6593
+ end
6594
+
6595
+ def to_json
6596
+ JSON.dump(to_hash)
6597
+ end
6598
+
6599
+ def copy(incoming={})
6600
+ CustomerForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
6601
+ end
6602
+
6603
+ def to_hash
6604
+ {
6605
+ :number => number,
6606
+ :name => name.to_hash,
6607
+ :phone => phone,
6608
+ :email => email
6585
6609
  }
6586
6610
  end
6587
6611
 
@@ -6995,12 +7019,10 @@ module Io
6995
7019
 
6996
7020
  class Dimension
6997
7021
 
6998
- attr_reader :type, :depth, :diameter, :length, :weight, :width
7022
+ attr_reader :depth, :diameter, :length, :weight, :width
6999
7023
 
7000
7024
  def initialize(incoming={})
7001
7025
  opts = HttpClient::Helper.symbolize_keys(incoming)
7002
- HttpClient::Preconditions.require_keys(opts, [:type], 'Dimension')
7003
- @type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::DimensionType) ? x : ::Io::Flow::V0::Models::DimensionType.apply(x))
7004
7026
  @depth = (x = opts.delete(:depth); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Measurement) ? x : ::Io::Flow::V0::Models::Measurement.new(x)))
7005
7027
  @diameter = (x = opts.delete(:diameter); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Measurement) ? x : ::Io::Flow::V0::Models::Measurement.new(x)))
7006
7028
  @length = (x = opts.delete(:length); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Measurement) ? x : ::Io::Flow::V0::Models::Measurement.new(x)))
@@ -7018,7 +7040,6 @@ module Io
7018
7040
 
7019
7041
  def to_hash
7020
7042
  {
7021
- :type => type.value,
7022
7043
  :depth => depth.nil? ? nil : depth.to_hash,
7023
7044
  :diameter => diameter.nil? ? nil : diameter.to_hash,
7024
7045
  :length => length.nil? ? nil : length.to_hash,
@@ -7029,20 +7050,14 @@ module Io
7029
7050
 
7030
7051
  end
7031
7052
 
7032
- # Defines elements of a localized cost available for display (e.g on a localized
7033
- # product page or checkout)
7034
- class Display
7053
+ class Dimensions
7035
7054
 
7036
- attr_reader :id, :key, :name, :component, :experience
7055
+ attr_reader :product, :packaging
7037
7056
 
7038
7057
  def initialize(incoming={})
7039
7058
  opts = HttpClient::Helper.symbolize_keys(incoming)
7040
- HttpClient::Preconditions.require_keys(opts, [:id, :key, :name, :component, :experience], 'Display')
7041
- @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
7042
- @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
7043
- @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
7044
- @component = (x = opts.delete(:component); x.is_a?(::Io::Flow::V0::Models::Component) ? x : ::Io::Flow::V0::Models::Component.new(x))
7045
- @experience = (x = opts.delete(:experience); x.is_a?(::Io::Flow::V0::Models::ExperienceReference) ? x : ::Io::Flow::V0::Models::ExperienceReference.new(x))
7059
+ @product = (x = opts.delete(:product); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Dimension) ? x : ::Io::Flow::V0::Models::Dimension.new(x)))
7060
+ @packaging = (x = opts.delete(:packaging); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Dimension) ? x : ::Io::Flow::V0::Models::Dimension.new(x)))
7046
7061
  end
7047
7062
 
7048
7063
  def to_json
@@ -7050,78 +7065,13 @@ module Io
7050
7065
  end
7051
7066
 
7052
7067
  def copy(incoming={})
7053
- Display.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
7068
+ Dimensions.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
7054
7069
  end
7055
7070
 
7056
7071
  def to_hash
7057
7072
  {
7058
- :id => id,
7059
- :key => key,
7060
- :name => name,
7061
- :component => component.to_hash,
7062
- :experience => experience.to_hash
7063
- }
7064
- end
7065
-
7066
- end
7067
-
7068
- class DisplayForm
7069
-
7070
- attr_reader :name, :component, :experience_id
7071
-
7072
- def initialize(incoming={})
7073
- opts = HttpClient::Helper.symbolize_keys(incoming)
7074
- HttpClient::Preconditions.require_keys(opts, [:name, :component, :experience_id], 'DisplayForm')
7075
- @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
7076
- @component = (x = opts.delete(:component); x.is_a?(::Io::Flow::V0::Models::Component) ? x : ::Io::Flow::V0::Models::Component.new(x))
7077
- @experience_id = HttpClient::Preconditions.assert_class('experience_id', opts.delete(:experience_id), String)
7078
- end
7079
-
7080
- def to_json
7081
- JSON.dump(to_hash)
7082
- end
7083
-
7084
- def copy(incoming={})
7085
- DisplayForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
7086
- end
7087
-
7088
- def to_hash
7089
- {
7090
- :name => name,
7091
- :component => component.to_hash,
7092
- :experience_id => experience_id
7093
- }
7094
- end
7095
-
7096
- end
7097
-
7098
- class DisplayVersion
7099
-
7100
- attr_reader :id, :timestamp, :type, :display
7101
-
7102
- def initialize(incoming={})
7103
- opts = HttpClient::Helper.symbolize_keys(incoming)
7104
- HttpClient::Preconditions.require_keys(opts, [:id, :timestamp, :type, :display], 'DisplayVersion')
7105
- @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
7106
- @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
7107
- @type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::ChangeType) ? x : ::Io::Flow::V0::Models::ChangeType.apply(x))
7108
- @display = (x = opts.delete(:display); x.is_a?(::Io::Flow::V0::Models::Display) ? x : ::Io::Flow::V0::Models::Display.new(x))
7109
- end
7110
-
7111
- def to_json
7112
- JSON.dump(to_hash)
7113
- end
7114
-
7115
- def copy(incoming={})
7116
- DisplayVersion.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
7117
- end
7118
-
7119
- def to_hash
7120
- {
7121
- :id => id,
7122
- :timestamp => timestamp,
7123
- :type => type.value,
7124
- :display => display.to_hash
7073
+ :product => product.nil? ? nil : product.to_hash,
7074
+ :packaging => packaging.nil? ? nil : packaging.to_hash
7125
7075
  }
7126
7076
  end
7127
7077
 
@@ -7129,134 +7079,13 @@ module Io
7129
7079
 
7130
7080
  class DocumentAttribute
7131
7081
 
7132
- attr_reader :name, :value
7133
-
7134
- def initialize(incoming={})
7135
- opts = HttpClient::Helper.symbolize_keys(incoming)
7136
- HttpClient::Preconditions.require_keys(opts, [:name, :value], 'DocumentAttribute')
7137
- @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
7138
- @value = HttpClient::Preconditions.assert_class('value', opts.delete(:value), String)
7139
- end
7140
-
7141
- def to_json
7142
- JSON.dump(to_hash)
7143
- end
7144
-
7145
- def copy(incoming={})
7146
- DocumentAttribute.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
7147
- end
7148
-
7149
- def to_hash
7150
- {
7151
- :name => name,
7152
- :value => value
7153
- }
7154
- end
7155
-
7156
- end
7157
-
7158
- # Represents a simple model of duties that apply to a given item / trade lane.
7159
- class Duty
7160
-
7161
- attr_reader :rate, :components, :deminimus
7162
-
7163
- def initialize(incoming={})
7164
- opts = HttpClient::Helper.symbolize_keys(incoming)
7165
- HttpClient::Preconditions.require_keys(opts, [:rate, :components], 'Duty')
7166
- @rate = HttpClient::Preconditions.assert_class('rate', HttpClient::Helper.to_big_decimal(opts.delete(:rate)), BigDecimal)
7167
- @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)) }
7168
- @deminimus = (x = opts.delete(:deminimus); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Deminimus) ? x : ::Io::Flow::V0::Models::Deminimus.from_json(x)))
7169
- end
7170
-
7171
- def to_json
7172
- JSON.dump(to_hash)
7173
- end
7174
-
7175
- def copy(incoming={})
7176
- Duty.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
7177
- end
7178
-
7179
- def to_hash
7180
- {
7181
- :rate => rate,
7182
- :components => components.map { |o| o.value },
7183
- :deminimus => deminimus.nil? ? nil : deminimus.to_hash
7184
- }
7185
- end
7186
-
7187
- end
7188
-
7189
- # Represents the successful response of an email verification token. We return
7190
- # the email address in this case to allow the UI to display which email address
7191
- # was verified.
7192
- class EmailVerification
7193
-
7194
- attr_reader :email
7195
-
7196
- def initialize(incoming={})
7197
- opts = HttpClient::Helper.symbolize_keys(incoming)
7198
- HttpClient::Preconditions.require_keys(opts, [:email], 'EmailVerification')
7199
- @email = HttpClient::Preconditions.assert_class('email', opts.delete(:email), String)
7200
- end
7201
-
7202
- def to_json
7203
- JSON.dump(to_hash)
7204
- end
7205
-
7206
- def copy(incoming={})
7207
- EmailVerification.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
7208
- end
7209
-
7210
- def to_hash
7211
- {
7212
- :email => email
7213
- }
7214
- end
7215
-
7216
- end
7217
-
7218
- # Represents an error of some sort (e.g. invalid input). Each error will contain
7219
- # a code and a specific message describing the failure.
7220
- class Error
7221
-
7222
- attr_reader :code, :message
7223
-
7224
- def initialize(incoming={})
7225
- opts = HttpClient::Helper.symbolize_keys(incoming)
7226
- HttpClient::Preconditions.require_keys(opts, [:code, :message], 'Error')
7227
- @code = HttpClient::Preconditions.assert_class('code', opts.delete(:code), String)
7228
- @message = HttpClient::Preconditions.assert_class('message', opts.delete(:message), String)
7229
- end
7230
-
7231
- def to_json
7232
- JSON.dump(to_hash)
7233
- end
7234
-
7235
- def copy(incoming={})
7236
- Error.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
7237
- end
7238
-
7239
- def to_hash
7240
- {
7241
- :code => code,
7242
- :message => message
7243
- }
7244
- end
7245
-
7246
- end
7247
-
7248
- # Range of time given a from and to number and the unit. For example: 1-4 hours
7249
- # or 4-7 days
7250
- class EstimatedWindow
7251
-
7252
- attr_reader :from, :to, :unit
7082
+ attr_reader :name, :value
7253
7083
 
7254
7084
  def initialize(incoming={})
7255
7085
  opts = HttpClient::Helper.symbolize_keys(incoming)
7256
- HttpClient::Preconditions.require_keys(opts, [:from, :to, :unit], 'EstimatedWindow')
7257
- @from = HttpClient::Preconditions.assert_class('from', opts.delete(:from), Integer)
7258
- @to = HttpClient::Preconditions.assert_class('to', opts.delete(:to), Integer)
7259
- @unit = (x = opts.delete(:unit); x.is_a?(::Io::Flow::V0::Models::UnitOfTime) ? x : ::Io::Flow::V0::Models::UnitOfTime.apply(x))
7086
+ HttpClient::Preconditions.require_keys(opts, [:name, :value], 'DocumentAttribute')
7087
+ @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
7088
+ @value = HttpClient::Preconditions.assert_class('value', opts.delete(:value), String)
7260
7089
  end
7261
7090
 
7262
7091
  def to_json
@@ -7264,32 +7093,29 @@ module Io
7264
7093
  end
7265
7094
 
7266
7095
  def copy(incoming={})
7267
- EstimatedWindow.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
7096
+ DocumentAttribute.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
7268
7097
  end
7269
7098
 
7270
7099
  def to_hash
7271
7100
  {
7272
- :from => from,
7273
- :to => to,
7274
- :unit => unit.value
7101
+ :name => name,
7102
+ :value => value
7275
7103
  }
7276
7104
  end
7277
7105
 
7278
7106
  end
7279
7107
 
7280
- class Event
7108
+ # Represents a simple model of duties that apply to a given item / trade lane.
7109
+ class Duty
7281
7110
 
7282
- attr_reader :id, :label, :location, :status, :timestamp, :description
7111
+ attr_reader :rate, :components, :deminimus
7283
7112
 
7284
7113
  def initialize(incoming={})
7285
7114
  opts = HttpClient::Helper.symbolize_keys(incoming)
7286
- HttpClient::Preconditions.require_keys(opts, [:id, :label, :location, :status, :timestamp], 'Event')
7287
- @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
7288
- @label = (x = opts.delete(:label); x.is_a?(::Io::Flow::V0::Models::LabelSummary) ? x : ::Io::Flow::V0::Models::LabelSummary.new(x))
7289
- @location = (x = opts.delete(:location); x.is_a?(::Io::Flow::V0::Models::ExpandableLocation) ? x : ::Io::Flow::V0::Models::ExpandableLocation.from_json(x))
7290
- @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::Status) ? x : ::Io::Flow::V0::Models::Status.apply(x))
7291
- @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
7292
- @description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
7115
+ HttpClient::Preconditions.require_keys(opts, [:rate, :components], 'Duty')
7116
+ @rate = HttpClient::Preconditions.assert_class('rate', HttpClient::Helper.to_big_decimal(opts.delete(:rate)), BigDecimal)
7117
+ @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)) }
7118
+ @deminimus = (x = opts.delete(:deminimus); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Deminimus) ? x : ::Io::Flow::V0::Models::Deminimus.from_json(x)))
7293
7119
  end
7294
7120
 
7295
7121
  def to_json
@@ -7297,34 +7123,30 @@ module Io
7297
7123
  end
7298
7124
 
7299
7125
  def copy(incoming={})
7300
- Event.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
7126
+ Duty.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
7301
7127
  end
7302
7128
 
7303
7129
  def to_hash
7304
7130
  {
7305
- :id => id,
7306
- :label => label.to_hash,
7307
- :location => location.to_hash,
7308
- :status => status.value,
7309
- :timestamp => timestamp,
7310
- :description => description
7131
+ :rate => rate,
7132
+ :components => components.map { |o| o.value },
7133
+ :deminimus => deminimus.nil? ? nil : deminimus.to_hash
7311
7134
  }
7312
7135
  end
7313
7136
 
7314
7137
  end
7315
7138
 
7316
- class EventForm
7139
+ # Represents the successful response of an email verification token. We return
7140
+ # the email address in this case to allow the UI to display which email address
7141
+ # was verified.
7142
+ class EmailVerification
7317
7143
 
7318
- attr_reader :label_id, :timestamp, :status, :description, :location
7144
+ attr_reader :email
7319
7145
 
7320
7146
  def initialize(incoming={})
7321
7147
  opts = HttpClient::Helper.symbolize_keys(incoming)
7322
- HttpClient::Preconditions.require_keys(opts, [:label_id, :timestamp, :status], 'EventForm')
7323
- @label_id = HttpClient::Preconditions.assert_class('label_id', opts.delete(:label_id), String)
7324
- @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
7325
- @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::Status) ? x : ::Io::Flow::V0::Models::Status.apply(x))
7326
- @description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
7327
- @location = (x = opts.delete(:location); x.nil? ? nil : HttpClient::Preconditions.assert_class('location', x, String))
7148
+ HttpClient::Preconditions.require_keys(opts, [:email], 'EmailVerification')
7149
+ @email = HttpClient::Preconditions.assert_class('email', opts.delete(:email), String)
7328
7150
  end
7329
7151
 
7330
7152
  def to_json
@@ -7332,31 +7154,28 @@ module Io
7332
7154
  end
7333
7155
 
7334
7156
  def copy(incoming={})
7335
- EventForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
7157
+ EmailVerification.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
7336
7158
  end
7337
7159
 
7338
7160
  def to_hash
7339
7161
  {
7340
- :label_id => label_id,
7341
- :timestamp => timestamp,
7342
- :status => status.value,
7343
- :description => description,
7344
- :location => location
7162
+ :email => email
7345
7163
  }
7346
7164
  end
7347
7165
 
7348
7166
  end
7349
7167
 
7350
- class EventSummary
7168
+ # Represents an error of some sort (e.g. invalid input). Each error will contain
7169
+ # a code and a specific message describing the failure.
7170
+ class Error
7351
7171
 
7352
- attr_reader :id, :status, :timestamp
7172
+ attr_reader :code, :message
7353
7173
 
7354
7174
  def initialize(incoming={})
7355
7175
  opts = HttpClient::Helper.symbolize_keys(incoming)
7356
- HttpClient::Preconditions.require_keys(opts, [:id, :status, :timestamp], 'EventSummary')
7357
- @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
7358
- @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::Status) ? x : ::Io::Flow::V0::Models::Status.apply(x))
7359
- @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
7176
+ HttpClient::Preconditions.require_keys(opts, [:code, :message], 'Error')
7177
+ @code = HttpClient::Preconditions.assert_class('code', opts.delete(:code), String)
7178
+ @message = HttpClient::Preconditions.assert_class('message', opts.delete(:message), String)
7360
7179
  end
7361
7180
 
7362
7181
  def to_json
@@ -7364,30 +7183,30 @@ module Io
7364
7183
  end
7365
7184
 
7366
7185
  def copy(incoming={})
7367
- EventSummary.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
7186
+ Error.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
7368
7187
  end
7369
7188
 
7370
7189
  def to_hash
7371
7190
  {
7372
- :id => id,
7373
- :status => status.value,
7374
- :timestamp => timestamp
7191
+ :code => code,
7192
+ :message => message
7375
7193
  }
7376
7194
  end
7377
7195
 
7378
7196
  end
7379
7197
 
7380
- class EventVersion
7198
+ # Range of time given a from and to number and the unit. For example: 1-4 hours
7199
+ # or 4-7 days
7200
+ class EstimatedWindow
7381
7201
 
7382
- attr_reader :id, :timestamp, :type, :event
7202
+ attr_reader :from, :to, :unit
7383
7203
 
7384
7204
  def initialize(incoming={})
7385
7205
  opts = HttpClient::Helper.symbolize_keys(incoming)
7386
- HttpClient::Preconditions.require_keys(opts, [:id, :timestamp, :type, :event], 'EventVersion')
7387
- @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
7388
- @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
7389
- @type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::ChangeType) ? x : ::Io::Flow::V0::Models::ChangeType.apply(x))
7390
- @event = (x = opts.delete(:event); x.is_a?(::Io::Flow::V0::Models::EventSummary) ? x : ::Io::Flow::V0::Models::EventSummary.new(x))
7206
+ HttpClient::Preconditions.require_keys(opts, [:from, :to, :unit], 'EstimatedWindow')
7207
+ @from = HttpClient::Preconditions.assert_class('from', opts.delete(:from), Integer)
7208
+ @to = HttpClient::Preconditions.assert_class('to', opts.delete(:to), Integer)
7209
+ @unit = (x = opts.delete(:unit); x.is_a?(::Io::Flow::V0::Models::UnitOfTime) ? x : ::Io::Flow::V0::Models::UnitOfTime.apply(x))
7391
7210
  end
7392
7211
 
7393
7212
  def to_json
@@ -7395,15 +7214,14 @@ module Io
7395
7214
  end
7396
7215
 
7397
7216
  def copy(incoming={})
7398
- EventVersion.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
7217
+ EstimatedWindow.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
7399
7218
  end
7400
7219
 
7401
7220
  def to_hash
7402
7221
  {
7403
- :id => id,
7404
- :timestamp => timestamp,
7405
- :type => type.value,
7406
- :event => event.to_hash
7222
+ :from => from,
7223
+ :to => to,
7224
+ :unit => unit.value
7407
7225
  }
7408
7226
  end
7409
7227
 
@@ -7438,22 +7256,24 @@ module Io
7438
7256
 
7439
7257
  end
7440
7258
 
7441
- # Properties that define a customized local experience for a given country
7259
+ # Properties that define a customized local experience for a given geographic
7260
+ # region
7442
7261
  class Experience
7443
7262
 
7444
- attr_reader :id, :key, :country, :currency, :language, :measurement_system, :name, :subcatalog
7263
+ attr_reader :id, :key, :region, :currency, :language, :measurement_system, :name, :subcatalog, :price_display
7445
7264
 
7446
7265
  def initialize(incoming={})
7447
7266
  opts = HttpClient::Helper.symbolize_keys(incoming)
7448
- HttpClient::Preconditions.require_keys(opts, [:id, :key, :country, :currency, :language, :measurement_system, :name, :subcatalog], 'Experience')
7267
+ HttpClient::Preconditions.require_keys(opts, [:id, :key, :region, :currency, :language, :measurement_system, :name, :subcatalog, :price_display], 'Experience')
7449
7268
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
7450
7269
  @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
7451
- @country = HttpClient::Preconditions.assert_class('country', opts.delete(:country), String)
7270
+ @region = (x = opts.delete(:region); x.is_a?(::Io::Flow::V0::Models::RegionReference) ? x : ::Io::Flow::V0::Models::RegionReference.new(x))
7452
7271
  @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
7453
7272
  @language = HttpClient::Preconditions.assert_class('language', opts.delete(:language), String)
7454
- @measurement_system = HttpClient::Preconditions.assert_class('measurement_system', opts.delete(:measurement_system), String)
7273
+ @measurement_system = (x = opts.delete(:measurement_system); x.is_a?(::Io::Flow::V0::Models::MeasurementSystem) ? x : ::Io::Flow::V0::Models::MeasurementSystem.apply(x))
7455
7274
  @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
7456
7275
  @subcatalog = (x = opts.delete(:subcatalog); x.is_a?(::Io::Flow::V0::Models::SubcatalogReference) ? x : ::Io::Flow::V0::Models::SubcatalogReference.new(x))
7276
+ @price_display = (x = opts.delete(:price_display); x.is_a?(::Io::Flow::V0::Models::PriceDisplay) ? x : ::Io::Flow::V0::Models::PriceDisplay.new(x))
7457
7277
  end
7458
7278
 
7459
7279
  def to_json
@@ -7468,29 +7288,32 @@ module Io
7468
7288
  {
7469
7289
  :id => id,
7470
7290
  :key => key,
7471
- :country => country,
7291
+ :region => region.to_hash,
7472
7292
  :currency => currency,
7473
7293
  :language => language,
7474
- :measurement_system => measurement_system,
7294
+ :measurement_system => measurement_system.value,
7475
7295
  :name => name,
7476
- :subcatalog => subcatalog.to_hash
7296
+ :subcatalog => subcatalog.to_hash,
7297
+ :price_display => price_display.to_hash
7477
7298
  }
7478
7299
  end
7479
7300
 
7480
7301
  end
7481
7302
 
7303
+ # Data needed to create an experience for a given geographic region
7482
7304
  class ExperienceForm
7483
7305
 
7484
- attr_reader :country, :name, :currency, :language, :measurement_system, :subcatalog_id
7306
+ attr_reader :region_id, :name, :currency, :language, :key, :measurement_system, :subcatalog_id
7485
7307
 
7486
7308
  def initialize(incoming={})
7487
7309
  opts = HttpClient::Helper.symbolize_keys(incoming)
7488
- HttpClient::Preconditions.require_keys(opts, [:country, :name], 'ExperienceForm')
7489
- @country = HttpClient::Preconditions.assert_class('country', opts.delete(:country), String)
7310
+ HttpClient::Preconditions.require_keys(opts, [:region_id, :name], 'ExperienceForm')
7311
+ @region_id = HttpClient::Preconditions.assert_class('region_id', opts.delete(:region_id), String)
7490
7312
  @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
7491
7313
  @currency = (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, String))
7492
7314
  @language = (x = opts.delete(:language); x.nil? ? nil : HttpClient::Preconditions.assert_class('language', x, String))
7493
- @measurement_system = (x = opts.delete(:measurement_system); x.nil? ? nil : HttpClient::Preconditions.assert_class('measurement_system', x, String))
7315
+ @key = (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, String))
7316
+ @measurement_system = (x = opts.delete(:measurement_system); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::MeasurementSystem) ? x : ::Io::Flow::V0::Models::MeasurementSystem.apply(x)))
7494
7317
  @subcatalog_id = (x = opts.delete(:subcatalog_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('subcatalog_id', x, String))
7495
7318
  end
7496
7319
 
@@ -7504,11 +7327,12 @@ module Io
7504
7327
 
7505
7328
  def to_hash
7506
7329
  {
7507
- :country => country,
7330
+ :region_id => region_id,
7508
7331
  :name => name,
7509
7332
  :currency => currency,
7510
7333
  :language => language,
7511
- :measurement_system => measurement_system,
7334
+ :key => key,
7335
+ :measurement_system => measurement_system.nil? ? nil : measurement_system.value,
7512
7336
  :subcatalog_id => subcatalog_id
7513
7337
  }
7514
7338
  end
@@ -7724,6 +7548,34 @@ module Io
7724
7548
 
7725
7549
  end
7726
7550
 
7551
+ class FulfillmentExperienceReference
7552
+
7553
+ attr_reader :id, :currency
7554
+
7555
+ def initialize(incoming={})
7556
+ opts = HttpClient::Helper.symbolize_keys(incoming)
7557
+ HttpClient::Preconditions.require_keys(opts, [:id, :currency], 'FulfillmentExperienceReference')
7558
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
7559
+ @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
7560
+ end
7561
+
7562
+ def to_json
7563
+ JSON.dump(to_hash)
7564
+ end
7565
+
7566
+ def copy(incoming={})
7567
+ FulfillmentExperienceReference.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
7568
+ end
7569
+
7570
+ def to_hash
7571
+ {
7572
+ :id => id,
7573
+ :currency => currency
7574
+ }
7575
+ end
7576
+
7577
+ end
7578
+
7727
7579
  # Prioritized calculation yielding a localized price (also allows for custom
7728
7580
  # defined price function)
7729
7581
  class Function < ExpandableFunction
@@ -9007,7 +8859,7 @@ module Io
9007
8859
 
9008
8860
  def initialize(incoming={})
9009
8861
  opts = HttpClient::Helper.symbolize_keys(incoming)
9010
- HttpClient::Preconditions.require_keys(opts, [:id, :number, :locale, :name, :price], 'Item')
8862
+ HttpClient::Preconditions.require_keys(opts, [:id, :number, :locale, :name, :price, :dimensions], 'Item')
9011
8863
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
9012
8864
  @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
9013
8865
  @locale = HttpClient::Preconditions.assert_class('locale', opts.delete(:locale), String)
@@ -9015,8 +8867,8 @@ module Io
9015
8867
  @price = (x = opts.delete(:price); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x))
9016
8868
  @categories = HttpClient::Preconditions.assert_class('categories', (x = opts.delete(:categories); x.nil? ? [] : x), Array).map { |v| HttpClient::Preconditions.assert_class('categories', v, String) }
9017
8869
  @description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
9018
- @attributes = HttpClient::Preconditions.assert_class('attributes', (x = opts.delete(:attributes); x.nil? ? [] : x), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::AttributeMetadata) ? x : ::Io::Flow::V0::Models::AttributeMetadata.new(x)) }
9019
- @dimensions = HttpClient::Preconditions.assert_class('dimensions', (x = opts.delete(:dimensions); x.nil? ? [] : x), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::Dimension) ? x : ::Io::Flow::V0::Models::Dimension.new(x)) }
8870
+ @attributes = HttpClient::Preconditions.assert_class('attributes', (x = opts.delete(:attributes); x.nil? ? {} : x), Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h }
8871
+ @dimensions = (x = opts.delete(:dimensions); x.is_a?(::Io::Flow::V0::Models::Dimensions) ? x : ::Io::Flow::V0::Models::Dimensions.new(x))
9020
8872
  @images = HttpClient::Preconditions.assert_class('images', (x = opts.delete(:images); x.nil? ? [] : x), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::Image) ? x : ::Io::Flow::V0::Models::Image.new(x)) }
9021
8873
  @flow = (x = opts.delete(:flow); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Flow) ? x : ::Io::Flow::V0::Models::Flow.new(x)))
9022
8874
  @local = (x = opts.delete(:local); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Local) ? x : ::Io::Flow::V0::Models::Local.new(x)))
@@ -9039,8 +8891,8 @@ module Io
9039
8891
  :price => price.to_hash,
9040
8892
  :categories => categories,
9041
8893
  :description => description,
9042
- :attributes => attributes.map { |o| o.to_hash },
9043
- :dimensions => dimensions.map { |o| o.to_hash },
8894
+ :attributes => attributes,
8895
+ :dimensions => dimensions.to_hash,
9044
8896
  :images => images.map { |o| o.to_hash },
9045
8897
  :flow => flow.nil? ? nil : flow.to_hash,
9046
8898
  :local => local.nil? ? nil : local.to_hash
@@ -9064,8 +8916,8 @@ module Io
9064
8916
  @price = HttpClient::Preconditions.assert_class('price', opts.delete(:price), Numeric)
9065
8917
  @categories = (x = opts.delete(:categories); x.nil? ? nil : HttpClient::Preconditions.assert_class('categories', x, Array).map { |v| HttpClient::Preconditions.assert_class('categories', v, String) })
9066
8918
  @description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
9067
- @attributes = (x = opts.delete(:attributes); x.nil? ? nil : HttpClient::Preconditions.assert_class('attributes', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::AttributeMetadata) ? x : ::Io::Flow::V0::Models::AttributeMetadata.new(x)) })
9068
- @dimensions = (x = opts.delete(:dimensions); x.nil? ? nil : HttpClient::Preconditions.assert_class('dimensions', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::Dimension) ? x : ::Io::Flow::V0::Models::Dimension.new(x)) })
8919
+ @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 })
8920
+ @dimensions = (x = opts.delete(:dimensions); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Dimensions) ? x : ::Io::Flow::V0::Models::Dimensions.new(x)))
9069
8921
  @images = (x = opts.delete(:images); x.nil? ? nil : HttpClient::Preconditions.assert_class('images', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::ImageForm) ? x : ::Io::Flow::V0::Models::ImageForm.new(x)) })
9070
8922
  end
9071
8923
 
@@ -9086,8 +8938,8 @@ module Io
9086
8938
  :price => price,
9087
8939
  :categories => categories.nil? ? nil : categories,
9088
8940
  :description => description,
9089
- :attributes => attributes.nil? ? nil : attributes.map { |o| o.to_hash },
9090
- :dimensions => dimensions.nil? ? nil : dimensions.map { |o| o.to_hash },
8941
+ :attributes => attributes.nil? ? nil : attributes,
8942
+ :dimensions => dimensions.nil? ? nil : dimensions.to_hash,
9091
8943
  :images => images.nil? ? nil : images.map { |o| o.to_hash }
9092
8944
  }
9093
8945
  end
@@ -9141,36 +8993,172 @@ module Io
9141
8993
  end
9142
8994
 
9143
8995
  def copy(incoming={})
9144
- ItemVersion.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
8996
+ ItemVersion.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
8997
+ end
8998
+
8999
+ def to_hash
9000
+ {
9001
+ :id => id,
9002
+ :timestamp => timestamp,
9003
+ :type => type.value,
9004
+ :item => item.to_hash
9005
+ }
9006
+ end
9007
+
9008
+ end
9009
+
9010
+ # Represents a specific label being tracked as part of the tracking bucket
9011
+ class Label
9012
+
9013
+ attr_reader :id, :tracking, :status, :carrier, :tracking_number, :timestamp, :delivery_estimate, :description
9014
+
9015
+ def initialize(incoming={})
9016
+ opts = HttpClient::Helper.symbolize_keys(incoming)
9017
+ HttpClient::Preconditions.require_keys(opts, [:id, :tracking, :status, :carrier, :tracking_number, :timestamp], 'Label')
9018
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
9019
+ @tracking = (x = opts.delete(:tracking); x.is_a?(::Io::Flow::V0::Models::TrackingSummary) ? x : ::Io::Flow::V0::Models::TrackingSummary.new(x))
9020
+ @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::TrackingStatus) ? x : ::Io::Flow::V0::Models::TrackingStatus.apply(x))
9021
+ @carrier = HttpClient::Preconditions.assert_class('carrier', opts.delete(:carrier), String)
9022
+ @tracking_number = HttpClient::Preconditions.assert_class('tracking_number', opts.delete(:tracking_number), String)
9023
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
9024
+ @delivery_estimate = (x = opts.delete(:delivery_estimate); x.nil? ? nil : HttpClient::Preconditions.assert_class('delivery_estimate', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
9025
+ @description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
9026
+ end
9027
+
9028
+ def to_json
9029
+ JSON.dump(to_hash)
9030
+ end
9031
+
9032
+ def copy(incoming={})
9033
+ Label.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
9034
+ end
9035
+
9036
+ def to_hash
9037
+ {
9038
+ :id => id,
9039
+ :tracking => tracking.to_hash,
9040
+ :status => status.value,
9041
+ :carrier => carrier,
9042
+ :tracking_number => tracking_number,
9043
+ :timestamp => timestamp,
9044
+ :delivery_estimate => delivery_estimate,
9045
+ :description => description
9046
+ }
9047
+ end
9048
+
9049
+ end
9050
+
9051
+ class LabelEvent
9052
+
9053
+ attr_reader :id, :label, :location, :status, :timestamp, :description
9054
+
9055
+ def initialize(incoming={})
9056
+ opts = HttpClient::Helper.symbolize_keys(incoming)
9057
+ HttpClient::Preconditions.require_keys(opts, [:id, :label, :location, :status, :timestamp], 'LabelEvent')
9058
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
9059
+ @label = (x = opts.delete(:label); x.is_a?(::Io::Flow::V0::Models::LabelSummary) ? x : ::Io::Flow::V0::Models::LabelSummary.new(x))
9060
+ @location = (x = opts.delete(:location); x.is_a?(::Io::Flow::V0::Models::ExpandableLocation) ? x : ::Io::Flow::V0::Models::ExpandableLocation.from_json(x))
9061
+ @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::TrackingStatus) ? x : ::Io::Flow::V0::Models::TrackingStatus.apply(x))
9062
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
9063
+ @description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
9064
+ end
9065
+
9066
+ def to_json
9067
+ JSON.dump(to_hash)
9068
+ end
9069
+
9070
+ def copy(incoming={})
9071
+ LabelEvent.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
9072
+ end
9073
+
9074
+ def to_hash
9075
+ {
9076
+ :id => id,
9077
+ :label => label.to_hash,
9078
+ :location => location.to_hash,
9079
+ :status => status.value,
9080
+ :timestamp => timestamp,
9081
+ :description => description
9082
+ }
9083
+ end
9084
+
9085
+ end
9086
+
9087
+ class LabelEventForm
9088
+
9089
+ attr_reader :label_id, :timestamp, :status, :description, :location
9090
+
9091
+ def initialize(incoming={})
9092
+ opts = HttpClient::Helper.symbolize_keys(incoming)
9093
+ HttpClient::Preconditions.require_keys(opts, [:label_id, :timestamp, :status], 'LabelEventForm')
9094
+ @label_id = HttpClient::Preconditions.assert_class('label_id', opts.delete(:label_id), String)
9095
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
9096
+ @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::TrackingStatus) ? x : ::Io::Flow::V0::Models::TrackingStatus.apply(x))
9097
+ @description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
9098
+ @location = (x = opts.delete(:location); x.nil? ? nil : HttpClient::Preconditions.assert_class('location', x, String))
9099
+ end
9100
+
9101
+ def to_json
9102
+ JSON.dump(to_hash)
9103
+ end
9104
+
9105
+ def copy(incoming={})
9106
+ LabelEventForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
9107
+ end
9108
+
9109
+ def to_hash
9110
+ {
9111
+ :label_id => label_id,
9112
+ :timestamp => timestamp,
9113
+ :status => status.value,
9114
+ :description => description,
9115
+ :location => location
9116
+ }
9117
+ end
9118
+
9119
+ end
9120
+
9121
+ class LabelEventSummary
9122
+
9123
+ attr_reader :id, :status, :timestamp
9124
+
9125
+ def initialize(incoming={})
9126
+ opts = HttpClient::Helper.symbolize_keys(incoming)
9127
+ HttpClient::Preconditions.require_keys(opts, [:id, :status, :timestamp], 'LabelEventSummary')
9128
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
9129
+ @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::TrackingStatus) ? x : ::Io::Flow::V0::Models::TrackingStatus.apply(x))
9130
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
9131
+ end
9132
+
9133
+ def to_json
9134
+ JSON.dump(to_hash)
9135
+ end
9136
+
9137
+ def copy(incoming={})
9138
+ LabelEventSummary.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
9145
9139
  end
9146
9140
 
9147
9141
  def to_hash
9148
9142
  {
9149
9143
  :id => id,
9150
- :timestamp => timestamp,
9151
- :type => type.value,
9152
- :item => item.to_hash
9144
+ :status => status.value,
9145
+ :timestamp => timestamp
9153
9146
  }
9154
9147
  end
9155
9148
 
9156
9149
  end
9157
9150
 
9158
- # Represents a specific label being tracked as part of the tracking bucket
9159
- class Label
9151
+ class LabelEventVersion
9160
9152
 
9161
- attr_reader :id, :tracking, :status, :carrier, :tracking_number, :timestamp, :delivery_estimate, :description
9153
+ attr_reader :id, :timestamp, :type, :label_event
9162
9154
 
9163
9155
  def initialize(incoming={})
9164
9156
  opts = HttpClient::Helper.symbolize_keys(incoming)
9165
- HttpClient::Preconditions.require_keys(opts, [:id, :tracking, :status, :carrier, :tracking_number, :timestamp], 'Label')
9157
+ HttpClient::Preconditions.require_keys(opts, [:id, :timestamp, :type, :label_event], 'LabelEventVersion')
9166
9158
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
9167
- @tracking = (x = opts.delete(:tracking); x.is_a?(::Io::Flow::V0::Models::TrackingSummary) ? x : ::Io::Flow::V0::Models::TrackingSummary.new(x))
9168
- @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::Status) ? x : ::Io::Flow::V0::Models::Status.apply(x))
9169
- @carrier = HttpClient::Preconditions.assert_class('carrier', opts.delete(:carrier), String)
9170
- @tracking_number = HttpClient::Preconditions.assert_class('tracking_number', opts.delete(:tracking_number), String)
9171
9159
  @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
9172
- @delivery_estimate = (x = opts.delete(:delivery_estimate); x.nil? ? nil : HttpClient::Preconditions.assert_class('delivery_estimate', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
9173
- @description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
9160
+ @type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::ChangeType) ? x : ::Io::Flow::V0::Models::ChangeType.apply(x))
9161
+ @label_event = (x = opts.delete(:label_event); x.is_a?(::Io::Flow::V0::Models::LabelEventSummary) ? x : ::Io::Flow::V0::Models::LabelEventSummary.new(x))
9174
9162
  end
9175
9163
 
9176
9164
  def to_json
@@ -9178,19 +9166,15 @@ module Io
9178
9166
  end
9179
9167
 
9180
9168
  def copy(incoming={})
9181
- Label.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
9169
+ LabelEventVersion.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
9182
9170
  end
9183
9171
 
9184
9172
  def to_hash
9185
9173
  {
9186
9174
  :id => id,
9187
- :tracking => tracking.to_hash,
9188
- :status => status.value,
9189
- :carrier => carrier,
9190
- :tracking_number => tracking_number,
9191
9175
  :timestamp => timestamp,
9192
- :delivery_estimate => delivery_estimate,
9193
- :description => description
9176
+ :type => type.value,
9177
+ :label_event => label_event.to_hash
9194
9178
  }
9195
9179
  end
9196
9180
 
@@ -9205,7 +9189,7 @@ module Io
9205
9189
  opts = HttpClient::Helper.symbolize_keys(incoming)
9206
9190
  HttpClient::Preconditions.require_keys(opts, [:tracking_id, :carrier, :tracking_number], 'LabelForm')
9207
9191
  @tracking_id = HttpClient::Preconditions.assert_class('tracking_id', opts.delete(:tracking_id), String)
9208
- @status = (x = (x = opts.delete(:status); x.nil? ? "pending" : x); x.is_a?(::Io::Flow::V0::Models::Status) ? x : ::Io::Flow::V0::Models::Status.apply(x))
9192
+ @status = (x = (x = opts.delete(:status); x.nil? ? "pending" : x); x.is_a?(::Io::Flow::V0::Models::TrackingStatus) ? x : ::Io::Flow::V0::Models::TrackingStatus.apply(x))
9209
9193
  @carrier = HttpClient::Preconditions.assert_class('carrier', opts.delete(:carrier), String)
9210
9194
  @tracking_number = HttpClient::Preconditions.assert_class('tracking_number', opts.delete(:tracking_number), String)
9211
9195
  @delivery_estimate = (x = opts.delete(:delivery_estimate); x.nil? ? nil : HttpClient::Preconditions.assert_class('delivery_estimate', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
@@ -9244,7 +9228,7 @@ module Io
9244
9228
  HttpClient::Preconditions.require_keys(opts, [:id, :tracking, :status, :carrier, :tracking_number], 'LabelSummary')
9245
9229
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
9246
9230
  @tracking = (x = opts.delete(:tracking); x.is_a?(::Io::Flow::V0::Models::TrackingSummary) ? x : ::Io::Flow::V0::Models::TrackingSummary.new(x))
9247
- @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::Status) ? x : ::Io::Flow::V0::Models::Status.apply(x))
9231
+ @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::TrackingStatus) ? x : ::Io::Flow::V0::Models::TrackingStatus.apply(x))
9248
9232
  @carrier = HttpClient::Preconditions.assert_class('carrier', opts.delete(:carrier), String)
9249
9233
  @tracking_number = HttpClient::Preconditions.assert_class('tracking_number', opts.delete(:tracking_number), String)
9250
9234
  end
@@ -9435,8 +9419,7 @@ module Io
9435
9419
 
9436
9420
  end
9437
9421
 
9438
- # ISO 639 2-character language code. See
9439
- # https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
9422
+ # ISO 639 2-character language code. See https://api.flow.io/reference/languages
9440
9423
  class Language
9441
9424
 
9442
9425
  attr_reader :name, :iso_639_2
@@ -9465,7 +9448,7 @@ module Io
9465
9448
 
9466
9449
  end
9467
9450
 
9468
- # Represents an order line for checkout
9451
+ # Represents an order line item
9469
9452
  class Line
9470
9453
 
9471
9454
  attr_reader :number, :quantity
@@ -9629,7 +9612,7 @@ module Io
9629
9612
  opts = HttpClient::Helper.symbolize_keys(incoming)
9630
9613
  HttpClient::Preconditions.require_keys(opts, [:name, :value], 'Margin')
9631
9614
  @name = (x = opts.delete(:name); x.is_a?(::Io::Flow::V0::Models::AdjustmentType) ? x : ::Io::Flow::V0::Models::AdjustmentType.apply(x))
9632
- @value = HttpClient::Preconditions.assert_class('value', opts.delete(:value), Numeric)
9615
+ @value = HttpClient::Preconditions.assert_class('value', HttpClient::Helper.to_big_decimal(opts.delete(:value)), BigDecimal)
9633
9616
  end
9634
9617
 
9635
9618
  def to_json
@@ -9861,10 +9844,11 @@ module Io
9861
9844
  # items)
9862
9845
  class Options
9863
9846
 
9864
- attr_reader :show_in_catalog, :show_in_harmonization
9847
+ attr_reader :required, :show_in_catalog, :show_in_harmonization
9865
9848
 
9866
9849
  def initialize(incoming={})
9867
9850
  opts = HttpClient::Helper.symbolize_keys(incoming)
9851
+ @required = HttpClient::Preconditions.assert_boolean('required', (x = opts.delete(:required); x.nil? ? false : x))
9868
9852
  @show_in_catalog = HttpClient::Preconditions.assert_boolean('show_in_catalog', (x = opts.delete(:show_in_catalog); x.nil? ? false : x))
9869
9853
  @show_in_harmonization = HttpClient::Preconditions.assert_boolean('show_in_harmonization', (x = opts.delete(:show_in_harmonization); x.nil? ? false : x))
9870
9854
  end
@@ -9879,6 +9863,7 @@ module Io
9879
9863
 
9880
9864
  def to_hash
9881
9865
  {
9866
+ :required => required,
9882
9867
  :show_in_catalog => show_in_catalog,
9883
9868
  :show_in_harmonization => show_in_harmonization
9884
9869
  }
@@ -9886,6 +9871,202 @@ module Io
9886
9871
 
9887
9872
  end
9888
9873
 
9874
+ # An order represents all of the information about a particular line item,
9875
+ # including pricing, currency rates, delivery options, etc. All information in
9876
+ # an order is guaranteed by Flow - if an order is booked before its expiration.
9877
+ # The intended use case is to create an order as a consumer enters checkout,
9878
+ # then to book that order in order processing.
9879
+ class Order
9880
+
9881
+ attr_reader :id, :number, :customer, :expires_at, :deliveries, :prices, :total
9882
+
9883
+ def initialize(incoming={})
9884
+ opts = HttpClient::Helper.symbolize_keys(incoming)
9885
+ HttpClient::Preconditions.require_keys(opts, [:id, :number, :customer, :expires_at, :deliveries, :prices, :total], 'Order')
9886
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
9887
+ @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
9888
+ @customer = (x = opts.delete(:customer); x.is_a?(::Io::Flow::V0::Models::Customer) ? x : ::Io::Flow::V0::Models::Customer.new(x))
9889
+ @expires_at = HttpClient::Preconditions.assert_class('expires_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:expires_at)), DateTime)
9890
+ @deliveries = HttpClient::Preconditions.assert_class('deliveries', opts.delete(:deliveries), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::Delivery) ? x : ::Io::Flow::V0::Models::Delivery.new(x)) }
9891
+ @prices = HttpClient::Preconditions.assert_class('prices', opts.delete(:prices), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::LocalizedPrice) ? x : ::Io::Flow::V0::Models::LocalizedPrice.new(x)) }
9892
+ @total = (x = opts.delete(:total); x.is_a?(::Io::Flow::V0::Models::LocalizedPrice) ? x : ::Io::Flow::V0::Models::LocalizedPrice.new(x))
9893
+ end
9894
+
9895
+ def to_json
9896
+ JSON.dump(to_hash)
9897
+ end
9898
+
9899
+ def copy(incoming={})
9900
+ Order.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
9901
+ end
9902
+
9903
+ def to_hash
9904
+ {
9905
+ :id => id,
9906
+ :number => number,
9907
+ :customer => customer.to_hash,
9908
+ :expires_at => expires_at,
9909
+ :deliveries => deliveries.map { |o| o.to_hash },
9910
+ :prices => prices.map { |o| o.to_hash },
9911
+ :total => total.to_hash
9912
+ }
9913
+ end
9914
+
9915
+ end
9916
+
9917
+ # Represents an order that has been booked. Booked orders can no longer be
9918
+ # deleted as they represent transactions in the real world
9919
+ class OrderBooking
9920
+
9921
+ attr_reader :id, :created_at, :order
9922
+
9923
+ def initialize(incoming={})
9924
+ opts = HttpClient::Helper.symbolize_keys(incoming)
9925
+ HttpClient::Preconditions.require_keys(opts, [:id, :created_at, :order], 'OrderBooking')
9926
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
9927
+ @created_at = HttpClient::Preconditions.assert_class('created_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:created_at)), DateTime)
9928
+ @order = (x = opts.delete(:order); x.is_a?(::Io::Flow::V0::Models::OrderReference) ? x : ::Io::Flow::V0::Models::OrderReference.new(x))
9929
+ end
9930
+
9931
+ def to_json
9932
+ JSON.dump(to_hash)
9933
+ end
9934
+
9935
+ def copy(incoming={})
9936
+ OrderBooking.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
9937
+ end
9938
+
9939
+ def to_hash
9940
+ {
9941
+ :id => id,
9942
+ :created_at => created_at,
9943
+ :order => order.to_hash
9944
+ }
9945
+ end
9946
+
9947
+ end
9948
+
9949
+ # Books an order. This means two things: a. all pricing in the quote will be
9950
+ # guaranteed by Flow (subject to an active contract); b. you will be invoiced
9951
+ # for any relevant costs.
9952
+ class OrderBookingForm
9953
+
9954
+ attr_reader :options
9955
+
9956
+ def initialize(incoming={})
9957
+ opts = HttpClient::Helper.symbolize_keys(incoming)
9958
+ HttpClient::Preconditions.require_keys(opts, [:options], 'OrderBookingForm')
9959
+ @options = HttpClient::Preconditions.assert_class('options', opts.delete(:options), Array).map { |v| HttpClient::Preconditions.assert_class('options', v, String) }
9960
+ end
9961
+
9962
+ def to_json
9963
+ JSON.dump(to_hash)
9964
+ end
9965
+
9966
+ def copy(incoming={})
9967
+ OrderBookingForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
9968
+ end
9969
+
9970
+ def to_hash
9971
+ {
9972
+ :options => options
9973
+ }
9974
+ end
9975
+
9976
+ end
9977
+
9978
+ # The order form is used to create an open order, providing the details on
9979
+ # pricing and delivery options for destination and items/quantities specified
9980
+ class OrderForm
9981
+
9982
+ attr_reader :number, :customer, :destination, :items
9983
+
9984
+ def initialize(incoming={})
9985
+ opts = HttpClient::Helper.symbolize_keys(incoming)
9986
+ HttpClient::Preconditions.require_keys(opts, [:number, :customer, :destination, :items], 'OrderForm')
9987
+ @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
9988
+ @customer = (x = opts.delete(:customer); x.is_a?(::Io::Flow::V0::Models::CustomerForm) ? x : ::Io::Flow::V0::Models::CustomerForm.new(x))
9989
+ @destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::Location) ? x : ::Io::Flow::V0::Models::Location.new(x))
9990
+ @items = HttpClient::Preconditions.assert_class('items', opts.delete(:items), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::Line) ? x : ::Io::Flow::V0::Models::Line.new(x)) }
9991
+ end
9992
+
9993
+ def to_json
9994
+ JSON.dump(to_hash)
9995
+ end
9996
+
9997
+ def copy(incoming={})
9998
+ OrderForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
9999
+ end
10000
+
10001
+ def to_hash
10002
+ {
10003
+ :number => number,
10004
+ :customer => customer.to_hash,
10005
+ :destination => destination.to_hash,
10006
+ :items => items.map { |o| o.to_hash }
10007
+ }
10008
+ end
10009
+
10010
+ end
10011
+
10012
+ class OrderReference
10013
+
10014
+ attr_reader :id
10015
+
10016
+ def initialize(incoming={})
10017
+ opts = HttpClient::Helper.symbolize_keys(incoming)
10018
+ HttpClient::Preconditions.require_keys(opts, [:id], 'OrderReference')
10019
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
10020
+ end
10021
+
10022
+ def to_json
10023
+ JSON.dump(to_hash)
10024
+ end
10025
+
10026
+ def copy(incoming={})
10027
+ OrderReference.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
10028
+ end
10029
+
10030
+ def to_hash
10031
+ {
10032
+ :id => id
10033
+ }
10034
+ end
10035
+
10036
+ end
10037
+
10038
+ class OrderVersion
10039
+
10040
+ attr_reader :id, :timestamp, :type, :order
10041
+
10042
+ def initialize(incoming={})
10043
+ opts = HttpClient::Helper.symbolize_keys(incoming)
10044
+ HttpClient::Preconditions.require_keys(opts, [:id, :timestamp, :type, :order], 'OrderVersion')
10045
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
10046
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
10047
+ @type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::ChangeType) ? x : ::Io::Flow::V0::Models::ChangeType.apply(x))
10048
+ @order = (x = opts.delete(:order); x.is_a?(::Io::Flow::V0::Models::Order) ? x : ::Io::Flow::V0::Models::Order.new(x))
10049
+ end
10050
+
10051
+ def to_json
10052
+ JSON.dump(to_hash)
10053
+ end
10054
+
10055
+ def copy(incoming={})
10056
+ OrderVersion.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
10057
+ end
10058
+
10059
+ def to_hash
10060
+ {
10061
+ :id => id,
10062
+ :timestamp => timestamp,
10063
+ :type => type.value,
10064
+ :order => order.to_hash
10065
+ }
10066
+ end
10067
+
10068
+ end
10069
+
9889
10070
  # Represents a single organization in the system, and what environment it is
9890
10071
  # currently operating in.
9891
10072
  class Organization < ExpandableOrganization
@@ -10300,6 +10481,77 @@ module Io
10300
10481
 
10301
10482
  end
10302
10483
 
10484
+ # Defines which elements of a the item price should be explicitly displayed
10485
+ # (e.g. deciding whether to list VAT standalone from item price or as part of
10486
+ # the item price)
10487
+ class PriceDisplay
10488
+
10489
+ attr_reader :levies
10490
+
10491
+ def initialize(incoming={})
10492
+ opts = HttpClient::Helper.symbolize_keys(incoming)
10493
+ HttpClient::Preconditions.require_keys(opts, [:levies], 'PriceDisplay')
10494
+ @levies = HttpClient::Preconditions.assert_class('levies', opts.delete(:levies), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::Levy) ? x : ::Io::Flow::V0::Models::Levy.apply(x)) }
10495
+ end
10496
+
10497
+ def to_json
10498
+ JSON.dump(to_hash)
10499
+ end
10500
+
10501
+ def copy(incoming={})
10502
+ PriceDisplay.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
10503
+ end
10504
+
10505
+ def to_hash
10506
+ {
10507
+ :levies => levies.map { |o| o.value }
10508
+ }
10509
+ end
10510
+
10511
+ end
10512
+
10513
+ class PriceEquation
10514
+
10515
+ attr_reader :base_price, :conversion, :fixed_margin, :percent_margin, :insurance, :freight, :duty, :tax, :rounding
10516
+
10517
+ def initialize(incoming={})
10518
+ opts = HttpClient::Helper.symbolize_keys(incoming)
10519
+ HttpClient::Preconditions.require_keys(opts, [:base_price, :conversion, :fixed_margin, :percent_margin, :insurance, :freight, :duty, :tax], 'PriceEquation')
10520
+ @base_price = HttpClient::Preconditions.assert_class('base_price', HttpClient::Helper.to_big_decimal(opts.delete(:base_price)), BigDecimal)
10521
+ @conversion = (x = opts.delete(:conversion); x.is_a?(::Io::Flow::V0::Models::Conversion) ? x : ::Io::Flow::V0::Models::Conversion.new(x))
10522
+ @fixed_margin = (x = opts.delete(:fixed_margin); x.is_a?(::Io::Flow::V0::Models::Margin) ? x : ::Io::Flow::V0::Models::Margin.new(x))
10523
+ @percent_margin = (x = opts.delete(:percent_margin); x.is_a?(::Io::Flow::V0::Models::Margin) ? x : ::Io::Flow::V0::Models::Margin.new(x))
10524
+ @insurance = HttpClient::Preconditions.assert_class('insurance', HttpClient::Helper.to_big_decimal(opts.delete(:insurance)), BigDecimal)
10525
+ @freight = HttpClient::Preconditions.assert_class('freight', HttpClient::Helper.to_big_decimal(opts.delete(:freight)), BigDecimal)
10526
+ @duty = (x = opts.delete(:duty); x.is_a?(::Io::Flow::V0::Models::Duty) ? x : ::Io::Flow::V0::Models::Duty.new(x))
10527
+ @tax = (x = opts.delete(:tax); x.is_a?(::Io::Flow::V0::Models::Tax) ? x : ::Io::Flow::V0::Models::Tax.new(x))
10528
+ @rounding = (x = opts.delete(:rounding); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Rounding) ? x : ::Io::Flow::V0::Models::Rounding.new(x)))
10529
+ end
10530
+
10531
+ def to_json
10532
+ JSON.dump(to_hash)
10533
+ end
10534
+
10535
+ def copy(incoming={})
10536
+ PriceEquation.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
10537
+ end
10538
+
10539
+ def to_hash
10540
+ {
10541
+ :base_price => base_price,
10542
+ :conversion => conversion.to_hash,
10543
+ :fixed_margin => fixed_margin.to_hash,
10544
+ :percent_margin => percent_margin.to_hash,
10545
+ :insurance => insurance,
10546
+ :freight => freight,
10547
+ :duty => duty.to_hash,
10548
+ :tax => tax.to_hash,
10549
+ :rounding => rounding.nil? ? nil : rounding.to_hash
10550
+ }
10551
+ end
10552
+
10553
+ end
10554
+
10303
10555
  # Amount-currency paid for a basic price to be used in model forms, before a
10304
10556
  # price label is created. Label in the main price model is created by the
10305
10557
  # implementing api.
@@ -10426,14 +10678,14 @@ module Io
10426
10678
 
10427
10679
  class QuoteForm
10428
10680
 
10429
- attr_reader :items, :destination, :origin
10681
+ attr_reader :destination, :experience, :items
10430
10682
 
10431
10683
  def initialize(incoming={})
10432
10684
  opts = HttpClient::Helper.symbolize_keys(incoming)
10433
- HttpClient::Preconditions.require_keys(opts, [:items, :destination], 'QuoteForm')
10434
- @items = HttpClient::Preconditions.assert_class('items', opts.delete(:items), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::ItemSummary) ? x : ::Io::Flow::V0::Models::ItemSummary.new(x)) }
10685
+ HttpClient::Preconditions.require_keys(opts, [:destination, :experience, :items], 'QuoteForm')
10435
10686
  @destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::Address) ? x : ::Io::Flow::V0::Models::Address.new(x))
10436
- @origin = (x = opts.delete(:origin); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Address) ? x : ::Io::Flow::V0::Models::Address.new(x)))
10687
+ @experience = HttpClient::Preconditions.assert_class('experience', opts.delete(:experience), String)
10688
+ @items = HttpClient::Preconditions.assert_class('items', opts.delete(:items), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::ItemSummary) ? x : ::Io::Flow::V0::Models::ItemSummary.new(x)) }
10437
10689
  end
10438
10690
 
10439
10691
  def to_json
@@ -10446,9 +10698,9 @@ module Io
10446
10698
 
10447
10699
  def to_hash
10448
10700
  {
10449
- :items => items.map { |o| o.to_hash },
10450
10701
  :destination => destination.to_hash,
10451
- :origin => origin.nil? ? nil : origin.to_hash
10702
+ :experience => experience,
10703
+ :items => items.map { |o| o.to_hash }
10452
10704
  }
10453
10705
  end
10454
10706
 
@@ -10629,7 +10881,7 @@ module Io
10629
10881
  @countries = HttpClient::Preconditions.assert_class('countries', opts.delete(:countries), Array).map { |v| HttpClient::Preconditions.assert_class('countries', v, String) }
10630
10882
  @currencies = HttpClient::Preconditions.assert_class('currencies', opts.delete(:currencies), Array).map { |v| HttpClient::Preconditions.assert_class('currencies', v, String) }
10631
10883
  @languages = HttpClient::Preconditions.assert_class('languages', opts.delete(:languages), Array).map { |v| HttpClient::Preconditions.assert_class('languages', v, String) }
10632
- @measurement_systems = HttpClient::Preconditions.assert_class('measurement_systems', opts.delete(:measurement_systems), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::MeasurementSystem) ? x : ::Io::Flow::V0::Models::MeasurementSystem.apply(x)) }
10884
+ @measurement_systems = HttpClient::Preconditions.assert_class('measurement_systems', opts.delete(:measurement_systems), Array).map { |v| HttpClient::Preconditions.assert_class('measurement_systems', v, String) }
10633
10885
  end
10634
10886
 
10635
10887
  def to_json
@@ -10647,7 +10899,33 @@ module Io
10647
10899
  :countries => countries,
10648
10900
  :currencies => currencies,
10649
10901
  :languages => languages,
10650
- :measurement_systems => measurement_systems.map { |o| o.value }
10902
+ :measurement_systems => measurement_systems
10903
+ }
10904
+ end
10905
+
10906
+ end
10907
+
10908
+ class RegionReference
10909
+
10910
+ attr_reader :id
10911
+
10912
+ def initialize(incoming={})
10913
+ opts = HttpClient::Helper.symbolize_keys(incoming)
10914
+ HttpClient::Preconditions.require_keys(opts, [:id], 'RegionReference')
10915
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
10916
+ end
10917
+
10918
+ def to_json
10919
+ JSON.dump(to_hash)
10920
+ end
10921
+
10922
+ def copy(incoming={})
10923
+ RegionReference.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
10924
+ end
10925
+
10926
+ def to_hash
10927
+ {
10928
+ :id => id
10651
10929
  }
10652
10930
  end
10653
10931
 
@@ -10655,15 +10933,15 @@ module Io
10655
10933
 
10656
10934
  class Rounding < Adjustment
10657
10935
 
10658
- attr_reader :name, :rounding_method, :value
10936
+ attr_reader :name, :method, :value
10659
10937
 
10660
10938
  def initialize(incoming={})
10661
10939
  super(:name => Adjustment::Types::ROUNDING)
10662
10940
  opts = HttpClient::Helper.symbolize_keys(incoming)
10663
- HttpClient::Preconditions.require_keys(opts, [:name, :rounding_method, :value], 'Rounding')
10941
+ HttpClient::Preconditions.require_keys(opts, [:name, :method, :value], 'Rounding')
10664
10942
  @name = (x = opts.delete(:name); x.is_a?(::Io::Flow::V0::Models::AdjustmentType) ? x : ::Io::Flow::V0::Models::AdjustmentType.apply(x))
10665
- @rounding_method = (x = opts.delete(:rounding_method); x.is_a?(::Io::Flow::V0::Models::RoundingMethod) ? x : ::Io::Flow::V0::Models::RoundingMethod.apply(x))
10666
- @value = HttpClient::Preconditions.assert_class('value', opts.delete(:value), Numeric)
10943
+ @method = (x = opts.delete(:method); x.is_a?(::Io::Flow::V0::Models::RoundingMethod) ? x : ::Io::Flow::V0::Models::RoundingMethod.apply(x))
10944
+ @value = HttpClient::Preconditions.assert_class('value', HttpClient::Helper.to_big_decimal(opts.delete(:value)), BigDecimal)
10667
10945
  end
10668
10946
 
10669
10947
  def to_json
@@ -10677,7 +10955,7 @@ module Io
10677
10955
  def subtype_to_hash
10678
10956
  {
10679
10957
  :name => name.value,
10680
- :rounding_method => rounding_method.value,
10958
+ :method => method.value,
10681
10959
  :value => value
10682
10960
  }
10683
10961
  end
@@ -11200,16 +11478,14 @@ module Io
11200
11478
  # for a localized experience
11201
11479
  class Subcatalog < ExpandableSubcatalog
11202
11480
 
11203
- attr_reader :id, :catalog, :country, :key, :settings
11481
+ attr_reader :id, :catalog, :settings
11204
11482
 
11205
11483
  def initialize(incoming={})
11206
11484
  super(:name => ExpandableSubcatalog::Types::SUBCATALOG)
11207
11485
  opts = HttpClient::Helper.symbolize_keys(incoming)
11208
- HttpClient::Preconditions.require_keys(opts, [:id, :catalog, :country, :key, :settings], 'Subcatalog')
11486
+ HttpClient::Preconditions.require_keys(opts, [:id, :catalog, :settings], 'Subcatalog')
11209
11487
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
11210
11488
  @catalog = (x = opts.delete(:catalog); x.is_a?(::Io::Flow::V0::Models::Catalog) ? x : ::Io::Flow::V0::Models::Catalog.new(x))
11211
- @country = HttpClient::Preconditions.assert_class('country', opts.delete(:country), String)
11212
- @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
11213
11489
  @settings = (x = opts.delete(:settings); x.is_a?(::Io::Flow::V0::Models::SubcatalogSettings) ? x : ::Io::Flow::V0::Models::SubcatalogSettings.new(x))
11214
11490
  end
11215
11491
 
@@ -11225,8 +11501,6 @@ module Io
11225
11501
  {
11226
11502
  :id => id,
11227
11503
  :catalog => catalog.to_hash,
11228
- :country => country,
11229
- :key => key,
11230
11504
  :settings => settings.to_hash
11231
11505
  }
11232
11506
  end
@@ -11235,12 +11509,10 @@ module Io
11235
11509
 
11236
11510
  class SubcatalogForm
11237
11511
 
11238
- attr_reader :country, :settings
11512
+ attr_reader :settings
11239
11513
 
11240
11514
  def initialize(incoming={})
11241
11515
  opts = HttpClient::Helper.symbolize_keys(incoming)
11242
- HttpClient::Preconditions.require_keys(opts, [:country], 'SubcatalogForm')
11243
- @country = HttpClient::Preconditions.assert_class('country', opts.delete(:country), String)
11244
11516
  @settings = (x = opts.delete(:settings); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::SubcatalogSettingsForm) ? x : ::Io::Flow::V0::Models::SubcatalogSettingsForm.new(x)))
11245
11517
  end
11246
11518
 
@@ -11254,7 +11526,6 @@ module Io
11254
11526
 
11255
11527
  def to_hash
11256
11528
  {
11257
- :country => country,
11258
11529
  :settings => settings.nil? ? nil : settings.to_hash
11259
11530
  }
11260
11531
  end
@@ -11467,7 +11738,7 @@ module Io
11467
11738
  opts = HttpClient::Helper.symbolize_keys(incoming)
11468
11739
  HttpClient::Preconditions.require_keys(opts, [:id, :experience, :integration, :name, :rules, :services, :strategy, :visibility], 'Tier')
11469
11740
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
11470
- @experience = (x = opts.delete(:experience); x.is_a?(::Io::Flow::V0::Models::ExperienceSummary) ? x : ::Io::Flow::V0::Models::ExperienceSummary.new(x))
11741
+ @experience = (x = opts.delete(:experience); x.is_a?(::Io::Flow::V0::Models::FulfillmentExperienceReference) ? x : ::Io::Flow::V0::Models::FulfillmentExperienceReference.new(x))
11471
11742
  @integration = (x = opts.delete(:integration); x.is_a?(::Io::Flow::V0::Models::ShipmentIntegrationType) ? x : ::Io::Flow::V0::Models::ShipmentIntegrationType.apply(x))
11472
11743
  @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
11473
11744
  @rules = HttpClient::Preconditions.assert_class('rules', opts.delete(:rules), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::TierRule) ? x : ::Io::Flow::V0::Models::TierRule.new(x)) }
@@ -11503,11 +11774,12 @@ module Io
11503
11774
  # Express tier, Economy tier
11504
11775
  class TierForm
11505
11776
 
11506
- attr_reader :experience, :integration, :name, :rules, :services, :strategy, :visibility
11777
+ attr_reader :currency, :experience, :integration, :name, :rules, :services, :strategy, :visibility
11507
11778
 
11508
11779
  def initialize(incoming={})
11509
11780
  opts = HttpClient::Helper.symbolize_keys(incoming)
11510
- HttpClient::Preconditions.require_keys(opts, [:experience, :integration, :name, :rules, :services, :strategy, :visibility], 'TierForm')
11781
+ HttpClient::Preconditions.require_keys(opts, [:currency, :experience, :integration, :name, :rules, :services, :strategy, :visibility], 'TierForm')
11782
+ @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
11511
11783
  @experience = HttpClient::Preconditions.assert_class('experience', opts.delete(:experience), String)
11512
11784
  @integration = (x = opts.delete(:integration); x.is_a?(::Io::Flow::V0::Models::ShipmentIntegrationType) ? x : ::Io::Flow::V0::Models::ShipmentIntegrationType.apply(x))
11513
11785
  @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
@@ -11527,6 +11799,7 @@ module Io
11527
11799
 
11528
11800
  def to_hash
11529
11801
  {
11802
+ :currency => currency,
11530
11803
  :experience => experience,
11531
11804
  :integration => integration.value,
11532
11805
  :name => name,
@@ -11603,7 +11876,7 @@ module Io
11603
11876
  opts = HttpClient::Helper.symbolize_keys(incoming)
11604
11877
  HttpClient::Preconditions.require_keys(opts, [:id, :experience, :integration, :name, :rules, :services, :strategy, :visibility], 'TierSummary')
11605
11878
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
11606
- @experience = (x = opts.delete(:experience); x.is_a?(::Io::Flow::V0::Models::ExperienceSummary) ? x : ::Io::Flow::V0::Models::ExperienceSummary.new(x))
11879
+ @experience = (x = opts.delete(:experience); x.is_a?(::Io::Flow::V0::Models::FulfillmentExperienceReference) ? x : ::Io::Flow::V0::Models::FulfillmentExperienceReference.new(x))
11607
11880
  @integration = (x = opts.delete(:integration); x.is_a?(::Io::Flow::V0::Models::ShipmentIntegrationType) ? x : ::Io::Flow::V0::Models::ShipmentIntegrationType.apply(x))
11608
11881
  @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
11609
11882
  @rules = HttpClient::Preconditions.assert_class('rules', opts.delete(:rules), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::TierRule) ? x : ::Io::Flow::V0::Models::TierRule.new(x)) }
@@ -11861,7 +12134,7 @@ module Io
11861
12134
  opts = HttpClient::Helper.symbolize_keys(incoming)
11862
12135
  HttpClient::Preconditions.require_keys(opts, [:id, :status, :metadata], 'Tracking')
11863
12136
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
11864
- @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::Status) ? x : ::Io::Flow::V0::Models::Status.apply(x))
12137
+ @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::TrackingStatus) ? x : ::Io::Flow::V0::Models::TrackingStatus.apply(x))
11865
12138
  @metadata = HttpClient::Preconditions.assert_class('metadata', HttpClient::Helper.to_object(opts.delete(:metadata)), Hash)
11866
12139
  end
11867
12140
 
@@ -11889,13 +12162,11 @@ module Io
11889
12162
  # tracking number
11890
12163
  class TrackingForm
11891
12164
 
11892
- attr_reader :organization, :status, :metadata
12165
+ attr_reader :status, :metadata
11893
12166
 
11894
12167
  def initialize(incoming={})
11895
12168
  opts = HttpClient::Helper.symbolize_keys(incoming)
11896
- HttpClient::Preconditions.require_keys(opts, [:organization], 'TrackingForm')
11897
- @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
11898
- @status = (x = opts.delete(:status); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Status) ? x : ::Io::Flow::V0::Models::Status.apply(x)))
12169
+ @status = (x = opts.delete(:status); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::TrackingStatus) ? x : ::Io::Flow::V0::Models::TrackingStatus.apply(x)))
11899
12170
  @metadata = (x = opts.delete(:metadata); x.nil? ? nil : HttpClient::Preconditions.assert_class('metadata', HttpClient::Helper.to_object(x), Hash))
11900
12171
  end
11901
12172
 
@@ -11909,7 +12180,6 @@ module Io
11909
12180
 
11910
12181
  def to_hash
11911
12182
  {
11912
- :organization => organization,
11913
12183
  :status => status.nil? ? nil : status.value,
11914
12184
  :metadata => metadata
11915
12185
  }
@@ -11925,7 +12195,7 @@ module Io
11925
12195
  opts = HttpClient::Helper.symbolize_keys(incoming)
11926
12196
  HttpClient::Preconditions.require_keys(opts, [:id, :status], 'TrackingSummary')
11927
12197
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
11928
- @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::Status) ? x : ::Io::Flow::V0::Models::Status.apply(x))
12198
+ @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::TrackingStatus) ? x : ::Io::Flow::V0::Models::TrackingStatus.apply(x))
11929
12199
  end
11930
12200
 
11931
12201
  def to_json