flowcommerce 0.2.43 → 0.2.44
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.
- data/lib/flow_commerce/flow_api_v0_client.rb +132 -49
- metadata +2 -2
@@ -1,6 +1,6 @@
|
|
1
1
|
# Generated by API Builder - https://www.apibuilder.io
|
2
|
-
# Service version: 0.
|
3
|
-
# apibuilder:0.12.
|
2
|
+
# Service version: 0.4.11
|
3
|
+
# apibuilder:0.12.82 https://app.apibuilder.io/flow/api/0.4.11/ruby_client
|
4
4
|
|
5
5
|
require 'cgi'
|
6
6
|
require 'net/http'
|
@@ -25,8 +25,8 @@ module Io
|
|
25
25
|
|
26
26
|
BASE_URL = 'https://api.flow.io' unless defined?(Constants::BASE_URL)
|
27
27
|
NAMESPACE = 'io.flow.v0' unless defined?(Constants::NAMESPACE)
|
28
|
-
USER_AGENT = 'apibuilder:0.12.
|
29
|
-
VERSION = '0.
|
28
|
+
USER_AGENT = 'apibuilder:0.12.82 https://app.apibuilder.io/flow/api/0.4.11/ruby_client' unless defined?(Constants::USER_AGENT)
|
29
|
+
VERSION = '0.4.11' unless defined?(Constants::VERSION)
|
30
30
|
VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
|
31
31
|
|
32
32
|
end
|
@@ -276,10 +276,6 @@ module Io
|
|
276
276
|
@tracking_labels ||= ::Io::Flow::V0::Clients::TrackingLabels.new(self)
|
277
277
|
end
|
278
278
|
|
279
|
-
def transit_windows
|
280
|
-
@transit_windows ||= ::Io::Flow::V0::Clients::TransitWindows.new(self)
|
281
|
-
end
|
282
|
-
|
283
279
|
def webhooks
|
284
280
|
@webhooks ||= ::Io::Flow::V0::Clients::Webhooks.new(self)
|
285
281
|
end
|
@@ -3702,27 +3698,6 @@ module Io
|
|
3702
3698
|
|
3703
3699
|
end
|
3704
3700
|
|
3705
|
-
class TransitWindows
|
3706
|
-
|
3707
|
-
def initialize(client)
|
3708
|
-
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
|
3709
|
-
end
|
3710
|
-
|
3711
|
-
def get(organization, incoming={})
|
3712
|
-
HttpClient::Preconditions.assert_class('organization', organization, String)
|
3713
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
3714
|
-
query = {
|
3715
|
-
:id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
|
3716
|
-
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
3717
|
-
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
3718
|
-
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
|
3719
|
-
}.delete_if { |k, v| v.nil? }
|
3720
|
-
r = @client.request("/#{CGI.escape(organization)}/transit-windows").with_query(query).get
|
3721
|
-
r.map { |x| ::Io::Flow::V0::Models::TransitWindow.new(x) }
|
3722
|
-
end
|
3723
|
-
|
3724
|
-
end
|
3725
|
-
|
3726
3701
|
class Webhooks
|
3727
3702
|
|
3728
3703
|
def initialize(client)
|
@@ -5518,6 +5493,7 @@ module Io
|
|
5518
5493
|
REVERSAL_UPSERTED = 'reversal_upserted' unless defined?(REVERSAL_UPSERTED)
|
5519
5494
|
ORGANIZATION_RATES_PUBLISHED = 'organization_rates_published' unless defined?(ORGANIZATION_RATES_PUBLISHED)
|
5520
5495
|
ORGANIZATION_COUNTRIES_PUBLISHED = 'organization_countries_published' unless defined?(ORGANIZATION_COUNTRIES_PUBLISHED)
|
5496
|
+
ORGANIZATION_RATECARD_TRANSIT_WINDOWS_PUBLISHED = 'organization_ratecard_transit_windows_published' unless defined?(ORGANIZATION_RATECARD_TRANSIT_WINDOWS_PUBLISHED)
|
5521
5497
|
RETURN_UPSERTED = 'return_upserted' unless defined?(RETURN_UPSERTED)
|
5522
5498
|
RETURN_DELETED = 'return_deleted' unless defined?(RETURN_DELETED)
|
5523
5499
|
TARGETING_ITEM_UPSERTED = 'targeting_item_upserted' unless defined?(TARGETING_ITEM_UPSERTED)
|
@@ -5534,7 +5510,7 @@ module Io
|
|
5534
5510
|
end
|
5535
5511
|
|
5536
5512
|
def subtype_to_hash
|
5537
|
-
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, fully_harmonized_item_upserted, rule_upserted, rule_deleted, 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'
|
5513
|
+
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, fully_harmonized_item_upserted, rule_upserted, rule_deleted, 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, organization_ratecard_transit_windows_published, return_upserted, return_deleted, targeting_item_upserted, targeting_item_deleted, tracking_label_event_upserted'
|
5538
5514
|
end
|
5539
5515
|
|
5540
5516
|
def to_hash
|
@@ -5625,6 +5601,7 @@ module Io
|
|
5625
5601
|
when Types::REVERSAL_UPSERTED; ReversalUpserted.new(hash)
|
5626
5602
|
when Types::ORGANIZATION_RATES_PUBLISHED; OrganizationRatesPublished.new(hash)
|
5627
5603
|
when Types::ORGANIZATION_COUNTRIES_PUBLISHED; OrganizationCountriesPublished.new(hash)
|
5604
|
+
when Types::ORGANIZATION_RATECARD_TRANSIT_WINDOWS_PUBLISHED; OrganizationRatecardTransitWindowsPublished.new(hash)
|
5628
5605
|
when Types::RETURN_UPSERTED; ReturnUpserted.new(hash)
|
5629
5606
|
when Types::RETURN_DELETED; ReturnDeleted.new(hash)
|
5630
5607
|
when Types::TARGETING_ITEM_UPSERTED; TargetingItemUpserted.new(hash)
|
@@ -8469,7 +8446,7 @@ module Io
|
|
8469
8446
|
end
|
8470
8447
|
|
8471
8448
|
def EventType.ALL
|
8472
|
-
@@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.fully_harmonized_item_upserted, EventType.rule_upserted, EventType.rule_deleted, 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]
|
8449
|
+
@@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.fully_harmonized_item_upserted, EventType.rule_upserted, EventType.rule_deleted, 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.organization_ratecard_transit_windows_published, EventType.return_upserted, EventType.return_deleted, EventType.targeting_item_upserted, EventType.targeting_item_deleted, EventType.tracking_label_event_upserted]
|
8473
8450
|
end
|
8474
8451
|
|
8475
8452
|
def EventType.attribute_upserted
|
@@ -8780,6 +8757,10 @@ module Io
|
|
8780
8757
|
@@_organization_countries_published ||= EventType.new('organization_countries_published')
|
8781
8758
|
end
|
8782
8759
|
|
8760
|
+
def EventType.organization_ratecard_transit_windows_published
|
8761
|
+
@@_organization_ratecard_transit_windows_published ||= EventType.new('organization_ratecard_transit_windows_published')
|
8762
|
+
end
|
8763
|
+
|
8783
8764
|
def EventType.return_upserted
|
8784
8765
|
@@_return_upserted ||= EventType.new('return_upserted')
|
8785
8766
|
end
|
@@ -9721,7 +9702,8 @@ module Io
|
|
9721
9702
|
end
|
9722
9703
|
|
9723
9704
|
# Indicates the order value exceeds the value threshold for destination and
|
9724
|
-
# cannot be shipped.
|
9705
|
+
# cannot be shipped. When specified, the order will also populate the threshold
|
9706
|
+
# attribute.
|
9725
9707
|
def OrderErrorCode.value_threshold_exceeded
|
9726
9708
|
@@_value_threshold_exceeded ||= OrderErrorCode.new('value_threshold_exceeded')
|
9727
9709
|
end
|
@@ -20015,13 +19997,14 @@ module Io
|
|
20015
19997
|
# line items as you like - including repeating item numbers across line items.
|
20016
19998
|
class LineItemForm
|
20017
19999
|
|
20018
|
-
attr_reader :number, :quantity, :price, :attributes, :center, :discount
|
20000
|
+
attr_reader :number, :quantity, :shipment_estimate, :price, :attributes, :center, :discount
|
20019
20001
|
|
20020
20002
|
def initialize(incoming={})
|
20021
20003
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
20022
20004
|
HttpClient::Preconditions.require_keys(opts, [:number, :quantity], 'LineItemForm')
|
20023
20005
|
@number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
|
20024
20006
|
@quantity = HttpClient::Preconditions.assert_class('quantity', opts.delete(:quantity), Integer)
|
20007
|
+
@shipment_estimate = (x = opts.delete(:shipment_estimate); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::DatetimeRange) ? x : ::Io::Flow::V0::Models::DatetimeRange.new(x)))
|
20025
20008
|
@price = (x = opts.delete(:price); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Money) ? x : ::Io::Flow::V0::Models::Money.new(x)))
|
20026
20009
|
@attributes = (x = opts.delete(:attributes); x.nil? ? nil : HttpClient::Preconditions.assert_class('attributes', x, Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h })
|
20027
20010
|
@center = (x = opts.delete(:center); x.nil? ? nil : HttpClient::Preconditions.assert_class('center', x, String))
|
@@ -20040,6 +20023,7 @@ module Io
|
|
20040
20023
|
{
|
20041
20024
|
:number => number,
|
20042
20025
|
:quantity => quantity,
|
20026
|
+
:shipment_estimate => shipment_estimate.nil? ? nil : shipment_estimate.to_hash,
|
20043
20027
|
:price => price.nil? ? nil : price.to_hash,
|
20044
20028
|
:attributes => attributes.nil? ? nil : attributes,
|
20045
20029
|
:center => center,
|
@@ -20521,7 +20505,7 @@ module Io
|
|
20521
20505
|
# Line items on the order, with localized pricing information
|
20522
20506
|
class LocalizedLineItem
|
20523
20507
|
|
20524
|
-
attr_reader :number, :name, :quantity, :center, :price, :discount, :attributes, :local
|
20508
|
+
attr_reader :number, :name, :quantity, :center, :price, :discount, :attributes, :local, :shipment_estimate
|
20525
20509
|
|
20526
20510
|
def initialize(incoming={})
|
20527
20511
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
@@ -20534,6 +20518,7 @@ module Io
|
|
20534
20518
|
@discount = (x = opts.delete(:discount); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Money) ? x : ::Io::Flow::V0::Models::Money.new(x)))
|
20535
20519
|
@attributes = (x = opts.delete(:attributes); x.nil? ? nil : HttpClient::Preconditions.assert_class('attributes', x, Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h })
|
20536
20520
|
@local = (x = opts.delete(:local); x.is_a?(::Io::Flow::V0::Models::Local) ? x : ::Io::Flow::V0::Models::Local.new(x))
|
20521
|
+
@shipment_estimate = (x = opts.delete(:shipment_estimate); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::DatetimeRange) ? x : ::Io::Flow::V0::Models::DatetimeRange.new(x)))
|
20537
20522
|
end
|
20538
20523
|
|
20539
20524
|
def to_json
|
@@ -20553,7 +20538,8 @@ module Io
|
|
20553
20538
|
:price => price.nil? ? nil : price.to_hash,
|
20554
20539
|
:discount => discount.nil? ? nil : discount.to_hash,
|
20555
20540
|
:attributes => attributes.nil? ? nil : attributes,
|
20556
|
-
:local => local.to_hash
|
20541
|
+
:local => local.to_hash,
|
20542
|
+
:shipment_estimate => shipment_estimate.nil? ? nil : shipment_estimate.to_hash
|
20557
20543
|
}
|
20558
20544
|
end
|
20559
20545
|
|
@@ -21628,7 +21614,7 @@ module Io
|
|
21628
21614
|
|
21629
21615
|
class OrderError
|
21630
21616
|
|
21631
|
-
attr_reader :code, :messages, :numbers, :destination_country
|
21617
|
+
attr_reader :code, :messages, :numbers, :destination_country, :threshold
|
21632
21618
|
|
21633
21619
|
def initialize(incoming={})
|
21634
21620
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
@@ -21637,6 +21623,7 @@ module Io
|
|
21637
21623
|
@messages = HttpClient::Preconditions.assert_class('messages', opts.delete(:messages), Array).map { |v| HttpClient::Preconditions.assert_class('messages', v, String) }
|
21638
21624
|
@numbers = (x = opts.delete(:numbers); x.nil? ? nil : HttpClient::Preconditions.assert_class('numbers', x, Array).map { |v| HttpClient::Preconditions.assert_class('numbers', v, String) })
|
21639
21625
|
@destination_country = (x = opts.delete(:destination_country); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Country) ? x : ::Io::Flow::V0::Models::Country.new(x)))
|
21626
|
+
@threshold = (x = opts.delete(:threshold); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::ValueThresholdExceededDetails) ? x : ::Io::Flow::V0::Models::ValueThresholdExceededDetails.new(x)))
|
21640
21627
|
end
|
21641
21628
|
|
21642
21629
|
def to_json
|
@@ -21652,7 +21639,8 @@ module Io
|
|
21652
21639
|
:code => code.value,
|
21653
21640
|
:messages => messages,
|
21654
21641
|
:numbers => numbers.nil? ? nil : numbers,
|
21655
|
-
:destination_country => destination_country.nil? ? nil : destination_country.to_hash
|
21642
|
+
:destination_country => destination_country.nil? ? nil : destination_country.to_hash,
|
21643
|
+
:threshold => threshold.nil? ? nil : threshold.to_hash
|
21656
21644
|
}
|
21657
21645
|
end
|
21658
21646
|
|
@@ -22734,6 +22722,68 @@ module Io
|
|
22734
22722
|
|
22735
22723
|
end
|
22736
22724
|
|
22725
|
+
class OrganizationRatecardTransitWindowsData
|
22726
|
+
|
22727
|
+
attr_reader :transit_windows
|
22728
|
+
|
22729
|
+
def initialize(incoming={})
|
22730
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
22731
|
+
HttpClient::Preconditions.require_keys(opts, [:transit_windows], 'OrganizationRatecardTransitWindowsData')
|
22732
|
+
@transit_windows = HttpClient::Preconditions.assert_class('transit_windows', opts.delete(:transit_windows), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::TransitWindow) ? x : ::Io::Flow::V0::Models::TransitWindow.new(x)) }
|
22733
|
+
end
|
22734
|
+
|
22735
|
+
def to_json
|
22736
|
+
JSON.dump(to_hash)
|
22737
|
+
end
|
22738
|
+
|
22739
|
+
def copy(incoming={})
|
22740
|
+
OrganizationRatecardTransitWindowsData.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
22741
|
+
end
|
22742
|
+
|
22743
|
+
def to_hash
|
22744
|
+
{
|
22745
|
+
:transit_windows => transit_windows.map { |o| o.to_hash }
|
22746
|
+
}
|
22747
|
+
end
|
22748
|
+
|
22749
|
+
end
|
22750
|
+
|
22751
|
+
# Represents the list of transit windows available for an organization. This is
|
22752
|
+
# a bulk event - meaning any time a transit window changes, we publish a new
|
22753
|
+
# complete list of all transit windows.
|
22754
|
+
class OrganizationRatecardTransitWindowsPublished < Event
|
22755
|
+
|
22756
|
+
attr_reader :event_id, :timestamp, :organization, :data
|
22757
|
+
|
22758
|
+
def initialize(incoming={})
|
22759
|
+
super(:discriminator => Event::Types::ORGANIZATION_RATECARD_TRANSIT_WINDOWS_PUBLISHED)
|
22760
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
22761
|
+
HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :data], 'OrganizationRatecardTransitWindowsPublished')
|
22762
|
+
@event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
|
22763
|
+
@timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
|
22764
|
+
@organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
|
22765
|
+
@data = (x = opts.delete(:data); x.is_a?(::Io::Flow::V0::Models::OrganizationRatecardTransitWindowsData) ? x : ::Io::Flow::V0::Models::OrganizationRatecardTransitWindowsData.new(x))
|
22766
|
+
end
|
22767
|
+
|
22768
|
+
def to_json
|
22769
|
+
JSON.dump(to_hash)
|
22770
|
+
end
|
22771
|
+
|
22772
|
+
def copy(incoming={})
|
22773
|
+
OrganizationRatecardTransitWindowsPublished.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
22774
|
+
end
|
22775
|
+
|
22776
|
+
def subtype_to_hash
|
22777
|
+
{
|
22778
|
+
:event_id => event_id,
|
22779
|
+
:timestamp => timestamp,
|
22780
|
+
:organization => organization,
|
22781
|
+
:data => data.to_hash
|
22782
|
+
}
|
22783
|
+
end
|
22784
|
+
|
22785
|
+
end
|
22786
|
+
|
22737
22787
|
class OrganizationRatesData
|
22738
22788
|
|
22739
22789
|
attr_reader :rates
|
@@ -28010,7 +28060,7 @@ module Io
|
|
28010
28060
|
# Express tier, Economy tier
|
28011
28061
|
class Tier
|
28012
28062
|
|
28013
|
-
attr_reader :id, :direction, :experience, :integration, :name, :rules, :services, :strategy, :visibility, :description
|
28063
|
+
attr_reader :id, :direction, :experience, :integration, :name, :rules, :services, :strategy, :visibility, :currency, :description
|
28014
28064
|
|
28015
28065
|
def initialize(incoming={})
|
28016
28066
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
@@ -28024,6 +28074,7 @@ module Io
|
|
28024
28074
|
@services = HttpClient::Preconditions.assert_class('services', opts.delete(:services), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::Service) ? x : ::Io::Flow::V0::Models::Service.new(x)) }
|
28025
28075
|
@strategy = (x = opts.delete(:strategy); x.is_a?(::Io::Flow::V0::Models::TierStrategy) ? x : ::Io::Flow::V0::Models::TierStrategy.apply(x))
|
28026
28076
|
@visibility = (x = opts.delete(:visibility); x.is_a?(::Io::Flow::V0::Models::Visibility) ? x : ::Io::Flow::V0::Models::Visibility.apply(x))
|
28077
|
+
@currency = (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, String))
|
28027
28078
|
@description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
|
28028
28079
|
end
|
28029
28080
|
|
@@ -28046,6 +28097,7 @@ module Io
|
|
28046
28097
|
:services => services.map { |o| o.to_hash },
|
28047
28098
|
:strategy => strategy.value,
|
28048
28099
|
:visibility => visibility.value,
|
28100
|
+
:currency => currency,
|
28049
28101
|
:description => description
|
28050
28102
|
}
|
28051
28103
|
end
|
@@ -28348,7 +28400,7 @@ module Io
|
|
28348
28400
|
|
28349
28401
|
class TierSummary
|
28350
28402
|
|
28351
|
-
attr_reader :id, :experience, :integration, :name, :services, :strategy, :visibility
|
28403
|
+
attr_reader :id, :experience, :integration, :name, :services, :strategy, :visibility, :currency
|
28352
28404
|
|
28353
28405
|
def initialize(incoming={})
|
28354
28406
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
@@ -28360,6 +28412,7 @@ module Io
|
|
28360
28412
|
@services = HttpClient::Preconditions.assert_class('services', opts.delete(:services), Array).map { |v| HttpClient::Preconditions.assert_class('services', v, String) }
|
28361
28413
|
@strategy = (x = opts.delete(:strategy); x.is_a?(::Io::Flow::V0::Models::TierStrategy) ? x : ::Io::Flow::V0::Models::TierStrategy.apply(x))
|
28362
28414
|
@visibility = (x = opts.delete(:visibility); x.is_a?(::Io::Flow::V0::Models::Visibility) ? x : ::Io::Flow::V0::Models::Visibility.apply(x))
|
28415
|
+
@currency = (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, String))
|
28363
28416
|
end
|
28364
28417
|
|
28365
28418
|
def to_json
|
@@ -28378,7 +28431,8 @@ module Io
|
|
28378
28431
|
:name => name,
|
28379
28432
|
:services => services,
|
28380
28433
|
:strategy => strategy.value,
|
28381
|
-
:visibility => visibility.value
|
28434
|
+
:visibility => visibility.value,
|
28435
|
+
:currency => currency
|
28382
28436
|
}
|
28383
28437
|
end
|
28384
28438
|
|
@@ -28386,7 +28440,7 @@ module Io
|
|
28386
28440
|
|
28387
28441
|
class TierUpserted < Event
|
28388
28442
|
|
28389
|
-
attr_reader :event_id, :timestamp, :organization, :id, :experience_key, :integration, :name, :rules, :services, :strategy, :visibility, :description
|
28443
|
+
attr_reader :event_id, :timestamp, :organization, :id, :experience_key, :integration, :name, :rules, :services, :strategy, :visibility, :currency, :description
|
28390
28444
|
|
28391
28445
|
def initialize(incoming={})
|
28392
28446
|
super(:discriminator => Event::Types::TIER_UPSERTED)
|
@@ -28403,6 +28457,7 @@ module Io
|
|
28403
28457
|
@services = HttpClient::Preconditions.assert_class('services', opts.delete(:services), Array).map { |v| HttpClient::Preconditions.assert_class('services', HttpClient::Helper.to_object(v), Hash) }
|
28404
28458
|
@strategy = HttpClient::Preconditions.assert_class('strategy', opts.delete(:strategy), String)
|
28405
28459
|
@visibility = HttpClient::Preconditions.assert_class('visibility', opts.delete(:visibility), String)
|
28460
|
+
@currency = (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, String))
|
28406
28461
|
@description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
|
28407
28462
|
end
|
28408
28463
|
|
@@ -28427,6 +28482,7 @@ module Io
|
|
28427
28482
|
:services => services,
|
28428
28483
|
:strategy => strategy,
|
28429
28484
|
:visibility => visibility,
|
28485
|
+
:currency => currency,
|
28430
28486
|
:description => description
|
28431
28487
|
}
|
28432
28488
|
end
|
@@ -29073,16 +29129,15 @@ module Io
|
|
29073
29129
|
|
29074
29130
|
class TransitWindow
|
29075
29131
|
|
29076
|
-
attr_reader :
|
29132
|
+
attr_reader :origin_country, :destination_country, :from, :to
|
29077
29133
|
|
29078
29134
|
def initialize(incoming={})
|
29079
29135
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
29080
|
-
HttpClient::Preconditions.require_keys(opts, [:
|
29081
|
-
@service_id = HttpClient::Preconditions.assert_class('service_id', opts.delete(:service_id), String)
|
29136
|
+
HttpClient::Preconditions.require_keys(opts, [:origin_country, :destination_country, :from, :to], 'TransitWindow')
|
29082
29137
|
@origin_country = HttpClient::Preconditions.assert_class('origin_country', opts.delete(:origin_country), String)
|
29083
29138
|
@destination_country = HttpClient::Preconditions.assert_class('destination_country', opts.delete(:destination_country), String)
|
29084
|
-
@from = HttpClient::Preconditions.assert_class('from', opts.delete(:from),
|
29085
|
-
@to = HttpClient::Preconditions.assert_class('to', opts.delete(:to),
|
29139
|
+
@from = HttpClient::Preconditions.assert_class('from', opts.delete(:from), Integer)
|
29140
|
+
@to = HttpClient::Preconditions.assert_class('to', opts.delete(:to), Integer)
|
29086
29141
|
end
|
29087
29142
|
|
29088
29143
|
def to_json
|
@@ -29095,7 +29150,6 @@ module Io
|
|
29095
29150
|
|
29096
29151
|
def to_hash
|
29097
29152
|
{
|
29098
|
-
:service_id => service_id,
|
29099
29153
|
:origin_country => origin_country,
|
29100
29154
|
:destination_country => destination_country,
|
29101
29155
|
:from => from,
|
@@ -29315,6 +29369,34 @@ module Io
|
|
29315
29369
|
|
29316
29370
|
end
|
29317
29371
|
|
29372
|
+
class ValueThresholdExceededDetails
|
29373
|
+
|
29374
|
+
attr_reader :local, :original
|
29375
|
+
|
29376
|
+
def initialize(incoming={})
|
29377
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
29378
|
+
HttpClient::Preconditions.require_keys(opts, [:local, :original], 'ValueThresholdExceededDetails')
|
29379
|
+
@local = (x = opts.delete(:local); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x))
|
29380
|
+
@original = (x = opts.delete(:original); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x))
|
29381
|
+
end
|
29382
|
+
|
29383
|
+
def to_json
|
29384
|
+
JSON.dump(to_hash)
|
29385
|
+
end
|
29386
|
+
|
29387
|
+
def copy(incoming={})
|
29388
|
+
ValueThresholdExceededDetails.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
29389
|
+
end
|
29390
|
+
|
29391
|
+
def to_hash
|
29392
|
+
{
|
29393
|
+
:local => local.to_hash,
|
29394
|
+
:original => original.to_hash
|
29395
|
+
}
|
29396
|
+
end
|
29397
|
+
|
29398
|
+
end
|
29399
|
+
|
29318
29400
|
class Webhook
|
29319
29401
|
|
29320
29402
|
attr_reader :id, :url, :events
|
@@ -29686,12 +29768,13 @@ module Io
|
|
29686
29768
|
|
29687
29769
|
class Request
|
29688
29770
|
|
29689
|
-
attr_reader :path
|
29771
|
+
attr_reader :base_uri, :path, :full_uri
|
29690
29772
|
|
29691
29773
|
def initialize(http_handler, base_uri, path)
|
29692
29774
|
@http_handler = http_handler
|
29693
29775
|
@base_uri = Preconditions.assert_class('base_uri', base_uri, URI)
|
29694
29776
|
@path = Preconditions.assert_class('path', path, String)
|
29777
|
+
@full_uri = @base_uri.to_s + @path
|
29695
29778
|
@params = nil
|
29696
29779
|
@body = nil
|
29697
29780
|
@auth = nil
|
@@ -29772,7 +29855,7 @@ module Io
|
|
29772
29855
|
def do_request(klass)
|
29773
29856
|
Preconditions.assert_class('klass', klass, Class)
|
29774
29857
|
|
29775
|
-
uri =
|
29858
|
+
uri = @full_uri.dup
|
29776
29859
|
if q = to_query(@params)
|
29777
29860
|
uri += "?%s" % q
|
29778
29861
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.44
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-10-
|
12
|
+
date: 2017-10-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|