flowcommerce 0.2.6 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 95fb117f02a2f7f0bfbd0624298cec59de13b4bd
4
- data.tar.gz: 33cdaf6e99b50906562d9c0ff886834680f398a2
3
+ metadata.gz: 5c71adcbf9bd7e85374c56c22b6f935652fa8530
4
+ data.tar.gz: 033bf60e80e1e045089fd9116c584d2fee3883cb
5
5
  SHA512:
6
- metadata.gz: 75ec30088fce5dde0489ef3a443c62564f82ff29385bef4204cee3a2444500675d8b6f144d5e7fa71a18926bdc007354885cad388c1c0958a694671015a9fd38
7
- data.tar.gz: be1ff1cf4ddf635f5998b6c27c2b580e4732c066f6d5b61cd50f45911ee2377285717c5c9d3b5fd71b539681d4c61c922b038a4fad3c2bf6bb6dece77fb58fdd
6
+ metadata.gz: b6ee7d89b51bdcfc3574c11b3c55d6986ad3ac7d593c79ec69b75429dd6871a0361254144345221f8fdd3b5c011798a983bab53f83018c4fb2910c944b799963
7
+ data.tar.gz: a413787fb98d480d25cf57498989660a3a936975b8fc960b98833faa25dae6de9946e09602f18f5fc12c9cfde5f2e2a7ea0018f7ad0961c0cbffb06bc6225e08
@@ -1,6 +1,6 @@
1
1
  # Generated by apidoc - http://www.apidoc.me
2
2
  # Service version: 0.2.87
3
- # apidoc:0.11.76 http://www.apidoc.me/flow/api/0.2.93/ruby_client
3
+ # apidoc:0.11.76 http://www.apidoc.me/flow/api/0.3.6/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.76 http://www.apidoc.me/flow/api/0.2.93/ruby_client' unless defined?(Constants::USER_AGENT)
28
+ USER_AGENT = 'apidoc:0.11.76 http://www.apidoc.me/flow/api/0.3.6/ruby_client' unless defined?(Constants::USER_AGENT)
29
29
  VERSION = '0.2.87' unless defined?(Constants::VERSION)
30
30
  VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
31
31
 
@@ -673,7 +673,7 @@ module Io
673
673
  HttpClient::Preconditions.assert_class('organization', organization, String)
674
674
  HttpClient::Preconditions.assert_class('key', key, String)
675
675
  r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(key)}/promotions/available").get
676
- r.map { |x| ::Io::Flow::V0::Models::AvailablePromotion.from_json(x) }
676
+ r.map { |x| ::Io::Flow::V0::Models::Promotion.from_json(x) }
677
677
  end
678
678
 
679
679
  # Formats the requested amount using the formatting settings for the
@@ -1088,9 +1088,13 @@ module Io
1088
1088
  # The countries resources provides a unique list of all of the countries for
1089
1089
  # which an experience exists. We generate this list of countries by iterating
1090
1090
  # through all of the experience regions, and collecting all of the countries.
1091
- def get_countries_by_organization(organization)
1091
+ def get_countries_by_organization(organization, incoming={})
1092
1092
  HttpClient::Preconditions.assert_class('organization', organization, String)
1093
- r = @client.request("/#{CGI.escape(organization)}/countries").get
1093
+ opts = HttpClient::Helper.symbolize_keys(incoming)
1094
+ query = {
1095
+ :country => (x = opts.delete(:country); x.nil? ? nil : HttpClient::Preconditions.assert_class('country', x, String))
1096
+ }.delete_if { |k, v| v.nil? }
1097
+ r = @client.request("/#{CGI.escape(organization)}/countries").with_query(query).get
1094
1098
  r.map { |x| ::Io::Flow::V0::Models::Country.new(x) }
1095
1099
  end
1096
1100
 
@@ -4029,6 +4033,12 @@ module Io
4029
4033
  ::Io::Flow::V0::Models::Session.from_json(r)
4030
4034
  end
4031
4035
 
4036
+ def delete_by_session(session)
4037
+ HttpClient::Preconditions.assert_class('session', session, String)
4038
+ r = @client.request("/sessions/#{CGI.escape(session)}").delete
4039
+ nil
4040
+ end
4041
+
4032
4042
  # Resets the session - returned session will be identical to the result of
4033
4043
  # using POST to create a session, except for we preserve the session id
4034
4044
  def put_reset_by_session(session, session_form)
@@ -4278,45 +4288,45 @@ module Io
4278
4288
 
4279
4289
  module Models
4280
4290
 
4281
- class Authorization
4291
+ class AllocationComponent
4282
4292
 
4283
4293
  module Types
4284
- CARD_AUTHORIZATION = 'card_authorization' unless defined?(CARD_AUTHORIZATION)
4285
- ONLINE_AUTHORIZATION = 'online_authorization' unless defined?(ONLINE_AUTHORIZATION)
4294
+ ALLOCATION_DETAIL_COMPONENT = 'allocation_detail_component' unless defined?(ALLOCATION_DETAIL_COMPONENT)
4295
+ ALLOCATION_LEVY_COMPONENT = 'allocation_levy_component' unless defined?(ALLOCATION_LEVY_COMPONENT)
4286
4296
  end
4287
4297
 
4288
4298
  attr_reader :discriminator
4289
4299
 
4290
4300
  def initialize(incoming={})
4291
4301
  opts = HttpClient::Helper.symbolize_keys(incoming)
4292
- HttpClient::Preconditions.require_keys(opts, [:discriminator], 'Authorization')
4302
+ HttpClient::Preconditions.require_keys(opts, [:discriminator], 'AllocationComponent')
4293
4303
  @discriminator = HttpClient::Preconditions.assert_class('discriminator', opts.delete(:discriminator), String)
4294
4304
  end
4295
4305
 
4296
4306
  def subtype_to_hash
4297
- raise 'Cannot serialize an instance of authorization directly - must use one of the specific types: card_authorization, online_authorization'
4307
+ raise 'Cannot serialize an instance of allocation_component directly - must use one of the specific types: allocation_detail_component, allocation_levy_component'
4298
4308
  end
4299
4309
 
4300
4310
  def to_hash
4301
4311
  subtype_to_hash.merge(:discriminator => @discriminator)
4302
4312
  end
4303
4313
 
4304
- def Authorization.from_json(hash)
4314
+ def AllocationComponent.from_json(hash)
4305
4315
  HttpClient::Preconditions.assert_class('hash', hash, Hash)
4306
4316
  discriminator = HttpClient::Helper.symbolize_keys(hash)[:discriminator].to_s.strip
4307
4317
  if discriminator.empty?
4308
- raise "Union type[authorization] requires a field named 'discriminator'"
4318
+ raise "Union type[allocation_component] requires a field named 'discriminator'"
4309
4319
  end
4310
4320
  case discriminator
4311
- when Types::CARD_AUTHORIZATION; CardAuthorization.new(hash)
4312
- when Types::ONLINE_AUTHORIZATION; OnlineAuthorization.new(hash)
4313
- else AuthorizationUndefinedType.new(:discriminator => discriminator)
4321
+ when Types::ALLOCATION_DETAIL_COMPONENT; AllocationDetailComponent.new(hash)
4322
+ when Types::ALLOCATION_LEVY_COMPONENT; AllocationLevyComponent.new(hash)
4323
+ else AllocationComponentUndefinedType.new(:discriminator => discriminator)
4314
4324
  end
4315
4325
  end
4316
4326
 
4317
4327
  end
4318
4328
 
4319
- class AuthorizationUndefinedType < Authorization
4329
+ class AllocationComponentUndefinedType < AllocationComponent
4320
4330
 
4321
4331
  attr_reader :name
4322
4332
 
@@ -4340,51 +4350,45 @@ module Io
4340
4350
 
4341
4351
  end
4342
4352
 
4343
- # Flow provides several different options for creating an authorization
4344
- class AuthorizationForm
4353
+ class AllocationDetail
4345
4354
 
4346
4355
  module Types
4347
- # Enables card payments
4348
- DIRECT_AUTHORIZATION_FORM = 'direct_authorization_form' unless defined?(DIRECT_AUTHORIZATION_FORM)
4349
- # Enables card payments with Flow as Merchant of Record
4350
- MERCHANT_OF_RECORD_AUTHORIZATION_FORM = 'merchant_of_record_authorization_form' unless defined?(MERCHANT_OF_RECORD_AUTHORIZATION_FORM)
4351
- # Enables authorization via paypal
4352
- PAYPAL_AUTHORIZATION_FORM = 'paypal_authorization_form' unless defined?(PAYPAL_AUTHORIZATION_FORM)
4356
+ ALLOCATION_LINE_DETAIL = 'allocation_line_detail' unless defined?(ALLOCATION_LINE_DETAIL)
4357
+ ALLOCATION_ORDER_DETAIL = 'allocation_order_detail' unless defined?(ALLOCATION_ORDER_DETAIL)
4353
4358
  end
4354
4359
 
4355
4360
  attr_reader :discriminator
4356
4361
 
4357
4362
  def initialize(incoming={})
4358
4363
  opts = HttpClient::Helper.symbolize_keys(incoming)
4359
- HttpClient::Preconditions.require_keys(opts, [:discriminator], 'AuthorizationForm')
4364
+ HttpClient::Preconditions.require_keys(opts, [:discriminator], 'AllocationDetail')
4360
4365
  @discriminator = HttpClient::Preconditions.assert_class('discriminator', opts.delete(:discriminator), String)
4361
4366
  end
4362
4367
 
