flowcommerce 0.2.20 → 0.2.21

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: 8428501e2efb49365c317cad3ab87935641a633c
4
- data.tar.gz: 6e2c51771003a515df1f9dbb1ac4e374f03874e2
3
+ metadata.gz: 8e5a93926266838903971f3c491924549a0de61d
4
+ data.tar.gz: e8eb91d1d1c4815191395ca46d9ebcb1b3efce6d
5
5
  SHA512:
6
- metadata.gz: 1ef2330e31b6c91229e54c590057d27ecbccdd3b879e731f5eadd22ed979fdc4073d5010be47c0a211bad3909697dff8041d10997d3d24ca8ae3332a93ebf4d3
7
- data.tar.gz: 8950cc292dd9e72b7b35a5db2cd127cd9192d888aa384ad3616ac141a5632f02581a7c8b4aeeea678227048906d1e20c01330c1fe34ae86122e259bdf2df207d
6
+ metadata.gz: b75a8a2cbc58184ecfcf44d6f6ad89bd3f9a44633f6337e6100ce53e8c67f5fa8e01a8dbdb1a2f30e9b568cda076b82ca3fddc9e1ef5c7bfd3241ff05ec38e20
7
+ data.tar.gz: d3f018416fa98197800a47eef804769e60bbda78c486cb3219d2f9fb76e924c1fb194c151592c78579308b59b0c2e9d03a49adc7d3716304fb13ddbb4b427ba7
@@ -1,6 +1,6 @@
1
1
  # Generated by apidoc - http://www.apidoc.me
2
2
  # Service version: 0.3.28
3
- # apidoc:0.11.92 http://www.apidoc.me/flow/api/0.3.34/ruby_client
3
+ # apidoc:0.11.93 http://www.apidoc.me/flow/api/0.3.38/ruby_client
4
4
 
5
5
  require 'cgi'
6
6
  require 'net/http'
@@ -25,7 +25,7 @@ module Io
25
25
 
26
26
  BASE_URL = 'https://api.flow.io' unless defined?(Constants::BASE_URL)
27
27
  NAMESPACE = 'io.flow.v0' unless defined?(Constants::NAMESPACE)
28
- USER_AGENT = 'apidoc:0.11.92 http://www.apidoc.me/flow/api/0.3.34/ruby_client' unless defined?(Constants::USER_AGENT)
28
+ USER_AGENT = 'apidoc:0.11.93 http://www.apidoc.me/flow/api/0.3.38/ruby_client' unless defined?(Constants::USER_AGENT)
29
29
  VERSION = '0.3.28' unless defined?(Constants::VERSION)
30
30
  VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
31
31
 
@@ -76,6 +76,10 @@ module Io
76
76
  @catalogs ||= ::Io::Flow::V0::Clients::Catalogs.new(self)
77
77
  end
78
78
 
79
+ def credit_payments
80
+ @credit_payments ||= ::Io::Flow::V0::Clients::CreditPayments.new(self)
81
+ end
82
+
79
83
  def experiences
80
84
  @experiences ||= ::Io::Flow::V0::Clients::Experiences.new(self)
81
85
  end
@@ -541,6 +545,85 @@ module Io
541
545
 
542
546
  end
543
547
 
