flowcommerce 0.1.20 → 0.1.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/flow_commerce/#flow_api_v0_client.rb# +22922 -0
- data/lib/flow_commerce/flow_api_v0_client.rb +487 -76
- metadata +3 -2
@@ -1,6 +1,6 @@
|
|
1
1
|
# Generated by apidoc - http://www.apidoc.me
|
2
2
|
# Service version: 0.2.65
|
3
|
-
# apidoc:0.11.74 http://www.apidoc.me/flow/api/0.2.
|
3
|
+
# apidoc:0.11.74 http://www.apidoc.me/flow/api/0.2.77/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.74 http://www.apidoc.me/flow/api/0.2.
|
28
|
+
USER_AGENT = 'apidoc:0.11.74 http://www.apidoc.me/flow/api/0.2.77/ruby_client' unless defined?(Constants::USER_AGENT)
|
29
29
|
VERSION = '0.2.65' unless defined?(Constants::VERSION)
|
30
30
|
VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
|
31
31
|
|
@@ -548,44 +548,9 @@ module Io
|
|
548
548
|
::Io::Flow::V0::Models::Experience.new(r)
|
549
549
|
end
|
550
550
|
|
551
|
-
|
552
|
-
def get_by_key(organization, key)
|
553
|
-
HttpClient::Preconditions.assert_class('organization', organization, String)
|
554
|
-
HttpClient::Preconditions.assert_class('key', key, String)
|
555
|
-
r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(key)}").get
|
556
|
-
::Io::Flow::V0::Models::Experience.new(r)
|
557
|
-
end
|
558
|
-
|
559
|
-
# Update experience with the specified key, creating if it does not exist.
|
560
|
-
def put_by_key(organization, key, experience_form)
|
561
|
-
HttpClient::Preconditions.assert_class('organization', organization, String)
|
562
|
-
HttpClient::Preconditions.assert_class('key', key, String)
|
563
|
-
HttpClient::Preconditions.assert_class('experience_form', experience_form, ::Io::Flow::V0::Models::ExperienceForm)
|
564
|
-
r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(key)}").with_json(experience_form.to_json).put
|
565
|
-
::Io::Flow::V0::Models::Experience.new(r)
|
566
|
-
end
|
567
|
-
|
568
|
-
# Delete the experience with this key
|
569
|
-
def delete_by_key(organization, key)
|
570
|
-
HttpClient::Preconditions.assert_class('organization', organization, String)
|
571
|
-
HttpClient::Preconditions.assert_class('key', key, String)
|
572
|
-
r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(key)}").delete
|
573
|
-
nil
|
574
|
-
end
|
575
|
-
|
576
|
-
# Returns detailed information on the pricing of this item within this
|
577
|
-
# experience
|
578
|
-
def get_items_and_price_by_key_and_number(organization, key, number)
|
551
|
+
def get_margins_by_experience_key(organization, experience_key, incoming={})
|
579
552
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
580
|
-
HttpClient::Preconditions.assert_class('
|
581
|
-
HttpClient::Preconditions.assert_class('number', number, String)
|
582
|
-
r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(key)}/items/#{CGI.escape(number)}/price").get
|
583
|
-
::Io::Flow::V0::Models::PriceCheck.new(r)
|
584
|
-
end
|
585
|
-
|
586
|
-
def get_margins_by_key(organization, key, incoming={})
|
587
|
-
HttpClient::Preconditions.assert_class('organization', organization, String)
|
588
|
-
HttpClient::Preconditions.assert_class('key', key, String)
|
553
|
+
HttpClient::Preconditions.assert_class('experience_key', experience_key, String)
|
589
554
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
590
555
|
query = {
|
591
556
|
:id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
|
@@ -593,54 +558,46 @@ module Io
|
|
593
558
|
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
594
559
|
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "name" : x), String)
|
595
560
|
}.delete_if { |k, v| v.nil? }
|
596
|
-
r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(
|
561
|
+
r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(experience_key)}/margins").with_query(query).get
|
597
562
|
r.map { |x| ::Io::Flow::V0::Models::ItemMargin.new(x) }
|
598
563
|
end
|
599
564
|
|
600
|
-
def
|
565
|
+
def post_margins_by_experience_key(organization, experience_key, item_margin_post_form)
|
601
566
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
602
|
-
HttpClient::Preconditions.assert_class('
|
603
|
-
HttpClient::Preconditions.assert_class('
|
604
|
-
r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(
|
567
|
+
HttpClient::Preconditions.assert_class('experience_key', experience_key, String)
|
568
|
+
HttpClient::Preconditions.assert_class('item_margin_post_form', item_margin_post_form, ::Io::Flow::V0::Models::ItemMarginPostForm)
|
569
|
+
r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(experience_key)}/margins").with_json(item_margin_post_form.to_json).post
|
605
570
|
::Io::Flow::V0::Models::ItemMargin.new(r)
|
606
571
|
end
|
607
572
|
|
608
|
-
def
|
573
|
+
def get_margins_by_experience_key_and_key(organization, experience_key, key)
|
609
574
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
575
|
+
HttpClient::Preconditions.assert_class('experience_key', experience_key, String)
|
610
576
|
HttpClient::Preconditions.assert_class('key', key, String)
|
611
|
-
|
612
|
-
r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(key)}/margins").with_json(item_margins.map { |o| o.to_hash }.to_json).put
|
613
|
-
r.map { |x| ::Io::Flow::V0::Models::ItemMargin.new(x) }
|
614
|
-
end
|
615
|
-
|
616
|
-
def get_margins_by_key_and_id(organization, key, id)
|
617
|
-
HttpClient::Preconditions.assert_class('organization', organization, String)
|
618
|
-
HttpClient::Preconditions.assert_class('key', key, String)
|
619
|
-
HttpClient::Preconditions.assert_class('id', id, String)
|
620
|
-
r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(key)}/margins/#{CGI.escape(id)}").get
|
577
|
+
r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(experience_key)}/margins/#{CGI.escape(key)}").get
|
621
578
|
::Io::Flow::V0::Models::ItemMargin.new(r)
|
622
579
|
end
|
623
580
|
|
624
|
-
def
|
581
|
+
def put_margins_by_experience_key_and_key(organization, experience_key, key, item_margin_put_form)
|
625
582
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
583
|
+
HttpClient::Preconditions.assert_class('experience_key', experience_key, String)
|
626
584
|
HttpClient::Preconditions.assert_class('key', key, String)
|
627
|
-
HttpClient::Preconditions.assert_class('
|
628
|
-
|
629
|
-
r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(key)}/margins/#{CGI.escape(id)}").with_json(item_margin_form.to_json).put
|
585
|
+
HttpClient::Preconditions.assert_class('item_margin_put_form', item_margin_put_form, ::Io::Flow::V0::Models::ItemMarginPutForm)
|
586
|
+
r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(experience_key)}/margins/#{CGI.escape(key)}").with_json(item_margin_put_form.to_json).put
|
630
587
|
::Io::Flow::V0::Models::ItemMargin.new(r)
|
631
588
|
end
|
632
589
|
|
633
|
-
def
|
590
|
+
def delete_margins_by_experience_key_and_key(organization, experience_key, key)
|
634
591
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
592
|
+
HttpClient::Preconditions.assert_class('experience_key', experience_key, String)
|
635
593
|
HttpClient::Preconditions.assert_class('key', key, String)
|
636
|
-
|
637
|
-
r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(key)}/margins/#{CGI.escape(id)}").delete
|
594
|
+
r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(experience_key)}/margins/#{CGI.escape(key)}").delete
|
638
595
|
nil
|
639
596
|
end
|
640
597
|
|
641
|
-
def
|
598
|
+
def get_margins_and_versions_by_experience_key(organization, experience_key, incoming={})
|
642
599
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
643
|
-
HttpClient::Preconditions.assert_class('
|
600
|
+
HttpClient::Preconditions.assert_class('experience_key', experience_key, String)
|
644
601
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
645
602
|
query = {
|
646
603
|
:id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
|
@@ -648,10 +605,45 @@ module Io
|
|
648
605
|
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
649
606
|
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
|
650
607
|
}.delete_if { |k, v| v.nil? }
|
651
|
-
r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(
|
608
|
+
r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(experience_key)}/margins/versions").with_query(query).get
|
652
609
|
r.map { |x| ::Io::Flow::V0::Models::ItemMarginVersion.new(x) }
|
653
610
|
end
|
654
611
|
|
612
|
+
# Returns information about a specific experience.
|
613
|
+
def get_by_key(organization, key)
|
614
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
615
|
+
HttpClient::Preconditions.assert_class('key', key, String)
|
616
|
+
r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(key)}").get
|
617
|
+
::Io::Flow::V0::Models::Experience.new(r)
|
618
|
+
end
|
619
|
+
|
620
|
+
# Update experience with the specified key, creating if it does not exist.
|
621
|
+
def put_by_key(organization, key, experience_form)
|
622
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
623
|
+
HttpClient::Preconditions.assert_class('key', key, String)
|
624
|
+
HttpClient::Preconditions.assert_class('experience_form', experience_form, ::Io::Flow::V0::Models::ExperienceForm)
|
625
|
+
r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(key)}").with_json(experience_form.to_json).put
|
626
|
+
::Io::Flow::V0::Models::Experience.new(r)
|
627
|
+
end
|
628
|
+
|
629
|
+
# Delete the experience with this key
|
630
|
+
def delete_by_key(organization, key)
|
631
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
632
|
+
HttpClient::Preconditions.assert_class('key', key, String)
|
633
|
+
r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(key)}").delete
|
634
|
+
nil
|
635
|
+
end
|
636
|
+
|
637
|
+
# Returns detailed information on the pricing of this item within this
|
638
|
+
# experience
|
639
|
+
def get_items_and_price_by_key_and_number(organization, key, number)
|
640
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
641
|
+
HttpClient::Preconditions.assert_class('key', key, String)
|
642
|
+
HttpClient::Preconditions.assert_class('number', number, String)
|
643
|
+
r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(key)}/items/#{CGI.escape(number)}/price").get
|
644
|
+
::Io::Flow::V0::Models::PriceCheck.new(r)
|
645
|
+
end
|
646
|
+
|
655
647
|
# Get the pricing settings for this experience
|
656
648
|
def get_pricing_by_key(organization, key)
|
657
649
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
@@ -1029,6 +1021,14 @@ module Io
|
|
1029
1021
|
::Io::Flow::V0::Models::OrderIdentifier.new(r)
|
1030
1022
|
end
|
1031
1023
|
|
1024
|
+
def put_by_number(organization, number, order_identifier_put_form)
|
1025
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
1026
|
+
HttpClient::Preconditions.assert_class('number', number, String)
|
1027
|
+
HttpClient::Preconditions.assert_class('order_identifier_put_form', order_identifier_put_form, ::Io::Flow::V0::Models::OrderIdentifierPutForm)
|
1028
|
+
r = @client.request("/#{CGI.escape(organization)}/order-identifiers/#{CGI.escape(number)}").with_json(order_identifier_put_form.to_json).put
|
1029
|
+
::Io::Flow::V0::Models::OrderIdentifier.new(r)
|
1030
|
+
end
|
1031
|
+
|
1032
1032
|
def delete_by_number(organization, number)
|
1033
1033
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
1034
1034
|
HttpClient::Preconditions.assert_class('number', number, String)
|
@@ -4241,6 +4241,66 @@ module Io
|
|
4241
4241
|
|
4242
4242
|
end
|
4243
4243
|
|
4244
|
+
class AvailablePromotion
|
4245
|
+
|
4246
|
+
module Types
|
4247
|
+
FREE_SHIPPING = 'free_shipping' unless defined?(FREE_SHIPPING)
|
4248
|
+
end
|
4249
|
+
|
4250
|
+
attr_reader :discriminator
|
4251
|
+
|
4252
|
+
def initialize(incoming={})
|
4253
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
4254
|
+
HttpClient::Preconditions.require_keys(opts, [:discriminator], 'AvailablePromotion')
|
4255
|
+
@discriminator = HttpClient::Preconditions.assert_class('discriminator', opts.delete(:discriminator), String)
|
4256
|
+
end
|
4257
|
+
|
4258
|
+
def subtype_to_hash
|
4259
|
+
raise 'Cannot serialize an instance of available_promotion directly - must use one of the specific types: free_shipping'
|
4260
|
+
end
|
4261
|
+
|
4262
|
+
def to_hash
|
4263
|
+
subtype_to_hash.merge(:discriminator => @discriminator)
|
4264
|
+
end
|
4265
|
+
|
4266
|
+
def AvailablePromotion.from_json(hash)
|
4267
|
+
HttpClient::Preconditions.assert_class('hash', hash, Hash)
|
4268
|
+
discriminator = HttpClient::Helper.symbolize_keys(hash)[:discriminator].to_s.strip
|
4269
|
+
if discriminator.empty?
|
4270
|
+
raise "Union type[available_promotion] requires a field named 'discriminator'"
|
4271
|
+
end
|
4272
|
+
case discriminator
|
4273
|
+
when Types::FREE_SHIPPING; FreeShipping.new(hash)
|
4274
|
+
else AvailablePromotionUndefinedType.new(:discriminator => discriminator)
|
4275
|
+
end
|
4276
|
+
end
|
4277
|
+
|
4278
|
+
end
|
4279
|
+
|
4280
|
+
class AvailablePromotionUndefinedType < AvailablePromotion
|
4281
|
+
|
4282
|
+
attr_reader :name
|
4283
|
+
|
4284
|
+
def initialize(incoming={})
|
4285
|
+
super(:discriminator => 'undefined_type')
|
4286
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
4287
|
+
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:discriminator), String)
|
4288
|
+
end
|
4289
|
+
|
4290
|
+
def subtype_to_hash
|
4291
|
+
raise 'Unable to serialize undefined type to json'
|
4292
|
+
end
|
4293
|
+
|
4294
|
+
def copy(incoming={})
|
4295
|
+
raise 'Operation not supported for undefined type'
|
4296
|
+
end
|
4297
|
+
|
4298
|
+
def to_hash
|
4299
|
+
raise 'Operation not supported for undefined type'
|
4300
|
+
end
|
4301
|
+
|
4302
|
+
end
|
4303
|
+
|
4244
4304
|
# De Minimis describes the country specific rules for exactly how tax and duties
|
4245
4305
|
# are calculated, as well as any exemptions that apply. See
|
4246
4306
|
# https://en.wikipedia.org/wiki/De_minimis for more information.
|
@@ -4395,6 +4455,8 @@ module Io
|
|
4395
4455
|
ORDER_IDENTIFIER_UPSERTED = 'order_identifier_upserted' unless defined?(ORDER_IDENTIFIER_UPSERTED)
|
4396
4456
|
PRICING_DELETED = 'pricing_deleted' unless defined?(PRICING_DELETED)
|
4397
4457
|
PRICING_UPSERTED = 'pricing_upserted' unless defined?(PRICING_UPSERTED)
|
4458
|
+
TIER_UPSERTED = 'tier_upserted' unless defined?(TIER_UPSERTED)
|
4459
|
+
TIER_DELETED = 'tier_deleted' unless defined?(TIER_DELETED)
|
4398
4460
|
HS6_CODE_UPSERTED = 'hs6_code_upserted' unless defined?(HS6_CODE_UPSERTED)
|
4399
4461
|
HS6_CODE_DELETED = 'hs6_code_deleted' unless defined?(HS6_CODE_DELETED)
|
4400
4462
|
HS10_CODE_UPSERTED = 'hs10_code_upserted' unless defined?(HS10_CODE_UPSERTED)
|
@@ -4437,7 +4499,7 @@ module Io
|
|
4437
4499
|
end
|
4438
4500
|
|
4439
4501
|
def subtype_to_hash
|
4440
|
-
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, experience_deleted, experience_upserted, item_margin_deleted, item_margin_upserted, label_format_deleted, label_format_upserted, order_deleted, order_upserted, order_identifier_deleted, order_identifier_upserted, pricing_deleted, pricing_upserted, 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'
|
4502
|
+
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, experience_deleted, experience_upserted, item_margin_deleted, item_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'
|
4441
4503
|
end
|
4442
4504
|
|
4443
4505
|
def to_hash
|
@@ -4475,6 +4537,8 @@ module Io
|
|
4475
4537
|
when Types::ORDER_IDENTIFIER_UPSERTED; OrderIdentifierUpserted.new(hash)
|
4476
4538
|
when Types::PRICING_DELETED; PricingDeleted.new(hash)
|
4477
4539
|
when Types::PRICING_UPSERTED; PricingUpserted.new(hash)
|
4540
|
+
when Types::TIER_UPSERTED; TierUpserted.new(hash)
|
4541
|
+
when Types::TIER_DELETED; TierDeleted.new(hash)
|
4478
4542
|
when Types::HS6_CODE_UPSERTED; Hs6CodeUpserted.new(hash)
|
4479
4543
|
when Types::HS6_CODE_DELETED; Hs6CodeDeleted.new(hash)
|
4480
4544
|
when Types::HS10_CODE_UPSERTED; Hs10CodeUpserted.new(hash)
|
@@ -5558,6 +5622,44 @@ module Io
|
|
5558
5622
|
|
5559
5623
|
end
|
5560
5624
|
|
5625
|
+
class AppliedPromotionType
|
5626
|
+
|
5627
|
+
attr_reader :value
|
5628
|
+
|
5629
|
+
def initialize(value)
|
5630
|
+
@value = HttpClient::Preconditions.assert_class('value', value, String)
|
5631
|
+
end
|
5632
|
+
|
5633
|
+
# Returns the instance of AppliedPromotionType for this value, creating a new instance for an unknown value
|
5634
|
+
def AppliedPromotionType.apply(value)
|
5635
|
+
if value.instance_of?(AppliedPromotionType)
|
5636
|
+
value
|
5637
|
+
else
|
5638
|
+
HttpClient::Preconditions.assert_class_or_nil('value', value, String)
|
5639
|
+
value.nil? ? nil : (from_string(value) || AppliedPromotionType.new(value))
|
5640
|
+
end
|
5641
|
+
end
|
5642
|
+
|
5643
|
+
# Returns the instance of AppliedPromotionType for this value, or nil if not found
|
5644
|
+
def AppliedPromotionType.from_string(value)
|
5645
|
+
HttpClient::Preconditions.assert_class('value', value, String)
|
5646
|
+
AppliedPromotionType.ALL.find { |v| v.value == value }
|
5647
|
+
end
|
5648
|
+
|
5649
|
+
def AppliedPromotionType.ALL
|
5650
|
+
@@all ||= [AppliedPromotionType.free_shipping]
|
5651
|
+
end
|
5652
|
+
|
5653
|
+
def AppliedPromotionType.free_shipping
|
5654
|
+
@@_free_shipping ||= AppliedPromotionType.new('free_shipping')
|
5655
|
+
end
|
5656
|
+
|
5657
|
+
def to_hash
|
5658
|
+
value
|
5659
|
+
end
|
5660
|
+
|
5661
|
+
end
|
5662
|
+
|
5561
5663
|
class AttributeDataType
|
5562
5664
|
|
5563
5665
|
attr_reader :value
|
@@ -6508,7 +6610,7 @@ module Io
|
|
6508
6610
|
end
|
6509
6611
|
|
6510
6612
|
def EventType.ALL
|
6511
|
-
@@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.experience_deleted, EventType.experience_upserted, EventType.item_margin_deleted, EventType.item_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.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]
|
6613
|
+
@@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.experience_deleted, EventType.experience_upserted, EventType.item_margin_deleted, EventType.item_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]
|
6512
6614
|
end
|
6513
6615
|
|
6514
6616
|
def EventType.attribute_upserted
|
@@ -6607,6 +6709,14 @@ module Io
|
|
6607
6709
|
@@_pricing_upserted ||= EventType.new('pricing_upserted')
|
6608
6710
|
end
|
6609
6711
|
|
6712
|
+
def EventType.tier_upserted
|
6713
|
+
@@_tier_upserted ||= EventType.new('tier_upserted')
|
6714
|
+
end
|
6715
|
+
|
6716
|
+
def EventType.tier_deleted
|
6717
|
+
@@_tier_deleted ||= EventType.new('tier_deleted')
|
6718
|
+
end
|
6719
|
+
|
6610
6720
|
def EventType.hs6_code_upserted
|
6611
6721
|
@@_hs6_code_upserted ||= EventType.new('hs6_code_upserted')
|
6612
6722
|
end
|
@@ -7785,6 +7895,44 @@ module Io
|
|
7785
7895
|
|
7786
7896
|
end
|
7787
7897
|
|
7898
|
+
class PromotionTriggerType
|
7899
|
+
|
7900
|
+
attr_reader :value
|
7901
|
+
|
7902
|
+
def initialize(value)
|
7903
|
+
@value = HttpClient::Preconditions.assert_class('value', value, String)
|
7904
|
+
end
|
7905
|
+
|
7906
|
+
# Returns the instance of PromotionTriggerType for this value, creating a new instance for an unknown value
|
7907
|
+
def PromotionTriggerType.apply(value)
|
7908
|
+
if value.instance_of?(PromotionTriggerType)
|
7909
|
+
value
|
7910
|
+
else
|
7911
|
+
HttpClient::Preconditions.assert_class_or_nil('value', value, String)
|
7912
|
+
value.nil? ? nil : (from_string(value) || PromotionTriggerType.new(value))
|
7913
|
+
end
|
7914
|
+
end
|
7915
|
+
|
7916
|
+
# Returns the instance of PromotionTriggerType for this value, or nil if not found
|
7917
|
+
def PromotionTriggerType.from_string(value)
|
7918
|
+
HttpClient::Preconditions.assert_class('value', value, String)
|
7919
|
+
PromotionTriggerType.ALL.find { |v| v.value == value }
|
7920
|
+
end
|
7921
|
+
|
7922
|
+
def PromotionTriggerType.ALL
|
7923
|
+
@@all ||= [PromotionTriggerType.order_subtotal]
|
7924
|
+
end
|
7925
|
+
|
7926
|
+
def PromotionTriggerType.order_subtotal
|
7927
|
+
@@_order_subtotal ||= PromotionTriggerType.new('order_subtotal')
|
7928
|
+
end
|
7929
|
+
|
7930
|
+
def to_hash
|
7931
|
+
value
|
7932
|
+
end
|
7933
|
+
|
7934
|
+
end
|
7935
|
+
|
7788
7936
|
class QueryType
|
7789
7937
|
|
7790
7938
|
attr_reader :value
|
@@ -9316,6 +9464,34 @@ module Io
|
|
9316
9464
|
|
9317
9465
|
end
|
9318
9466
|
|
9467
|
+
class AppliedPromotion
|
9468
|
+
|
9469
|
+
attr_reader :type, :value
|
9470
|
+
|
9471
|
+
def initialize(incoming={})
|
9472
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
9473
|
+
HttpClient::Preconditions.require_keys(opts, [:type, :value], 'AppliedPromotion')
|
9474
|
+
@type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::AppliedPromotionType) ? x : ::Io::Flow::V0::Models::AppliedPromotionType.apply(x))
|
9475
|
+
@value = (x = opts.delete(:value); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x))
|
9476
|
+
end
|
9477
|
+
|
9478
|
+
def to_json
|
9479
|
+
JSON.dump(to_hash)
|
9480
|
+
end
|
9481
|
+
|
9482
|
+
def copy(incoming={})
|
9483
|
+
AppliedPromotion.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
9484
|
+
end
|
9485
|
+
|
9486
|
+
def to_hash
|
9487
|
+
{
|
9488
|
+
:type => type.value,
|
9489
|
+
:value => value.to_hash
|
9490
|
+
}
|
9491
|
+
end
|
9492
|
+
|
9493
|
+
end
|
9494
|
+
|
9319
9495
|
# Rule outcome where shipping surfaced in quote is actual cost of the service
|
9320
9496
|
class AtCost < TierRuleOutcome
|
9321
9497
|
|
@@ -12501,6 +12677,33 @@ module Io
|
|
12501
12677
|
|
12502
12678
|
end
|
12503
12679
|
|
12680
|
+
class FreeShipping < AvailablePromotion
|
12681
|
+
|
12682
|
+
attr_reader :trigger
|
12683
|
+
|
12684
|
+
def initialize(incoming={})
|
12685
|
+
super(:discriminator => AvailablePromotion::Types::FREE_SHIPPING)
|
12686
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
12687
|
+
HttpClient::Preconditions.require_keys(opts, [:trigger], 'FreeShipping')
|
12688
|
+
@trigger = (x = opts.delete(:trigger); x.is_a?(::Io::Flow::V0::Models::PromotionTrigger) ? x : ::Io::Flow::V0::Models::PromotionTrigger.new(x))
|
12689
|
+
end
|
12690
|
+
|
12691
|
+
def to_json
|
12692
|
+
JSON.dump(to_hash)
|
12693
|
+
end
|
12694
|
+
|
12695
|
+
def copy(incoming={})
|
12696
|
+
FreeShipping.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
12697
|
+
end
|
12698
|
+
|
12699
|
+
def subtype_to_hash
|
12700
|
+
{
|
12701
|
+
:trigger => trigger.to_hash
|
12702
|
+
}
|
12703
|
+
end
|
12704
|
+
|
12705
|
+
end
|
12706
|
+
|
12504
12707
|
class FulfillmentExperienceReference
|
12505
12708
|
|
12506
12709
|
attr_reader :id, :currency
|
@@ -14637,12 +14840,13 @@ module Io
|
|
14637
14840
|
# Defines a fixed and percent margin to apply to items matching a query.
|
14638
14841
|
class ItemMargin
|
14639
14842
|
|
14640
|
-
attr_reader :id, :name, :q, :fixed, :percent, :position
|
14843
|
+
attr_reader :id, :key, :name, :q, :fixed, :percent, :position
|
14641
14844
|
|
14642
14845
|
def initialize(incoming={})
|
14643
14846
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
14644
|
-
HttpClient::Preconditions.require_keys(opts, [:id, :name, :q, :fixed, :percent, :position], 'ItemMargin')
|
14847
|
+
HttpClient::Preconditions.require_keys(opts, [:id, :key, :name, :q, :fixed, :percent, :position], 'ItemMargin')
|
14645
14848
|
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
14849
|
+
@key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
|
14646
14850
|
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
|
14647
14851
|
@q = HttpClient::Preconditions.assert_class('q', opts.delete(:q), String)
|
14648
14852
|
@fixed = HttpClient::Preconditions.assert_class('fixed', HttpClient::Helper.to_big_decimal(opts.delete(:fixed)), BigDecimal)
|
@@ -14661,6 +14865,7 @@ module Io
|
|
14661
14865
|
def to_hash
|
14662
14866
|
{
|
14663
14867
|
:id => id,
|
14868
|
+
:key => key,
|
14664
14869
|
:name => name,
|
14665
14870
|
:q => q,
|
14666
14871
|
:fixed => fixed,
|
@@ -14707,13 +14912,50 @@ module Io
|
|
14707
14912
|
end
|
14708
14913
|
|
14709
14914
|
# A percent and/or fixed margin to apply to items based on query.
|
14710
|
-
class
|
14915
|
+
class ItemMarginPostForm
|
14916
|
+
|
14917
|
+
attr_reader :name, :q, :key, :fixed, :percent, :position
|
14918
|
+
|
14919
|
+
def initialize(incoming={})
|
14920
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
14921
|
+
HttpClient::Preconditions.require_keys(opts, [:name, :q], 'ItemMarginPostForm')
|
14922
|
+
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
|
14923
|
+
@q = HttpClient::Preconditions.assert_class('q', opts.delete(:q), String)
|
14924
|
+
@key = (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, String))
|
14925
|
+
@fixed = (x = opts.delete(:fixed); x.nil? ? nil : HttpClient::Preconditions.assert_class('fixed', HttpClient::Helper.to_big_decimal(x), BigDecimal))
|
14926
|
+
@percent = (x = opts.delete(:percent); x.nil? ? nil : HttpClient::Preconditions.assert_class('percent', HttpClient::Helper.to_big_decimal(x), BigDecimal))
|
14927
|
+
@position = (x = opts.delete(:position); x.nil? ? nil : HttpClient::Preconditions.assert_class('position', x, Integer))
|
14928
|
+
end
|
14929
|
+
|
14930
|
+
def to_json
|
14931
|
+
JSON.dump(to_hash)
|
14932
|
+
end
|
14933
|
+
|
14934
|
+
def copy(incoming={})
|
14935
|
+
ItemMarginPostForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
14936
|
+
end
|
14937
|
+
|
14938
|
+
def to_hash
|
14939
|
+
{
|
14940
|
+
:name => name,
|
14941
|
+
:q => q,
|
14942
|
+
:key => key,
|
14943
|
+
:fixed => fixed,
|
14944
|
+
:percent => percent,
|
14945
|
+
:position => position
|
14946
|
+
}
|
14947
|
+
end
|
14948
|
+
|
14949
|
+
end
|
14950
|
+
|
14951
|
+
# A percent and/or fixed margin to apply to items based on query.
|
14952
|
+
class ItemMarginPutForm
|
14711
14953
|
|
14712
14954
|
attr_reader :name, :q, :fixed, :percent, :position
|
14713
14955
|
|
14714
14956
|
def initialize(incoming={})
|
14715
14957
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
14716
|
-
HttpClient::Preconditions.require_keys(opts, [:name, :q], '
|
14958
|
+
HttpClient::Preconditions.require_keys(opts, [:name, :q], 'ItemMarginPutForm')
|
14717
14959
|
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
|
14718
14960
|
@q = HttpClient::Preconditions.assert_class('q', opts.delete(:q), String)
|
14719
14961
|
@fixed = (x = opts.delete(:fixed); x.nil? ? nil : HttpClient::Preconditions.assert_class('fixed', HttpClient::Helper.to_big_decimal(x), BigDecimal))
|
@@ -14726,7 +14968,7 @@ module Io
|
|
14726
14968
|
end
|
14727
14969
|
|
14728
14970
|
def copy(incoming={})
|
14729
|
-
|
14971
|
+
ItemMarginPutForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
14730
14972
|
end
|
14731
14973
|
|
14732
14974
|
def to_hash
|
@@ -16320,7 +16562,7 @@ module Io
|
|
16320
16562
|
# payment authorization for an order.
|
16321
16563
|
class Order
|
16322
16564
|
|
16323
|
-
attr_reader :id, :number, :customer, :destination, :expires_at, :items, :deliveries, :selections, :prices, :total, :attributes, :submitted_at, :lines, :identifiers
|
16565
|
+
attr_reader :id, :number, :customer, :destination, :expires_at, :items, :deliveries, :selections, :prices, :total, :attributes, :submitted_at, :lines, :identifiers, :promotions
|
16324
16566
|
|
16325
16567
|
def initialize(incoming={})
|
16326
16568
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
@@ -16339,6 +16581,7 @@ module Io
|
|
16339
16581
|
@submitted_at = (x = opts.delete(:submitted_at); x.nil? ? nil : HttpClient::Preconditions.assert_class('submitted_at', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
|
16340
16582
|
@lines = (x = opts.delete(:lines); x.nil? ? nil : HttpClient::Preconditions.assert_class('lines', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::Line) ? x : ::Io::Flow::V0::Models::Line.new(x)) })
|
16341
16583
|
@identifiers = (x = opts.delete(:identifiers); x.nil? ? nil : HttpClient::Preconditions.assert_class('identifiers', x, Array).map { |v| HttpClient::Preconditions.assert_class('identifiers', v, String) })
|
16584
|
+
@promotions = (x = opts.delete(:promotions); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Promotions) ? x : ::Io::Flow::V0::Models::Promotions.new(x)))
|
16342
16585
|
end
|
16343
16586
|
|
16344
16587
|
def to_json
|
@@ -16364,7 +16607,8 @@ module Io
|
|
16364
16607
|
:attributes => attributes,
|
16365
16608
|
:submitted_at => submitted_at,
|
16366
16609
|
:lines => lines.nil? ? nil : lines.map { |o| o.to_hash },
|
16367
|
-
:identifiers => identifiers.nil? ? nil : identifiers
|
16610
|
+
:identifiers => identifiers.nil? ? nil : identifiers,
|
16611
|
+
:promotions => promotions.nil? ? nil : promotions.to_hash
|
16368
16612
|
}
|
16369
16613
|
end
|
16370
16614
|
|
@@ -16479,7 +16723,7 @@ module Io
|
|
16479
16723
|
# duties.
|
16480
16724
|
class OrderEstimate
|
16481
16725
|
|
16482
|
-
attr_reader :id, :items, :destination, :deliveries, :prices, :selections, :total, :lines
|
16726
|
+
attr_reader :id, :items, :destination, :deliveries, :prices, :selections, :total, :lines, :promotions
|
16483
16727
|
|
16484
16728
|
def initialize(incoming={})
|
16485
16729
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
@@ -16492,6 +16736,7 @@ module Io
|
|
16492
16736
|
@selections = HttpClient::Preconditions.assert_class('selections', opts.delete(:selections), Array).map { |v| HttpClient::Preconditions.assert_class('selections', v, String) }
|
16493
16737
|
@total = (x = opts.delete(:total); x.is_a?(::Io::Flow::V0::Models::LocalizedTotal) ? x : ::Io::Flow::V0::Models::LocalizedTotal.new(x))
|
16494
16738
|
@lines = (x = opts.delete(:lines); x.nil? ? nil : HttpClient::Preconditions.assert_class('lines', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::Line) ? x : ::Io::Flow::V0::Models::Line.new(x)) })
|
16739
|
+
@promotions = (x = opts.delete(:promotions); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Promotions) ? x : ::Io::Flow::V0::Models::Promotions.new(x)))
|
16495
16740
|
end
|
16496
16741
|
|
16497
16742
|
def to_json
|
@@ -16511,7 +16756,8 @@ module Io
|
|
16511
16756
|
:prices => prices.map { |o| o.to_hash },
|
16512
16757
|
:selections => selections,
|
16513
16758
|
:total => total.to_hash,
|
16514
|
-
:lines => lines.nil? ? nil : lines.map { |o| o.to_hash }
|
16759
|
+
:lines => lines.nil? ? nil : lines.map { |o| o.to_hash },
|
16760
|
+
:promotions => promotions.nil? ? nil : promotions.to_hash
|
16515
16761
|
}
|
16516
16762
|
end
|
16517
16763
|
|
@@ -16715,6 +16961,32 @@ module Io
|
|
16715
16961
|
|
16716
16962
|
end
|
16717
16963
|
|
16964
|
+
class OrderIdentifierPutForm
|
16965
|
+
|
16966
|
+
attr_reader :order
|
16967
|
+
|
16968
|
+
def initialize(incoming={})
|
16969
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
16970
|
+
HttpClient::Preconditions.require_keys(opts, [:order], 'OrderIdentifierPutForm')
|
16971
|
+
@order = HttpClient::Preconditions.assert_class('order', opts.delete(:order), String)
|
16972
|
+
end
|
16973
|
+
|
16974
|
+
def to_json
|
16975
|
+
JSON.dump(to_hash)
|
16976
|
+
end
|
16977
|
+
|
16978
|
+
def copy(incoming={})
|
16979
|
+
OrderIdentifierPutForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
16980
|
+
end
|
16981
|
+
|
16982
|
+
def to_hash
|
16983
|
+
{
|
16984
|
+
:order => order
|
16985
|
+
}
|
16986
|
+
end
|
16987
|
+
|
16988
|
+
end
|
16989
|
+
|
16718
16990
|
class OrderIdentifierUpserted < Event
|
16719
16991
|
|
16720
16992
|
attr_reader :event_id, :timestamp, :id, :organization, :number, :order_number
|
@@ -18234,6 +18506,65 @@ module Io
|
|
18234
18506
|
|
18235
18507
|
end
|
18236
18508
|
|
18509
|
+
class PromotionTrigger
|
18510
|
+
|
18511
|
+
attr_reader :type, :min, :remaining, :max
|
18512
|
+
|
18513
|
+
def initialize(incoming={})
|
18514
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
18515
|
+
HttpClient::Preconditions.require_keys(opts, [:type, :min, :remaining], 'PromotionTrigger')
|
18516
|
+
@type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::PromotionTriggerType) ? x : ::Io::Flow::V0::Models::PromotionTriggerType.apply(x))
|
18517
|
+
@min = (x = opts.delete(:min); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x))
|
18518
|
+
@remaining = (x = opts.delete(:remaining); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x))
|
18519
|
+
@max = (x = opts.delete(:max); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x)))
|
18520
|
+
end
|
18521
|
+
|
18522
|
+
def to_json
|
18523
|
+
JSON.dump(to_hash)
|
18524
|
+
end
|
18525
|
+
|
18526
|
+
def copy(incoming={})
|
18527
|
+
PromotionTrigger.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
18528
|
+
end
|
18529
|
+
|
18530
|
+
def to_hash
|
18531
|
+
{
|
18532
|
+
:type => type.value,
|
18533
|
+
:min => min.to_hash,
|
18534
|
+
:remaining => remaining.to_hash,
|
18535
|
+
:max => max.nil? ? nil : max.to_hash
|
18536
|
+
}
|
18537
|
+
end
|
18538
|
+
|
18539
|
+
end
|
18540
|
+
|
18541
|
+
class Promotions
|
18542
|
+
|
18543
|
+
attr_reader :applied, :available
|
18544
|
+
|
18545
|
+
def initialize(incoming={})
|
18546
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
18547
|
+
@applied = (x = opts.delete(:applied); x.nil? ? nil : HttpClient::Preconditions.assert_class('applied', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::AppliedPromotion) ? x : ::Io::Flow::V0::Models::AppliedPromotion.new(x)) })
|
18548
|
+
@available = (x = opts.delete(:available); x.nil? ? nil : HttpClient::Preconditions.assert_class('available', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::AvailablePromotion) ? x : ::Io::Flow::V0::Models::AvailablePromotion.from_json(x)) })
|
18549
|
+
end
|
18550
|
+
|
18551
|
+
def to_json
|
18552
|
+
JSON.dump(to_hash)
|
18553
|
+
end
|
18554
|
+
|
18555
|
+
def copy(incoming={})
|
18556
|
+
Promotions.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
18557
|
+
end
|
18558
|
+
|
18559
|
+
def to_hash
|
18560
|
+
{
|
18561
|
+
:applied => applied.nil? ? nil : applied.map { |o| o.to_hash },
|
18562
|
+
:available => available.nil? ? nil : available.map { |o| o.to_hash }
|
18563
|
+
}
|
18564
|
+
end
|
18565
|
+
|
18566
|
+
end
|
18567
|
+
|
18237
18568
|
# A public key is used to encrypt cards client side prior to submitting to the
|
18238
18569
|
# Flow vault.
|
18239
18570
|
class PublicKey
|
@@ -21185,6 +21516,37 @@ module Io
|
|
21185
21516
|
|
21186
21517
|
end
|
21187
21518
|
|
21519
|
+
class TierDeleted < Event
|
21520
|
+
|
21521
|
+
attr_reader :event_id, :timestamp, :id
|
21522
|
+
|
21523
|
+
def initialize(incoming={})
|
21524
|
+
super(:discriminator => Event::Types::TIER_DELETED)
|
21525
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
21526
|
+
HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :id], 'TierDeleted')
|
21527
|
+
@event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
|
21528
|
+
@timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
|
21529
|
+
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
21530
|
+
end
|
21531
|
+
|
21532
|
+
def to_json
|
21533
|
+
JSON.dump(to_hash)
|
21534
|
+
end
|
21535
|
+
|
21536
|
+
def copy(incoming={})
|
21537
|
+
TierDeleted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
21538
|
+
end
|
21539
|
+
|
21540
|
+
def subtype_to_hash
|
21541
|
+
{
|
21542
|
+
:event_id => event_id,
|
21543
|
+
:timestamp => timestamp,
|
21544
|
+
:id => id
|
21545
|
+
}
|
21546
|
+
end
|
21547
|
+
|
21548
|
+
end
|
21549
|
+
|
21188
21550
|
# Service shipping tier available in this tier gorup. e.g. Standard tier,
|
21189
21551
|
# Express tier, Economy tier
|
21190
21552
|
class TierForm
|
@@ -21389,6 +21751,55 @@ module Io
|
|
21389
21751
|
|
21390
21752
|
end
|
21391
21753
|
|
21754
|
+
class TierUpserted < Event
|
21755
|
+
|
21756
|
+
attr_reader :event_id, :timestamp, :organization, :id, :experience_key, :integration, :name, :rules, :services, :strategy, :visibility, :description
|
21757
|
+
|
21758
|
+
def initialize(incoming={})
|
21759
|
+
super(:discriminator => Event::Types::TIER_UPSERTED)
|
21760
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
21761
|
+
HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :id, :experience_key, :integration, :name, :rules, :services, :strategy, :visibility], 'TierUpserted')
|
21762
|
+
@event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
|
21763
|
+
@timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
|
21764
|
+
@organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
|
21765
|
+
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
21766
|
+
@experience_key = HttpClient::Preconditions.assert_class('experience_key', opts.delete(:experience_key), String)
|
21767
|
+
@integration = HttpClient::Preconditions.assert_class('integration', opts.delete(:integration), String)
|
21768
|
+
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
|
21769
|
+
@rules = HttpClient::Preconditions.assert_class('rules', opts.delete(:rules), Array).map { |v| HttpClient::Preconditions.assert_class('rules', HttpClient::Helper.to_object(v), Hash) }
|
21770
|
+
@services = HttpClient::Preconditions.assert_class('services', opts.delete(:services), Array).map { |v| HttpClient::Preconditions.assert_class('services', HttpClient::Helper.to_object(v), Hash) }
|
21771
|
+
@strategy = HttpClient::Preconditions.assert_class('strategy', opts.delete(:strategy), String)
|
21772
|
+
@visibility = HttpClient::Preconditions.assert_class('visibility', opts.delete(:visibility), String)
|
21773
|
+
@description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
|
21774
|
+
end
|
21775
|
+
|
21776
|
+
def to_json
|
21777
|
+
JSON.dump(to_hash)
|
21778
|
+
end
|
21779
|
+
|
21780
|
+
def copy(incoming={})
|
21781
|
+
TierUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
21782
|
+
end
|
21783
|
+
|
21784
|
+
def subtype_to_hash
|
21785
|
+
{
|
21786
|
+
:event_id => event_id,
|
21787
|
+
:timestamp => timestamp,
|
21788
|
+
:organization => organization,
|
21789
|
+
:id => id,
|
21790
|
+
:experience_key => experience_key,
|
21791
|
+
:integration => integration,
|
21792
|
+
:name => name,
|
21793
|
+
:rules => rules,
|
21794
|
+
:services => services,
|
21795
|
+
:strategy => strategy,
|
21796
|
+
:visibility => visibility,
|
21797
|
+
:description => description
|
21798
|
+
}
|
21799
|
+
end
|
21800
|
+
|
21801
|
+
end
|
21802
|
+
|
21392
21803
|
class TierVersion
|
21393
21804
|
|
21394
21805
|
attr_reader :id, :timestamp, :type, :tier
|