4363
4368
  def subtype_to_hash
4364
- raise 'Cannot serialize an instance of authorization_form directly - must use one of the specific types: direct_authorization_form, merchant_of_record_authorization_form, paypal_authorization_form'
4369
+ raise 'Cannot serialize an instance of allocation_detail directly - must use one of the specific types: allocation_line_detail, allocation_order_detail'
4365
4370
  end
4366
4371
 
4367
4372
  def to_hash
4368
4373
  subtype_to_hash.merge(:discriminator => @discriminator)
4369
4374
  end
4370
4375
 
4371
- def AuthorizationForm.from_json(hash)
4376
+ def AllocationDetail.from_json(hash)
4372
4377
  HttpClient::Preconditions.assert_class('hash', hash, Hash)
4373
4378
  discriminator = HttpClient::Helper.symbolize_keys(hash)[:discriminator].to_s.strip
4374
4379
  if discriminator.empty?
4375
- raise "Union type[authorization_form] requires a field named 'discriminator'"
4380
+ raise "Union type[allocation_detail] requires a field named 'discriminator'"
4376
4381
  end
4377
4382
  case discriminator
4378
- when Types::DIRECT_AUTHORIZATION_FORM; DirectAuthorizationForm.new(hash)
4379
- when Types::MERCHANT_OF_RECORD_AUTHORIZATION_FORM; MerchantOfRecordAuthorizationForm.new(hash)
4380
- when Types::PAYPAL_AUTHORIZATION_FORM; PaypalAuthorizationForm.new(hash)
4381
- else AuthorizationFormUndefinedType.new(:discriminator => discriminator)
4383
+ when Types::ALLOCATION_LINE_DETAIL; AllocationLineDetail.new(hash)
4384
+ when Types::ALLOCATION_ORDER_DETAIL; AllocationOrderDetail.new(hash)
4385
+ else AllocationDetailUndefinedType.new(:discriminator => discriminator)
4382
4386
  end
4383
4387
  end
4384
4388
 
4385
4389
  end
4386
4390
 
4387
- class AuthorizationFormUndefinedType < AuthorizationForm
4391
+ class AllocationDetailUndefinedType < AllocationDetail
4388
4392
 
4389
4393
  attr_reader :name
4390
4394
 
@@ -4408,43 +4412,113 @@ module Io
4408
4412
 
4409
4413
  end
4410
4414
 
4411
- class AvailablePromotion
4415
+ class Authorization
4412
4416
 
4413
4417
  module Types
4414
- FREE_SHIPPING = 'free_shipping' unless defined?(FREE_SHIPPING)
4418
+ CARD_AUTHORIZATION = 'card_authorization' unless defined?(CARD_AUTHORIZATION)
4419
+ ONLINE_AUTHORIZATION = 'online_authorization' unless defined?(ONLINE_AUTHORIZATION)
4415
4420
  end
4416
4421
 
4417
4422
  attr_reader :discriminator
4418
4423
 
4419
4424
  def initialize(incoming={})
4420
4425
  opts = HttpClient::Helper.symbolize_keys(incoming)
4421
- HttpClient::Preconditions.require_keys(opts, [:discriminator], 'AvailablePromotion')
4426
+ HttpClient::Preconditions.require_keys(opts, [:discriminator], 'Authorization')
4422
4427
  @discriminator = HttpClient::Preconditions.assert_class('discriminator', opts.delete(:discriminator), String)
4423
4428
  end
4424
4429
 
4425
4430
  def subtype_to_hash
4426
- raise 'Cannot serialize an instance of available_promotion directly - must use one of the specific types: free_shipping'
4431
+ raise 'Cannot serialize an instance of authorization directly - must use one of the specific types: card_authorization, online_authorization'
4427
4432
  end
4428
4433
 
4429
4434
  def to_hash
4430
4435
  subtype_to_hash.merge(:discriminator => @discriminator)
4431
4436
  end
4432
4437
 
4433
- def AvailablePromotion.from_json(hash)
4438
+ def Authorization.from_json(hash)
4434
4439
  HttpClient::Preconditions.assert_class('hash', hash, Hash)
4435
4440
  discriminator = HttpClient::Helper.symbolize_keys(hash)[:discriminator].to_s.strip
4436
4441
  if discriminator.empty?
4437
- raise "Union type[available_promotion] requires a field named 'discriminator'"
4442
+ raise "Union type[authorization] requires a field named 'discriminator'"
4438
4443
  end
4439
4444
  case discriminator
4440
- when Types::FREE_SHIPPING; FreeShipping.new(hash)
4441
- else AvailablePromotionUndefinedType.new(:discriminator => discriminator)
4445
+ when Types::CARD_AUTHORIZATION; CardAuthorization.new(hash)
4446
+ when Types::ONLINE_AUTHORIZATION; OnlineAuthorization.new(hash)
4447
+ else AuthorizationUndefinedType.new(:discriminator => discriminator)
4442
4448
  end
4443
4449
  end
4444
4450
 
4445
4451
  end
4446
4452
 
4447
- class AvailablePromotionUndefinedType < AvailablePromotion
4453
+ class AuthorizationUndefinedType < Authorization
4454
+
4455
+ attr_reader :name
4456
+
4457
+ def initialize(incoming={})
4458
+ super(:discriminator => 'undefined_type')
4459
+ opts = HttpClient::Helper.symbolize_keys(incoming)
4460
+ @name = HttpClient::Preconditions.assert_class('name', opts.delete(:discriminator), String)
4461
+ end
4462
+
4463
+ def subtype_to_hash
4464
+ raise 'Unable to serialize undefined type to json'
4465
+ end
4466
+
4467
+ def copy(incoming={})
4468
+ raise 'Operation not supported for undefined type'
4469
+ end
4470
+
4471
+ def to_hash
4472
+ raise 'Operation not supported for undefined type'
4473
+ end
4474
+
4475
+ end
4476
+
4477
+ # Flow provides several different options for creating an authorization
4478
+ class AuthorizationForm
4479
+
4480
+ module Types
4481
+ # Enables card payments
4482
+ DIRECT_AUTHORIZATION_FORM = 'direct_authorization_form' unless defined?(DIRECT_AUTHORIZATION_FORM)
4483
+ # Enables card payments with Flow as Merchant of Record
4484
+ MERCHANT_OF_RECORD_AUTHORIZATION_FORM = 'merchant_of_record_authorization_form' unless defined?(MERCHANT_OF_RECORD_AUTHORIZATION_FORM)
4485
+ # Enables authorization via paypal
4486
+ PAYPAL_AUTHORIZATION_FORM = 'paypal_authorization_form' unless defined?(PAYPAL_AUTHORIZATION_FORM)
4487
+ end
4488
+
4489
+ attr_reader :discriminator
4490
+
4491
+ def initialize(incoming={})
4492
+ opts = HttpClient::Helper.symbolize_keys(incoming)
4493
+ HttpClient::Preconditions.require_keys(opts, [:discriminator], 'AuthorizationForm')
4494
+ @discriminator = HttpClient::Preconditions.assert_class('discriminator', opts.delete(:discriminator), String)
4495
+ end
4496
+
4497
+ def subtype_to_hash
4498
+ raise 'Cannot serialize an instance of authorization_form directly - must use one of the specific types: direct_authorization_form, merchant_of_record_authorization_form, paypal_authorization_form'
4499
+ end
4500
+
4501
+ def to_hash
4502
+ subtype_to_hash.merge(:discriminator => @discriminator)
4503
+ end
4504
+
4505
+ def AuthorizationForm.from_json(hash)
4506
+ HttpClient::Preconditions.assert_class('hash', hash, Hash)
4507
+ discriminator = HttpClient::Helper.symbolize_keys(hash)[:discriminator].to_s.strip
4508
+ if discriminator.empty?
4509
+ raise "Union type[authorization_form] requires a field named 'discriminator'"
4510
+ end
4511
+ case discriminator
4512
+ when Types::DIRECT_AUTHORIZATION_FORM; DirectAuthorizationForm.new(hash)
4513
+ when Types::MERCHANT_OF_RECORD_AUTHORIZATION_FORM; MerchantOfRecordAuthorizationForm.new(hash)
4514
+ when Types::PAYPAL_AUTHORIZATION_FORM; PaypalAuthorizationForm.new(hash)
4515
+ else AuthorizationFormUndefinedType.new(:discriminator => discriminator)
4516
+ end
4517
+ end
4518
+
4519
+ end
4520
+
4521
+ class AuthorizationFormUndefinedType < AuthorizationForm
4448
4522
 
4449
4523
  attr_reader :name
4450
4524
 
@@ -4612,6 +4686,8 @@ module Io
4612
4686
  RATE_UPSERTED = 'rate_upserted' unless defined?(RATE_UPSERTED)
4613
4687
  AVAILABLE_PROMOTIONS_UPSERTED = 'available_promotions_upserted' unless defined?(AVAILABLE_PROMOTIONS_UPSERTED)
4614
4688
  AVAILABLE_PROMOTIONS_DELETED = 'available_promotions_deleted' unless defined?(AVAILABLE_PROMOTIONS_DELETED)
4689
+ ALLOCATION_DELETED = 'allocation_deleted' unless defined?(ALLOCATION_DELETED)
4690
+ ALLOCATION_UPSERTED = 'allocation_upserted' unless defined?(ALLOCATION_UPSERTED)
4615
4691
  EXPERIENCE_DELETED = 'experience_deleted' unless defined?(EXPERIENCE_DELETED)