548
+ class CreditPayments
549
+
550
+ def initialize(client)
551
+ @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
552
+ end
553
+
554
+ def get(organization, incoming={})
555
+ HttpClient::Preconditions.assert_class('organization', organization, String)
556
+ opts = HttpClient::Helper.symbolize_keys(incoming)
557
+ query = {
558
+ :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
559
+ :key => (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, Array).map { |v| HttpClient::Preconditions.assert_class('key', v, String) }),
560
+ :order_number => (x = opts.delete(:order_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('order_number', x, String)),
561
+ :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
562
+ :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
563
+ :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String),
564
+ :expand => (x = opts.delete(:expand); x.nil? ? nil : HttpClient::Preconditions.assert_class('expand', x, Array).map { |v| HttpClient::Preconditions.assert_class('expand', v, String) })
565
+ }.delete_if { |k, v| v.nil? }
566
+ r = @client.request("/#{CGI.escape(organization)}/credit/payments").with_query(query).get
567
+ r.map { |x| ::Io::Flow::V0::Models::CreditPayment.new(x) }
568
+ end
569
+
570
+ def post(organization, credit_payment_form, incoming={})
571
+ HttpClient::Preconditions.assert_class('organization', organization, String)
572
+ opts = HttpClient::Helper.symbolize_keys(incoming)
573
+ query = {
574
+ :expand => (x = opts.delete(:expand); x.nil? ? nil : HttpClient::Preconditions.assert_class('expand', x, Array).map { |v| HttpClient::Preconditions.assert_class('expand', v, String) })
575
+ }.delete_if { |k, v| v.nil? }
576
+ (x = credit_payment_form; x.is_a?(::Io::Flow::V0::Models::CreditPaymentForm) ? x : ::Io::Flow::V0::Models::CreditPaymentForm.new(x))
577
+ r = @client.request("/#{CGI.escape(organization)}/credit/payments").with_query(query).with_json(credit_payment_form.to_json).post
578
+ ::Io::Flow::V0::Models::CreditPayment.new(r)
579
+ end
580
+
581
+ def get_by_key(organization, key, incoming={})
582
+ HttpClient::Preconditions.assert_class('organization', organization, String)
583
+ HttpClient::Preconditions.assert_class('key', key, String)
584
+ opts = HttpClient::Helper.symbolize_keys(incoming)
585
+ query = {
586
+ :expand => (x = opts.delete(:expand); x.nil? ? nil : HttpClient::Preconditions.assert_class('expand', x, Array).map { |v| HttpClient::Preconditions.assert_class('expand', v, String) })
587
+ }.delete_if { |k, v| v.nil? }
588
+ r = @client.request("/#{CGI.escape(organization)}/credit/payments/#{CGI.escape(key)}").with_query(query).get
589
+ ::Io::Flow::V0::Models::CreditPayment.new(r)
590
+ end
591
+
592
+ def put_by_key(organization, key, credit_payment_put_form, incoming={})
593
+ HttpClient::Preconditions.assert_class('organization', organization, String)
594
+ HttpClient::Preconditions.assert_class('key', key, String)
595
+ opts = HttpClient::Helper.symbolize_keys(incoming)
596
+ query = {
597
+ :expand => (x = opts.delete(:expand); x.nil? ? nil : HttpClient::Preconditions.assert_class('expand', x, Array).map { |v| HttpClient::Preconditions.assert_class('expand', v, String) })
598
+ }.delete_if { |k, v| v.nil? }
599
+ (x = credit_payment_put_form; x.is_a?(::Io::Flow::V0::Models::CreditPaymentPutForm) ? x : ::Io::Flow::V0::Models::CreditPaymentPutForm.new(x))
600
+ r = @client.request("/#{CGI.escape(organization)}/credit/payments/#{CGI.escape(key)}").with_query(query).with_json(credit_payment_put_form.to_json).put
601
+ ::Io::Flow::V0::Models::CreditPayment.new(r)
602
+ end
603
+
604
+ def delete_by_key(organization, key)
605
+ HttpClient::Preconditions.assert_class('organization', organization, String)
606
+ HttpClient::Preconditions.assert_class('key', key, String)
607
+ r = @client.request("/#{CGI.escape(organization)}/credit/payments/#{CGI.escape(key)}").delete
608
+ nil
609
+ end
610
+
611
+ def get_versions(organization, incoming={})
612
+ HttpClient::Preconditions.assert_class('organization', organization, String)
613
+ opts = HttpClient::Helper.symbolize_keys(incoming)
614
+ query = {
615
+ :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
616
+ :key => (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, Array).map { |v| HttpClient::Preconditions.assert_class('key', v, String) }),
617
+ :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
618
+ :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
619
+ :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
620
+ }.delete_if { |k, v| v.nil? }
621
+ r = @client.request("/#{CGI.escape(organization)}/credit/payments/versions").with_query(query).get
622
+ r.map { |x| ::Io::Flow::V0::Models::CreditPaymentVersion.new(x) }
623
+ end
624
+
625
+ end
626
+
544
627
  class Experiences
545
628
 
546
629
  def initialize(client)
@@ -4766,6 +4849,75 @@ module Io
4766
4849
 
4767
4850
  end
4768
4851
 
4852
+ # A delivery represents a group of items that will be delivered together -
4853
+ # presenting a single price and delivery time frame, where applicable, to the
4854
+ # user. Deliveries commonly are created based on the type of item and, for
4855
+ # physical goods, their center of origin
4856
+ class Delivery
4857
+
4858
+ module Types
4859
+ # Represents items that can be delivered electronically (e.g. a gift card
4860
+ # delivered via email)
4861
+ DIGITAL_DELIVERY = 'digital_delivery' unless defined?(DIGITAL_DELIVERY)
4862
+ # Represents items that are physical and require shipment
4863
+ PHYSICAL_DELIVERY = 'physical_delivery' unless defined?(PHYSICAL_DELIVERY)
4864
+ end
4865
+
4866
+ attr_reader :discriminator
4867
+
4868
+ def initialize(incoming={})
4869
+ opts = HttpClient::Helper.symbolize_keys(incoming)
4870
+ HttpClient::Preconditions.require_keys(opts, [:discriminator], 'Delivery')
4871
+ @discriminator = HttpClient::Preconditions.assert_class('discriminator', opts.delete(:discriminator), String)
4872
+ end
4873
+
4874
+ def subtype_to_hash
4875
+ raise 'Cannot serialize an instance of delivery directly - must use one of the specific types: digital_delivery, physical_delivery'
4876
+ end
4877
+
4878
+ def to_hash
4879
+ subtype_to_hash.merge(:discriminator => @discriminator)
4880
+ end
4881
+
4882
+ def Delivery.from_json(hash)
4883
+ HttpClient::Preconditions.assert_class('hash', hash, Hash)
4884
+ discriminator = HttpClient::Helper.symbolize_keys(hash)[:discriminator].to_s.strip
4885
+ if discriminator.empty?
4886
+ raise "Union type[delivery] requires a field named 'discriminator'"
4887
+ end
4888
+ case discriminator
4889
+ when Types::DIGITAL_DELIVERY; DigitalDelivery.new(hash)
4890
+ when Types::PHYSICAL_DELIVERY; PhysicalDelivery.new(hash)
4891
+ else DeliveryUndefinedType.new(:discriminator => discriminator)
4892
+ end
4893
+ end
4894
+
4895
+ end
4896
+
4897
+ class DeliveryUndefinedType < Delivery
4898
+
4899
+ attr_reader :name
4900
+
4901
+ def initialize(incoming={})
4902
+ super(:discriminator => 'undefined_type')
4903
+ opts = HttpClient::Helper.symbolize_keys(incoming)
4904
+ @name = HttpClient::Preconditions.assert_class('name', opts.delete(:discriminator), String)
4905
+ end
4906
+
4907
+ def subtype_to_hash
4908
+ raise 'Unable to serialize undefined type to json'
4909
+ end
4910
+
4911
+ def copy(incoming={})
4912
+ raise 'Operation not supported for undefined type'
4913
+ end
4914
+
4915
+ def to_hash
4916
+ raise 'Operation not supported for undefined type'
4917
+ end
4918
+
4919
+ end
4920
+
4769
4921
  # De Minimis describes the country specific rules for exactly how tax and duties
