flowcommerce 0.2.36 → 0.2.37
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 +4 -4
- data/lib/flow_commerce/flow_api_v0_client.rb +195 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ff31060093b378921a5f2df64ed4adabc176b6a
|
4
|
+
data.tar.gz: 069ac17d106a0156b2e355e25a099597b0ff242f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31c75f24bc581446f15b50e5ac936dfba4505d4f4160a07663a7d245fbe927446b5403781aa712a6c933e787012a37686db6c393c42d1b69571af1a6b950ca76
|
7
|
+
data.tar.gz: 85d01e51b67531337a7f4929c86d3312fd8c98226baf9d11bd010693fcf35a01d566ae329d9d54da3c71d155e6534cb0bd41b877b1b214be644e92bfd7447447
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Generated by API Builder - https://www.apibuilder.io
|
2
2
|
# Service version: 0.3.65
|
3
|
-
# apibuilder:0.12.61 https://app.apibuilder.io/flow/api/0.3.
|
3
|
+
# apibuilder:0.12.61 https://app.apibuilder.io/flow/api/0.3.88/ruby_client
|
4
4
|
|
5
5
|
require 'cgi'
|
6
6
|
require 'net/http'
|
@@ -25,7 +25,7 @@ module Io
|
|
25
25
|
|
26
26
|
BASE_URL = 'https://api.flow.io' unless defined?(Constants::BASE_URL)
|
27
27
|
NAMESPACE = 'io.flow.v0' unless defined?(Constants::NAMESPACE)
|
28
|
-
USER_AGENT = 'apibuilder:0.12.61 https://app.apibuilder.io/flow/api/0.3.
|
28
|
+
USER_AGENT = 'apibuilder:0.12.61 https://app.apibuilder.io/flow/api/0.3.88/ruby_client' unless defined?(Constants::USER_AGENT)
|
29
29
|
VERSION = '0.3.65' unless defined?(Constants::VERSION)
|
30
30
|
VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
|
31
31
|
|
@@ -2414,6 +2414,20 @@ module Io
|
|
2414
2414
|
nil
|
2415
2415
|
end
|
2416
2416
|
|
2417
|
+
# Updates the value of the authorization, or returns the authorization as-is
|
2418
|
+
# if the value is the same.
|
2419
|
+
def put_value_by_key(organization, key, authorization_value_form, incoming={})
|
2420
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
2421
|
+
HttpClient::Preconditions.assert_class('key', key, String)
|
2422
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
2423
|
+
query = {
|
2424
|
+
:expand => (x = opts.delete(:expand); x.nil? ? nil : HttpClient::Preconditions.assert_class('expand', x, Array).map { |v| HttpClient::Preconditions.assert_class('expand', v, String) })
|
2425
|
+
}.delete_if { |k, v| v.nil? }
|
2426
|
+
(x = authorization_value_form; x.is_a?(::Io::Flow::V0::Models::AuthorizationValueForm) ? x : ::Io::Flow::V0::Models::AuthorizationValueForm.new(x))
|
2427
|
+
r = @client.request("/#{CGI.escape(organization)}/authorizations/#{CGI.escape(key)}/value").with_query(query).with_json(authorization_value_form.to_json).put
|
2428
|
+
::Io::Flow::V0::Models::Authorization.from_json(r)
|
2429
|
+
end
|
2430
|
+
|
2417
2431
|
# Create a new card authorization using card details, or the token of a
|
2418
2432
|
# previously tokenized card.
|
2419
2433
|
def post_card(organization, card_authorization_form)
|
@@ -5435,6 +5449,7 @@ module Io
|
|
5435
5449
|
REFUND_UPSERTED = 'refund_upserted' unless defined?(REFUND_UPSERTED)
|
5436
5450
|
REFUND_UPSERTED_V2 = 'refund_upserted_v2' unless defined?(REFUND_UPSERTED_V2)
|
5437
5451
|
REVERSAL_UPSERTED = 'reversal_upserted' unless defined?(REVERSAL_UPSERTED)
|
5452
|
+
CATALOG_ITEM_COUNTRY_STATES_PUBLISHED = 'catalog_item_country_states_published' unless defined?(CATALOG_ITEM_COUNTRY_STATES_PUBLISHED)
|
5438
5453
|
ORGANIZATION_RATES_PUBLISHED = 'organization_rates_published' unless defined?(ORGANIZATION_RATES_PUBLISHED)
|
5439
5454
|
ORGANIZATION_COUNTRIES_PUBLISHED = 'organization_countries_published' unless defined?(ORGANIZATION_COUNTRIES_PUBLISHED)
|
5440
5455
|
RETURN_UPSERTED = 'return_upserted' unless defined?(RETURN_UPSERTED)
|
@@ -5453,7 +5468,7 @@ module Io
|
|
5453
5468
|
end
|
5454
5469
|
|
5455
5470
|
def subtype_to_hash
|
5456
|
-
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, harmonized_landed_cost_upserted, snapshot_upserted, snapshot_deleted, label_upserted, notification_upserted, notification_deleted, manifested_label_upserted, manifested_label_deleted, local_item_upserted, local_item_deleted, membership_upserted, membership_deleted, organization_upserted, organization_deleted, authorization_upserted, authorization_deleted, authorization_deleted_v2, authorization_status_changed, card_authorization_upserted, card_authorization_upserted_v2, online_authorization_upserted, online_authorization_upserted_v2, capture_upserted, capture_upserted_v2, card_upserted, card_upserted_v2, card_deleted, payment_upserted, payment_deleted, refund_upserted, refund_upserted_v2, reversal_upserted, organization_rates_published, organization_countries_published, return_upserted, return_deleted, targeting_item_upserted, targeting_item_deleted, tracking_label_event_upserted'
|
5471
|
+
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, harmonized_landed_cost_upserted, snapshot_upserted, snapshot_deleted, label_upserted, notification_upserted, notification_deleted, manifested_label_upserted, manifested_label_deleted, local_item_upserted, local_item_deleted, membership_upserted, membership_deleted, organization_upserted, organization_deleted, authorization_upserted, authorization_deleted, authorization_deleted_v2, authorization_status_changed, card_authorization_upserted, card_authorization_upserted_v2, online_authorization_upserted, online_authorization_upserted_v2, capture_upserted, capture_upserted_v2, card_upserted, card_upserted_v2, card_deleted, payment_upserted, payment_deleted, refund_upserted, refund_upserted_v2, reversal_upserted, catalog_item_country_states_published, organization_rates_published, organization_countries_published, return_upserted, return_deleted, targeting_item_upserted, targeting_item_deleted, tracking_label_event_upserted'
|
5457
5472
|
end
|
5458
5473
|
|
5459
5474
|
def to_hash
|
@@ -5539,6 +5554,7 @@ module Io
|
|
5539
5554
|
when Types::REFUND_UPSERTED; RefundUpserted.new(hash)
|
5540
5555
|
when Types::REFUND_UPSERTED_V2; RefundUpsertedV2.new(hash)
|
5541
5556
|
when Types::REVERSAL_UPSERTED; ReversalUpserted.new(hash)
|
5557
|
+
when Types::CATALOG_ITEM_COUNTRY_STATES_PUBLISHED; CatalogItemCountryStatesPublished.new(hash)
|
5542
5558
|
when Types::ORGANIZATION_RATES_PUBLISHED; OrganizationRatesPublished.new(hash)
|
5543
5559
|
when Types::ORGANIZATION_COUNTRIES_PUBLISHED; OrganizationCountriesPublished.new(hash)
|
5544
5560
|
when Types::RETURN_UPSERTED; ReturnUpserted.new(hash)
|
@@ -7413,7 +7429,7 @@ module Io
|
|
7413
7429
|
end
|
7414
7430
|
|
7415
7431
|
def AuthorizationDeclineCode.ALL
|
7416
|
-
@@all ||= [AuthorizationDeclineCode.expired, AuthorizationDeclineCode.invalid_name, AuthorizationDeclineCode.invalid_number, AuthorizationDeclineCode.invalid_expiration, AuthorizationDeclineCode.no_account, AuthorizationDeclineCode.avs, AuthorizationDeclineCode.cvv, AuthorizationDeclineCode.fraud, AuthorizationDeclineCode.duplicate, AuthorizationDeclineCode.not_supported, AuthorizationDeclineCode.unknown]
|
7432
|
+
@@all ||= [AuthorizationDeclineCode.expired, AuthorizationDeclineCode.invalid_name, AuthorizationDeclineCode.invalid_number, AuthorizationDeclineCode.invalid_expiration, AuthorizationDeclineCode.invalid_address, AuthorizationDeclineCode.invalid_token_type, AuthorizationDeclineCode.invalid_token, AuthorizationDeclineCode.no_account, AuthorizationDeclineCode.avs, AuthorizationDeclineCode.cvv, AuthorizationDeclineCode.fraud, AuthorizationDeclineCode.duplicate, AuthorizationDeclineCode.not_supported, AuthorizationDeclineCode.unknown]
|
7417
7433
|
end
|
7418
7434
|
|
7419
7435
|
# Payment method has expired
|
@@ -7436,6 +7452,21 @@ module Io
|
|
7436
7452
|
@@_invalid_expiration ||= AuthorizationDeclineCode.new('invalid_expiration')
|
7437
7453
|
end
|
7438
7454
|
|
7455
|
+
# Invalid billing address
|
7456
|
+
def AuthorizationDeclineCode.invalid_address
|
7457
|
+
@@_invalid_address ||= AuthorizationDeclineCode.new('invalid_address')
|
7458
|
+
end
|
7459
|
+
|
7460
|
+
# Cannot create a permanent card via an unauthorized request
|
7461
|
+
def AuthorizationDeclineCode.invalid_token_type
|
7462
|
+
@@_invalid_token_type ||= AuthorizationDeclineCode.new('invalid_token_type')
|
7463
|
+
end
|
7464
|
+
|
7465
|
+
# The provided card token is invalid or it does not exist.
|
7466
|
+
def AuthorizationDeclineCode.invalid_token
|
7467
|
+
@@_invalid_token ||= AuthorizationDeclineCode.new('invalid_token')
|
7468
|
+
end
|
7469
|
+
|
7439
7470
|
# The provided payment method is not known by the issuing bank (the account does
|
7440
7471
|
# not exist)
|
7441
7472
|
def AuthorizationDeclineCode.no_account
|
@@ -8370,7 +8401,7 @@ module Io
|
|
8370
8401
|
end
|
8371
8402
|
|
8372
8403
|
def EventType.ALL
|
8373
|
-
@@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.harmonized_landed_cost_upserted, EventType.snapshot_upserted, EventType.snapshot_deleted, EventType.label_upserted, EventType.notification_upserted, EventType.notification_deleted, EventType.manifested_label_upserted, EventType.manifested_label_deleted, EventType.local_item_upserted, EventType.local_item_deleted, EventType.membership_upserted, EventType.membership_deleted, EventType.organization_upserted, EventType.organization_deleted, EventType.authorization_upserted, EventType.authorization_deleted, EventType.authorization_deleted_v2, EventType.authorization_status_changed, EventType.card_authorization_upserted, EventType.card_authorization_upserted_v2, EventType.online_authorization_upserted, EventType.online_authorization_upserted_v2, EventType.capture_upserted, EventType.capture_upserted_v2, EventType.card_upserted, EventType.card_upserted_v2, EventType.card_deleted, EventType.payment_upserted, EventType.payment_deleted, EventType.refund_upserted, EventType.refund_upserted_v2, EventType.reversal_upserted, EventType.organization_rates_published, EventType.organization_countries_published, EventType.return_upserted, EventType.return_deleted, EventType.targeting_item_upserted, EventType.targeting_item_deleted, EventType.tracking_label_event_upserted]
|
8404
|
+
@@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.harmonized_landed_cost_upserted, EventType.snapshot_upserted, EventType.snapshot_deleted, EventType.label_upserted, EventType.notification_upserted, EventType.notification_deleted, EventType.manifested_label_upserted, EventType.manifested_label_deleted, EventType.local_item_upserted, EventType.local_item_deleted, EventType.membership_upserted, EventType.membership_deleted, EventType.organization_upserted, EventType.organization_deleted, EventType.authorization_upserted, EventType.authorization_deleted, EventType.authorization_deleted_v2, EventType.authorization_status_changed, EventType.card_authorization_upserted, EventType.card_authorization_upserted_v2, EventType.online_authorization_upserted, EventType.online_authorization_upserted_v2, EventType.capture_upserted, EventType.capture_upserted_v2, EventType.card_upserted, EventType.card_upserted_v2, EventType.card_deleted, EventType.payment_upserted, EventType.payment_deleted, EventType.refund_upserted, EventType.refund_upserted_v2, EventType.reversal_upserted, EventType.catalog_item_country_states_published, EventType.organization_rates_published, EventType.organization_countries_published, EventType.return_upserted, EventType.return_deleted, EventType.targeting_item_upserted, EventType.targeting_item_deleted, EventType.tracking_label_event_upserted]
|
8374
8405
|
end
|
8375
8406
|
|
8376
8407
|
def EventType.attribute_upserted
|
@@ -8661,6 +8692,10 @@ module Io
|
|
8661
8692
|
@@_reversal_upserted ||= EventType.new('reversal_upserted')
|
8662
8693
|
end
|
8663
8694
|
|
8695
|
+
def EventType.catalog_item_country_states_published
|
8696
|
+
@@_catalog_item_country_states_published ||= EventType.new('catalog_item_country_states_published')
|
8697
|
+
end
|
8698
|
+
|
8664
8699
|
def EventType.organization_rates_published
|
8665
8700
|
@@_organization_rates_published ||= EventType.new('organization_rates_published')
|
8666
8701
|
end
|
@@ -12897,6 +12932,39 @@ module Io
|
|
12897
12932
|
|
12898
12933
|
end
|
12899
12934
|
|
12935
|
+
# Details for why an authorization was not created
|
12936
|
+
class AuthorizationError
|
12937
|
+
|
12938
|
+
attr_reader :code, :messages, :avs, :cvv
|
12939
|
+
|
12940
|
+
def initialize(incoming={})
|
12941
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
12942
|
+
HttpClient::Preconditions.require_keys(opts, [:code, :messages], 'AuthorizationError')
|
12943
|
+
@code = (x = opts.delete(:code); x.is_a?(::Io::Flow::V0::Models::AuthorizationDeclineCode) ? x : ::Io::Flow::V0::Models::AuthorizationDeclineCode.apply(x))
|
12944
|
+
@messages = HttpClient::Preconditions.assert_class('messages', opts.delete(:messages), Array).map { |v| HttpClient::Preconditions.assert_class('messages', v, String) }
|
12945
|
+
@avs = (x = opts.delete(:avs); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Avs) ? x : ::Io::Flow::V0::Models::Avs.new(x)))
|
12946
|
+
@cvv = (x = opts.delete(:cvv); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Cvv) ? x : ::Io::Flow::V0::Models::Cvv.new(x)))
|
12947
|
+
end
|
12948
|
+
|
12949
|
+
def to_json
|
12950
|
+
JSON.dump(to_hash)
|
12951
|
+
end
|
12952
|
+
|
12953
|
+
def copy(incoming={})
|
12954
|
+
AuthorizationError.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
12955
|
+
end
|
12956
|
+
|
12957
|
+
def to_hash
|
12958
|
+
{
|
12959
|
+
:code => code.value,
|
12960
|
+
:messages => messages,
|
12961
|
+
:avs => avs.nil? ? nil : avs.to_hash,
|
12962
|
+
:cvv => cvv.nil? ? nil : cvv.to_hash
|
12963
|
+
}
|
12964
|
+
end
|
12965
|
+
|
12966
|
+
end
|
12967
|
+
|
12900
12968
|
class AuthorizationOrderReference
|
12901
12969
|
|
12902
12970
|
attr_reader :number
|
@@ -13075,6 +13143,35 @@ module Io
|
|
13075
13143
|
|
13076
13144
|
end
|
13077
13145
|
|
13146
|
+
# Used to authorize funds for a pending card authorization.
|
13147
|
+
class AuthorizationValueForm
|
13148
|
+
|
13149
|
+
attr_reader :amount, :currency
|
13150
|
+
|
13151
|
+
def initialize(incoming={})
|
13152
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
13153
|
+
HttpClient::Preconditions.require_keys(opts, [:amount, :currency], 'AuthorizationValueForm')
|
13154
|
+
@amount = HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(opts.delete(:amount)), BigDecimal)
|
13155
|
+
@currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
|
13156
|
+
end
|
13157
|
+
|
13158
|
+
def to_json
|
13159
|
+
JSON.dump(to_hash)
|
13160
|
+
end
|
13161
|
+
|
13162
|
+
def copy(incoming={})
|
13163
|
+
AuthorizationValueForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
13164
|
+
end
|
13165
|
+
|
13166
|
+
def to_hash
|
13167
|
+
{
|
13168
|
+
:amount => amount,
|
13169
|
+
:currency => currency
|
13170
|
+
}
|
13171
|
+
end
|
13172
|
+
|
13173
|
+
end
|
13174
|
+
|
13078
13175
|
class AuthorizationVersion
|
13079
13176
|
|
13080
13177
|
attr_reader :id, :timestamp, :type, :authorization
|
@@ -14234,6 +14331,99 @@ module Io
|
|
14234
14331
|
|
14235
14332
|
end
|
14236
14333
|
|
14334
|
+
class CatalogItemCountryStates
|
14335
|
+
|
14336
|
+
attr_reader :country, :statuses
|
14337
|
+
|
14338
|
+
def initialize(incoming={})
|
14339
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
14340
|
+
HttpClient::Preconditions.require_keys(opts, [:country, :statuses], 'CatalogItemCountryStates')
|
14341
|
+
@country = HttpClient::Preconditions.assert_class('country', opts.delete(:country), String)
|
14342
|
+
@statuses = HttpClient::Preconditions.assert_class('statuses', opts.delete(:statuses), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::SubcatalogItemStatus) ? x : ::Io::Flow::V0::Models::SubcatalogItemStatus.apply(x)) }
|
14343
|
+
end
|
14344
|
+
|
14345
|
+
def to_json
|
14346
|
+
JSON.dump(to_hash)
|
14347
|
+
end
|
14348
|
+
|
14349
|
+
def copy(incoming={})
|
14350
|
+
CatalogItemCountryStates.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
14351
|
+
end
|
14352
|
+
|
14353
|
+
def to_hash
|
14354
|
+
{
|
14355
|
+
:country => country,
|
14356
|
+
:statuses => statuses.map { |o| o.value }
|
14357
|
+
}
|
14358
|
+
end
|
14359
|
+
|
14360
|
+
end
|
14361
|
+
|
14362
|
+
class CatalogItemCountryStatesData
|
14363
|
+
|
14364
|
+
attr_reader :item_number, :countries
|
14365
|
+
|
14366
|
+
def initialize(incoming={})
|
14367
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
14368
|
+
HttpClient::Preconditions.require_keys(opts, [:item_number, :countries], 'CatalogItemCountryStatesData')
|
14369
|
+
@item_number = HttpClient::Preconditions.assert_class('item_number', opts.delete(:item_number), String)
|
14370
|
+
@countries = HttpClient::Preconditions.assert_class('countries', opts.delete(:countries), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::CatalogItemCountryStates) ? x : ::Io::Flow::V0::Models::CatalogItemCountryStates.new(x)) }
|
14371
|
+
end
|
14372
|
+
|
14373
|
+
def to_json
|
14374
|
+
JSON.dump(to_hash)
|
14375
|
+
end
|
14376
|
+
|
14377
|
+
def copy(incoming={})
|
14378
|
+
CatalogItemCountryStatesData.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
14379
|
+
end
|
14380
|
+
|
14381
|
+
def to_hash
|
14382
|
+
{
|
14383
|
+
:item_number => item_number,
|
14384
|
+
:countries => countries.map { |o| o.to_hash }
|
14385
|
+
}
|
14386
|
+
end
|
14387
|
+
|
14388
|
+
end
|
14389
|
+
|
14390
|
+
# Represents a catalog item and a list of countries with the item's availability
|
14391
|
+
# in each. This is a bulk event - meaning any time an individual item status
|
14392
|
+
# changes, we publish the new complete list of the item's country availability
|
14393
|
+
# statuses.
|
14394
|
+
class CatalogItemCountryStatesPublished < Event
|
14395
|
+
|
14396
|
+
attr_reader :event_id, :timestamp, :organization, :data
|
14397
|
+
|
14398
|
+
def initialize(incoming={})
|
14399
|
+
super(:discriminator => Event::Types::CATALOG_ITEM_COUNTRY_STATES_PUBLISHED)
|
14400
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
14401
|
+
HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :data], 'CatalogItemCountryStatesPublished')
|
14402
|
+
@event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
|
14403
|
+
@timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
|
14404
|
+
@organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
|
14405
|
+
@data = (x = opts.delete(:data); x.is_a?(::Io::Flow::V0::Models::CatalogItemCountryStatesData) ? x : ::Io::Flow::V0::Models::CatalogItemCountryStatesData.new(x))
|
14406
|
+
end
|
14407
|
+
|
14408
|
+
def to_json
|
14409
|
+
JSON.dump(to_hash)
|
14410
|
+
end
|
14411
|
+
|
14412
|
+
def copy(incoming={})
|
14413
|
+
CatalogItemCountryStatesPublished.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
14414
|
+
end
|
14415
|
+
|
14416
|
+
def subtype_to_hash
|
14417
|
+
{
|
14418
|
+
:event_id => event_id,
|
14419
|
+
:timestamp => timestamp,
|
14420
|
+
:organization => organization,
|
14421
|
+
:data => data.to_hash
|
14422
|
+
}
|
14423
|
+
end
|
14424
|
+
|
14425
|
+
end
|
14426
|
+
|
14237
14427
|
class CatalogItemDeleted < Event
|
14238
14428
|
|
14239
14429
|
attr_reader :event_id, :timestamp, :organization, :number, :catalog
|
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.
|
4
|
+
version: 0.2.37
|
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-09-
|
11
|
+
date: 2017-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|