4616
4692
  EXPERIENCE_UPSERTED = 'experience_upserted' unless defined?(EXPERIENCE_UPSERTED)
4617
4693
  ITEM_MARGIN_DELETED = 'item_margin_deleted' unless defined?(ITEM_MARGIN_DELETED)
@@ -4670,7 +4746,7 @@ module Io
4670
4746
  end
4671
4747
 
4672
4748
  def subtype_to_hash
4673
- raise 'Cannot serialize an instance of event directly - must use one of the specific types: attribute_upserted, attribute_deleted, catalog_upserted, catalog_deleted, subcatalog_upserted, subcatalog_deleted, catalog_item_upserted, catalog_item_deleted, subcatalog_item_upserted, subcatalog_item_deleted, rate_deleted, rate_upserted, available_promotions_upserted, available_promotions_deleted, experience_deleted, experience_upserted, item_margin_deleted, item_margin_upserted, item_sales_margin_deleted, item_sales_margin_upserted, label_format_deleted, label_format_upserted, order_deleted, order_upserted, order_identifier_deleted, order_identifier_upserted, pricing_deleted, pricing_upserted, tier_upserted, tier_deleted, hs6_code_upserted, hs6_code_deleted, hs10_code_upserted, hs10_code_deleted, item_origin_upserted, item_origin_deleted, harmonized_item_upserted, harmonized_item_deleted, snapshot_upserted, snapshot_deleted, label_upserted, notification_upserted, notification_deleted, localized_item_upserted, localized_item_deleted, localized_item_snapshot, membership_upserted, membership_deleted, organization_upserted, organization_deleted, authorization_upserted, authorization_deleted, capture_upserted, card_upserted, card_deleted, refund_upserted, return_upserted, return_deleted, targeting_item_upserted, targeting_item_deleted, tracking_label_event_upserted'
4749
+ raise 'Cannot serialize an instance of event directly - must use one of the specific types: attribute_upserted, attribute_deleted, catalog_upserted, catalog_deleted, subcatalog_upserted, subcatalog_deleted, catalog_item_upserted, catalog_item_deleted, subcatalog_item_upserted, subcatalog_item_deleted, rate_deleted, rate_upserted, available_promotions_upserted, available_promotions_deleted, allocation_deleted, allocation_upserted, experience_deleted, experience_upserted, item_margin_deleted, item_margin_upserted, item_sales_margin_deleted, item_sales_margin_upserted, label_format_deleted, label_format_upserted, order_deleted, order_upserted, order_identifier_deleted, order_identifier_upserted, pricing_deleted, pricing_upserted, tier_upserted, tier_deleted, hs6_code_upserted, hs6_code_deleted, hs10_code_upserted, hs10_code_deleted, item_origin_upserted, item_origin_deleted, harmonized_item_upserted, harmonized_item_deleted, snapshot_upserted, snapshot_deleted, label_upserted, notification_upserted, notification_deleted, localized_item_upserted, localized_item_deleted, localized_item_snapshot, membership_upserted, membership_deleted, organization_upserted, organization_deleted, authorization_upserted, authorization_deleted, capture_upserted, card_upserted, card_deleted, refund_upserted, return_upserted, return_deleted, targeting_item_upserted, targeting_item_deleted, tracking_label_event_upserted'
4674
4750
  end
4675
4751
 
4676
4752
  def to_hash
@@ -4698,6 +4774,8 @@ module Io
4698
4774
  when Types::RATE_UPSERTED; RateUpserted.new(hash)
4699
4775
  when Types::AVAILABLE_PROMOTIONS_UPSERTED; AvailablePromotionsUpserted.new(hash)
4700
4776
  when Types::AVAILABLE_PROMOTIONS_DELETED; AvailablePromotionsDeleted.new(hash)
4777
+ when Types::ALLOCATION_DELETED; AllocationDeleted.new(hash)
4778
+ when Types::ALLOCATION_UPSERTED; AllocationUpserted.new(hash)
4701
4779
  when Types::EXPERIENCE_DELETED; ExperienceDeleted.new(hash)
4702
4780
  when Types::EXPERIENCE_UPSERTED; ExperienceUpserted.new(hash)
4703
4781
  when Types::ITEM_MARGIN_DELETED; ItemMarginDeleted.new(hash)
@@ -5554,6 +5632,66 @@ module Io
5554
5632
 
5555
5633
  end
5556
5634
 
5635
+ class Promotion
5636
+
5637
+ module Types
5638
+ FREE_SHIPPING = 'free_shipping' unless defined?(FREE_SHIPPING)
5639
+ end
5640
+
5641
+ attr_reader :discriminator
5642
+
5643
+ def initialize(incoming={})
5644
+ opts = HttpClient::Helper.symbolize_keys(incoming)
5645
+ HttpClient::Preconditions.require_keys(opts, [:discriminator], 'Promotion')
5646
+ @discriminator = HttpClient::Preconditions.assert_class('discriminator', opts.delete(:discriminator), String)
5647
+ end
5648
+
5649
+ def subtype_to_hash
5650
+ raise 'Cannot serialize an instance of promotion directly - must use one of the specific types: free_shipping'
5651
+ end
5652
+
5653
+ def to_hash
5654
+ subtype_to_hash.merge(:discriminator => @discriminator)
5655
+ end
5656
+
5657
+ def Promotion.from_json(hash)
5658
+ HttpClient::Preconditions.assert_class('hash', hash, Hash)
5659
+ discriminator = HttpClient::Helper.symbolize_keys(hash)[:discriminator].to_s.strip
5660
+ if discriminator.empty?
5661
+ raise "Union type[promotion] requires a field named 'discriminator'"
5662
+ end
5663
+ case discriminator
5664
+ when Types::FREE_SHIPPING; FreeShipping.new(hash)
5665
+ else PromotionUndefinedType.new(:discriminator => discriminator)
5666
+ end
5667
+ end
5668
+
5669
+ end
5670
+
5671
+ class PromotionUndefinedType < Promotion
5672
+
5673
+ attr_reader :name
5674
+
5675
+ def initialize(incoming={})
5676
+ super(:discriminator => 'undefined_type')
5677
+ opts = HttpClient::Helper.symbolize_keys(incoming)
5678
+ @name = HttpClient::Preconditions.assert_class('name', opts.delete(:discriminator), String)
5679
+ end
5680
+
5681
+ def subtype_to_hash
5682
+ raise 'Unable to serialize undefined type to json'
5683
+ end
5684
+
5685
+ def copy(incoming={})
5686
+ raise 'Operation not supported for undefined type'
5687
+ end
5688
+
5689
+ def to_hash
5690
+ raise 'Operation not supported for undefined type'
5691
+ end
5692
+
5693
+ end
5694
+
5557
5695
  class Session
5558
5696
 
5559
5697
  module Types
@@ -6043,44 +6181,6 @@ module Io
6043
6181
 
6044
6182
  end
6045
6183
 
6046
- class AppliedPromotionType
6047
-
6048
- attr_reader :value
6049
-
6050
- def initialize(value)
6051
- @value = HttpClient::Preconditions.assert_class('value', value, String)
6052
- end
6053
-
6054
- # Returns the instance of AppliedPromotionType for this value, creating a new instance for an unknown value
6055
- def AppliedPromotionType.apply(value)
6056
- if value.instance_of?(AppliedPromotionType)
6057
- value
6058
- else
6059
- HttpClient::Preconditions.assert_class_or_nil('value', value, String)
6060
- value.nil? ? nil : (from_string(value) || AppliedPromotionType.new(value))
6061
- end
6062
- end
6063
-
6064
- # Returns the instance of AppliedPromotionType for this value, or nil if not found
6065
- def AppliedPromotionType.from_string(value)
6066
- HttpClient::Preconditions.assert_class('value', value, String)
6067
- AppliedPromotionType.ALL.find { |v| v.value == value }
6068
- end
6069
-
6070
- def AppliedPromotionType.ALL
6071
- @@all ||= [AppliedPromotionType.free_shipping]
6072
- end
6073
-
6074
- def AppliedPromotionType.free_shipping
6075
- @@_free_shipping ||= AppliedPromotionType.new('free_shipping')
6076
- end
6077
-
6078
- def to_hash
6079
- value
6080
- end
6081
-
6082
- end
6083
-
6084
6184
  class AttributeDataType
6085
6185
 
6086
6186
  attr_reader :value
@@ -7067,7 +7167,7 @@ module Io
7067
7167
  end
7068
7168
 
7069
7169
  def EventType.ALL