4770
4922
  # are calculated, as well as any exemptions that apply. See
4771
4923
  # https://en.wikipedia.org/wiki/De_minimis for more information.
@@ -5289,6 +5441,68 @@ module Io
5289
5441
 
5290
5442
  end
5291
5443
 
5444
+ class ExpandableOrder
5445
+
5446
+ module Types
5447
+ ORDER = 'order' unless defined?(ORDER)
5448
+ ORDER_REFERENCE = 'order_reference' unless defined?(ORDER_REFERENCE)
5449
+ end
5450
+
5451
+ attr_reader :discriminator
5452
+
5453
+ def initialize(incoming={})
5454
+ opts = HttpClient::Helper.symbolize_keys(incoming)
5455
+ HttpClient::Preconditions.require_keys(opts, [:discriminator], 'ExpandableOrder')
5456
+ @discriminator = HttpClient::Preconditions.assert_class('discriminator', opts.delete(:discriminator), String)
5457
+ end
5458
+
5459
+ def subtype_to_hash
5460
+ raise 'Cannot serialize an instance of expandable_order directly - must use one of the specific types: order, order_reference'
5461
+ end
5462
+
5463
+ def to_hash
5464
+ subtype_to_hash.merge(:discriminator => @discriminator)
5465
+ end
5466
+
5467
+ def ExpandableOrder.from_json(hash)
5468
+ HttpClient::Preconditions.assert_class('hash', hash, Hash)
5469
+ discriminator = HttpClient::Helper.symbolize_keys(hash)[:discriminator].to_s.strip
5470
+ if discriminator.empty?
5471
+ raise "Union type[expandable_order] requires a field named 'discriminator'"
5472
+ end
5473
+ case discriminator
5474
+ when Types::ORDER; Order.new(hash)
5475
+ when Types::ORDER_REFERENCE; OrderReference.new(hash)
5476
+ else ExpandableOrderUndefinedType.new(:discriminator => discriminator)
5477
+ end
5478
+ end
5479
+
5480
+ end
5481
+
5482
+ class ExpandableOrderUndefinedType < ExpandableOrder
5483
+
5484
+ attr_reader :name
5485
+
5486
+ def initialize(incoming={})
5487
+ super(:discriminator => 'undefined_type')
5488
+ opts = HttpClient::Helper.symbolize_keys(incoming)
5489
+ @name = HttpClient::Preconditions.assert_class('name', opts.delete(:discriminator), String)
5490
+ end
5491
+
5492
+ def subtype_to_hash
5493
+ raise 'Unable to serialize undefined type to json'
5494
+ end
5495
+
5496
+ def copy(incoming={})
5497
+ raise 'Operation not supported for undefined type'
5498
+ end
5499
+
5500
+ def to_hash
5501
+ raise 'Operation not supported for undefined type'
5502
+ end
5503
+
5504
+ end
5505
+
5292
5506
  class ExpandableOrganization
5293
5507
 
5294
5508
  module Types
@@ -5613,6 +5827,7 @@ module Io
5613
5827
  HARMONIZATION_OVERVIEW_EXPORT_TYPE = 'harmonization_overview_export_type' unless defined?(HARMONIZATION_OVERVIEW_EXPORT_TYPE)
5614
5828
  HARMONIZATION_HS6_EXPORT_TYPE = 'harmonization_hs6_export_type' unless defined?(HARMONIZATION_HS6_EXPORT_TYPE)
5615
5829
  HARMONIZATION_HS10_EXPORT_TYPE = 'harmonization_hs10_export_type' unless defined?(HARMONIZATION_HS10_EXPORT_TYPE)
5830
+ UNHARMONIZED_ITEM_EXPORT_TYPE = 'unharmonized_item_export_type' unless defined?(UNHARMONIZED_ITEM_EXPORT_TYPE)
5616
5831
  ORDER_EXPORT_TYPE = 'order_export_type' unless defined?(ORDER_EXPORT_TYPE)
5617
5832
  SOLIDUS_PRODUCT_EXPORT_TYPE = 'solidus_product_export_type' unless defined?(SOLIDUS_PRODUCT_EXPORT_TYPE)
5618
5833
  SOLIDUS_VARIANT_EXPORT_TYPE = 'solidus_variant_export_type' unless defined?(SOLIDUS_VARIANT_EXPORT_TYPE)
@@ -5627,7 +5842,7 @@ module Io
5627
5842
  end
5628
5843
 
5629
5844
  def subtype_to_hash
5630
- raise 'Cannot serialize an instance of export_type directly - must use one of the specific types: account_transactions_export_type, account_orders_export_type, catalog_item_export_type, harmonization_overview_export_type, harmonization_hs6_export_type, harmonization_hs10_export_type, order_export_type, solidus_product_export_type, solidus_variant_export_type'
5845
+ raise 'Cannot serialize an instance of export_type directly - must use one of the specific types: account_transactions_export_type, account_orders_export_type, catalog_item_export_type, harmonization_overview_export_type, harmonization_hs6_export_type, harmonization_hs10_export_type, unharmonized_item_export_type, order_export_type, solidus_product_export_type, solidus_variant_export_type'
5631
5846
  end
5632
5847
 
5633
5848
  def to_hash
@@ -5647,6 +5862,7 @@ module Io
5647
5862
  when Types::HARMONIZATION_OVERVIEW_EXPORT_TYPE; HarmonizationOverviewExportType.new(hash)
