flowcommerce 0.0.41 → 0.0.42
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 +212 -527
- 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: 0e8db05b57ac70bed2fe65fc017e2c828efa5c18
|
4
|
+
data.tar.gz: 5383b739f3c0cfbe88030187bf00f7a233b26737
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f54b9fb89b57d416fdbd53919cbc2a6ce2aa744231146e9c046f00648f3776d3c6ef78f4dd621bd8f904bf5334c83155022864c7a4b6ea29c559f8157259d92d
|
7
|
+
data.tar.gz: 4d181370b8007561a8a8a0aa5a0aea06dcce40e51161527caba0803003453ee14d5a541e151d5d13b2523f6ea5dd30363f7848775f2dacb21e3306e3809f91cf
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Generated by apidoc - http://www.apidoc.me
|
2
|
-
# Service version: 0.1.
|
3
|
-
# apidoc:0.11.34 http://www.apidoc.me/flow/api/0.1.
|
2
|
+
# Service version: 0.1.19
|
3
|
+
# apidoc:0.11.34 http://www.apidoc.me/flow/api/0.1.18/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 = 'apidoc:0.11.34 http://www.apidoc.me/flow/api/0.1.
|
29
|
-
VERSION = '0.1.
|
28
|
+
USER_AGENT = 'apidoc:0.11.34 http://www.apidoc.me/flow/api/0.1.18/ruby_client' unless defined?(Constants::USER_AGENT)
|
29
|
+
VERSION = '0.1.19' unless defined?(Constants::VERSION)
|
30
30
|
VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
|
31
31
|
|
32
32
|
end
|
@@ -157,10 +157,6 @@ module Io
|
|
157
157
|
@refunds ||= ::Io::Flow::V0::Clients::Refunds.new(self)
|
158
158
|
end
|
159
159
|
|
160
|
-
def bookings
|
161
|
-
@bookings ||= ::Io::Flow::V0::Clients::Bookings.new(self)
|
162
|
-
end
|
163
|
-
|
164
160
|
def carriers
|
165
161
|
@carriers ||= ::Io::Flow::V0::Clients::Carriers.new(self)
|
166
162
|
end
|
@@ -201,14 +197,6 @@ module Io
|
|
201
197
|
@services ||= ::Io::Flow::V0::Clients::Services.new(self)
|
202
198
|
end
|
203
199
|
|
204
|
-
def shipments
|
205
|
-
@shipments ||= ::Io::Flow::V0::Clients::Shipments.new(self)
|
206
|
-
end
|
207
|
-
|
208
|
-
def shipment_labels
|
209
|
-
@shipment_labels ||= ::Io::Flow::V0::Clients::ShipmentLabels.new(self)
|
210
|
-
end
|
211
|
-
|
212
200
|
def tiers
|
213
201
|
@tiers ||= ::Io::Flow::V0::Clients::Tiers.new(self)
|
214
202
|
end
|
@@ -297,6 +285,10 @@ module Io
|
|
297
285
|
@password_reset_forms ||= ::Io::Flow::V0::Clients::PasswordResetForms.new(self)
|
298
286
|
end
|
299
287
|
|
288
|
+
def shipping_labels
|
289
|
+
@shipping_labels ||= ::Io::Flow::V0::Clients::ShippingLabels.new(self)
|
290
|
+
end
|
291
|
+
|
300
292
|
def suggestions
|
301
293
|
@suggestions ||= ::Io::Flow::V0::Clients::Suggestions.new(self)
|
302
294
|
end
|
@@ -1892,56 +1884,6 @@ module Io
|
|
1892
1884
|
|
1893
1885
|
end
|
1894
1886
|
|
1895
|
-
class Bookings
|
1896
|
-
|
1897
|
-
def initialize(client)
|
1898
|
-
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
|
1899
|
-
end
|
1900
|
-
|
1901
|
-
def get(organization, incoming={})
|
1902
|
-
HttpClient::Preconditions.assert_class('organization', organization, String)
|
1903
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
1904
|
-
query = {
|
1905
|
-
:id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
|
1906
|
-
:number => (x = opts.delete(:number); x.nil? ? nil : HttpClient::Preconditions.assert_class('number', x, String)),
|
1907
|
-
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
1908
|
-
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
1909
|
-
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
|
1910
|
-
}.delete_if { |k, v| v.nil? }
|
1911
|
-
r = @client.request("/#{CGI.escape(organization)}/bookings").with_query(query).get
|
1912
|
-
r.map { |x| ::Io::Flow::V0::Models::Booking.new(x) }
|
1913
|
-
end
|
1914
|
-
|
1915
|
-
def post(organization, booking_form)
|
1916
|
-
HttpClient::Preconditions.assert_class('organization', organization, String)
|
1917
|
-
HttpClient::Preconditions.assert_class('booking_form', booking_form, ::Io::Flow::V0::Models::BookingForm)
|
1918
|
-
r = @client.request("/#{CGI.escape(organization)}/bookings").with_json(booking_form.to_json).post
|
1919
|
-
::Io::Flow::V0::Models::Booking.new(r)
|
1920
|
-
end
|
1921
|
-
|
1922
|
-
def get_by_id(organization, id)
|
1923
|
-
HttpClient::Preconditions.assert_class('organization', organization, String)
|
1924
|
-
HttpClient::Preconditions.assert_class('id', id, String)
|
1925
|
-
r = @client.request("/#{CGI.escape(organization)}/bookings/#{CGI.escape(id)}").get
|
1926
|
-
::Io::Flow::V0::Models::Booking.new(r)
|
1927
|
-
end
|
1928
|
-
|
1929
|
-
def get_versions(organization, incoming={})
|
1930
|
-
HttpClient::Preconditions.assert_class('organization', organization, String)
|
1931
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
1932
|
-
query = {
|
1933
|
-
:id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
|
1934
|
-
:booking => (x = opts.delete(:booking); x.nil? ? nil : HttpClient::Preconditions.assert_class('booking', x, Array).map { |v| HttpClient::Preconditions.assert_class('booking', v, String) }),
|
1935
|
-
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
1936
|
-
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
1937
|
-
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
|
1938
|
-
}.delete_if { |k, v| v.nil? }
|
1939
|
-
r = @client.request("/#{CGI.escape(organization)}/bookings/versions").with_query(query).get
|
1940
|
-
r.map { |x| ::Io::Flow::V0::Models::BookingVersion.new(x) }
|
1941
|
-
end
|
1942
|
-
|
1943
|
-
end
|
1944
|
-
|
1945
1887
|
class Carriers
|
1946
1888
|
|
1947
1889
|
def initialize(client)
|
@@ -2362,99 +2304,6 @@ module Io
|
|
2362
2304
|
|
2363
2305
|
end
|
2364
2306
|
|
2365
|
-
class Shipments
|
2366
|
-
|
2367
|
-
def initialize(client)
|
2368
|
-
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
|
2369
|
-
end
|
2370
|
-
|
2371
|
-
def get(organization, incoming={})
|
2372
|
-
HttpClient::Preconditions.assert_class('organization', organization, String)
|
2373
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
2374
|
-
query = {
|
2375
|
-
:id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
|
2376
|
-
:number => (x = opts.delete(:number); x.nil? ? nil : HttpClient::Preconditions.assert_class('number', x, String)),
|
2377
|
-
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
2378
|
-
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
2379
|
-
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
|
2380
|
-
}.delete_if { |k, v| v.nil? }
|
2381
|
-
r = @client.request("/#{CGI.escape(organization)}/shipments").with_query(query).get
|
2382
|
-
r.map { |x| ::Io::Flow::V0::Models::Shipment.new(x) }
|
2383
|
-
end
|
2384
|
-
|
2385
|
-
def post(organization, shipment_form)
|
2386
|
-
HttpClient::Preconditions.assert_class('organization', organization, String)
|
2387
|
-
HttpClient::Preconditions.assert_class('shipment_form', shipment_form, ::Io::Flow::V0::Models::ShipmentForm)
|
2388
|
-
r = @client.request("/#{CGI.escape(organization)}/shipments").with_json(shipment_form.to_json).post
|
2389
|
-
::Io::Flow::V0::Models::Shipment.new(r)
|
2390
|
-
end
|
2391
|
-
|
2392
|
-
def get_by_id(organization, id)
|
2393
|
-
HttpClient::Preconditions.assert_class('organization', organization, String)
|
2394
|
-
HttpClient::Preconditions.assert_class('id', id, String)
|
2395
|
-
r = @client.request("/#{CGI.escape(organization)}/shipments/#{CGI.escape(id)}").get
|
2396
|
-
::Io::Flow::V0::Models::Shipment.new(r)
|
2397
|
-
end
|
2398
|
-
|
2399
|
-
def get_versions(organization, incoming={})
|
2400
|
-
HttpClient::Preconditions.assert_class('organization', organization, String)
|
2401
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
2402
|
-
query = {
|
2403
|
-
:id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
|
2404
|
-
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
2405
|
-
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
2406
|
-
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
|
2407
|
-
}.delete_if { |k, v| v.nil? }
|
2408
|
-
r = @client.request("/#{CGI.escape(organization)}/shipments/versions").with_query(query).get
|
2409
|
-
r.map { |x| ::Io::Flow::V0::Models::ShipmentVersion.new(x) }
|
2410
|
-
end
|
2411
|
-
|
2412
|
-
end
|
2413
|
-
|
2414
|
-
class ShipmentLabels
|
2415
|
-
|
2416
|
-
def initialize(client)
|
2417
|
-
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
|
2418
|
-
end
|
2419
|
-
|
2420
|
-
def get(organization, tracking_number, incoming={})
|
2421
|
-
HttpClient::Preconditions.assert_class('organization', organization, String)
|
2422
|
-
HttpClient::Preconditions.assert_class('tracking_number', tracking_number, String)
|
2423
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
2424
|
-
query = {
|
2425
|
-
:id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
|
2426
|
-
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
2427
|
-
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
2428
|
-
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
|
2429
|
-
}.delete_if { |k, v| v.nil? }
|
2430
|
-
r = @client.request("/#{CGI.escape(organization)}/shipments/#{CGI.escape(tracking_number)}/labels").with_query(query).get
|
2431
|
-
r.map { |x| ::Io::Flow::V0::Models::ShipmentLabel.new(x) }
|
2432
|
-
end
|
2433
|
-
|
2434
|
-
def post(organization, tracking_number, shipment_label_form)
|
2435
|
-
HttpClient::Preconditions.assert_class('organization', organization, String)
|
2436
|
-
HttpClient::Preconditions.assert_class('tracking_number', tracking_number, String)
|
2437
|
-
HttpClient::Preconditions.assert_class('shipment_label_form', shipment_label_form, ::Io::Flow::V0::Models::ShipmentLabelForm)
|
2438
|
-
r = @client.request("/#{CGI.escape(organization)}/shipments/#{CGI.escape(tracking_number)}/labels").with_json(shipment_label_form.to_json).post
|
2439
|
-
::Io::Flow::V0::Models::ShipmentLabel.new(r)
|
2440
|
-
end
|
2441
|
-
|
2442
|
-
def get_versions(organization, tracking_number, incoming={})
|
2443
|
-
HttpClient::Preconditions.assert_class('organization', organization, String)
|
2444
|
-
HttpClient::Preconditions.assert_class('tracking_number', tracking_number, String)
|
2445
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
2446
|
-
query = {
|
2447
|
-
:id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
|
2448
|
-
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
2449
|
-
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
2450
|
-
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
|
2451
|
-
}.delete_if { |k, v| v.nil? }
|
2452
|
-
r = @client.request("/#{CGI.escape(organization)}/shipments/#{CGI.escape(tracking_number)}/labels/versions").with_query(query).get
|
2453
|
-
r.map { |x| ::Io::Flow::V0::Models::ShipmentLabelVersion.new(x) }
|
2454
|
-
end
|
2455
|
-
|
2456
|
-
end
|
2457
|
-
|
2458
2307
|
class Tiers
|
2459
2308
|
|
2460
2309
|
def initialize(client)
|
@@ -3280,6 +3129,58 @@ module Io
|
|
3280
3129
|
|
3281
3130
|
end
|
3282
3131
|
|
3132
|
+
class ShippingLabels
|
3133
|
+
|
3134
|
+
def initialize(client)
|
3135
|
+
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
|
3136
|
+
end
|
3137
|
+
|
3138
|
+
def get(organization, incoming={})
|
3139
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
3140
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
3141
|
+
query = {
|
3142
|
+
:id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
|
3143
|
+
:carrier_tracking_number => (x = opts.delete(:carrier_tracking_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('carrier_tracking_number', x, Array).map { |v| HttpClient::Preconditions.assert_class('carrier_tracking_number', v, String) }),
|
3144
|
+
:flow_tracking_number => (x = opts.delete(:flow_tracking_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('flow_tracking_number', x, Array).map { |v| HttpClient::Preconditions.assert_class('flow_tracking_number', v, String) }),
|
3145
|
+
:service => (x = opts.delete(:service); x.nil? ? nil : HttpClient::Preconditions.assert_class('service', x, Array).map { |v| HttpClient::Preconditions.assert_class('service', v, String) }),
|
3146
|
+
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
3147
|
+
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
3148
|
+
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
|
3149
|
+
}.delete_if { |k, v| v.nil? }
|
3150
|
+
r = @client.request("/#{CGI.escape(organization)}/shipping_label").with_query(query).get
|
3151
|
+
r.map { |x| ::Io::Flow::V0::Models::ShippingLabel.new(x) }
|
3152
|
+
end
|
3153
|
+
|
3154
|
+
def post(organization, shipping_label_form)
|
3155
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
3156
|
+
HttpClient::Preconditions.assert_class('shipping_label_form', shipping_label_form, ::Io::Flow::V0::Models::ShippingLabelForm)
|
3157
|
+
r = @client.request("/#{CGI.escape(organization)}/shipping_label").with_json(shipping_label_form.to_json).post
|
3158
|
+
::Io::Flow::V0::Models::ShippingLabel.new(r)
|
3159
|
+
end
|
3160
|
+
|
3161
|
+
def get_by_id(organization, id)
|
3162
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
3163
|
+
HttpClient::Preconditions.assert_class('id', id, String)
|
3164
|
+
r = @client.request("/#{CGI.escape(organization)}/shipping_label/#{CGI.escape(id)}").get
|
3165
|
+
::Io::Flow::V0::Models::ShippingLabel.new(r)
|
3166
|
+
end
|
3167
|
+
|
3168
|
+
def get_versions(organization, incoming={})
|
3169
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
3170
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
3171
|
+
query = {
|
3172
|
+
:id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
|
3173
|
+
:label => (x = opts.delete(:label); x.nil? ? nil : HttpClient::Preconditions.assert_class('label', x, Array).map { |v| HttpClient::Preconditions.assert_class('label', v, String) }),
|
3174
|
+
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
3175
|
+
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
3176
|
+
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
|
3177
|
+
}.delete_if { |k, v| v.nil? }
|
3178
|
+
r = @client.request("/#{CGI.escape(organization)}/shipping_label/versions").with_query(query).get
|
3179
|
+
r.map { |x| ::Io::Flow::V0::Models::ShippingLabelVersion.new(x) }
|
3180
|
+
end
|
3181
|
+
|
3182
|
+
end
|
3183
|
+
|
3283
3184
|
class Suggestions
|
3284
3185
|
|
3285
3186
|
def initialize(client)
|
@@ -3664,6 +3565,8 @@ module Io
|
|
3664
3565
|
ORGANIZATION_CURRENCY_SETTING_UPSERTED = 'organization_currency_setting_upserted' unless defined?(ORGANIZATION_CURRENCY_SETTING_UPSERTED)
|
3665
3566
|
EXPERIENCE_DELETED = 'experience_deleted' unless defined?(EXPERIENCE_DELETED)
|
3666
3567
|
EXPERIENCE_UPSERTED = 'experience_upserted' unless defined?(EXPERIENCE_UPSERTED)
|
3568
|
+
ITEM_MARGIN_DELETED = 'item_margin_deleted' unless defined?(ITEM_MARGIN_DELETED)
|
3569
|
+
ITEM_MARGIN_UPSERTED = 'item_margin_upserted' unless defined?(ITEM_MARGIN_UPSERTED)
|
3667
3570
|
HS6_CODE_UPSERTED = 'hs6_code_upserted' unless defined?(HS6_CODE_UPSERTED)
|
3668
3571
|
HS6_CODE_DELETED = 'hs6_code_deleted' unless defined?(HS6_CODE_DELETED)
|
3669
3572
|
HS10_CODE_UPSERTED = 'hs10_code_upserted' unless defined?(HS10_CODE_UPSERTED)
|
@@ -3705,6 +3608,8 @@ module Io
|
|
3705
3608
|
when Types::ORGANIZATION_CURRENCY_SETTING_UPSERTED; OrganizationCurrencySettingUpserted.new(hash)
|
3706
3609
|
when Types::EXPERIENCE_DELETED; ExperienceDeleted.new(hash)
|
3707
3610
|
when Types::EXPERIENCE_UPSERTED; ExperienceUpserted.new(hash)
|
3611
|
+
when Types::ITEM_MARGIN_DELETED; ItemMarginDeleted.new(hash)
|
3612
|
+
when Types::ITEM_MARGIN_UPSERTED; ItemMarginUpserted.new(hash)
|
3708
3613
|
when Types::HS6_CODE_UPSERTED; Hs6CodeUpserted.new(hash)
|
3709
3614
|
when Types::HS6_CODE_DELETED; Hs6CodeDeleted.new(hash)
|
3710
3615
|
when Types::HS10_CODE_UPSERTED; Hs10CodeUpserted.new(hash)
|
@@ -4543,7 +4448,7 @@ module Io
|
|
4543
4448
|
end
|
4544
4449
|
|
4545
4450
|
def EventType.ALL
|
4546
|
-
@@all ||= [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.flow_currency_setting_deleted, EventType.flow_currency_setting_upserted, EventType.rate_deleted, EventType.rate_upserted, EventType.spot_rate_deleted, EventType.spot_rate_upserted, EventType.organization_currency_setting_deleted, EventType.organization_currency_setting_upserted, EventType.experience_deleted, EventType.experience_upserted, EventType.hs6_code_upserted, EventType.hs6_code_deleted, EventType.hs10_code_upserted, EventType.hs10_code_deleted, EventType.localized_item_upserted, EventType.localized_item_deleted, EventType.organization_upserted, EventType.organization_deleted]
|
4451
|
+
@@all ||= [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.flow_currency_setting_deleted, EventType.flow_currency_setting_upserted, EventType.rate_deleted, EventType.rate_upserted, EventType.spot_rate_deleted, EventType.spot_rate_upserted, EventType.organization_currency_setting_deleted, EventType.organization_currency_setting_upserted, EventType.experience_deleted, EventType.experience_upserted, EventType.item_margin_deleted, EventType.item_margin_upserted, EventType.hs6_code_upserted, EventType.hs6_code_deleted, EventType.hs10_code_upserted, EventType.hs10_code_deleted, EventType.localized_item_upserted, EventType.localized_item_deleted, EventType.organization_upserted, EventType.organization_deleted]
|
4547
4452
|
end
|
4548
4453
|
|
4549
4454
|
def EventType.catalog_upserted
|
@@ -4618,6 +4523,14 @@ module Io
|
|
4618
4523
|
@@_experience_upserted ||= EventType.new('experience_upserted')
|
4619
4524
|
end
|
4620
4525
|
|
4526
|
+
def EventType.item_margin_deleted
|
4527
|
+
@@_item_margin_deleted ||= EventType.new('item_margin_deleted')
|
4528
|
+
end
|
4529
|
+
|
4530
|
+
def EventType.item_margin_upserted
|
4531
|
+
@@_item_margin_upserted ||= EventType.new('item_margin_upserted')
|
4532
|
+
end
|
4533
|
+
|
4621
4534
|
def EventType.hs6_code_upserted
|
4622
4535
|
@@_hs6_code_upserted ||= EventType.new('hs6_code_upserted')
|
4623
4536
|
end
|
@@ -6379,128 +6292,6 @@ module Io
|
|
6379
6292
|
|
6380
6293
|
end
|
6381
6294
|
|
6382
|
-
# Represents second step of two-step purchase of Flow services.
|
6383
|
-
class Booking
|
6384
|
-
|
6385
|
-
attr_reader :id, :number, :shipments
|
6386
|
-
|
6387
|
-
def initialize(incoming={})
|
6388
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
6389
|
-
HttpClient::Preconditions.require_keys(opts, [:id, :number, :shipments], 'Booking')
|
6390
|
-
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
6391
|
-
@number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
|
6392
|
-
@shipments = HttpClient::Preconditions.assert_class('shipments', opts.delete(:shipments), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::ShipmentReference) ? x : ::Io::Flow::V0::Models::ShipmentReference.new(x)) }
|
6393
|
-
end
|
6394
|
-
|
6395
|
-
def to_json
|
6396
|
-
JSON.dump(to_hash)
|
6397
|
-
end
|
6398
|
-
|
6399
|
-
def copy(incoming={})
|
6400
|
-
Booking.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
6401
|
-
end
|
6402
|
-
|
6403
|
-
def to_hash
|
6404
|
-
{
|
6405
|
-
:id => id,
|
6406
|
-
:number => number,
|
6407
|
-
:shipments => shipments.map { |o| o.to_hash }
|
6408
|
-
}
|
6409
|
-
end
|
6410
|
-
|
6411
|
-
end
|
6412
|
-
|
6413
|
-
# Represents second step of two-step purchase of Flow services.
|
6414
|
-
class BookingForm
|
6415
|
-
|
6416
|
-
attr_reader :number, :quote, :options
|
6417
|
-
|
6418
|
-
def initialize(incoming={})
|
6419
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
6420
|
-
HttpClient::Preconditions.require_keys(opts, [:number, :quote, :options], 'BookingForm')
|
6421
|
-
@number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
|
6422
|
-
@quote = HttpClient::Preconditions.assert_class('quote', opts.delete(:quote), String)
|
6423
|
-
@options = HttpClient::Preconditions.assert_class('options', opts.delete(:options), Array).map { |v| HttpClient::Preconditions.assert_class('options', v, String) }
|
6424
|
-
end
|
6425
|
-
|
6426
|
-
def to_json
|
6427
|
-
JSON.dump(to_hash)
|
6428
|
-
end
|
6429
|
-
|
6430
|
-
def copy(incoming={})
|
6431
|
-
BookingForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
6432
|
-
end
|
6433
|
-
|
6434
|
-
def to_hash
|
6435
|
-
{
|
6436
|
-
:number => number,
|
6437
|
-
:quote => quote,
|
6438
|
-
:options => options
|
6439
|
-
}
|
6440
|
-
end
|
6441
|
-
|
6442
|
-
end
|
6443
|
-
|
6444
|
-
class BookingSummary
|
6445
|
-
|
6446
|
-
attr_reader :id, :number
|
6447
|
-
|
6448
|
-
def initialize(incoming={})
|
6449
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
6450
|
-
HttpClient::Preconditions.require_keys(opts, [:id, :number], 'BookingSummary')
|
6451
|
-
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
6452
|
-
@number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
|
6453
|
-
end
|
6454
|
-
|
6455
|
-
def to_json
|
6456
|
-
JSON.dump(to_hash)
|
6457
|
-
end
|
6458
|
-
|
6459
|
-
def copy(incoming={})
|
6460
|
-
BookingSummary.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
6461
|
-
end
|
6462
|
-
|
6463
|
-
def to_hash
|
6464
|
-
{
|
6465
|
-
:id => id,
|
6466
|
-
:number => number
|
6467
|
-
}
|
6468
|
-
end
|
6469
|
-
|
6470
|
-
end
|
6471
|
-
|
6472
|
-
class BookingVersion
|
6473
|
-
|
6474
|
-
attr_reader :id, :timestamp, :type, :booking
|
6475
|
-
|
6476
|
-
def initialize(incoming={})
|
6477
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
6478
|
-
HttpClient::Preconditions.require_keys(opts, [:id, :timestamp, :type, :booking], 'BookingVersion')
|
6479
|
-
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
6480
|
-
@timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
|
6481
|
-
@type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::ChangeType) ? x : ::Io::Flow::V0::Models::ChangeType.apply(x))
|
6482
|
-
@booking = (x = opts.delete(:booking); x.is_a?(::Io::Flow::V0::Models::BookingSummary) ? x : ::Io::Flow::V0::Models::BookingSummary.new(x))
|
6483
|
-
end
|
6484
|
-
|
6485
|
-
def to_json
|
6486
|
-
JSON.dump(to_hash)
|
6487
|
-
end
|
6488
|
-
|
6489
|
-
def copy(incoming={})
|
6490
|
-
BookingVersion.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
6491
|
-
end
|
6492
|
-
|
6493
|
-
def to_hash
|
6494
|
-
{
|
6495
|
-
:id => id,
|
6496
|
-
:timestamp => timestamp,
|
6497
|
-
:type => type.value,
|
6498
|
-
:booking => booking.to_hash
|
6499
|
-
}
|
6500
|
-
end
|
6501
|
-
|
6502
|
-
end
|
6503
|
-
|
6504
6295
|
# Capture actually transfers funds. You can capture as many times as you'd like
|
6505
6296
|
# up until the total amount of the authorization has been captured or the
|
6506
6297
|
# authorization otherwise becomes unavailable (e.g. expires).
|
@@ -8222,16 +8013,17 @@ module Io
|
|
8222
8013
|
|
8223
8014
|
class ExperienceDeleted < Event
|
8224
8015
|
|
8225
|
-
attr_reader :event_id, :timestamp, :organization, :key
|
8016
|
+
attr_reader :event_id, :timestamp, :organization, :key, :subcatalog_id
|
8226
8017
|
|
8227
8018
|
def initialize(incoming={})
|
8228
8019
|
super(:name => Event::Types::EXPERIENCE_DELETED)
|
8229
8020
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
8230
|
-
HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :key], 'ExperienceDeleted')
|
8021
|
+
HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :key, :subcatalog_id], 'ExperienceDeleted')
|
8231
8022
|
@event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
|
8232
8023
|
@timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
|
8233
8024
|
@organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
|
8234
8025
|
@key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
|
8026
|
+
@subcatalog_id = HttpClient::Preconditions.assert_class('subcatalog_id', opts.delete(:subcatalog_id), String)
|
8235
8027
|
end
|
8236
8028
|
|
8237
8029
|
def to_json
|
@@ -8247,7 +8039,8 @@ module Io
|
|
8247
8039
|
:event_id => event_id,
|
8248
8040
|
:timestamp => timestamp,
|
8249
8041
|
:organization => organization,
|
8250
|
-
:key => key
|
8042
|
+
:key => key,
|
8043
|
+
:subcatalog_id => subcatalog_id
|
8251
8044
|
}
|
8252
8045
|
end
|
8253
8046
|
|
@@ -10388,6 +10181,37 @@ module Io
|
|
10388
10181
|
|
10389
10182
|
end
|
10390
10183
|
|
10184
|
+
class ItemMarginDeleted < Event
|
10185
|
+
|
10186
|
+
attr_reader :event_id, :timestamp, :item_margin_id
|
10187
|
+
|
10188
|
+
def initialize(incoming={})
|
10189
|
+
super(:name => Event::Types::ITEM_MARGIN_DELETED)
|
10190
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
10191
|
+
HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :item_margin_id], 'ItemMarginDeleted')
|
10192
|
+
@event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
|
10193
|
+
@timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
|
10194
|
+
@item_margin_id = HttpClient::Preconditions.assert_class('item_margin_id', opts.delete(:item_margin_id), String)
|
10195
|
+
end
|
10196
|
+
|
10197
|
+
def to_json
|
10198
|
+
JSON.dump(to_hash)
|
10199
|
+
end
|
10200
|
+
|
10201
|
+
def copy(incoming={})
|
10202
|
+
ItemMarginDeleted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
10203
|
+
end
|
10204
|
+
|
10205
|
+
def subtype_to_hash
|
10206
|
+
{
|
10207
|
+
:event_id => event_id,
|
10208
|
+
:timestamp => timestamp,
|
10209
|
+
:item_margin_id => item_margin_id
|
10210
|
+
}
|
10211
|
+
end
|
10212
|
+
|
10213
|
+
end
|
10214
|
+
|
10391
10215
|
# A list of margin to apply to items based on query.
|
10392
10216
|
class ItemMarginForm
|
10393
10217
|
|
@@ -10421,6 +10245,51 @@ module Io
|
|
10421
10245
|
|
10422
10246
|
end
|
10423
10247
|
|
10248
|
+
class ItemMarginUpserted < Event
|
10249
|
+
|
10250
|
+
attr_reader :event_id, :timestamp, :item_margin_id, :organization_id, :experience_key, :name, :q, :margin_type, :margin_value, :position
|
10251
|
+
|
10252
|
+
def initialize(incoming={})
|
10253
|
+
super(:name => Event::Types::ITEM_MARGIN_UPSERTED)
|
10254
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
10255
|
+
HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :item_margin_id, :organization_id, :experience_key, :name, :q, :margin_type, :margin_value, :position], 'ItemMarginUpserted')
|
10256
|
+
@event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
|
10257
|
+
@timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
|
10258
|
+
@item_margin_id = HttpClient::Preconditions.assert_class('item_margin_id', opts.delete(:item_margin_id), String)
|
10259
|
+
@organization_id = HttpClient::Preconditions.assert_class('organization_id', opts.delete(:organization_id), String)
|
10260
|
+
@experience_key = HttpClient::Preconditions.assert_class('experience_key', opts.delete(:experience_key), String)
|
10261
|
+
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
|
10262
|
+
@q = HttpClient::Preconditions.assert_class('q', opts.delete(:q), String)
|
10263
|
+
@margin_type = HttpClient::Preconditions.assert_class('margin_type', opts.delete(:margin_type), String)
|
10264
|
+
@margin_value = HttpClient::Preconditions.assert_class('margin_value', HttpClient::Helper.to_big_decimal(opts.delete(:margin_value)), BigDecimal)
|
10265
|
+
@position = HttpClient::Preconditions.assert_class('position', opts.delete(:position), Integer)
|
10266
|
+
end
|
10267
|
+
|
10268
|
+
def to_json
|
10269
|
+
JSON.dump(to_hash)
|
10270
|
+
end
|
10271
|
+
|
10272
|
+
def copy(incoming={})
|
10273
|
+
ItemMarginUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
10274
|
+
end
|
10275
|
+
|
10276
|
+
def subtype_to_hash
|
10277
|
+
{
|
10278
|
+
:event_id => event_id,
|
10279
|
+
:timestamp => timestamp,
|
10280
|
+
:item_margin_id => item_margin_id,
|
10281
|
+
:organization_id => organization_id,
|
10282
|
+
:experience_key => experience_key,
|
10283
|
+
:name => name,
|
10284
|
+
:q => q,
|
10285
|
+
:margin_type => margin_type,
|
10286
|
+
:margin_value => margin_value,
|
10287
|
+
:position => position
|
10288
|
+
}
|
10289
|
+
end
|
10290
|
+
|
10291
|
+
end
|
10292
|
+
|
10424
10293
|
class ItemMarginVersion
|
10425
10294
|
|
10426
10295
|
attr_reader :id, :timestamp, :type, :item_margin
|
@@ -13033,57 +12902,15 @@ module Io
|
|
13033
12902
|
|
13034
12903
|
end
|
13035
12904
|
|
13036
|
-
|
13037
|
-
# shipment. Flow provides a generated tracking number to track this shipment
|
13038
|
-
# across multiple possible hops and carriers.
|
13039
|
-
class Shipment
|
13040
|
-
|
13041
|
-
attr_reader :id, :commercial_invoice, :destination, :items, :shipment_labels, :tracking_number
|
13042
|
-
|
13043
|
-
def initialize(incoming={})
|
13044
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
13045
|
-
HttpClient::Preconditions.require_keys(opts, [:id, :commercial_invoice, :destination, :items, :shipment_labels, :tracking_number], 'Shipment')
|
13046
|
-
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
13047
|
-
@commercial_invoice = HttpClient::Preconditions.assert_class('commercial_invoice', opts.delete(:commercial_invoice), String)
|
13048
|
-
@destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::ShippingAddress) ? x : ::Io::Flow::V0::Models::ShippingAddress.new(x))
|
13049
|
-
@items = HttpClient::Preconditions.assert_class('items', opts.delete(:items), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::LineItem) ? x : ::Io::Flow::V0::Models::LineItem.new(x)) }
|
13050
|
-
@shipment_labels = HttpClient::Preconditions.assert_class('shipment_labels', opts.delete(:shipment_labels), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::ShipmentLabel) ? x : ::Io::Flow::V0::Models::ShipmentLabel.new(x)) }
|
13051
|
-
@tracking_number = HttpClient::Preconditions.assert_class('tracking_number', opts.delete(:tracking_number), String)
|
13052
|
-
end
|
13053
|
-
|
13054
|
-
def to_json
|
13055
|
-
JSON.dump(to_hash)
|
13056
|
-
end
|
13057
|
-
|
13058
|
-
def copy(incoming={})
|
13059
|
-
Shipment.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
13060
|
-
end
|
13061
|
-
|
13062
|
-
def to_hash
|
13063
|
-
{
|
13064
|
-
:id => id,
|
13065
|
-
:commercial_invoice => commercial_invoice,
|
13066
|
-
:destination => destination.to_hash,
|
13067
|
-
:items => items.map { |o| o.to_hash },
|
13068
|
-
:shipment_labels => shipment_labels.map { |o| o.to_hash },
|
13069
|
-
:tracking_number => tracking_number
|
13070
|
-
}
|
13071
|
-
end
|
13072
|
-
|
13073
|
-
end
|
13074
|
-
|
13075
|
-
# Represents a subset of items from an order grouped into a single physical
|
13076
|
-
# shipment.
|
13077
|
-
class ShipmentForm
|
12905
|
+
class ShippingAddress
|
13078
12906
|
|
13079
|
-
attr_reader :
|
12907
|
+
attr_reader :contact, :location
|
13080
12908
|
|
13081
12909
|
def initialize(incoming={})
|
13082
12910
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
13083
|
-
HttpClient::Preconditions.require_keys(opts, [:
|
13084
|
-
@
|
13085
|
-
@
|
13086
|
-
@shipment_labels = (x = opts.delete(:shipment_labels); x.nil? ? nil : HttpClient::Preconditions.assert_class('shipment_labels', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::ShipmentLabelForm) ? x : ::Io::Flow::V0::Models::ShipmentLabelForm.new(x)) })
|
12911
|
+
HttpClient::Preconditions.require_keys(opts, [:contact, :location], 'ShippingAddress')
|
12912
|
+
@contact = (x = opts.delete(:contact); x.is_a?(::Io::Flow::V0::Models::Contact) ? x : ::Io::Flow::V0::Models::Contact.new(x))
|
12913
|
+
@location = (x = opts.delete(:location); x.is_a?(::Io::Flow::V0::Models::Address) ? x : ::Io::Flow::V0::Models::Address.new(x))
|
13087
12914
|
end
|
13088
12915
|
|
13089
12916
|
def to_json
|
@@ -13091,33 +12918,38 @@ module Io
|
|
13091
12918
|
end
|
13092
12919
|
|
13093
12920
|
def copy(incoming={})
|
13094
|
-
|
12921
|
+
ShippingAddress.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
13095
12922
|
end
|
13096
12923
|
|
13097
12924
|
def to_hash
|
13098
12925
|
{
|
13099
|
-
:
|
13100
|
-
:
|
13101
|
-
:shipment_labels => shipment_labels.nil? ? nil : shipment_labels.map { |o| o.to_hash }
|
12926
|
+
:contact => contact.to_hash,
|
12927
|
+
:location => location.to_hash
|
13102
12928
|
}
|
13103
12929
|
end
|
13104
12930
|
|
13105
12931
|
end
|
13106
12932
|
|
13107
|
-
#
|
13108
|
-
|
12933
|
+
# Represents information about a carrier-generated shipping label used by a
|
12934
|
+
# shipper to transport a package from a given origin to destination
|
12935
|
+
class ShippingLabel
|
13109
12936
|
|
13110
|
-
attr_reader :id, :
|
12937
|
+
attr_reader :id, :carrier_tracking_number, :commercial_invoice, :data, :destination, :flow_tracking_number, :origin, :service, :window, :pdf, :png
|
13111
12938
|
|
13112
12939
|
def initialize(incoming={})
|
13113
12940
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
13114
|
-
HttpClient::Preconditions.require_keys(opts, [:id, :service, :
|
12941
|
+
HttpClient::Preconditions.require_keys(opts, [:id, :carrier_tracking_number, :commercial_invoice, :data, :destination, :flow_tracking_number, :origin, :service, :window], 'ShippingLabel')
|
13115
12942
|
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
12943
|
+
@carrier_tracking_number = HttpClient::Preconditions.assert_class('carrier_tracking_number', opts.delete(:carrier_tracking_number), String)
|
12944
|
+
@commercial_invoice = HttpClient::Preconditions.assert_class('commercial_invoice', opts.delete(:commercial_invoice), String)
|
12945
|
+
@data = HttpClient::Preconditions.assert_class('data', opts.delete(:data), String)
|
12946
|
+
@destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::ShippingAddress) ? x : ::Io::Flow::V0::Models::ShippingAddress.new(x))
|
12947
|
+
@flow_tracking_number = HttpClient::Preconditions.assert_class('flow_tracking_number', opts.delete(:flow_tracking_number), String)
|
12948
|
+
@origin = (x = opts.delete(:origin); x.is_a?(::Io::Flow::V0::Models::ShippingAddress) ? x : ::Io::Flow::V0::Models::ShippingAddress.new(x))
|
13116
12949
|
@service = (x = opts.delete(:service); x.is_a?(::Io::Flow::V0::Models::ServiceSummary) ? x : ::Io::Flow::V0::Models::ServiceSummary.new(x))
|
13117
|
-
@
|
13118
|
-
@window = (x = opts.delete(:window); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::DatetimeRange) ? x : ::Io::Flow::V0::Models::DatetimeRange.new(x)))
|
12950
|
+
@window = (x = opts.delete(:window); x.is_a?(::Io::Flow::V0::Models::DatetimeRange) ? x : ::Io::Flow::V0::Models::DatetimeRange.new(x))
|
13119
12951
|
@pdf = (x = opts.delete(:pdf); x.nil? ? nil : HttpClient::Preconditions.assert_class('pdf', x, String))
|
13120
|
-
@
|
12952
|
+
@png = (x = opts.delete(:png); x.nil? ? nil : HttpClient::Preconditions.assert_class('png', x, String))
|
13121
12953
|
end
|
13122
12954
|
|
13123
12955
|
def to_json
|
@@ -13125,35 +12957,40 @@ module Io
|
|
13125
12957
|
end
|
13126
12958
|
|
13127
12959
|
def copy(incoming={})
|
13128
|
-
|
12960
|
+
ShippingLabel.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
13129
12961
|
end
|
13130
12962
|
|
13131
12963
|
def to_hash
|
13132
12964
|
{
|
13133
12965
|
:id => id,
|
12966
|
+
:carrier_tracking_number => carrier_tracking_number,
|
12967
|
+
:commercial_invoice => commercial_invoice,
|
12968
|
+
:data => data,
|
12969
|
+
:destination => destination.to_hash,
|
12970
|
+
:flow_tracking_number => flow_tracking_number,
|
12971
|
+
:origin => origin.to_hash,
|
13134
12972
|
:service => service.to_hash,
|
13135
|
-
:
|
13136
|
-
:window => window.nil? ? nil : window.to_hash,
|
12973
|
+
:window => window.to_hash,
|
13137
12974
|
:pdf => pdf,
|
13138
|
-
:
|
12975
|
+
:png => png
|
13139
12976
|
}
|
13140
12977
|
end
|
13141
12978
|
|
13142
12979
|
end
|
13143
12980
|
|
13144
|
-
|
13145
|
-
class ShipmentLabelForm
|
12981
|
+
class ShippingLabelForm
|
13146
12982
|
|
13147
|
-
attr_reader :service, :
|
12983
|
+
attr_reader :service, :destination, :origin, :packages, :delivered_duty, :insurance
|
13148
12984
|
|
13149
12985
|
def initialize(incoming={})
|
13150
12986
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
13151
|
-
HttpClient::Preconditions.require_keys(opts, [:service, :
|
12987
|
+
HttpClient::Preconditions.require_keys(opts, [:service, :destination, :origin, :packages], 'ShippingLabelForm')
|
13152
12988
|
@service = HttpClient::Preconditions.assert_class('service', opts.delete(:service), String)
|
13153
|
-
@
|
13154
|
-
@
|
13155
|
-
@
|
13156
|
-
@
|
12989
|
+
@destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::ShippingAddress) ? x : ::Io::Flow::V0::Models::ShippingAddress.new(x))
|
12990
|
+
@origin = (x = opts.delete(:origin); x.is_a?(::Io::Flow::V0::Models::ShippingAddress) ? x : ::Io::Flow::V0::Models::ShippingAddress.new(x))
|
12991
|
+
@packages = HttpClient::Preconditions.assert_class('packages', opts.delete(:packages), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::ShippingLabelPackage) ? x : ::Io::Flow::V0::Models::ShippingLabelPackage.new(x)) }
|
12992
|
+
@delivered_duty = (x = opts.delete(:delivered_duty); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::DeliveredDuty) ? x : ::Io::Flow::V0::Models::DeliveredDuty.apply(x)))
|
12993
|
+
@insurance = (x = opts.delete(:insurance); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x)))
|
13157
12994
|
end
|
13158
12995
|
|
13159
12996
|
def to_json
|
@@ -13161,153 +12998,32 @@ module Io
|
|
13161
12998
|
end
|
13162
12999
|
|
13163
13000
|
def copy(incoming={})
|
13164
|
-
|
13001
|
+
ShippingLabelForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
13165
13002
|
end
|
13166
13003
|
|
13167
13004
|
def to_hash
|
13168
13005
|
{
|
13169
13006
|
:service => service,
|
13170
|
-
:
|
13171
|
-
:
|
13172
|
-
:
|
13173
|
-
:
|
13174
|
-
|
13175
|
-
end
|
13176
|
-
|
13177
|
-
end
|
13178
|
-
|
13179
|
-
class ShipmentLabelReference
|
13180
|
-
|
13181
|
-
attr_reader :id
|
13182
|
-
|
13183
|
-
def initialize(incoming={})
|
13184
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
13185
|
-
HttpClient::Preconditions.require_keys(opts, [:id], 'ShipmentLabelReference')
|
13186
|
-
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
13187
|
-
end
|
13188
|
-
|
13189
|
-
def to_json
|
13190
|
-
JSON.dump(to_hash)
|
13191
|
-
end
|
13192
|
-
|
13193
|
-
def copy(incoming={})
|
13194
|
-
ShipmentLabelReference.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
13195
|
-
end
|
13196
|
-
|
13197
|
-
def to_hash
|
13198
|
-
{
|
13199
|
-
:id => id
|
13200
|
-
}
|
13201
|
-
end
|
13202
|
-
|
13203
|
-
end
|
13204
|
-
|
13205
|
-
class ShipmentLabelSummary
|
13206
|
-
|
13207
|
-
attr_reader :id, :service, :tracking_number, :window, :pdf, :zpl
|
13208
|
-
|
13209
|
-
def initialize(incoming={})
|
13210
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
13211
|
-
HttpClient::Preconditions.require_keys(opts, [:id, :service, :tracking_number], 'ShipmentLabelSummary')
|
13212
|
-
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
13213
|
-
@service = (x = opts.delete(:service); x.is_a?(::Io::Flow::V0::Models::ServiceReference) ? x : ::Io::Flow::V0::Models::ServiceReference.new(x))
|
13214
|
-
@tracking_number = HttpClient::Preconditions.assert_class('tracking_number', opts.delete(:tracking_number), String)
|
13215
|
-
@window = (x = opts.delete(:window); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::DatetimeRange) ? x : ::Io::Flow::V0::Models::DatetimeRange.new(x)))
|
13216
|
-
@pdf = (x = opts.delete(:pdf); x.nil? ? nil : HttpClient::Preconditions.assert_class('pdf', x, String))
|
13217
|
-
@zpl = (x = opts.delete(:zpl); x.nil? ? nil : HttpClient::Preconditions.assert_class('zpl', x, String))
|
13218
|
-
end
|
13219
|
-
|
13220
|
-
def to_json
|
13221
|
-
JSON.dump(to_hash)
|
13222
|
-
end
|
13223
|
-
|
13224
|
-
def copy(incoming={})
|
13225
|
-
ShipmentLabelSummary.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
13226
|
-
end
|
13227
|
-
|
13228
|
-
def to_hash
|
13229
|
-
{
|
13230
|
-
:id => id,
|
13231
|
-
:service => service.to_hash,
|
13232
|
-
:tracking_number => tracking_number,
|
13233
|
-
:window => window.nil? ? nil : window.to_hash,
|
13234
|
-
:pdf => pdf,
|
13235
|
-
:zpl => zpl
|
13236
|
-
}
|
13237
|
-
end
|
13238
|
-
|
13239
|
-
end
|
13240
|
-
|
13241
|
-
class ShipmentLabelVersion
|
13242
|
-
|
13243
|
-
attr_reader :id, :timestamp, :type, :shipment_label
|
13244
|
-
|
13245
|
-
def initialize(incoming={})
|
13246
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
13247
|
-
HttpClient::Preconditions.require_keys(opts, [:id, :timestamp, :type, :shipment_label], 'ShipmentLabelVersion')
|
13248
|
-
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
13249
|
-
@timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
|
13250
|
-
@type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::ChangeType) ? x : ::Io::Flow::V0::Models::ChangeType.apply(x))
|
13251
|
-
@shipment_label = (x = opts.delete(:shipment_label); x.is_a?(::Io::Flow::V0::Models::ShipmentLabelSummary) ? x : ::Io::Flow::V0::Models::ShipmentLabelSummary.new(x))
|
13252
|
-
end
|
13253
|
-
|
13254
|
-
def to_json
|
13255
|
-
JSON.dump(to_hash)
|
13256
|
-
end
|
13257
|
-
|
13258
|
-
def copy(incoming={})
|
13259
|
-
ShipmentLabelVersion.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
13260
|
-
end
|
13261
|
-
|
13262
|
-
def to_hash
|
13263
|
-
{
|
13264
|
-
:id => id,
|
13265
|
-
:timestamp => timestamp,
|
13266
|
-
:type => type.value,
|
13267
|
-
:shipment_label => shipment_label.to_hash
|
13268
|
-
}
|
13269
|
-
end
|
13270
|
-
|
13271
|
-
end
|
13272
|
-
|
13273
|
-
class ShipmentReference
|
13274
|
-
|
13275
|
-
attr_reader :id
|
13276
|
-
|
13277
|
-
def initialize(incoming={})
|
13278
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
13279
|
-
HttpClient::Preconditions.require_keys(opts, [:id], 'ShipmentReference')
|
13280
|
-
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
13281
|
-
end
|
13282
|
-
|
13283
|
-
def to_json
|
13284
|
-
JSON.dump(to_hash)
|
13285
|
-
end
|
13286
|
-
|
13287
|
-
def copy(incoming={})
|
13288
|
-
ShipmentReference.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
13289
|
-
end
|
13290
|
-
|
13291
|
-
def to_hash
|
13292
|
-
{
|
13293
|
-
:id => id
|
13007
|
+
:destination => destination.to_hash,
|
13008
|
+
:origin => origin.to_hash,
|
13009
|
+
:packages => packages.map { |o| o.to_hash },
|
13010
|
+
:delivered_duty => delivered_duty.nil? ? nil : delivered_duty.value,
|
13011
|
+
:insurance => insurance.nil? ? nil : insurance.to_hash
|
13294
13012
|
}
|
13295
13013
|
end
|
13296
13014
|
|
13297
13015
|
end
|
13298
13016
|
|
13299
|
-
|
13017
|
+
# Describes a package to be shipped, including dimensions and items included
|
13018
|
+
class ShippingLabelPackage
|
13300
13019
|
|
13301
|
-
attr_reader :
|
13020
|
+
attr_reader :dimensions, :items
|
13302
13021
|
|
13303
13022
|
def initialize(incoming={})
|
13304
13023
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
13305
|
-
HttpClient::Preconditions.require_keys(opts, [:
|
13306
|
-
@
|
13307
|
-
@commercial_invoice = HttpClient::Preconditions.assert_class('commercial_invoice', opts.delete(:commercial_invoice), String)
|
13308
|
-
@destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::ShippingAddress) ? x : ::Io::Flow::V0::Models::ShippingAddress.new(x))
|
13024
|
+
HttpClient::Preconditions.require_keys(opts, [:dimensions, :items], 'ShippingLabelPackage')
|
13025
|
+
@dimensions = (x = opts.delete(:dimensions); x.is_a?(::Io::Flow::V0::Models::Dimension) ? x : ::Io::Flow::V0::Models::Dimension.new(x))
|
13309
13026
|
@items = HttpClient::Preconditions.assert_class('items', opts.delete(:items), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::LineItem) ? x : ::Io::Flow::V0::Models::LineItem.new(x)) }
|
13310
|
-
@tracking_number = HttpClient::Preconditions.assert_class('tracking_number', opts.delete(:tracking_number), String)
|
13311
13027
|
end
|
13312
13028
|
|
13313
13029
|
def to_json
|
@@ -13315,32 +13031,29 @@ module Io
|
|
13315
13031
|
end
|
13316
13032
|
|
13317
13033
|
def copy(incoming={})
|
13318
|
-
|
13034
|
+
ShippingLabelPackage.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
13319
13035
|
end
|
13320
13036
|
|
13321
13037
|
def to_hash
|
13322
13038
|
{
|
13323
|
-
:
|
13324
|
-
:
|
13325
|
-
:destination => destination.to_hash,
|
13326
|
-
:items => items.map { |o| o.to_hash },
|
13327
|
-
:tracking_number => tracking_number
|
13039
|
+
:dimensions => dimensions.to_hash,
|
13040
|
+
:items => items.map { |o| o.to_hash }
|
13328
13041
|
}
|
13329
13042
|
end
|
13330
13043
|
|
13331
13044
|
end
|
13332
13045
|
|
13333
|
-
class
|
13046
|
+
class ShippingLabelVersion
|
13334
13047
|
|
13335
|
-
attr_reader :id, :timestamp, :type, :
|
13048
|
+
attr_reader :id, :timestamp, :type, :shipping_label
|
13336
13049
|
|
13337
13050
|
def initialize(incoming={})
|
13338
13051
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
13339
|
-
HttpClient::Preconditions.require_keys(opts, [:id, :timestamp, :type, :
|
13052
|
+
HttpClient::Preconditions.require_keys(opts, [:id, :timestamp, :type, :shipping_label], 'ShippingLabelVersion')
|
13340
13053
|
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
13341
13054
|
@timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
|
13342
13055
|
@type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::ChangeType) ? x : ::Io::Flow::V0::Models::ChangeType.apply(x))
|
13343
|
-
@
|
13056
|
+
@shipping_label = (x = opts.delete(:shipping_label); x.is_a?(::Io::Flow::V0::Models::ShippingLabel) ? x : ::Io::Flow::V0::Models::ShippingLabel.new(x))
|
13344
13057
|
end
|
13345
13058
|
|
13346
13059
|
def to_json
|
@@ -13348,7 +13061,7 @@ module Io
|
|
13348
13061
|
end
|
13349
13062
|
|
13350
13063
|
def copy(incoming={})
|
13351
|
-
|
13064
|
+
ShippingLabelVersion.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
13352
13065
|
end
|
13353
13066
|
|
13354
13067
|
def to_hash
|
@@ -13356,35 +13069,7 @@ module Io
|
|
13356
13069
|
:id => id,
|
13357
13070
|
:timestamp => timestamp,
|
13358
13071
|
:type => type.value,
|
13359
|
-
:
|
13360
|
-
}
|
13361
|
-
end
|
13362
|
-
|
13363
|
-
end
|
13364
|
-
|
13365
|
-
class ShippingAddress
|
13366
|
-
|
13367
|
-
attr_reader :contact, :location
|
13368
|
-
|
13369
|
-
def initialize(incoming={})
|
13370
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
13371
|
-
HttpClient::Preconditions.require_keys(opts, [:contact, :location], 'ShippingAddress')
|
13372
|
-
@contact = (x = opts.delete(:contact); x.is_a?(::Io::Flow::V0::Models::Contact) ? x : ::Io::Flow::V0::Models::Contact.new(x))
|
13373
|
-
@location = (x = opts.delete(:location); x.is_a?(::Io::Flow::V0::Models::Address) ? x : ::Io::Flow::V0::Models::Address.new(x))
|
13374
|
-
end
|
13375
|
-
|
13376
|
-
def to_json
|
13377
|
-
JSON.dump(to_hash)
|
13378
|
-
end
|
13379
|
-
|
13380
|
-
def copy(incoming={})
|
13381
|
-
ShippingAddress.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
13382
|
-
end
|
13383
|
-
|
13384
|
-
def to_hash
|
13385
|
-
{
|
13386
|
-
:contact => contact.to_hash,
|
13387
|
-
:location => location.to_hash
|
13072
|
+
:shipping_label => shipping_label.to_hash
|
13388
13073
|
}
|
13389
13074
|
end
|
13390
13075
|
|
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.0.
|
4
|
+
version: 0.0.42
|
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: 2016-08-
|
11
|
+
date: 2016-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|