7070
- @@all ||= [EventType.attribute_upserted, EventType.attribute_deleted, EventType.catalog_upserted, EventType.catalog_deleted, EventType.subcatalog_upserted, EventType.subcatalog_deleted, EventType.catalog_item_upserted, EventType.catalog_item_deleted, EventType.subcatalog_item_upserted, EventType.subcatalog_item_deleted, EventType.rate_deleted, EventType.rate_upserted, EventType.available_promotions_upserted, EventType.available_promotions_deleted, EventType.experience_deleted, EventType.experience_upserted, EventType.item_margin_deleted, EventType.item_margin_upserted, EventType.item_sales_margin_deleted, EventType.item_sales_margin_upserted, EventType.label_format_deleted, EventType.label_format_upserted, EventType.order_deleted, EventType.order_upserted, EventType.order_identifier_deleted, EventType.order_identifier_upserted, EventType.pricing_deleted, EventType.pricing_upserted, EventType.tier_upserted, EventType.tier_deleted, EventType.hs6_code_upserted, EventType.hs6_code_deleted, EventType.hs10_code_upserted, EventType.hs10_code_deleted, EventType.item_origin_upserted, EventType.item_origin_deleted, EventType.harmonized_item_upserted, EventType.harmonized_item_deleted, EventType.snapshot_upserted, EventType.snapshot_deleted, EventType.label_upserted, EventType.notification_upserted, EventType.notification_deleted, EventType.localized_item_upserted, EventType.localized_item_deleted, EventType.localized_item_snapshot, EventType.membership_upserted, EventType.membership_deleted, EventType.organization_upserted, EventType.organization_deleted, EventType.authorization_upserted, EventType.authorization_deleted, EventType.capture_upserted, EventType.card_upserted, EventType.card_deleted, EventType.refund_upserted, EventType.return_upserted, EventType.return_deleted, EventType.targeting_item_upserted, EventType.targeting_item_deleted, EventType.tracking_label_event_upserted]
7170
+ @@all ||= [EventType.attribute_upserted, EventType.attribute_deleted, EventType.catalog_upserted, EventType.catalog_deleted, EventType.subcatalog_upserted, EventType.subcatalog_deleted, EventType.catalog_item_upserted, EventType.catalog_item_deleted, EventType.subcatalog_item_upserted, EventType.subcatalog_item_deleted, EventType.rate_deleted, EventType.rate_upserted, EventType.available_promotions_upserted, EventType.available_promotions_deleted, EventType.allocation_deleted, EventType.allocation_upserted, EventType.experience_deleted, EventType.experience_upserted, EventType.item_margin_deleted, EventType.item_margin_upserted, EventType.item_sales_margin_deleted, EventType.item_sales_margin_upserted, EventType.label_format_deleted, EventType.label_format_upserted, EventType.order_deleted, EventType.order_upserted, EventType.order_identifier_deleted, EventType.order_identifier_upserted, EventType.pricing_deleted, EventType.pricing_upserted, EventType.tier_upserted, EventType.tier_deleted, EventType.hs6_code_upserted, EventType.hs6_code_deleted, EventType.hs10_code_upserted, EventType.hs10_code_deleted, EventType.item_origin_upserted, EventType.item_origin_deleted, EventType.harmonized_item_upserted, EventType.harmonized_item_deleted, EventType.snapshot_upserted, EventType.snapshot_deleted, EventType.label_upserted, EventType.notification_upserted, EventType.notification_deleted, EventType.localized_item_upserted, EventType.localized_item_deleted, EventType.localized_item_snapshot, EventType.membership_upserted, EventType.membership_deleted, EventType.organization_upserted, EventType.organization_deleted, EventType.authorization_upserted, EventType.authorization_deleted, EventType.capture_upserted, EventType.card_upserted, EventType.card_deleted, EventType.refund_upserted, EventType.return_upserted, EventType.return_deleted, EventType.targeting_item_upserted, EventType.targeting_item_deleted, EventType.tracking_label_event_upserted]
7071
7171
  end
7072
7172
 
7073
7173
  def EventType.attribute_upserted
@@ -7126,6 +7226,14 @@ module Io
7126
7226
  @@_available_promotions_deleted ||= EventType.new('available_promotions_deleted')
7127
7227
  end
7128
7228
 
7229
+ def EventType.allocation_deleted
7230
+ @@_allocation_deleted ||= EventType.new('allocation_deleted')
7231
+ end
7232
+
7233
+ def EventType.allocation_upserted
7234
+ @@_allocation_upserted ||= EventType.new('allocation_upserted')
7235
+ end
7236
+
7129
7237
  def EventType.experience_deleted
7130
7238
  @@_experience_deleted ||= EventType.new('experience_deleted')
7131
7239
  end
@@ -7934,7 +8042,7 @@ module Io
7934
8042
  end
7935
8043
 
7936
8044
  def OrderPriceDetailComponentKey.ALL
7937
- @@all ||= [OrderPriceDetailComponentKey.adjustment, OrderPriceDetailComponentKey.vat_deminimis, OrderPriceDetailComponentKey.duty_deminimis, OrderPriceDetailComponentKey.duties_item_price, OrderPriceDetailComponentKey.duties_freight, OrderPriceDetailComponentKey.duties_insurance, OrderPriceDetailComponentKey.vat_item_price, OrderPriceDetailComponentKey.vat_freight, OrderPriceDetailComponentKey.vat_insurance, OrderPriceDetailComponentKey.vat_duties_item_price, OrderPriceDetailComponentKey.vat_duties_freight, OrderPriceDetailComponentKey.vat_duties_insurance, OrderPriceDetailComponentKey.item_price, OrderPriceDetailComponentKey.rounding, OrderPriceDetailComponentKey.insurance, OrderPriceDetailComponentKey.shipping, OrderPriceDetailComponentKey.order_discount, OrderPriceDetailComponentKey.subtotal_percent_sales_margin, OrderPriceDetailComponentKey.subtotal_vat_percent_sales_margin, OrderPriceDetailComponentKey.subtotal_duty_percent_sales_margin]
8045
+ @@all ||= [OrderPriceDetailComponentKey.adjustment, OrderPriceDetailComponentKey.vat_deminimis, OrderPriceDetailComponentKey.duty_deminimis, OrderPriceDetailComponentKey.duties_item_price, OrderPriceDetailComponentKey.duties_freight, OrderPriceDetailComponentKey.duties_insurance, OrderPriceDetailComponentKey.vat_item_price, OrderPriceDetailComponentKey.vat_freight, OrderPriceDetailComponentKey.vat_insurance, OrderPriceDetailComponentKey.vat_duties_item_price, OrderPriceDetailComponentKey.vat_duties_freight, OrderPriceDetailComponentKey.vat_duties_insurance, OrderPriceDetailComponentKey.item_price, OrderPriceDetailComponentKey.rounding, OrderPriceDetailComponentKey.insurance, OrderPriceDetailComponentKey.shipping, OrderPriceDetailComponentKey.order_discount, OrderPriceDetailComponentKey.subtotal_percent_sales_margin, OrderPriceDetailComponentKey.subtotal_vat_percent_sales_margin, OrderPriceDetailComponentKey.subtotal_duty_percent_sales_margin, OrderPriceDetailComponentKey.vat_subsidy, OrderPriceDetailComponentKey.duty_subsidy]
7938
8046
  end
7939
8047
 
7940
8048
  # A general purpose adjustment applied to the order.
@@ -8042,6 +8150,22 @@ module Io
8042
8150
  @@_subtotal_duty_percent_sales_margin ||= OrderPriceDetailComponentKey.new('subtotal_duty_percent_sales_margin')
8043
8151
  end
8044
8152
 
8153
+ # An offset to account for any VAT subsidized by the organization. For example,
8154
+ # if VAT is included in an item price and changes at the order level (due to
8155
+ # passing de minimis threshold, or the destination having a more specific VAT
8156
+ # rate), the difference will be represented here.
8157
+ def OrderPriceDetailComponentKey.vat_subsidy
8158
+ @@_vat_subsidy ||= OrderPriceDetailComponentKey.new('vat_subsidy')
8159
+ end
8160
+
8161
+ # An offset to account for any duty subsidized by the organization. For example,
8162
+ # if duty is included in an item price and changes at the order level (due to
8163
+ # passing de minimis threshold, or the destination having a more specific duty
8164
+ # rate), the difference will be represented here.
8165
+ def OrderPriceDetailComponentKey.duty_subsidy
8166
+ @@_duty_subsidy ||= OrderPriceDetailComponentKey.new('duty_subsidy')
8167
+ end
8168
+
8045
8169
  def to_hash
8046
8170
  value
8047
8171
  end
@@ -8308,7 +8432,7 @@ module Io
8308
8432
  end
8309
8433
 
8310
8434
  def PriceDetailComponentKey.ALL
8311
- @@all ||= [PriceDetailComponentKey.base_price, PriceDetailComponentKey.discount, PriceDetailComponentKey.currency_margin, PriceDetailComponentKey.percent_item_margin, PriceDetailComponentKey.fixed_item_margin, PriceDetailComponentKey.duties_item_price, PriceDetailComponentKey.duties_added_margin, PriceDetailComponentKey.duties_rounding, PriceDetailComponentKey.duties_deminimis, PriceDetailComponentKey.vat_item_price, PriceDetailComponentKey.vat_added_margin, PriceDetailComponentKey.vat_rounding, PriceDetailComponentKey.vat_duties_item_price, PriceDetailComponentKey.vat_duties_added_margin, PriceDetailComponentKey.vat_duties_rounding, PriceDetailComponentKey.vat_deminimis, PriceDetailComponentKey.item_price_percent_sales_margin, PriceDetailComponentKey.margins_percent_sales_margin, PriceDetailComponentKey.rounding_percent_sales_margin, PriceDetailComponentKey.vat_percent_sales_margin, PriceDetailComponentKey.duty_percent_sales_margin]
8435
+ @@all ||= [PriceDetailComponentKey.base_price, PriceDetailComponentKey.discount, PriceDetailComponentKey.currency_margin, PriceDetailComponentKey.percent_item_margin, PriceDetailComponentKey.fixed_item_margin, PriceDetailComponentKey.duties_item_price, PriceDetailComponentKey.duties_added_margin, PriceDetailComponentKey.duties_rounding, PriceDetailComponentKey.duties_deminimis, PriceDetailComponentKey.vat_item_price, PriceDetailComponentKey.vat_added_margin, PriceDetailComponentKey.vat_rounding, PriceDetailComponentKey.vat_duties_item_price, PriceDetailComponentKey.vat_duties_added_margin, PriceDetailComponentKey.vat_duties_rounding, PriceDetailComponentKey.vat_deminimis, PriceDetailComponentKey.item_price_percent_sales_margin, PriceDetailComponentKey.margins_percent_sales_margin, PriceDetailComponentKey.rounding_percent_sales_margin, PriceDetailComponentKey.vat_percent_sales_margin, PriceDetailComponentKey.vat_duty_percent_sales_margin, PriceDetailComponentKey.duty_percent_sales_margin]
8312
8436
  end