5648
5863
  when Types::HARMONIZATION_HS6_EXPORT_TYPE; HarmonizationHs6ExportType.new(hash)
5649
5864
  when Types::HARMONIZATION_HS10_EXPORT_TYPE; HarmonizationHs10ExportType.new(hash)
5865
+ when Types::UNHARMONIZED_ITEM_EXPORT_TYPE; UnharmonizedItemExportType.new(hash)
5650
5866
  when Types::ORDER_EXPORT_TYPE; OrderExportType.new(hash)
5651
5867
  when Types::SOLIDUS_PRODUCT_EXPORT_TYPE; SolidusProductExportType.new(hash)
5652
5868
  when Types::SOLIDUS_VARIANT_EXPORT_TYPE; SolidusVariantExportType.new(hash)
@@ -7336,6 +7552,75 @@ module Io
7336
7552
 
7337
7553
  end
7338
7554
 
7555
+ class CreditPaymentErrorCode
7556
+
7557
+ attr_reader :value
7558
+
7559
+ def initialize(value)
7560
+ @value = HttpClient::Preconditions.assert_class('value', value, String)
7561
+ end
7562
+
7563
+ # Returns the instance of CreditPaymentErrorCode for this value, creating a new instance for an unknown value
7564
+ def CreditPaymentErrorCode.apply(value)
7565
+ if value.instance_of?(CreditPaymentErrorCode)
7566
+ value
7567
+ else
7568
+ HttpClient::Preconditions.assert_class_or_nil('value', value, String)
7569
+ value.nil? ? nil : (from_string(value) || CreditPaymentErrorCode.new(value))
7570
+ end
7571
+ end
7572
+
7573
+ # Returns the instance of CreditPaymentErrorCode for this value, or nil if not found
7574
+ def CreditPaymentErrorCode.from_string(value)
7575
+ HttpClient::Preconditions.assert_class('value', value, String)
7576
+ CreditPaymentErrorCode.ALL.find { |v| v.value == value }
7577
+ end
7578
+
7579
+ def CreditPaymentErrorCode.ALL
7580
+ @@all ||= [CreditPaymentErrorCode.generic_error, CreditPaymentErrorCode.invalid_order_number, CreditPaymentErrorCode.invalid_currency, CreditPaymentErrorCode.invalid_description, CreditPaymentErrorCode.duplicate, CreditPaymentErrorCode.amount_must_be_positive, CreditPaymentErrorCode.amount_exceeds_balance]
7581
+ end
7582
+
7583
+ def CreditPaymentErrorCode.generic_error
7584
+ @@_generic_error ||= CreditPaymentErrorCode.new('generic_error')
7585
+ end
7586
+
7587
+ # Indicates the specified order does not exist
7588
+ def CreditPaymentErrorCode.invalid_order_number
7589
+ @@_invalid_order_number ||= CreditPaymentErrorCode.new('invalid_order_number')
7590
+ end
7591
+
7592
+ # Indicates that the specified currency code is not valid
7593
+ def CreditPaymentErrorCode.invalid_currency
7594
+ @@_invalid_currency ||= CreditPaymentErrorCode.new('invalid_currency')
7595
+ end
7596
+
7597
+ # Indicates that the description is invalid (must be non-empty)
7598
+ def CreditPaymentErrorCode.invalid_description
7599
+ @@_invalid_description ||= CreditPaymentErrorCode.new('invalid_description')
7600
+ end
7601
+
7602
+ # Indicates that a credit payment with the specified key already exists
7603
+ def CreditPaymentErrorCode.duplicate
7604
+ @@_duplicate ||= CreditPaymentErrorCode.new('duplicate')
7605
+ end
7606
+
7607
+ # Indicates the provided credit amount was <= 0
7608
+ def CreditPaymentErrorCode.amount_must_be_positive
7609
+ @@_amount_must_be_positive ||= CreditPaymentErrorCode.new('amount_must_be_positive')
7610
+ end
7611
+
7612
+ # Indicates the provided credit amount exceeds the remaining balance on the
7613
+ # order
7614
+ def CreditPaymentErrorCode.amount_exceeds_balance
7615
+ @@_amount_exceeds_balance ||= CreditPaymentErrorCode.new('amount_exceeds_balance')
7616
+ end
7617
+
7618
+ def to_hash
7619
+ value
7620
+ end
7621
+
7622
+ end
7623
+
7339
7624
  class CvvCode
7340
7625
 
7341
7626
  attr_reader :value
@@ -10268,18 +10553,18 @@ module Io
10268
10553
  @@all ||= [SubcatalogItemStatus.excluded, SubcatalogItemStatus.included, SubcatalogItemStatus.restricted]
10269
10554
  end
10270
10555
 
10271
- # Item is excluded based on targeting query. This is separate from an item
10272
- # marked as restricted.
10556
+ # The user has chosen to exclude the item from the associated subcatalog.
10273
10557
  def SubcatalogItemStatus.excluded
10274
10558
  @@_excluded ||= SubcatalogItemStatus.new('excluded')
10275
10559
  end
10276
10560
 
10277
- # Item is included
10561
+ # The item is included in the associated subcatalog.
10278
10562
  def SubcatalogItemStatus.included
10279
10563
  @@_included ||= SubcatalogItemStatus.new('included')
10280
10564
  end
10281
10565
 
10282
- # Item is restricted and will be treated as excluded
10566
+ # Item is not allowed to be sold in the market associated with the given
10567
+ # subcatalog.
10283
10568
  def SubcatalogItemStatus.restricted
10284
10569
  @@_restricted ||= SubcatalogItemStatus.new('restricted')
10285
10570
  end
@@ -13688,6 +13973,181 @@ module Io
13688
13973
 
13689
13974
  end
13690
13975
 
13976
+ # A Credit Payment records a 'non cash' payment against an order (e.g. a store
13977
+ # credit, gift card, etc.), recording the amount of that credit and additional
13978
+ # details to reconcile payments. The primary purpose of the credit payment is to
13979
+ # record that a payment has been made against an order so the remaining balance
13980
+ # can be correctly computed.
13981
+ class CreditPayment
13982
+
13983
+ attr_reader :id, :order, :key, :description, :value, :original, :attributes
13984
+
13985
+ def initialize(incoming={})
13986
+ opts = HttpClient::Helper.symbolize_keys(incoming)
13987
+ HttpClient::Preconditions.require_keys(opts, [:id, :order, :key, :description, :value, :original, :attributes], 'CreditPayment')
13988
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
13989
+ @order = (x = opts.delete(:order); x.is_a?(::Io::Flow::V0::Models::ExpandableOrder) ? x : ::Io::Flow::V0::Models::ExpandableOrder.from_json(x))
13990
+ @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
13991
+ @description = HttpClient::Preconditions.assert_class('description', opts.delete(:description), String)
13992
+ @value = (x = opts.delete(:value); x.is_a?(::Io::Flow::V0::Models::PriceWithBase) ? x : ::Io::Flow::V0::Models::PriceWithBase.new(x))
13993
+ @original = (x = opts.delete(:original); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x))
13994
+ @attributes = HttpClient::Preconditions.assert_class('attributes', opts.delete(:attributes), Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h }
13995
+ end
13996
+
13997
+ def to_json
13998
+ JSON.dump(to_hash)
13999
+ end
14000
+
14001
+ def copy(incoming={})
14002
+ CreditPayment.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
14003
+ end
14004
+
14005
+ def to_hash
14006
+ {
14007
+ :id => id,
14008
+ :order => order.to_hash,
14009
+ :key => key,
14010
+ :description => description,
14011
+ :value => value.to_hash,
14012
+ :original => original.to_hash,
14013
+ :attributes => attributes
14014
+ }
14015
+ end
14016
+
14017
+ end
14018
+
14019
+ class CreditPaymentError
14020
+
14021
+ attr_reader :code, :messages, :codes
14022
+
14023
+ def initialize(incoming={})
14024
+ opts = HttpClient::Helper.symbolize_keys(incoming)
14025
+ HttpClient::Preconditions.require_keys(opts, [:code, :messages, :codes], 'CreditPaymentError')
14026
+ @code = (x = opts.delete(:code); x.is_a?(::Io::Flow::V0::Models::CreditPaymentErrorCode) ? x : ::Io::Flow::V0::Models::CreditPaymentErrorCode.apply(x))
14027
+ @messages = HttpClient::Preconditions.assert_class('messages', opts.delete(:messages), Array).map { |v| HttpClient::Preconditions.assert_class('messages', v, String) }
14028
+ @codes = HttpClient::Preconditions.assert_class('codes', opts.delete(:codes), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::CreditPaymentErrorCode) ? x : ::Io::Flow::V0::Models::CreditPaymentErrorCode.apply(x)) }
14029
+ end
14030
+
14031
+ def to_json
14032
+ JSON.dump(to_hash)
14033
+ end
14034
+
14035
+ def copy(incoming={})
14036
+ CreditPaymentError.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
14037
+ end
14038
+
14039
+ def to_hash
14040
+ {
14041
+ :code => code.value,
14042
+ :messages => messages,
14043
+ :codes => codes.map { |o| o.value }
14044
+ }
14045
+ end
14046
+
14047
+ end
14048
+
14049
+ class CreditPaymentForm
14050
+
14051
+ attr_reader :order_number, :key, :description, :amount, :currency, :attributes
14052
+
14053
+ def initialize(incoming={})
14054
+ opts = HttpClient::Helper.symbolize_keys(incoming)
14055
+ HttpClient::Preconditions.require_keys(opts, [:order_number, :description, :amount, :currency], 'CreditPaymentForm')
14056
+ @order_number = HttpClient::Preconditions.assert_class('order_number', opts.delete(:order_number), String)
14057
+ @key = (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, String))
14058
+ @description = HttpClient::Preconditions.assert_class('description', opts.delete(:description), String)
14059
+ @amount = HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(opts.delete(:amount)), BigDecimal)
14060
+ @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
14061
+ @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 })
14062
+ end
14063
+
14064
+ def to_json
14065
+ JSON.dump(to_hash)
14066
+ end
14067
+
14068
+ def copy(incoming={})
14069
+ CreditPaymentForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
14070
+ end
14071
+
14072
+ def to_hash
14073
+ {
14074
+ :order_number => order_number,
14075
+ :key => key,
14076
+ :description => description,
14077
+ :amount => amount,
14078
+ :currency => currency,
14079
+ :attributes => attributes.nil? ? nil : attributes
14080
+ }
14081
+ end
14082
+
14083
+ end
14084
+
14085
+ class CreditPaymentPutForm
14086
+
14087
+ attr_reader :order_number, :description, :amount, :currency, :attributes
14088
+
14089
+ def initialize(incoming={})
14090
+ opts = HttpClient::Helper.symbolize_keys(incoming)
14091
+ HttpClient::Preconditions.require_keys(opts, [:order_number, :description, :amount, :currency], 'CreditPaymentPutForm')
14092
+ @order_number = HttpClient::Preconditions.assert_class('order_number', opts.delete(:order_number), String)
14093
+ @description = HttpClient::Preconditions.assert_class('description', opts.delete(:description), String)
14094
+ @amount = HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(opts.delete(:amount)), BigDecimal)
14095
+ @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
14096
+ @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 })
14097
+ end
14098
+
14099
+ def to_json
14100
+ JSON.dump(to_hash)
14101
+ end
14102
+
14103
+ def copy(incoming={})
14104
+ CreditPaymentPutForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
14105
+ end
14106
+
14107
+ def to_hash
14108
+ {
14109
+ :order_number => order_number,
14110
+ :description => description,
14111
+ :amount => amount,
14112
+ :currency => currency,
14113
+ :attributes => attributes.nil? ? nil : attributes
14114
+ }
14115
+ end
14116
+
14117
+ end
14118
+
14119
+ class CreditPaymentVersion
14120
+
14121
+ attr_reader :id, :timestamp, :type, :credit_payment
14122
+
14123
+ def initialize(incoming={})
14124
+ opts = HttpClient::Helper.symbolize_keys(incoming)
14125
+ HttpClient::Preconditions.require_keys(opts, [:id, :timestamp, :type, :credit_payment], 'CreditPaymentVersion')
14126
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
14127
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
14128
+ @type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::ChangeType) ? x : ::Io::Flow::V0::Models::ChangeType.apply(x))
14129
+ @credit_payment = (x = opts.delete(:credit_payment); x.is_a?(::Io::Flow::V0::Models::CreditPayment) ? x : ::Io::Flow::V0::Models::CreditPayment.new(x))
14130
+ end
14131
+
14132
+ def to_json
14133
+ JSON.dump(to_hash)
14134
+ end
14135
+
14136
+ def copy(incoming={})
14137
+ CreditPaymentVersion.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
14138
+ end
14139
+
14140
+ def to_hash
14141
+ {
14142
+ :id => id,
14143
+ :timestamp => timestamp,
14144
+ :type => type.value,
14145
+ :credit_payment => credit_payment.to_hash
14146
+ }
14147
+ end
14148
+
14149
+ end
14150
+
13691
14151
  # ISO 4217 3-character currency code. See