8313
8437
 
8314
8438
  # The base price of the item.
@@ -8417,6 +8541,12 @@ module Io
8417
8541
  @@_vat_percent_sales_margin ||= PriceDetailComponentKey.new('vat_percent_sales_margin')
8418
8542
  end
8419
8543
 
8544
+ # An adjustment made to VAT on duties (e.g. VAT on duties on item price) owed as
8545
+ # a result of a percent sales margin.
8546
+ def PriceDetailComponentKey.vat_duty_percent_sales_margin
8547
+ @@_vat_duty_percent_sales_margin ||= PriceDetailComponentKey.new('vat_duty_percent_sales_margin')
8548
+ end
8549
+
8420
8550
  # An adjustment made to duty owed as a result of a percent sales margin.
8421
8551
  def PriceDetailComponentKey.duty_percent_sales_margin
8422
8552
  @@_duty_percent_sales_margin ||= PriceDetailComponentKey.new('duty_percent_sales_margin')
@@ -9872,15 +10002,13 @@ module Io
9872
10002
 
9873
10003
  class Allocation
9874
10004
 
9875
- attr_reader :order, :currency, :total, :items
10005
+ attr_reader :order, :details
9876
10006
 
9877
10007
  def initialize(incoming={})
9878
10008
  opts = HttpClient::Helper.symbolize_keys(incoming)
9879
- HttpClient::Preconditions.require_keys(opts, [:order, :currency, :total, :items], 'Allocation')
10009
+ HttpClient::Preconditions.require_keys(opts, [:order, :details], 'Allocation')
9880
10010
  @order = (x = opts.delete(:order); x.is_a?(::Io::Flow::V0::Models::OrderReference) ? x : ::Io::Flow::V0::Models::OrderReference.new(x))
9881
- @currency = (x = opts.delete(:currency); x.is_a?(::Io::Flow::V0::Models::AllocationCurrencies) ? x : ::Io::Flow::V0::Models::AllocationCurrencies.new(x))
9882
- @total = (x = opts.delete(:total); x.is_a?(::Io::Flow::V0::Models::AllocationTotals) ? x : ::Io::Flow::V0::Models::AllocationTotals.new(x))
9883
- @items = HttpClient::Preconditions.assert_class('items', opts.delete(:items), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::AllocationItem) ? x : ::Io::Flow::V0::Models::AllocationItem.new(x)) }
10011
+ @details = HttpClient::Preconditions.assert_class('details', opts.delete(:details), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::AllocationDetail) ? x : ::Io::Flow::V0::Models::AllocationDetail.from_json(x)) }
9884
10012
  end
9885
10013
 
9886
10014
  def to_json
@@ -9894,23 +10022,23 @@ module Io
9894
10022
  def to_hash
9895
10023
  {
9896
10024
  :order => order.to_hash,
9897
- :currency => currency.to_hash,
9898
- :total => total.to_hash,
9899
- :items => items.map { |o| o.to_hash }
10025
+ :details => details.map { |o| o.to_hash }
9900
10026
  }
9901
10027
  end
9902
10028
 
9903
10029
  end
9904
10030
 
9905
- class AllocationCurrencies
10031
+ class AllocationDeleted < Event
9906
10032
 
9907
- attr_reader :base, :target
10033
+ attr_reader :event_id, :timestamp, :id
9908
10034
 
9909
10035
  def initialize(incoming={})
10036
+ super(:discriminator => Event::Types::ALLOCATION_DELETED)
9910
10037
  opts = HttpClient::Helper.symbolize_keys(incoming)
9911
- HttpClient::Preconditions.require_keys(opts, [:base, :target], 'AllocationCurrencies')
9912
- @base = HttpClient::Preconditions.assert_class('base', opts.delete(:base), String)
9913
- @target = HttpClient::Preconditions.assert_class('target', opts.delete(:target), String)
10038
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :id], 'AllocationDeleted')
10039
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
10040
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
10041
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
9914
10042
  end
9915
10043
 
9916
10044
  def to_json
@@ -9918,29 +10046,31 @@ module Io
9918
10046
  end
9919
10047
 
9920
10048
  def copy(incoming={})
9921
- AllocationCurrencies.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
10049
+ AllocationDeleted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
9922
10050
  end
9923
10051
 
9924
- def to_hash
10052
+ def subtype_to_hash
9925
10053
  {
9926
- :base => base,
9927
- :target => target
10054
+ :event_id => event_id,
10055
+ :timestamp => timestamp,
10056
+ :id => id
9928
10057
  }
9929
10058
  end
9930
10059
 
9931
10060
  end
9932
10061
 
9933
- class AllocationDetail
10062
+ # Represents any component that is not VAT or duty, such as item price,
10063
+ # rounding, shipping, etc.
10064
+ class AllocationDetailComponent < AllocationComponent
9934
10065
 
9935
- attr_reader :key, :base, :target, :components
10066
+ attr_reader :key, :total
9936
10067
 
9937
10068
  def initialize(incoming={})
10069
+ super(:discriminator => AllocationComponent::Types::ALLOCATION_DETAIL_COMPONENT)
9938
10070
  opts = HttpClient::Helper.symbolize_keys(incoming)
9939
- HttpClient::Preconditions.require_keys(opts, [:key, :base, :target, :components], 'AllocationDetail')
9940
- @key = (x = opts.delete(:key); x.is_a?(::Io::Flow::V0::Models::OrderPriceDetailKey) ? x : ::Io::Flow::V0::Models::OrderPriceDetailKey.apply(x))
9941
- @base = HttpClient::Preconditions.assert_class('base', HttpClient::Helper.to_big_decimal(opts.delete(:base)), BigDecimal)
9942
- @target = HttpClient::Preconditions.assert_class('target', HttpClient::Helper.to_big_decimal(opts.delete(:target)), BigDecimal)
9943
- @components = HttpClient::Preconditions.assert_class('components', opts.delete(:components), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::AllocationDetailComponent) ? x : ::Io::Flow::V0::Models::AllocationDetailComponent.new(x)) }
10071
+ HttpClient::Preconditions.require_keys(opts, [:key, :total], 'AllocationDetailComponent')
10072
+ @key = (x = opts.delete(:key); x.is_a?(::Io::Flow::V0::Models::OrderPriceDetailComponentKey) ? x : ::Io::Flow::V0::Models::OrderPriceDetailComponentKey.apply(x))
10073
+ @total = (x = opts.delete(:total); x.is_a?(::Io::Flow::V0::Models::PriceWithBase) ? x : ::Io::Flow::V0::Models::PriceWithBase.new(x))
9944
10074
  end
9945
10075
 
9946
10076
  def to_json
@@ -9948,30 +10078,31 @@ module Io
9948
10078
  end
9949
10079
 
9950
10080
  def copy(incoming={})
9951
- AllocationDetail.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
10081
+ AllocationDetailComponent.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
9952
10082
  end
9953
10083
 
9954
- def to_hash
10084
+ def subtype_to_hash
9955
10085
  {
9956
10086
  :key => key.value,
9957
- :base => base,
9958
- :target => target,
9959
- :components => components.map { |o| o.to_hash }
10087
+ :total => total.to_hash
9960
10088
  }
9961
10089
  end
9962
10090
 
9963
10091
  end
9964
10092
 
9965
- class AllocationDetailComponent
10093
+ # Represents either a VAT or duty component.
10094
+ class AllocationLevyComponent < AllocationComponent
9966
10095
 
9967
- attr_reader :key, :base, :target
10096
+ attr_reader :key, :total, :rate, :name
9968
10097
 
9969
10098
  def initialize(incoming={})
10099
+ super(:discriminator => AllocationComponent::Types::ALLOCATION_LEVY_COMPONENT)
9970
10100
  opts = HttpClient::Helper.symbolize_keys(incoming)
9971
- HttpClient::Preconditions.require_keys(opts, [:key, :base, :target], 'AllocationDetailComponent')
10101
+ HttpClient::Preconditions.require_keys(opts, [:key, :total, :rate, :name], 'AllocationLevyComponent')
9972
10102
  @key = (x = opts.delete(:key); x.is_a?(::Io::Flow::V0::Models::OrderPriceDetailComponentKey) ? x : ::Io::Flow::V0::Models::OrderPriceDetailComponentKey.apply(x))
9973
- @base = HttpClient::Preconditions.assert_class('base', HttpClient::Helper.to_big_decimal(opts.delete(:base)), BigDecimal)
9974
- @target = HttpClient::Preconditions.assert_class('target', HttpClient::Helper.to_big_decimal(opts.delete(:target)), BigDecimal)
10103
+ @total = (x = opts.delete(:total); x.is_a?(::Io::Flow::V0::Models::PriceWithBase) ? x : ::Io::Flow::V0::Models::PriceWithBase.new(x))
10104
+ @rate = HttpClient::Preconditions.assert_class('rate', HttpClient::Helper.to_big_decimal(opts.delete(:rate)), BigDecimal)
10105
+ @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
9975
10106
  end
9976
10107
 
9977
10108
  def to_json