13692
14152
  # https://api.flow.io/reference/currencies
13693
14153
  class Currency
@@ -13876,72 +14336,6 @@ module Io
13876
14336
 
13877
14337
  end
13878
14338
 
13879
- # Represents a collection of items, the available delivery option tier for that
13880
- # collection of items, and metadata about those options
13881
- class Delivery
13882
-
13883
- attr_reader :id, :center, :items, :options
13884
-
13885
- def initialize(incoming={})
13886
- opts = HttpClient::Helper.symbolize_keys(incoming)
13887
- HttpClient::Preconditions.require_keys(opts, [:id, :items, :options], 'Delivery')
13888
- @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
13889
- @center = (x = opts.delete(:center); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::CenterSummary) ? x : ::Io::Flow::V0::Models::CenterSummary.new(x)))
13890
- @items = HttpClient::Preconditions.assert_class('items', opts.delete(:items), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::LineItemForm) ? x : ::Io::Flow::V0::Models::LineItemForm.new(x)) }
13891
- @options = HttpClient::Preconditions.assert_class('options', opts.delete(:options), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::DeliveryOption) ? x : ::Io::Flow::V0::Models::DeliveryOption.new(x)) }
13892
- end
13893
-
13894
- def to_json
13895
- JSON.dump(to_hash)
13896
- end
13897
-
13898
- def copy(incoming={})
13899
- Delivery.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
13900
- end
13901
-
13902
- def to_hash
13903
- {
13904
- :id => id,
13905
- :center => center.nil? ? nil : center.to_hash,
13906
- :items => items.map { |o| o.to_hash },
13907
- :options => options.map { |o| o.to_hash }
13908
- }
13909
- end
13910
-
13911
- end
13912
-
13913
- # Represents a collection of items, the available delivery option tier for that
13914
- # collection of items, and metadata about those options
13915
- class DeliveryForm
13916
-
13917
- attr_reader :quote, :items, :destination
13918
-
13919
- def initialize(incoming={})
13920
- opts = HttpClient::Helper.symbolize_keys(incoming)
13921
- HttpClient::Preconditions.require_keys(opts, [:quote, :items, :destination], 'DeliveryForm')
13922
- @quote = HttpClient::Preconditions.assert_class('quote', opts.delete(:quote), String)
13923
- @items = HttpClient::Preconditions.assert_class('items', opts.delete(:items), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::LineItemForm) ? x : ::Io::Flow::V0::Models::LineItemForm.new(x)) }
13924
- @destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::ShippingAddress) ? x : ::Io::Flow::V0::Models::ShippingAddress.new(x))
13925
- end
13926
-
13927
- def to_json
13928
- JSON.dump(to_hash)
13929
- end
13930
-
13931
- def copy(incoming={})
13932
- DeliveryForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
13933
- end
13934
-
13935
- def to_hash
13936
- {
13937
- :quote => quote,
13938
- :items => items.map { |o| o.to_hash },
13939
- :destination => destination.to_hash
13940
- }
13941
- end
13942
-
13943
- end
13944
-
13945
14339
  # Represents a way to fulfill a delivery, including an estimates for the date
13946
14340
  # range and cost
13947
14341
  class DeliveryOption
@@ -14272,6 +14666,37 @@ module Io
14272
14666
 
14273
14667
  end
14274
14668
 
14669
+ # Represents a collection of items that are digitally available and do not
14670
+ # require a physical shipment
14671
+ class DigitalDelivery < Delivery
14672
+
14673
+ attr_reader :id, :items
14674
+
14675
+ def initialize(incoming={})
14676
+ super(:discriminator => Delivery::Types::DIGITAL_DELIVERY)
14677
+ opts = HttpClient::Helper.symbolize_keys(incoming)
14678
+ HttpClient::Preconditions.require_keys(opts, [:id, :items], 'DigitalDelivery')
14679
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
14680
+ @items = HttpClient::Preconditions.assert_class('items', opts.delete(:items), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::LineItemForm) ? x : ::Io::Flow::V0::Models::LineItemForm.new(x)) }
14681
+ end
14682
+
14683
+ def to_json
14684
+ JSON.dump(to_hash)
14685
+ end
14686
+
14687
+ def copy(incoming={})
14688
+ DigitalDelivery.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
14689
+ end
14690
+
14691
+ def subtype_to_hash
14692
+ {
14693
+ :id => id,
14694
+ :items => items.map { |o| o.to_hash }
14695
+ }
14696
+ end
14697
+
14698
+ end
14699
+
14275
14700
  class Dimension
14276
14701
 
14277
14702
  attr_reader :depth, :diameter, :length, :weight, :width
@@ -19641,11 +20066,12 @@ module Io
19641
20066
  # checkout, then to submit that order as part of the user submitting their
19642
20067
  # order. Note that Flow will automatically mark an order submitted if we see a
19643
20068
  # payment authorization for an order.
19644
- class Order
20069
+ class Order < ExpandableOrder
19645
20070
 
19646
20071
  attr_reader :id, :number, :experience, :customer, :delivered_duty, :destination, :expires_at, :items, :deliveries, :selections, :prices, :total, :attributes, :submitted_at, :lines, :identifiers, :promotions, :payments, :balance
19647
20072
 
19648
20073
  def initialize(incoming={})
20074
+ super(:discriminator => ExpandableOrder::Types::ORDER)
19649
20075
  opts = HttpClient::Helper.symbolize_keys(incoming)
19650
20076
  HttpClient::Preconditions.require_keys(opts, [:id, :number, :customer, :delivered_duty, :destination, :expires_at, :items, :deliveries, :selections, :prices, :total, :attributes], 'Order')
19651
20077
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
@@ -19656,7 +20082,7 @@ module Io
19656
20082
  @destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::OrderAddress) ? x : ::Io::Flow::V0::Models::OrderAddress.new(x))
19657
20083
  @expires_at = HttpClient::Preconditions.assert_class('expires_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:expires_at)), DateTime)
19658
20084
  @items = HttpClient::Preconditions.assert_class('items', opts.delete(:items), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::LocalizedLineItem) ? x : ::Io::Flow::V0::Models::LocalizedLineItem.new(x)) }
19659
- @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)) }
20085
+ @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.from_json(x)) }
19660
20086
  @selections = HttpClient::Preconditions.assert_class('selections', opts.delete(:selections), Array).map { |v| HttpClient::Preconditions.assert_class('selections', v, String) }
19661
20087
  @prices = HttpClient::Preconditions.assert_class('prices', opts.delete(:prices), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::OrderPriceDetail) ? x : ::Io::Flow::V0::Models::OrderPriceDetail.new(x)) }
19662
20088
  @total = (x = opts.delete(:total); x.is_a?(::Io::Flow::V0::Models::LocalizedTotal) ? x : ::Io::Flow::V0::Models::LocalizedTotal.new(x))
@@ -19674,10 +20100,10 @@ module Io
19674
20100
  end
19675
20101
 
19676
20102
  def copy(incoming={})
19677
- Order.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
20103
+ Order.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
19678
20104
  end
19679
20105
 
19680
- def to_hash
20106
+ def subtype_to_hash
19681
20107
  {
19682
20108
  :id => id,
19683
20109
  :number => number,
@@ -19820,7 +20246,7 @@ module Io
19820
20246
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
19821
20247
  @items = HttpClient::Preconditions.assert_class('items', opts.delete(:items), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::LocalizedLineItem) ? x : ::Io::Flow::V0::Models::LocalizedLineItem.new(x)) }
19822
20248
  @destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::OrderAddress) ? x : ::Io::Flow::V0::Models::OrderAddress.new(x))
19823
- @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)) }
20249
+ @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.from_json(x)) }
19824
20250
  @prices = HttpClient::Preconditions.assert_class('prices', opts.delete(:prices), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::OrderPriceDetail) ? x : ::Io::Flow::V0::Models::OrderPriceDetail.new(x)) }
19825
20251
  @selections = HttpClient::Preconditions.assert_class('selections', opts.delete(:selections), Array).map { |v| HttpClient::Preconditions.assert_class('selections', v, String) }
19826
20252
  @total = (x = opts.delete(:total); x.is_a?(::Io::Flow::V0::Models::LocalizedTotal) ? x : ::Io::Flow::V0::Models::LocalizedTotal.new(x))
@@ -20298,11 +20724,12 @@ module Io
20298
20724
 
20299
20725
  end
20300
20726
 
20301
- class OrderReference
20727
+ class OrderReference < ExpandableOrder
20302
20728
 
20303
20729
  attr_reader :id, :number
20304
20730
 
20305
20731
  def initialize(incoming={})
20732
+ super(:discriminator => ExpandableOrder::Types::ORDER_REFERENCE)
20306
20733
  opts = HttpClient::Helper.symbolize_keys(incoming)
20307
20734
  HttpClient::Preconditions.require_keys(opts, [:id, :number], 'OrderReference')
20308
20735
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
@@ -20314,10 +20741,10 @@ module Io
20314
20741
  end
20315
20742
 
20316
20743
  def copy(incoming={})
20317
- OrderReference.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
20744
+ OrderReference.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
20318
20745
  end