@@ -9979,30 +10110,35 @@ module Io
9979
10110
  end
9980
10111
 
9981
10112
  def copy(incoming={})
9982
- AllocationDetailComponent.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
10113
+ AllocationLevyComponent.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
9983
10114
  end
9984
10115
 
9985
- def to_hash
10116
+ def subtype_to_hash
9986
10117
  {
9987
10118
  :key => key.value,
9988
- :base => base,
9989
- :target => target
10119
+ :total => total.to_hash,
10120
+ :rate => rate,
10121
+ :name => name
9990
10122
  }
9991
10123
  end
9992
10124
 
9993
10125
  end
9994
10126
 
9995
- class AllocationItem
10127
+ class AllocationLineDetail < AllocationDetail
9996
10128
 
9997
- attr_reader :number, :base, :target, :details
10129
+ attr_reader :number, :quantity, :key, :price, :total, :included, :not_included
9998
10130
 
9999
10131
  def initialize(incoming={})
10132
+ super(:discriminator => AllocationDetail::Types::ALLOCATION_LINE_DETAIL)
10000
10133
  opts = HttpClient::Helper.symbolize_keys(incoming)
10001
- HttpClient::Preconditions.require_keys(opts, [:number, :base, :target, :details], 'AllocationItem')
10134
+ HttpClient::Preconditions.require_keys(opts, [:number, :quantity, :key, :price, :total, :included, :not_included], 'AllocationLineDetail')
10002
10135
  @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
10003
- @base = HttpClient::Preconditions.assert_class('base', HttpClient::Helper.to_big_decimal(opts.delete(:base)), BigDecimal)
10004
- @target = HttpClient::Preconditions.assert_class('target', HttpClient::Helper.to_big_decimal(opts.delete(:target)), BigDecimal)
10005
- @details = HttpClient::Preconditions.assert_class('details', opts.delete(:details), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::AllocationDetail) ? x : ::Io::Flow::V0::Models::AllocationDetail.new(x)) }
10136
+ @quantity = HttpClient::Preconditions.assert_class('quantity', opts.delete(:quantity), Integer)
10137
+ @key = (x = opts.delete(:key); x.is_a?(::Io::Flow::V0::Models::OrderPriceDetailKey) ? x : ::Io::Flow::V0::Models::OrderPriceDetailKey.apply(x))
10138
+ @price = (x = opts.delete(:price); x.is_a?(::Io::Flow::V0::Models::PriceWithBase) ? x : ::Io::Flow::V0::Models::PriceWithBase.new(x))
10139
+ @total = (x = opts.delete(:total); x.is_a?(::Io::Flow::V0::Models::PriceWithBase) ? x : ::Io::Flow::V0::Models::PriceWithBase.new(x))
10140
+ @included = HttpClient::Preconditions.assert_class('included', opts.delete(:included), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::AllocationComponent) ? x : ::Io::Flow::V0::Models::AllocationComponent.from_json(x)) }
10141
+ @not_included = HttpClient::Preconditions.assert_class('not_included', opts.delete(:not_included), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::AllocationComponent) ? x : ::Io::Flow::V0::Models::AllocationComponent.from_json(x)) }
10006
10142
  end
10007
10143
 
10008
10144
  def to_json
@@ -10010,29 +10146,37 @@ module Io
10010
10146
  end
10011
10147
 
10012
10148
  def copy(incoming={})
10013
- AllocationItem.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
10149
+ AllocationLineDetail.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
10014
10150
  end
10015
10151
 
10016
- def to_hash
10152
+ def subtype_to_hash
10017
10153
  {
10018
10154
  :number => number,
10019
- :base => base,
10020
- :target => target,
10021
- :details => details.map { |o| o.to_hash }
10155
+ :quantity => quantity,
10156
+ :key => key.value,
10157
+ :price => price.to_hash,
10158
+ :total => total.to_hash,
10159
+ :included => included.map { |o| o.to_hash },
10160
+ :not_included => not_included.map { |o| o.to_hash }
10022
10161
  }
10023
10162
  end
10024
10163
 
10025
10164
  end
10026
10165
 
10027
- class AllocationTotals
10166
+ # Represents an order-specific detail such as shipping, insurance, or an
10167
+ # order-level discount.
10168
+ class AllocationOrderDetail < AllocationDetail
10028
10169
 
10029
- attr_reader :target, :base
10170
+ attr_reader :key, :total, :included, :not_included
10030
10171
 
10031
10172
  def initialize(incoming={})
10173
+ super(:discriminator => AllocationDetail::Types::ALLOCATION_ORDER_DETAIL)
10032
10174
  opts = HttpClient::Helper.symbolize_keys(incoming)
10033
- HttpClient::Preconditions.require_keys(opts, [:target, :base], 'AllocationTotals')
10034
- @target = HttpClient::Preconditions.assert_class('target', HttpClient::Helper.to_big_decimal(opts.delete(:target)), BigDecimal)
10035
- @base = HttpClient::Preconditions.assert_class('base', HttpClient::Helper.to_big_decimal(opts.delete(:base)), BigDecimal)
10175
+ HttpClient::Preconditions.require_keys(opts, [:key, :total, :included, :not_included], 'AllocationOrderDetail')
10176
+ @key = (x = opts.delete(:key); x.is_a?(::Io::Flow::V0::Models::OrderPriceDetailKey) ? x : ::Io::Flow::V0::Models::OrderPriceDetailKey.apply(x))
10177
+ @total = (x = opts.delete(:total); x.is_a?(::Io::Flow::V0::Models::PriceWithBase) ? x : ::Io::Flow::V0::Models::PriceWithBase.new(x))
10178
+ @included = HttpClient::Preconditions.assert_class('included', opts.delete(:included), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::AllocationComponent) ? x : ::Io::Flow::V0::Models::AllocationComponent.from_json(x)) }
10179
+ @not_included = HttpClient::Preconditions.assert_class('not_included', opts.delete(:not_included), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::AllocationComponent) ? x : ::Io::Flow::V0::Models::AllocationComponent.from_json(x)) }
10036
10180
  end
10037
10181
 
10038
10182
  def to_json
@@ -10040,29 +10184,35 @@ module Io
10040
10184
  end
10041
10185
 
10042
10186
  def copy(incoming={})
10043
- AllocationTotals.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
10187
+ AllocationOrderDetail.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
10044
10188
  end
10045
10189
 
10046
- def to_hash
10190
+ def subtype_to_hash
10047
10191
  {
10048
- :target => target,
10049
- :base => base
10192
+ :key => key.value,
10193
+ :total => total.to_hash,
10194
+ :included => included.map { |o| o.to_hash },
10195
+ :not_included => not_included.map { |o| o.to_hash }
10050
10196
  }
10051
10197
  end
10052
10198
 
10053
10199
  end
10054
10200
 
10055
- # Rule outcome where shipping surfaced in quote is actual cost plus a predefined
10056
- # margin price
10057
- class AmountMargin < TierRuleOutcome
10201
+ class AllocationUpserted < Event
10058
10202
 
10059
- attr_reader :margin
10203
+ attr_reader :event_id, :timestamp, :id, :organization, :order_id, :order_number, :details
10060
10204
 
10061
10205
  def initialize(incoming={})
10062
- super(:discriminator => TierRuleOutcome::Types::AMOUNT_MARGIN)
10206
+ super(:discriminator => Event::Types::ALLOCATION_UPSERTED)
10063
10207
  opts = HttpClient::Helper.symbolize_keys(incoming)
10064
- HttpClient::Preconditions.require_keys(opts, [:margin], 'AmountMargin')
10065
- @margin = (x = opts.delete(:margin); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x))
10208
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :id, :organization, :order_id, :order_number, :details], 'AllocationUpserted')
10209
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
10210
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
10211
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
10212
+ @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
10213
+ @order_id = HttpClient::Preconditions.assert_class('order_id', opts.delete(:order_id), String)
10214
+ @order_number = HttpClient::Preconditions.assert_class('order_number', opts.delete(:order_number), String)
10215
+ @details = HttpClient::Preconditions.assert_class('details', opts.delete(:details), Array).map { |v| HttpClient::Preconditions.assert_class('details', HttpClient::Helper.to_object(v), Hash) }
10066
10216
  end
10067
10217
 
10068
10218
  def to_json
@@ -10070,26 +10220,34 @@ module Io
10070
10220
  end
10071
10221
 
10072
10222
  def copy(incoming={})
10073
- AmountMargin.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
10223
+ AllocationUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
10074
10224
  end
10075
10225
 
10076
10226
  def subtype_to_hash
10077
10227
  {
10078
- :margin => margin.to_hash
10228
+ :event_id => event_id,
10229
+ :timestamp => timestamp,
10230
+ :id => id,
10231
+ :organization => organization,
10232
+ :order_id => order_id,
10233
+ :order_number => order_number,
10234
+ :details => details
10079
10235
  }
10080
10236
  end
10081
10237
 
10082
10238
  end
10083
10239
 
10084
- class AmountMarginForm < TierRuleOutcomeForm
10240
+ # Rule outcome where shipping surfaced in quote is actual cost plus a predefined
10241
+ # margin price
10242
+ class AmountMargin < TierRuleOutcome
10085
10243
 
10086
10244
  attr_reader :margin
10087
10245
 
10088
10246
  def initialize(incoming={})
10089
- super(:discriminator => TierRuleOutcomeForm::Types::AMOUNT_MARGIN_FORM)
10247
+ super(:discriminator => TierRuleOutcome::Types::AMOUNT_MARGIN)
10090
10248
  opts = HttpClient::Helper.symbolize_keys(incoming)