20319
20746
 
20320
- def to_hash
20747
+ def subtype_to_hash
20321
20748
  {
20322
20749
  :id => id,
20323
20750
  :number => number
@@ -21706,6 +22133,41 @@ module Io
21706
22133
 
21707
22134
  end
21708
22135
 
22136
+ # Represents a collection of items, the available delivery option tier for that
22137
+ # collection of items, and metadata about those options
22138
+ class PhysicalDelivery < Delivery
22139
+
22140
+ attr_reader :id, :center, :items, :options
22141
+
22142
+ def initialize(incoming={})
22143
+ super(:discriminator => Delivery::Types::PHYSICAL_DELIVERY)
22144
+ opts = HttpClient::Helper.symbolize_keys(incoming)
22145
+ HttpClient::Preconditions.require_keys(opts, [:id, :items, :options], 'PhysicalDelivery')
22146
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
22147
+ @center = (x = opts.delete(:center); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::CenterSummary) ? x : ::Io::Flow::V0::Models::CenterSummary.new(x)))
22148
+ @items = HttpClient::Preconditions.assert_class('items', opts.delete(:items), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::LineItemForm) ? x : ::Io::Flow::V0::Models::LineItemForm.new(x)) }
22149
+ @options = HttpClient::Preconditions.assert_class('options', opts.delete(:options), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::DeliveryOption) ? x : ::Io::Flow::V0::Models::DeliveryOption.new(x)) }
22150
+ end
22151
+
22152
+ def to_json
22153
+ JSON.dump(to_hash)
22154
+ end
22155
+
22156
+ def copy(incoming={})
22157
+ PhysicalDelivery.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
22158
+ end
22159
+
22160
+ def subtype_to_hash
22161
+ {
22162
+ :id => id,
22163
+ :center => center.nil? ? nil : center.to_hash,
22164
+ :items => items.map { |o| o.to_hash },
22165
+ :options => options.map { |o| o.to_hash }
22166
+ }
22167
+ end
22168
+
22169
+ end
22170
+
21709
22171
  # Represents an amount-currency pair for a basic price
21710
22172
  class Price
21711
22173
 
@@ -22319,7 +22781,7 @@ module Io
22319
22781
  HttpClient::Preconditions.require_keys(opts, [:id, :destination, :deliveries, :selections], 'Quote')
22320
22782
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
22321
22783
  @destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::ShippingAddress) ? x : ::Io::Flow::V0::Models::ShippingAddress.new(x))
22322
- @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)) }
22784
+ @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.from_json(x)) }
22323
22785
  @selections = HttpClient::Preconditions.assert_class('selections', opts.delete(:selections), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::DeliveryOptionReference) ? x : ::Io::Flow::V0::Models::DeliveryOptionReference.new(x)) }
22324
22786
  @delivered_duty = (x = (x = opts.delete(:delivered_duty); x.nil? ? "paid" : x); x.is_a?(::Io::Flow::V0::Models::DeliveredDuty) ? x : ::Io::Flow::V0::Models::DeliveredDuty.apply(x))
22325
22787
  end
@@ -26193,6 +26655,44 @@ module Io
26193
26655
 
26194
26656
  end
26195
26657
 
26658
+ # Combines HS10 export and catalog item export for items that require
26659
+ # harmonization.
26660
+ class UnharmonizedItemExportType < ExportType
26661
+
26662
+ attr_reader :origin, :destination, :numbers, :has_codes, :has_origins, :sort
26663
+
26664
+ def initialize(incoming={})
26665
+ super(:discriminator => ExportType::Types::UNHARMONIZED_ITEM_EXPORT_TYPE)
26666
+ opts = HttpClient::Helper.symbolize_keys(incoming)
26667
+ @origin = (x = opts.delete(:origin); x.nil? ? nil : HttpClient::Preconditions.assert_class('origin', x, String))
26668
+ @destination = (x = opts.delete(:destination); x.nil? ? nil : HttpClient::Preconditions.assert_class('destination', x, String))
26669
+ @numbers = (x = opts.delete(:numbers); x.nil? ? nil : HttpClient::Preconditions.assert_class('numbers', x, Array).map { |v| HttpClient::Preconditions.assert_class('numbers', v, String) })
26670
+ @has_codes = (x = opts.delete(:has_codes); x.nil? ? nil : HttpClient::Preconditions.assert_boolean('has_codes', x))
26671
+ @has_origins = (x = opts.delete(:has_origins); x.nil? ? nil : HttpClient::Preconditions.assert_boolean('has_origins', x))
26672
+ @sort = (x = opts.delete(:sort); x.nil? ? nil : HttpClient::Preconditions.assert_class('sort', x, String))
26673
+ end
26674
+
26675
+ def to_json
26676
+ JSON.dump(to_hash)
26677
+ end
26678
+
26679
+ def copy(incoming={})
26680
+ UnharmonizedItemExportType.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
26681
+ end
26682
+
26683
+ def subtype_to_hash
26684
+ {
26685
+ :origin => origin,
26686
+ :destination => destination,
26687
+ :numbers => numbers.nil? ? nil : numbers,
26688
+ :has_codes => has_codes,
26689
+ :has_origins => has_origins,
26690
+ :sort => sort
26691
+ }
26692
+ end
26693
+
26694
+ end
26695
+
26196
26696
  # Provides the ability to upload a file to a URL (an expiring s3 url, usually
26197
26697
  # valid for 1 week)
26198
26698
  class Upload
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flowcommerce
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.20
4
+ version: 0.2.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Flow Commerce, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-12 00:00:00.000000000 Z
11
+ date: 2017-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json