10091
- HttpClient::Preconditions.require_keys(opts, [:margin], 'AmountMarginForm')
10092
- @margin = (x = opts.delete(:margin); x.is_a?(::Io::Flow::V0::Models::Money) ? x : ::Io::Flow::V0::Models::Money.new(x))
10249
+ HttpClient::Preconditions.require_keys(opts, [:margin], 'AmountMargin')
10250
+ @margin = (x = opts.delete(:margin); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x))
10093
10251
  end
10094
10252
 
10095
10253
  def to_json
@@ -10097,7 +10255,7 @@ module Io
10097
10255
  end
10098
10256
 
10099
10257
  def copy(incoming={})
10100
- AmountMarginForm.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
10258
+ AmountMargin.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
10101
10259
  end
10102
10260
 
10103
10261
  def subtype_to_hash
@@ -10108,15 +10266,15 @@ module Io
10108
10266
 
10109
10267
  end
10110
10268
 
10111
- class AppliedPromotion
10269
+ class AmountMarginForm < TierRuleOutcomeForm
10112
10270
 
10113
- attr_reader :type, :value
10271
+ attr_reader :margin
10114
10272
 
10115
10273
  def initialize(incoming={})
10274
+ super(:discriminator => TierRuleOutcomeForm::Types::AMOUNT_MARGIN_FORM)
10116
10275
  opts = HttpClient::Helper.symbolize_keys(incoming)
10117
- HttpClient::Preconditions.require_keys(opts, [:type, :value], 'AppliedPromotion')
10118
- @type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::AppliedPromotionType) ? x : ::Io::Flow::V0::Models::AppliedPromotionType.apply(x))
10119
- @value = (x = opts.delete(:value); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x))
10276
+ HttpClient::Preconditions.require_keys(opts, [:margin], 'AmountMarginForm')
10277
+ @margin = (x = opts.delete(:margin); x.is_a?(::Io::Flow::V0::Models::Money) ? x : ::Io::Flow::V0::Models::Money.new(x))
10120
10278
  end
10121
10279
 
10122
10280
  def to_json
@@ -10124,13 +10282,12 @@ module Io
10124
10282
  end
10125
10283
 
10126
10284
  def copy(incoming={})
10127
- AppliedPromotion.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
10285
+ AmountMarginForm.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
10128
10286
  end
10129
10287
 
10130
- def to_hash
10288
+ def subtype_to_hash
10131
10289
  {
10132
- :type => type.value,
10133
- :value => value.to_hash
10290
+ :margin => margin.to_hash
10134
10291
  }
10135
10292
  end
10136
10293
 
@@ -12264,7 +12421,7 @@ module Io
12264
12421
  # range and cost
12265
12422
  class DeliveryOption
12266
12423
 
12267
- attr_reader :id, :cost, :delivered_duty, :price, :service, :tier, :window, :weight
12424
+ attr_reader :id, :cost, :delivered_duty, :price, :service, :tier, :window, :rule_outcome, :weight
12268
12425
 
12269
12426
  def initialize(incoming={})
12270
12427
  opts = HttpClient::Helper.symbolize_keys(incoming)
@@ -12276,6 +12433,7 @@ module Io
12276
12433
  @service = (x = opts.delete(:service); x.is_a?(::Io::Flow::V0::Models::ServiceSummary) ? x : ::Io::Flow::V0::Models::ServiceSummary.new(x))
12277
12434
  @tier = (x = opts.delete(:tier); x.is_a?(::Io::Flow::V0::Models::TierSummary) ? x : ::Io::Flow::V0::Models::TierSummary.new(x))
12278
12435
  @window = (x = opts.delete(:window); x.is_a?(::Io::Flow::V0::Models::DatetimeRange) ? x : ::Io::Flow::V0::Models::DatetimeRange.new(x))
12436
+ @rule_outcome = (x = opts.delete(:rule_outcome); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::TierRuleOutcome) ? x : ::Io::Flow::V0::Models::TierRuleOutcome.from_json(x)))
12279
12437
  @weight = (x = opts.delete(:weight); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::OptionWeightEstimates) ? x : ::Io::Flow::V0::Models::OptionWeightEstimates.new(x)))
12280
12438
  end
12281
12439
 
@@ -12296,6 +12454,7 @@ module Io
12296
12454
  :service => service.to_hash,
12297
12455
  :tier => tier.to_hash,
12298
12456
  :window => window.to_hash,
12457
+ :rule_outcome => rule_outcome.nil? ? nil : rule_outcome.to_hash,
12299
12458
  :weight => weight.nil? ? nil : weight.to_hash
12300
12459
  }
12301
12460
  end
@@ -13014,41 +13173,15 @@ module Io
13014
13173
 
13015
13174
  end
13016
13175
 
13017
- class ExperienceKeyReference
13018
-
13019
- attr_reader :key
13020
-
13021
- def initialize(incoming={})
13022
- opts = HttpClient::Helper.symbolize_keys(incoming)
13023
- HttpClient::Preconditions.require_keys(opts, [:key], 'ExperienceKeyReference')
13024
- @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
13025
- end
13026
-
13027
- def to_json
13028
- JSON.dump(to_hash)
13029
- end
13030
-
13031
- def copy(incoming={})
13032
- ExperienceKeyReference.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
13033
- end
13034
-
13035
- def to_hash
13036
- {
13037
- :key => key
13038
- }
13039
- end
13040
-
13041
- end
13042
-
13043
13176
  class ExperienceReference < ExpandableExperience
13044
13177
 
13045
- attr_reader :id
13178
+ attr_reader :key
13046
13179
 
13047
13180
  def initialize(incoming={})
13048
13181
  super(:discriminator => ExpandableExperience::Types::EXPERIENCE_REFERENCE)
13049
13182
  opts = HttpClient::Helper.symbolize_keys(incoming)
13050
- HttpClient::Preconditions.require_keys(opts, [:id], 'ExperienceReference')
13051
- @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
13183
+ HttpClient::Preconditions.require_keys(opts, [:key], 'ExperienceReference')
13184
+ @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
13052
13185
  end
13053
13186
 
13054
13187
  def to_json
@@ -13061,7 +13194,7 @@ module Io
13061
13194
 
13062
13195
  def subtype_to_hash
13063
13196
  {
13064
- :id => id
13197
+ :key => key
13065
13198
  }
13066
13199
  end
13067
13200
 
@@ -13538,12 +13671,12 @@ module Io
13538
13671
 
13539
13672
  end
13540
13673
 
13541
- class FreeShipping < AvailablePromotion
13674
+ class FreeShipping < Promotion
13542
13675
 
13543
13676
  attr_reader :trigger
13544
13677
 
13545
13678
  def initialize(incoming={})
13546
- super(:discriminator => AvailablePromotion::Types::FREE_SHIPPING)
13679
+ super(:discriminator => Promotion::Types::FREE_SHIPPING)
13547
13680
  opts = HttpClient::Helper.symbolize_keys(incoming)
13548
13681
  HttpClient::Preconditions.require_keys(opts, [:trigger], 'FreeShipping')
13549
13682
  @trigger = (x = opts.delete(:trigger); x.is_a?(::Io::Flow::V0::Models::PromotionTrigger) ? x : ::Io::Flow::V0::Models::PromotionTrigger.new(x))
@@ -16542,7 +16675,7 @@ module Io
16542
16675
  @currency = (x = opts.delete(:currency); x.is_a?(::Io::Flow::V0::Models::Currency) ? x : ::Io::Flow::V0::Models::Currency.new(x))
16543
16676
  @language = (x = opts.delete(:language); x.is_a?(::Io::Flow::V0::Models::Language) ? x : ::Io::Flow::V0::Models::Language.new(x))
16544
16677
  @locale = (x = opts.delete(:locale); x.is_a?(::Io::Flow::V0::Models::Locale) ? x : ::Io::Flow::V0::Models::Locale.new(x))
16545
- @experience = (x = opts.delete(:experience); x.is_a?(::Io::Flow::V0::Models::ExperienceKeyReference) ? x : ::Io::Flow::V0::Models::ExperienceKeyReference.new(x))
16678
+ @experience = (x = opts.delete(:experience); x.is_a?(::Io::Flow::V0::Models::ExperienceReference) ? x : ::Io::Flow::V0::Models::ExperienceReference.new(x))
16546
16679
  end
16547
16680
 
16548
16681
  def to_json
@@ -17484,12 +17617,12 @@ module Io
17484
17617
 
17485
17618
  class OnlineAuthorization < Authorization
17486
17619
 
17487
- attr_reader :id, :key, :payment, :amount, :currency, :customer, :attributes, :destination, :order, :ip, :created_at
17620
+ attr_reader :id, :key, :payment, :amount, :currency, :customer, :attributes, :destination, :order, :ip, :result, :created_at
17488
17621
 
17489
17622
  def initialize(incoming={})
17490
17623
  super(:discriminator => Authorization::Types::ONLINE_AUTHORIZATION)
17491
17624
  opts = HttpClient::Helper.symbolize_keys(incoming)
17492
- HttpClient::Preconditions.require_keys(opts, [:id, :key, :payment, :amount, :currency, :customer, :attributes, :created_at], 'OnlineAuthorization')
17625
+ HttpClient::Preconditions.require_keys(opts, [:id, :key, :payment, :amount, :currency, :customer, :attributes, :result, :created_at], 'OnlineAuthorization')
17493
17626
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
17494
17627
  @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
17495
17628
  @payment = (x = opts.delete(:payment); x.is_a?(::Io::Flow::V0::Models::PaymentReference) ? x : ::Io::Flow::V0::Models::PaymentReference.new(x))
@@ -17500,6 +17633,7 @@ module Io
17500
17633
  @destination = (x = opts.delete(:destination); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Address) ? x : ::Io::Flow::V0::Models::Address.new(x)))
17501
17634
  @order = (x = opts.delete(:order); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::AuthorizationOrderReference) ? x : ::Io::Flow::V0::Models::AuthorizationOrderReference.new(x)))
17502
17635
  @ip = (x = opts.delete(:ip); x.nil? ? nil : HttpClient::Preconditions.assert_class('ip', x, String))
17636
+ @result = (x = opts.delete(:result); x.is_a?(::Io::Flow::V0::Models::AuthorizationResult) ? x : ::Io::Flow::V0::Models::AuthorizationResult.new(x))
17503
17637
  @created_at = HttpClient::Preconditions.assert_class('created_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:created_at)), DateTime)
17504
17638
  end
17505
17639
 
@@ -17523,6 +17657,7 @@ module Io
17523
17657
  :destination => destination.nil? ? nil : destination.to_hash,
17524
17658
  :order => order.nil? ? nil : order.to_hash,
17525
17659
  :ip => ip,
17660
+ :result => result.to_hash,
17526
17661
  :created_at => created_at
17527
17662
  }
17528
17663
  end
@@ -18650,14 +18785,15 @@ module Io
18650
18785
 
18651
18786
  class OrganizationSession < Session
18652
18787
 
18653
- attr_reader :id, :organization, :attributes, :local
18788
+ attr_reader :id, :organization, :environment, :attributes, :local
18654
18789
 
18655
18790
  def initialize(incoming={})
18656
18791
  super(:discriminator => Session::Types::ORGANIZATION_SESSION)
18657
18792
  opts = HttpClient::Helper.symbolize_keys(incoming)
18658
- HttpClient::Preconditions.require_keys(opts, [:id, :organization, :attributes], 'OrganizationSession')
18793
+ HttpClient::Preconditions.require_keys(opts, [:id, :organization, :environment, :attributes], 'OrganizationSession')
18659
18794
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
18660
18795
  @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
18796
+ @environment = (x = opts.delete(:environment); x.is_a?(::Io::Flow::V0::Models::Environment) ? x : ::Io::Flow::V0::Models::Environment.apply(x))
18661
18797
  @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 }
18662
18798
  @local = (x = opts.delete(:local); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::LocalSession) ? x : ::Io::Flow::V0::Models::LocalSession.new(x)))
18663
18799
  end
@@ -18674,6 +18810,7 @@ module Io
18674
18810
  {
18675
18811
  :id => id,
18676
18812
  :organization => organization,
18813
+ :environment => environment.value,
18677
18814
  :attributes => attributes,
18678
18815
  :local => local.nil? ? nil : local.to_hash
18679
18816
  }
@@ -19881,8 +20018,8 @@ module Io
19881
20018
  def initialize(incoming={})
19882
20019
  opts = HttpClient::Helper.symbolize_keys(incoming)
19883
20020
  HttpClient::Preconditions.require_keys(opts, [:applied, :available], 'Promotions')
19884
- @applied = HttpClient::Preconditions.assert_class('applied', opts.delete(:applied), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::AppliedPromotion) ? x : ::Io::Flow::V0::Models::AppliedPromotion.new(x)) }
19885
- @available = HttpClient::Preconditions.assert_class('available', opts.delete(:available), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::AvailablePromotion) ? x : ::Io::Flow::V0::Models::AvailablePromotion.from_json(x)) }
20021
+ @applied = HttpClient::Preconditions.assert_class('applied', opts.delete(:applied), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::Promotion) ? x : ::Io::Flow::V0::Models::Promotion.from_json(x)) }
20022
+ @available = HttpClient::Preconditions.assert_class('available', opts.delete(:available), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::Promotion) ? x : ::Io::Flow::V0::Models::Promotion.from_json(x)) }
19886
20023
  end
19887
20024
 
19888
20025
  def to_json
@@ -21404,18 +21541,20 @@ module Io
21404
21541
  # shipper to transport a package from a given origin to destination
21405
21542
  class ShippingLabel
21406
21543
 
21407
- attr_reader :id, :direction, :attributes, :carrier_tracking_number, :cost, :destination, :flow_tracking_number, :origin, :service, :window, :commercial_invoice, :zpl, :pdf, :png, :order
21544
+ attr_reader :id, :direction, :attributes, :carrier_tracking_number, :carrier_tracking_number_url, :cost, :destination, :flow_tracking_number, :flow_tracking_number_url, :origin, :service, :window, :commercial_invoice, :zpl, :pdf, :png, :order
21408
21545
 
21409
21546
  def initialize(incoming={})
21410
21547
  opts = HttpClient::Helper.symbolize_keys(incoming)
21411
- HttpClient::Preconditions.require_keys(opts, [:id, :direction, :carrier_tracking_number, :cost, :destination, :flow_tracking_number, :origin, :service, :window], 'ShippingLabel')
21548
+ HttpClient::Preconditions.require_keys(opts, [:id, :direction, :carrier_tracking_number, :carrier_tracking_number_url, :cost, :destination, :flow_tracking_number, :flow_tracking_number_url, :origin, :service, :window], 'ShippingLabel')
21412
21549
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
21413
21550
  @direction = (x = opts.delete(:direction); x.is_a?(::Io::Flow::V0::Models::Direction) ? x : ::Io::Flow::V0::Models::Direction.apply(x))
21414
21551
  @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 }
21415
21552
  @carrier_tracking_number = HttpClient::Preconditions.assert_class('carrier_tracking_number', opts.delete(:carrier_tracking_number), String)
21553
+ @carrier_tracking_number_url = HttpClient::Preconditions.assert_class('carrier_tracking_number_url', opts.delete(:carrier_tracking_number_url), String)
21416
21554
  @cost = (x = opts.delete(:cost); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x))
21417
21555
  @destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::ShippingAddress) ? x : ::Io::Flow::V0::Models::ShippingAddress.new(x))
21418
21556
  @flow_tracking_number = HttpClient::Preconditions.assert_class('flow_tracking_number', opts.delete(:flow_tracking_number), String)
21557
+ @flow_tracking_number_url = HttpClient::Preconditions.assert_class('flow_tracking_number_url', opts.delete(:flow_tracking_number_url), String)
21419
21558
  @origin = (x = opts.delete(:origin); x.is_a?(::Io::Flow::V0::Models::ShippingAddress) ? x : ::Io::Flow::V0::Models::ShippingAddress.new(x))
21420
21559
  @service = (x = opts.delete(:service); x.is_a?(::Io::Flow::V0::Models::ServiceSummary) ? x : ::Io::Flow::V0::Models::ServiceSummary.new(x))
21421
21560
  @window = (x = opts.delete(:window); x.is_a?(::Io::Flow::V0::Models::DatetimeRange) ? x : ::Io::Flow::V0::Models::DatetimeRange.new(x))
@@ -21440,9 +21579,11 @@ module Io
21440
21579
  :direction => direction.value,
21441
21580
  :attributes => attributes,
21442
21581
  :carrier_tracking_number => carrier_tracking_number,
21582
+ :carrier_tracking_number_url => carrier_tracking_number_url,
21443
21583
  :cost => cost.to_hash,
21444
21584
  :destination => destination.to_hash,
21445
21585
  :flow_tracking_number => flow_tracking_number,
21586
+ :flow_tracking_number_url => flow_tracking_number_url,
21446
21587
  :origin => origin.to_hash,
21447
21588
  :service => service.to_hash,
21448
21589
  :window => window.to_hash,
@@ -21685,14 +21826,15 @@ module Io
21685
21826
 
21686
21827
  class ShopifySession < Session
21687
21828
 
21688
- attr_reader :id, :organization, :attributes, :local, :shop, :cart, :experiments
21829
+ attr_reader :id, :organization, :environment, :attributes, :local, :shop, :cart, :experiments
21689
21830
 
21690
21831
  def initialize(incoming={})
21691
21832
  super(:discriminator => Session::Types::SHOPIFY_SESSION)
21692
21833
  opts = HttpClient::Helper.symbolize_keys(incoming)
21693
- HttpClient::Preconditions.require_keys(opts, [:id, :organization, :attributes, :shop, :cart], 'ShopifySession')
21834
+ HttpClient::Preconditions.require_keys(opts, [:id, :organization, :environment, :attributes, :shop, :cart], 'ShopifySession')
21694
21835
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
21695
21836
  @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
21837
+ @environment = (x = opts.delete(:environment); x.is_a?(::Io::Flow::V0::Models::Environment) ? x : ::Io::Flow::V0::Models::Environment.apply(x))
21696
21838
  @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 }
21697
21839
  @local = (x = opts.delete(:local); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::LocalSession) ? x : ::Io::Flow::V0::Models::LocalSession.new(x)))
21698
21840
  @shop = HttpClient::Preconditions.assert_class('shop', opts.delete(:shop), String)
@@ -21712,6 +21854,7 @@ module Io
21712
21854
  {
21713
21855
  :id => id,
21714
21856
  :organization => organization,
21857
+ :environment => environment.value,
21715
21858
  :attributes => attributes,
21716
21859
  :local => local.nil? ? nil : local.to_hash,
21717
21860
  :shop => shop,
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.6
4
+ version: 0.2.7
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-04-01 00:00:00.000000000 Z
11
+ date: 2017-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json