flowcommerce 0.1.10 → 0.1.11
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 +458 -161
- 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: d6d7de8d9c9c0b7ff290659c807c4f560904d832
|
4
|
+
data.tar.gz: e4236724a02e472368356b30d5c8802bdc50affa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11cb7cfa979eda7e3931bd8ab3bd80903eca49935851b5ca9a72962b90d9fac073e4da5326e685b30ef67f86f592431999773a74c4cd3c5fe12313a32c6981e4
|
7
|
+
data.tar.gz: 295031f2a4cc972e341a4cd87ec74407d52bbd3ca7788d29ccf4659b3912a356d03271d1e7c307a2818277aa31bccaf8e4a2ad22f4dbcd61c9f92bf43f64063d
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Generated by apidoc - http://www.apidoc.me
|
2
2
|
# Service version: 0.1.77
|
3
|
-
# apidoc:0.11.51 http://
|
3
|
+
# apidoc:0.11.51 http://www.apidoc.me/flow/api/0.2.34/ruby_client
|
4
4
|
|
5
5
|
require 'cgi'
|
6
6
|
require 'net/http'
|
@@ -25,7 +25,7 @@ module Io
|
|
25
25
|
|
26
26
|
BASE_URL = 'https://api.flow.io' unless defined?(Constants::BASE_URL)
|
27
27
|
NAMESPACE = 'io.flow.v0' unless defined?(Constants::NAMESPACE)
|
28
|
-
USER_AGENT = 'apidoc:0.11.51 http://
|
28
|
+
USER_AGENT = 'apidoc:0.11.51 http://www.apidoc.me/flow/api/0.2.34/ruby_client' unless defined?(Constants::USER_AGENT)
|
29
29
|
VERSION = '0.1.77' unless defined?(Constants::VERSION)
|
30
30
|
VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
|
31
31
|
|
@@ -209,6 +209,10 @@ module Io
|
|
209
209
|
@quote_estimates ||= ::Io::Flow::V0::Clients::QuoteEstimates.new(self)
|
210
210
|
end
|
211
211
|
|
212
|
+
def rmas
|
213
|
+
@rmas ||= ::Io::Flow::V0::Clients::Rmas.new(self)
|
214
|
+
end
|
215
|
+
|
212
216
|
def services
|
213
217
|
@services ||= ::Io::Flow::V0::Clients::Services.new(self)
|
214
218
|
end
|
@@ -432,6 +436,46 @@ module Io
|
|
432
436
|
::Io::Flow::V0::Models::Catalog.new(r)
|
433
437
|
end
|
434
438
|
|
439
|
+
# Search global restrictions. Always paginated.
|
440
|
+
def get_catalog_and_restrictions(organization, incoming={})
|
441
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
442
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
443
|
+
query = {
|
444
|
+
:id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
|
445
|
+
:number => (x = opts.delete(:number); x.nil? ? nil : HttpClient::Preconditions.assert_class('number', x, Array).map { |v| HttpClient::Preconditions.assert_class('number', v, String) }),
|
446
|
+
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
447
|
+
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
448
|
+
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "name" : x), String)
|
449
|
+
}.delete_if { |k, v| v.nil? }
|
450
|
+
r = @client.request("/#{CGI.escape(organization)}/catalog/restrictions").with_query(query).get
|
451
|
+
r.map { |x| ::Io::Flow::V0::Models::Item.new(x) }
|
452
|
+
end
|
453
|
+
|
454
|
+
# Returns a spcifical globally restricted item.
|
455
|
+
def get_catalog_and_restrictions_by_number(organization, number)
|
456
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
457
|
+
HttpClient::Preconditions.assert_class('number', number, String)
|
458
|
+
r = @client.request("/#{CGI.escape(organization)}/catalog/restrictions/#{CGI.escape(number)}").get
|
459
|
+
::Io::Flow::V0::Models::Item.new(r)
|
460
|
+
end
|
461
|
+
|
462
|
+
# Upsert a global restriction
|
463
|
+
def put_catalog_and_restrictions_by_number(organization, number, hash)
|
464
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
465
|
+
HttpClient::Preconditions.assert_class('number', number, String)
|
466
|
+
HttpClient::Preconditions.assert_class('hash', hash, Hash)
|
467
|
+
r = @client.request("/#{CGI.escape(organization)}/catalog/restrictions/#{CGI.escape(number)}").with_json(hash.to_json).put
|
468
|
+
::Io::Flow::V0::Models::Item.new(r)
|
469
|
+
end
|
470
|
+
|
471
|
+
# Delete the global restriction for this catalog item number
|
472
|
+
def delete_catalog_and_restrictions_by_number(organization, number)
|
473
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
474
|
+
HttpClient::Preconditions.assert_class('number', number, String)
|
475
|
+
r = @client.request("/#{CGI.escape(organization)}/catalog/restrictions/#{CGI.escape(number)}").delete
|
476
|
+
nil
|
477
|
+
end
|
478
|
+
|
435
479
|
# Get statistics for this organization's catalog.
|
436
480
|
def get_catalog_and_statistics(organization)
|
437
481
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
@@ -779,8 +823,8 @@ module Io
|
|
779
823
|
end
|
780
824
|
|
781
825
|
# Create an order, using the localized information from the experience
|
782
|
-
# selected by the query parameters. Note the order must be
|
783
|
-
#
|
826
|
+
# selected by the query parameters. Note the order must be submitted before
|
827
|
+
# its expiration
|
784
828
|
def post(organization, order_form, incoming={})
|
785
829
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
786
830
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
@@ -805,8 +849,8 @@ module Io
|
|
805
849
|
end
|
806
850
|
|
807
851
|
# Upserts an order. using the localized information from the experience
|
808
|
-
# selected by the query parameters. Note the order must be
|
809
|
-
#
|
852
|
+
# selected by the query parameters. Note the order must be submitted before
|
853
|
+
# its expiration
|
810
854
|
def put_by_number(organization, number, order_put_form, incoming={})
|
811
855
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
812
856
|
HttpClient::Preconditions.assert_class('number', number, String)
|
@@ -823,8 +867,8 @@ module Io
|
|
823
867
|
::Io::Flow::V0::Models::Order.new(r)
|
824
868
|
end
|
825
869
|
|
826
|
-
# Delete an order. Note that production orders that have already been
|
827
|
-
# cannot be deleted (you will see a 422 response in these cases).
|
870
|
+
# Delete an order. Note that production orders that have already been
|
871
|
+
# submitted cannot be deleted (you will see a 422 response in these cases).
|
828
872
|
def delete_by_number(organization, number)
|
829
873
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
830
874
|
HttpClient::Preconditions.assert_class('number', number, String)
|
@@ -832,24 +876,16 @@ module Io
|
|
832
876
|
nil
|
833
877
|
end
|
834
878
|
|
835
|
-
#
|
836
|
-
def get_bookings_by_number(organization, number)
|
837
|
-
HttpClient::Preconditions.assert_class('organization', organization, String)
|
838
|
-
HttpClient::Preconditions.assert_class('number', number, String)
|
839
|
-
r = @client.request("/#{CGI.escape(organization)}/orders/#{CGI.escape(number)}/bookings").get
|
840
|
-
r.map { |x| ::Io::Flow::V0::Models::OrderBooking.new(x) }
|
841
|
-
end
|
842
|
-
|
843
|
-
# Books an order. You will get a validation error if the order has already
|
879
|
+
# Submits an order. You will get a validation error if the order has already
|
844
880
|
# expired (and a new quote could not be automatically recreated for a lower or
|
845
|
-
# same price). This method is idempotent -
|
846
|
-
# no effect.
|
847
|
-
def
|
881
|
+
# same price). This method is idempotent - submitting an order a second time
|
882
|
+
# has no effect.
|
883
|
+
def put_submissions_by_number(organization, number, hash)
|
848
884
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
849
885
|
HttpClient::Preconditions.assert_class('number', number, String)
|
850
886
|
HttpClient::Preconditions.assert_class('hash', hash, Hash)
|
851
|
-
r = @client.request("/#{CGI.escape(organization)}/orders/#{CGI.escape(number)}/
|
852
|
-
::Io::Flow::V0::Models::
|
887
|
+
r = @client.request("/#{CGI.escape(organization)}/orders/#{CGI.escape(number)}/submissions").with_json(hash.to_json).put
|
888
|
+
::Io::Flow::V0::Models::Order.new(r)
|
853
889
|
end
|
854
890
|
|
855
891
|
# Provides visibility into recent changes of each order, including deletion
|
@@ -877,7 +913,8 @@ module Io
|
|
877
913
|
|
878
914
|
# Create an order estimate, using the localized information from the
|
879
915
|
# experience selected by the query parameters. This is similar to the POST
|
880
|
-
# orders endpoint, except this just returns an estimate and cannot be
|
916
|
+
# orders endpoint, except this just returns an estimate and cannot be
|
917
|
+
# submitted.
|
881
918
|
def post(organization, order_estimate_form, incoming={})
|
882
919
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
883
920
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
@@ -2507,6 +2544,60 @@ module Io
|
|
2507
2544
|
|
2508
2545
|
end
|
2509
2546
|
|
2547
|
+
class Rmas
|
2548
|
+
|
2549
|
+
def initialize(client)
|
2550
|
+
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
|
2551
|
+
end
|
2552
|
+
|
2553
|
+
def get(organization, incoming={})
|
2554
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
2555
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
2556
|
+
query = {
|
2557
|
+
:id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
|
2558
|
+
:number => (x = opts.delete(:number); x.nil? ? nil : HttpClient::Preconditions.assert_class('number', x, Array).map { |v| HttpClient::Preconditions.assert_class('number', v, String) }),
|
2559
|
+
: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) }),
|
2560
|
+
: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) }),
|
2561
|
+
:order_number => (x = opts.delete(:order_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('order_number', x, Array).map { |v| HttpClient::Preconditions.assert_class('order_number', v, String) }),
|
2562
|
+
:service => (x = opts.delete(:service); x.nil? ? nil : HttpClient::Preconditions.assert_class('service', x, Array).map { |v| HttpClient::Preconditions.assert_class('service', v, String) }),
|
2563
|
+
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
2564
|
+
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
2565
|
+
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
|
2566
|
+
}.delete_if { |k, v| v.nil? }
|
2567
|
+
r = @client.request("/#{CGI.escape(organization)}/rmas").with_query(query).get
|
2568
|
+
r.map { |x| ::Io::Flow::V0::Models::Rma.new(x) }
|
2569
|
+
end
|
2570
|
+
|
2571
|
+
def post(organization, rma_form)
|
2572
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
2573
|
+
HttpClient::Preconditions.assert_class('rma_form', rma_form, ::Io::Flow::V0::Models::RmaForm)
|
2574
|
+
r = @client.request("/#{CGI.escape(organization)}/rmas").with_json(rma_form.to_json).post
|
2575
|
+
::Io::Flow::V0::Models::Rma.new(r)
|
2576
|
+
end
|
2577
|
+
|
2578
|
+
def get_by_id(organization, id)
|
2579
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
2580
|
+
HttpClient::Preconditions.assert_class('id', id, String)
|
2581
|
+
r = @client.request("/#{CGI.escape(organization)}/rmas/#{CGI.escape(id)}").get
|
2582
|
+
::Io::Flow::V0::Models::Rma.new(r)
|
2583
|
+
end
|
2584
|
+
|
2585
|
+
def get_versions(organization, incoming={})
|
2586
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
2587
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
2588
|
+
query = {
|
2589
|
+
:id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
|
2590
|
+
:number => (x = opts.delete(:number); x.nil? ? nil : HttpClient::Preconditions.assert_class('number', x, Array).map { |v| HttpClient::Preconditions.assert_class('number', v, String) }),
|
2591
|
+
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
2592
|
+
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
2593
|
+
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
|
2594
|
+
}.delete_if { |k, v| v.nil? }
|
2595
|
+
r = @client.request("/#{CGI.escape(organization)}/rmas/versions").with_query(query).get
|
2596
|
+
r.map { |x| ::Io::Flow::V0::Models::RmaVersion.new(x) }
|
2597
|
+
end
|
2598
|
+
|
2599
|
+
end
|
2600
|
+
|
2510
2601
|
class Services
|
2511
2602
|
|
2512
2603
|
def initialize(client)
|
@@ -4130,10 +4221,10 @@ module Io
|
|
4130
4221
|
EXPERIENCE_UPSERTED = 'experience_upserted' unless defined?(EXPERIENCE_UPSERTED)
|
4131
4222
|
ITEM_MARGIN_DELETED = 'item_margin_deleted' unless defined?(ITEM_MARGIN_DELETED)
|
4132
4223
|
ITEM_MARGIN_UPSERTED = 'item_margin_upserted' unless defined?(ITEM_MARGIN_UPSERTED)
|
4224
|
+
LABEL_FORMAT_DELETED = 'label_format_deleted' unless defined?(LABEL_FORMAT_DELETED)
|
4225
|
+
LABEL_FORMAT_UPSERTED = 'label_format_upserted' unless defined?(LABEL_FORMAT_UPSERTED)
|
4133
4226
|
ORDER_DELETED = 'order_deleted' unless defined?(ORDER_DELETED)
|
4134
4227
|
ORDER_UPSERTED = 'order_upserted' unless defined?(ORDER_UPSERTED)
|
4135
|
-
ORDER_BOOKING_DELETED = 'order_booking_deleted' unless defined?(ORDER_BOOKING_DELETED)
|
4136
|
-
ORDER_BOOKING_UPSERTED = 'order_booking_upserted' unless defined?(ORDER_BOOKING_UPSERTED)
|
4137
4228
|
HS6_CODE_UPSERTED = 'hs6_code_upserted' unless defined?(HS6_CODE_UPSERTED)
|
4138
4229
|
HS6_CODE_DELETED = 'hs6_code_deleted' unless defined?(HS6_CODE_DELETED)
|
4139
4230
|
HS10_CODE_UPSERTED = 'hs10_code_upserted' unless defined?(HS10_CODE_UPSERTED)
|
@@ -4145,6 +4236,8 @@ module Io
|
|
4145
4236
|
LABEL_UPSERTED = 'label_upserted' unless defined?(LABEL_UPSERTED)
|
4146
4237
|
NOTIFICATION_UPSERTED = 'notification_upserted' unless defined?(NOTIFICATION_UPSERTED)
|
4147
4238
|
NOTIFICATION_DELETED = 'notification_deleted' unless defined?(NOTIFICATION_DELETED)
|
4239
|
+
RMA_UPSERTED = 'rma_upserted' unless defined?(RMA_UPSERTED)
|
4240
|
+
RMA_DELETED = 'rma_deleted' unless defined?(RMA_DELETED)
|
4148
4241
|
LOCALIZED_ITEM_UPSERTED = 'localized_item_upserted' unless defined?(LOCALIZED_ITEM_UPSERTED)
|
4149
4242
|
LOCALIZED_ITEM_DELETED = 'localized_item_deleted' unless defined?(LOCALIZED_ITEM_DELETED)
|
4150
4243
|
LOCALIZED_ITEM_SNAPSHOT = 'localized_item_snapshot' unless defined?(LOCALIZED_ITEM_SNAPSHOT)
|
@@ -4170,7 +4263,7 @@ module Io
|
|
4170
4263
|
end
|
4171
4264
|
|
4172
4265
|
def subtype_to_hash
|
4173
|
-
raise 'Cannot serialize an instance of event directly - must use one of the specific types: catalog_upserted, catalog_deleted, subcatalog_upserted, subcatalog_deleted, catalog_item_upserted, catalog_item_deleted, subcatalog_item_upserted, subcatalog_item_deleted, flow_currency_setting_deleted, flow_currency_setting_upserted, rate_deleted, rate_upserted, spot_rate_deleted, spot_rate_upserted, organization_currency_setting_deleted, organization_currency_setting_upserted, contracted_rate_upserted, experience_deleted, experience_upserted, item_margin_deleted, item_margin_upserted,
|
4266
|
+
raise 'Cannot serialize an instance of event directly - must use one of the specific types: catalog_upserted, catalog_deleted, subcatalog_upserted, subcatalog_deleted, catalog_item_upserted, catalog_item_deleted, subcatalog_item_upserted, subcatalog_item_deleted, flow_currency_setting_deleted, flow_currency_setting_upserted, rate_deleted, rate_upserted, spot_rate_deleted, spot_rate_upserted, organization_currency_setting_deleted, organization_currency_setting_upserted, contracted_rate_upserted, experience_deleted, experience_upserted, item_margin_deleted, item_margin_upserted, label_format_deleted, label_format_upserted, order_deleted, order_upserted, hs6_code_upserted, hs6_code_deleted, hs10_code_upserted, hs10_code_deleted, item_origin_upserted, item_origin_deleted, harmonized_item_upserted, harmonized_item_deleted, label_upserted, notification_upserted, notification_deleted, rma_upserted, rma_deleted, localized_item_upserted, localized_item_deleted, localized_item_snapshot, organization_upserted, organization_deleted, authorization_upserted, authorization_deleted, capture_upserted, card_upserted, card_deleted, refund_upserted, targeting_item_upserted, targeting_item_deleted, tracking_label_event_upserted'
|
4174
4267
|
end
|
4175
4268
|
|
4176
4269
|
def to_hash
|
@@ -4205,10 +4298,10 @@ module Io
|
|
4205
4298
|
when Types::EXPERIENCE_UPSERTED; ExperienceUpserted.new(hash)
|
4206
4299
|
when Types::ITEM_MARGIN_DELETED; ItemMarginDeleted.new(hash)
|
4207
4300
|
when Types::ITEM_MARGIN_UPSERTED; ItemMarginUpserted.new(hash)
|
4301
|
+
when Types::LABEL_FORMAT_DELETED; LabelFormatDeleted.new(hash)
|
4302
|
+
when Types::LABEL_FORMAT_UPSERTED; LabelFormatUpserted.new(hash)
|
4208
4303
|
when Types::ORDER_DELETED; OrderDeleted.new(hash)
|
4209
4304
|
when Types::ORDER_UPSERTED; OrderUpserted.new(hash)
|
4210
|
-
when Types::ORDER_BOOKING_DELETED; OrderBookingDeleted.new(hash)
|
4211
|
-
when Types::ORDER_BOOKING_UPSERTED; OrderBookingUpserted.new(hash)
|
4212
4305
|
when Types::HS6_CODE_UPSERTED; Hs6CodeUpserted.new(hash)
|
4213
4306
|
when Types::HS6_CODE_DELETED; Hs6CodeDeleted.new(hash)
|
4214
4307
|
when Types::HS10_CODE_UPSERTED; Hs10CodeUpserted.new(hash)
|
@@ -4220,6 +4313,8 @@ module Io
|
|
4220
4313
|
when Types::LABEL_UPSERTED; LabelUpserted.new(hash)
|
4221
4314
|
when Types::NOTIFICATION_UPSERTED; NotificationUpserted.new(hash)
|
4222
4315
|
when Types::NOTIFICATION_DELETED; NotificationDeleted.new(hash)
|
4316
|
+
when Types::RMA_UPSERTED; RmaUpserted.new(hash)
|
4317
|
+
when Types::RMA_DELETED; RmaDeleted.new(hash)
|
4223
4318
|
when Types::LOCALIZED_ITEM_UPSERTED; LocalizedItemUpserted.new(hash)
|
4224
4319
|
when Types::LOCALIZED_ITEM_DELETED; LocalizedItemDeleted.new(hash)
|
4225
4320
|
when Types::LOCALIZED_ITEM_SNAPSHOT; LocalizedItemSnapshot.new(hash)
|
@@ -5845,7 +5940,7 @@ module Io
|
|
5845
5940
|
end
|
5846
5941
|
|
5847
5942
|
def EventType.ALL
|
5848
|
-
@@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.contracted_rate_upserted, EventType.experience_deleted, EventType.experience_upserted, EventType.item_margin_deleted, EventType.item_margin_upserted, EventType.
|
5943
|
+
@@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.contracted_rate_upserted, EventType.experience_deleted, EventType.experience_upserted, EventType.item_margin_deleted, EventType.item_margin_upserted, EventType.label_format_deleted, EventType.label_format_upserted, EventType.order_deleted, EventType.order_upserted, EventType.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.label_upserted, EventType.notification_upserted, EventType.notification_deleted, EventType.rma_upserted, EventType.rma_deleted, EventType.localized_item_upserted, EventType.localized_item_deleted, EventType.localized_item_snapshot, EventType.organization_upserted, EventType.organization_deleted, EventType.authorization_upserted, EventType.authorization_deleted, EventType.capture_upserted, EventType.card_upserted, EventType.card_deleted, EventType.refund_upserted, EventType.targeting_item_upserted, EventType.targeting_item_deleted, EventType.tracking_label_event_upserted]
|
5849
5944
|
end
|
5850
5945
|
|
5851
5946
|
def EventType.catalog_upserted
|
@@ -5932,20 +6027,20 @@ module Io
|
|
5932
6027
|
@@_item_margin_upserted ||= EventType.new('item_margin_upserted')
|
5933
6028
|
end
|
5934
6029
|
|
5935
|
-
def EventType.
|
5936
|
-
@@
|
6030
|
+
def EventType.label_format_deleted
|
6031
|
+
@@_label_format_deleted ||= EventType.new('label_format_deleted')
|
5937
6032
|
end
|
5938
6033
|
|
5939
|
-
def EventType.
|
5940
|
-
@@
|
6034
|
+
def EventType.label_format_upserted
|
6035
|
+
@@_label_format_upserted ||= EventType.new('label_format_upserted')
|
5941
6036
|
end
|
5942
6037
|
|
5943
|
-
def EventType.
|
5944
|
-
@@
|
6038
|
+
def EventType.order_deleted
|
6039
|
+
@@_order_deleted ||= EventType.new('order_deleted')
|
5945
6040
|
end
|
5946
6041
|
|
5947
|
-
def EventType.
|
5948
|
-
@@
|
6042
|
+
def EventType.order_upserted
|
6043
|
+
@@_order_upserted ||= EventType.new('order_upserted')
|
5949
6044
|
end
|
5950
6045
|
|
5951
6046
|
def EventType.hs6_code_upserted
|
@@ -5992,6 +6087,14 @@ module Io
|
|
5992
6087
|
@@_notification_deleted ||= EventType.new('notification_deleted')
|
5993
6088
|
end
|
5994
6089
|
|
6090
|
+
def EventType.rma_upserted
|
6091
|
+
@@_rma_upserted ||= EventType.new('rma_upserted')
|
6092
|
+
end
|
6093
|
+
|
6094
|
+
def EventType.rma_deleted
|
6095
|
+
@@_rma_deleted ||= EventType.new('rma_deleted')
|
6096
|
+
end
|
6097
|
+
|
5995
6098
|
def EventType.localized_item_upserted
|
5996
6099
|
@@_localized_item_upserted ||= EventType.new('localized_item_upserted')
|
5997
6100
|
end
|
@@ -8875,16 +8978,16 @@ module Io
|
|
8875
8978
|
|
8876
8979
|
class CardDeleted < Event
|
8877
8980
|
|
8878
|
-
attr_reader :event_id, :timestamp, :organization, :
|
8981
|
+
attr_reader :event_id, :timestamp, :organization, :id
|
8879
8982
|
|
8880
8983
|
def initialize(incoming={})
|
8881
8984
|
super(:discriminator => Event::Types::CARD_DELETED)
|
8882
8985
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
8883
|
-
HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :
|
8986
|
+
HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :id], 'CardDeleted')
|
8884
8987
|
@event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
|
8885
8988
|
@timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
|
8886
8989
|
@organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
|
8887
|
-
@
|
8990
|
+
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
8888
8991
|
end
|
8889
8992
|
|
8890
8993
|
def to_json
|
@@ -8900,7 +9003,7 @@ module Io
|
|
8900
9003
|
:event_id => event_id,
|
8901
9004
|
:timestamp => timestamp,
|
8902
9005
|
:organization => organization,
|
8903
|
-
:
|
9006
|
+
:id => id
|
8904
9007
|
}
|
8905
9008
|
end
|
8906
9009
|
|
@@ -9041,16 +9144,16 @@ module Io
|
|
9041
9144
|
|
9042
9145
|
class CardUpserted < Event
|
9043
9146
|
|
9044
|
-
attr_reader :event_id, :timestamp, :organization, :
|
9147
|
+
attr_reader :event_id, :timestamp, :organization, :id, :type, :expiration, :iin, :last4, :name, :address
|
9045
9148
|
|
9046
9149
|
def initialize(incoming={})
|
9047
9150
|
super(:discriminator => Event::Types::CARD_UPSERTED)
|
9048
9151
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
9049
|
-
HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :
|
9152
|
+
HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :id, :type, :expiration, :iin, :last4, :name], 'CardUpserted')
|
9050
9153
|
@event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
|
9051
9154
|
@timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
|
9052
9155
|
@organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
|
9053
|
-
@
|
9156
|
+
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
9054
9157
|
@type = HttpClient::Preconditions.assert_class('type', opts.delete(:type), String)
|
9055
9158
|
@expiration = HttpClient::Preconditions.assert_class('expiration', HttpClient::Helper.to_object(opts.delete(:expiration)), Hash)
|
9056
9159
|
@iin = HttpClient::Preconditions.assert_class('iin', opts.delete(:iin), String)
|
@@ -9072,7 +9175,7 @@ module Io
|
|
9072
9175
|
:event_id => event_id,
|
9073
9176
|
:timestamp => timestamp,
|
9074
9177
|
:organization => organization,
|
9075
|
-
:
|
9178
|
+
:id => id,
|
9076
9179
|
:type => type,
|
9077
9180
|
:expiration => expiration,
|
9078
9181
|
:iin => iin,
|
@@ -13688,6 +13791,74 @@ module Io
|
|
13688
13791
|
|
13689
13792
|
end
|
13690
13793
|
|
13794
|
+
class LabelFormatDeleted < Event
|
13795
|
+
|
13796
|
+
attr_reader :event_id, :timestamp, :organization, :experience_key
|
13797
|
+
|
13798
|
+
def initialize(incoming={})
|
13799
|
+
super(:discriminator => Event::Types::LABEL_FORMAT_DELETED)
|
13800
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
13801
|
+
HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :experience_key], 'LabelFormatDeleted')
|
13802
|
+
@event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
|
13803
|
+
@timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
|
13804
|
+
@organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
|
13805
|
+
@experience_key = HttpClient::Preconditions.assert_class('experience_key', opts.delete(:experience_key), String)
|
13806
|
+
end
|
13807
|
+
|
13808
|
+
def to_json
|
13809
|
+
JSON.dump(to_hash)
|
13810
|
+
end
|
13811
|
+
|
13812
|
+
def copy(incoming={})
|
13813
|
+
LabelFormatDeleted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
13814
|
+
end
|
13815
|
+
|
13816
|
+
def subtype_to_hash
|
13817
|
+
{
|
13818
|
+
:event_id => event_id,
|
13819
|
+
:timestamp => timestamp,
|
13820
|
+
:organization => organization,
|
13821
|
+
:experience_key => experience_key
|
13822
|
+
}
|
13823
|
+
end
|
13824
|
+
|
13825
|
+
end
|
13826
|
+
|
13827
|
+
class LabelFormatUpserted < Event
|
13828
|
+
|
13829
|
+
attr_reader :event_id, :timestamp, :organization, :experience_key, :format
|
13830
|
+
|
13831
|
+
def initialize(incoming={})
|
13832
|
+
super(:discriminator => Event::Types::LABEL_FORMAT_UPSERTED)
|
13833
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
13834
|
+
HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :experience_key, :format], 'LabelFormatUpserted')
|
13835
|
+
@event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
|
13836
|
+
@timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
|
13837
|
+
@organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
|
13838
|
+
@experience_key = HttpClient::Preconditions.assert_class('experience_key', opts.delete(:experience_key), String)
|
13839
|
+
@format = HttpClient::Preconditions.assert_class('format', opts.delete(:format), String)
|
13840
|
+
end
|
13841
|
+
|
13842
|
+
def to_json
|
13843
|
+
JSON.dump(to_hash)
|
13844
|
+
end
|
13845
|
+
|
13846
|
+
def copy(incoming={})
|
13847
|
+
LabelFormatUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
13848
|
+
end
|
13849
|
+
|
13850
|
+
def subtype_to_hash
|
13851
|
+
{
|
13852
|
+
:event_id => event_id,
|
13853
|
+
:timestamp => timestamp,
|
13854
|
+
:organization => organization,
|
13855
|
+
:experience_key => experience_key,
|
13856
|
+
:format => format
|
13857
|
+
}
|
13858
|
+
end
|
13859
|
+
|
13860
|
+
end
|
13861
|
+
|
13691
13862
|
class LabelOrderSummary
|
13692
13863
|
|
13693
13864
|
attr_reader :id, :number
|
@@ -13718,24 +13889,24 @@ module Io
|
|
13718
13889
|
|
13719
13890
|
class LabelUpserted < Event
|
13720
13891
|
|
13721
|
-
attr_reader :event_id, :timestamp, :organization, :label_id, :carrier_tracking_number, :
|
13892
|
+
attr_reader :event_id, :timestamp, :organization, :label_id, :carrier_tracking_number, :commercial_invoice, :flow_tracking_number, :destination, :origin, :carrier, :service, :zpl, :pdf, :png, :order
|
13722
13893
|
|
13723
13894
|
def initialize(incoming={})
|
13724
13895
|
super(:discriminator => Event::Types::LABEL_UPSERTED)
|
13725
13896
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
13726
|
-
HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :label_id, :carrier_tracking_number, :
|
13897
|
+
HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :label_id, :carrier_tracking_number, :commercial_invoice, :flow_tracking_number, :destination, :origin, :carrier, :service], 'LabelUpserted')
|
13727
13898
|
@event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
|
13728
13899
|
@timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
|
13729
13900
|
@organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
|
13730
13901
|
@label_id = HttpClient::Preconditions.assert_class('label_id', opts.delete(:label_id), String)
|
13731
13902
|
@carrier_tracking_number = HttpClient::Preconditions.assert_class('carrier_tracking_number', opts.delete(:carrier_tracking_number), String)
|
13903
|
+
@commercial_invoice = HttpClient::Preconditions.assert_class('commercial_invoice', opts.delete(:commercial_invoice), String)
|
13732
13904
|
@flow_tracking_number = HttpClient::Preconditions.assert_class('flow_tracking_number', opts.delete(:flow_tracking_number), String)
|
13733
|
-
@data = HttpClient::Preconditions.assert_class('data', opts.delete(:data), String)
|
13734
13905
|
@destination = HttpClient::Preconditions.assert_class('destination', HttpClient::Helper.to_object(opts.delete(:destination)), Hash)
|
13735
13906
|
@origin = HttpClient::Preconditions.assert_class('origin', HttpClient::Helper.to_object(opts.delete(:origin)), Hash)
|
13736
13907
|
@carrier = HttpClient::Preconditions.assert_class('carrier', opts.delete(:carrier), String)
|
13737
13908
|
@service = HttpClient::Preconditions.assert_class('service', opts.delete(:service), String)
|
13738
|
-
@
|
13909
|
+
@zpl = (x = opts.delete(:zpl); x.nil? ? nil : HttpClient::Preconditions.assert_class('zpl', x, String))
|
13739
13910
|
@pdf = (x = opts.delete(:pdf); x.nil? ? nil : HttpClient::Preconditions.assert_class('pdf', x, String))
|
13740
13911
|
@png = (x = opts.delete(:png); x.nil? ? nil : HttpClient::Preconditions.assert_class('png', x, String))
|
13741
13912
|
@order = (x = opts.delete(:order); x.nil? ? nil : HttpClient::Preconditions.assert_class('order', x, String))
|
@@ -13756,13 +13927,13 @@ module Io
|
|
13756
13927
|
:organization => organization,
|
13757
13928
|
:label_id => label_id,
|
13758
13929
|
:carrier_tracking_number => carrier_tracking_number,
|
13930
|
+
:commercial_invoice => commercial_invoice,
|
13759
13931
|
:flow_tracking_number => flow_tracking_number,
|
13760
|
-
:data => data,
|
13761
13932
|
:destination => destination,
|
13762
13933
|
:origin => origin,
|
13763
13934
|
:carrier => carrier,
|
13764
13935
|
:service => service,
|
13765
|
-
:
|
13936
|
+
:zpl => zpl,
|
13766
13937
|
:pdf => pdf,
|
13767
13938
|
:png => png,
|
13768
13939
|
:order => order
|
@@ -14751,12 +14922,14 @@ module Io
|
|
14751
14922
|
|
14752
14923
|
# An order represents all of the information about a particular line item,
|
14753
14924
|
# including pricing, currency rates, delivery options, etc. All information in
|
14754
|
-
# an order is guaranteed by Flow - if an order is
|
14755
|
-
# The intended use case is to create an order as a consumer enters
|
14756
|
-
# then to
|
14925
|
+
# an order is guaranteed by Flow - if an order is submitted before its
|
14926
|
+
# expiration. The intended use case is to create an order as a consumer enters
|
14927
|
+
# checkout, then to submit that order as part of the user submitting their
|
14928
|
+
# order. Note that Flow will automatically mark an order submitted if we see a
|
14929
|
+
# payment authorization for an order.
|
14757
14930
|
class Order
|
14758
14931
|
|
14759
|
-
attr_reader :id, :number, :customer, :expires_at, :items, :destination, :deliveries, :selections, :prices, :total, :attributes, :lines
|
14932
|
+
attr_reader :id, :number, :customer, :expires_at, :items, :destination, :deliveries, :selections, :prices, :total, :attributes, :submitted_at, :lines
|
14760
14933
|
|
14761
14934
|
def initialize(incoming={})
|
14762
14935
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
@@ -14772,6 +14945,7 @@ module Io
|
|
14772
14945
|
@prices = HttpClient::Preconditions.assert_class('prices', opts.delete(:prices), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::OrderPriceDetail) ? x : ::Io::Flow::V0::Models::OrderPriceDetail.new(x)) }
|
14773
14946
|
@total = (x = opts.delete(:total); x.is_a?(::Io::Flow::V0::Models::LocalizedTotal) ? x : ::Io::Flow::V0::Models::LocalizedTotal.new(x))
|
14774
14947
|
@attributes = HttpClient::Preconditions.assert_class('attributes', opts.delete(:attributes), Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h }
|
14948
|
+
@submitted_at = (x = opts.delete(:submitted_at); x.nil? ? nil : HttpClient::Preconditions.assert_class('submitted_at', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
|
14775
14949
|
@lines = (x = opts.delete(:lines); x.nil? ? nil : HttpClient::Preconditions.assert_class('lines', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::Line) ? x : ::Io::Flow::V0::Models::Line.new(x)) })
|
14776
14950
|
end
|
14777
14951
|
|
@@ -14796,6 +14970,7 @@ module Io
|
|
14796
14970
|
:prices => prices.map { |o| o.to_hash },
|
14797
14971
|
:total => total.to_hash,
|
14798
14972
|
:attributes => attributes,
|
14973
|
+
:submitted_at => submitted_at,
|
14799
14974
|
:lines => lines.nil? ? nil : lines.map { |o| o.to_hash }
|
14800
14975
|
}
|
14801
14976
|
end
|
@@ -14843,104 +15018,6 @@ module Io
|
|
14843
15018
|
|
14844
15019
|
end
|
14845
15020
|
|
14846
|
-
# Represents an order that has been booked. Booked orders can no longer be
|
14847
|
-
# deleted as they represent transactions in the real world.
|
14848
|
-
class OrderBooking
|
14849
|
-
|
14850
|
-
attr_reader :id, :order, :created_at
|
14851
|
-
|
14852
|
-
def initialize(incoming={})
|
14853
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
14854
|
-
HttpClient::Preconditions.require_keys(opts, [:id, :order, :created_at], 'OrderBooking')
|
14855
|
-
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
14856
|
-
@order = (x = opts.delete(:order); x.is_a?(::Io::Flow::V0::Models::OrderReference) ? x : ::Io::Flow::V0::Models::OrderReference.new(x))
|
14857
|
-
@created_at = HttpClient::Preconditions.assert_class('created_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:created_at)), DateTime)
|
14858
|
-
end
|
14859
|
-
|
14860
|
-
def to_json
|
14861
|
-
JSON.dump(to_hash)
|
14862
|
-
end
|
14863
|
-
|
14864
|
-
def copy(incoming={})
|
14865
|
-
OrderBooking.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
14866
|
-
end
|
14867
|
-
|
14868
|
-
def to_hash
|
14869
|
-
{
|
14870
|
-
:id => id,
|
14871
|
-
:order => order.to_hash,
|
14872
|
-
:created_at => created_at
|
14873
|
-
}
|
14874
|
-
end
|
14875
|
-
|
14876
|
-
end
|
14877
|
-
|
14878
|
-
class OrderBookingDeleted < Event
|
14879
|
-
|
14880
|
-
attr_reader :event_id, :timestamp, :organization, :order_number
|
14881
|
-
|
14882
|
-
def initialize(incoming={})
|
14883
|
-
super(:discriminator => Event::Types::ORDER_BOOKING_DELETED)
|
14884
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
14885
|
-
HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :order_number], 'OrderBookingDeleted')
|
14886
|
-
@event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
|
14887
|
-
@timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
|
14888
|
-
@organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
|
14889
|
-
@order_number = HttpClient::Preconditions.assert_class('order_number', opts.delete(:order_number), String)
|
14890
|
-
end
|
14891
|
-
|
14892
|
-
def to_json
|
14893
|
-
JSON.dump(to_hash)
|
14894
|
-
end
|
14895
|
-
|
14896
|
-
def copy(incoming={})
|
14897
|
-
OrderBookingDeleted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
14898
|
-
end
|
14899
|
-
|
14900
|
-
def subtype_to_hash
|
14901
|
-
{
|
14902
|
-
:event_id => event_id,
|
14903
|
-
:timestamp => timestamp,
|
14904
|
-
:organization => organization,
|
14905
|
-
:order_number => order_number
|
14906
|
-
}
|
14907
|
-
end
|
14908
|
-
|
14909
|
-
end
|
14910
|
-
|
14911
|
-
class OrderBookingUpserted < Event
|
14912
|
-
|
14913
|
-
attr_reader :event_id, :timestamp, :organization, :order_number
|
14914
|
-
|
14915
|
-
def initialize(incoming={})
|
14916
|
-
super(:discriminator => Event::Types::ORDER_BOOKING_UPSERTED)
|
14917
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
14918
|
-
HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :order_number], 'OrderBookingUpserted')
|
14919
|
-
@event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
|
14920
|
-
@timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
|
14921
|
-
@organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
|
14922
|
-
@order_number = HttpClient::Preconditions.assert_class('order_number', opts.delete(:order_number), String)
|
14923
|
-
end
|
14924
|
-
|
14925
|
-
def to_json
|
14926
|
-
JSON.dump(to_hash)
|
14927
|
-
end
|
14928
|
-
|
14929
|
-
def copy(incoming={})
|
14930
|
-
OrderBookingUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
14931
|
-
end
|
14932
|
-
|
14933
|
-
def subtype_to_hash
|
14934
|
-
{
|
14935
|
-
:event_id => event_id,
|
14936
|
-
:timestamp => timestamp,
|
14937
|
-
:organization => organization,
|
14938
|
-
:order_number => order_number
|
14939
|
-
}
|
14940
|
-
end
|
14941
|
-
|
14942
|
-
end
|
14943
|
-
|
14944
15021
|
class OrderDeleted < Event
|
14945
15022
|
|
14946
15023
|
attr_reader :event_id, :timestamp, :organization, :number
|
@@ -15253,7 +15330,7 @@ module Io
|
|
15253
15330
|
|
15254
15331
|
class OrderUpserted < Event
|
15255
15332
|
|
15256
|
-
attr_reader :event_id, :timestamp, :organization, :number, :environment, :experience_id, :expires_at, :customer, :selections, :items, :destination, :deliveries, :prices, :discount, :total
|
15333
|
+
attr_reader :event_id, :timestamp, :organization, :number, :environment, :experience_id, :expires_at, :customer, :selections, :items, :destination, :deliveries, :prices, :discount, :total, :created_at, :updated_at, :submitted_at, :lines
|
15257
15334
|
|
15258
15335
|
def initialize(incoming={})
|
15259
15336
|
super(:discriminator => Event::Types::ORDER_UPSERTED)
|
@@ -15274,6 +15351,10 @@ module Io
|
|
15274
15351
|
@prices = HttpClient::Preconditions.assert_class('prices', opts.delete(:prices), Array).map { |v| HttpClient::Preconditions.assert_class('prices', HttpClient::Helper.to_object(v), Hash) }
|
15275
15352
|
@discount = (x = opts.delete(:discount); x.nil? ? nil : HttpClient::Preconditions.assert_class('discount', HttpClient::Helper.to_object(x), Hash))
|
15276
15353
|
@total = HttpClient::Preconditions.assert_class('total', HttpClient::Helper.to_object(opts.delete(:total)), Hash)
|
15354
|
+
@created_at = (x = opts.delete(:created_at); x.nil? ? nil : HttpClient::Preconditions.assert_class('created_at', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
|
15355
|
+
@updated_at = (x = opts.delete(:updated_at); x.nil? ? nil : HttpClient::Preconditions.assert_class('updated_at', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
|
15356
|
+
@submitted_at = (x = opts.delete(:submitted_at); x.nil? ? nil : HttpClient::Preconditions.assert_class('submitted_at', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
|
15357
|
+
@lines = (x = opts.delete(:lines); x.nil? ? nil : HttpClient::Preconditions.assert_class('lines', x, Array).map { |v| HttpClient::Preconditions.assert_class('lines', HttpClient::Helper.to_object(v), Hash) })
|
15277
15358
|
end
|
15278
15359
|
|
15279
15360
|
def to_json
|
@@ -15300,7 +15381,11 @@ module Io
|
|
15300
15381
|
:deliveries => deliveries,
|
15301
15382
|
:prices => prices,
|
15302
15383
|
:discount => discount,
|
15303
|
-
:total => total
|
15384
|
+
:total => total,
|
15385
|
+
:created_at => created_at,
|
15386
|
+
:updated_at => updated_at,
|
15387
|
+
:submitted_at => submitted_at,
|
15388
|
+
:lines => lines.nil? ? nil : lines
|
15304
15389
|
}
|
15305
15390
|
end
|
15306
15391
|
|
@@ -17295,6 +17380,218 @@ module Io
|
|
17295
17380
|
|
17296
17381
|
end
|
17297
17382
|
|
17383
|
+
class Rma
|
17384
|
+
|
17385
|
+
attr_reader :id, :attributes, :carrier_tracking_number, :commercial_invoice, :destination, :flow_tracking_number, :number, :order_number, :origin, :service, :zpl, :pdf, :png
|
17386
|
+
|
17387
|
+
def initialize(incoming={})
|
17388
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
17389
|
+
HttpClient::Preconditions.require_keys(opts, [:id, :carrier_tracking_number, :commercial_invoice, :destination, :flow_tracking_number, :number, :order_number, :origin, :service], 'Rma')
|
17390
|
+
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
17391
|
+
@attributes = HttpClient::Preconditions.assert_class('attributes', (x = opts.delete(:attributes); x.nil? ? {} : x), Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h }
|
17392
|
+
@carrier_tracking_number = HttpClient::Preconditions.assert_class('carrier_tracking_number', opts.delete(:carrier_tracking_number), String)
|
17393
|
+
@commercial_invoice = HttpClient::Preconditions.assert_class('commercial_invoice', opts.delete(:commercial_invoice), String)
|
17394
|
+
@destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::ShippingAddress) ? x : ::Io::Flow::V0::Models::ShippingAddress.new(x))
|
17395
|
+
@flow_tracking_number = HttpClient::Preconditions.assert_class('flow_tracking_number', opts.delete(:flow_tracking_number), String)
|
17396
|
+
@number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
|
17397
|
+
@order_number = HttpClient::Preconditions.assert_class('order_number', opts.delete(:order_number), String)
|
17398
|
+
@origin = (x = opts.delete(:origin); x.is_a?(::Io::Flow::V0::Models::ShippingAddress) ? x : ::Io::Flow::V0::Models::ShippingAddress.new(x))
|
17399
|
+
@service = (x = opts.delete(:service); x.is_a?(::Io::Flow::V0::Models::ServiceSummary) ? x : ::Io::Flow::V0::Models::ServiceSummary.new(x))
|
17400
|
+
@zpl = (x = opts.delete(:zpl); x.nil? ? nil : HttpClient::Preconditions.assert_class('zpl', x, String))
|
17401
|
+
@pdf = (x = opts.delete(:pdf); x.nil? ? nil : HttpClient::Preconditions.assert_class('pdf', x, String))
|
17402
|
+
@png = (x = opts.delete(:png); x.nil? ? nil : HttpClient::Preconditions.assert_class('png', x, String))
|
17403
|
+
end
|
17404
|
+
|
17405
|
+
def to_json
|
17406
|
+
JSON.dump(to_hash)
|
17407
|
+
end
|
17408
|
+
|
17409
|
+
def copy(incoming={})
|
17410
|
+
Rma.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
17411
|
+
end
|
17412
|
+
|
17413
|
+
def to_hash
|
17414
|
+
{
|
17415
|
+
:id => id,
|
17416
|
+
:attributes => attributes,
|
17417
|
+
:carrier_tracking_number => carrier_tracking_number,
|
17418
|
+
:commercial_invoice => commercial_invoice,
|
17419
|
+
:destination => destination.to_hash,
|
17420
|
+
:flow_tracking_number => flow_tracking_number,
|
17421
|
+
:number => number,
|
17422
|
+
:order_number => order_number,
|
17423
|
+
:origin => origin.to_hash,
|
17424
|
+
:service => service.to_hash,
|
17425
|
+
:zpl => zpl,
|
17426
|
+
:pdf => pdf,
|
17427
|
+
:png => png
|
17428
|
+
}
|
17429
|
+
end
|
17430
|
+
|
17431
|
+
end
|
17432
|
+
|
17433
|
+
class RmaDeleted < Event
|
17434
|
+
|
17435
|
+
attr_reader :event_id, :timestamp, :organization, :number, :rma_id
|
17436
|
+
|
17437
|
+
def initialize(incoming={})
|
17438
|
+
super(:discriminator => Event::Types::RMA_DELETED)
|
17439
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
17440
|
+
HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :number, :rma_id], 'RmaDeleted')
|
17441
|
+
@event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
|
17442
|
+
@timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
|
17443
|
+
@organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
|
17444
|
+
@number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
|
17445
|
+
@rma_id = HttpClient::Preconditions.assert_class('rma_id', opts.delete(:rma_id), String)
|
17446
|
+
end
|
17447
|
+
|
17448
|
+
def to_json
|
17449
|
+
JSON.dump(to_hash)
|
17450
|
+
end
|
17451
|
+
|
17452
|
+
def copy(incoming={})
|
17453
|
+
RmaDeleted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
17454
|
+
end
|
17455
|
+
|
17456
|
+
def subtype_to_hash
|
17457
|
+
{
|
17458
|
+
:event_id => event_id,
|
17459
|
+
:timestamp => timestamp,
|
17460
|
+
:organization => organization,
|
17461
|
+
:number => number,
|
17462
|
+
:rma_id => rma_id
|
17463
|
+
}
|
17464
|
+
end
|
17465
|
+
|
17466
|
+
end
|
17467
|
+
|
17468
|
+
class RmaForm
|
17469
|
+
|
17470
|
+
attr_reader :destination, :number, :order_number, :origin, :package, :service, :attributes
|
17471
|
+
|
17472
|
+
def initialize(incoming={})
|
17473
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
17474
|
+
HttpClient::Preconditions.require_keys(opts, [:destination, :number, :order_number, :origin, :package, :service], 'RmaForm')
|
17475
|
+
@destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::ShippingAddress) ? x : ::Io::Flow::V0::Models::ShippingAddress.new(x))
|
17476
|
+
@number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
|
17477
|
+
@order_number = HttpClient::Preconditions.assert_class('order_number', opts.delete(:order_number), String)
|
17478
|
+
@origin = (x = opts.delete(:origin); x.is_a?(::Io::Flow::V0::Models::ShippingAddress) ? x : ::Io::Flow::V0::Models::ShippingAddress.new(x))
|
17479
|
+
@package = (x = opts.delete(:package); x.is_a?(::Io::Flow::V0::Models::ShippingLabelPackage) ? x : ::Io::Flow::V0::Models::ShippingLabelPackage.new(x))
|
17480
|
+
@service = HttpClient::Preconditions.assert_class('service', opts.delete(:service), String)
|
17481
|
+
@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 })
|
17482
|
+
end
|
17483
|
+
|
17484
|
+
def to_json
|
17485
|
+
JSON.dump(to_hash)
|
17486
|
+
end
|
17487
|
+
|
17488
|
+
def copy(incoming={})
|
17489
|
+
RmaForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
17490
|
+
end
|
17491
|
+
|
17492
|
+
def to_hash
|
17493
|
+
{
|
17494
|
+
:destination => destination.to_hash,
|
17495
|
+
:number => number,
|
17496
|
+
:order_number => order_number,
|
17497
|
+
:origin => origin.to_hash,
|
17498
|
+
:package => package.to_hash,
|
17499
|
+
:service => service,
|
17500
|
+
:attributes => attributes.nil? ? nil : attributes
|
17501
|
+
}
|
17502
|
+
end
|
17503
|
+
|
17504
|
+
end
|
17505
|
+
|
17506
|
+
class RmaUpserted < Event
|
17507
|
+
|
17508
|
+
attr_reader :event_id, :timestamp, :organization, :number, :rma_id, :carrier_tracking_number, :commercial_invoice, :flow_tracking_number, :destination, :origin, :order_number, :service, :zpl, :pdf, :png, :created_at
|
17509
|
+
|
17510
|
+
def initialize(incoming={})
|
17511
|
+
super(:discriminator => Event::Types::RMA_UPSERTED)
|
17512
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
17513
|
+
HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :number, :rma_id, :carrier_tracking_number, :commercial_invoice, :flow_tracking_number, :destination, :origin, :order_number, :service, :created_at], 'RmaUpserted')
|
17514
|
+
@event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
|
17515
|
+
@timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
|
17516
|
+
@organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
|
17517
|
+
@number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
|
17518
|
+
@rma_id = HttpClient::Preconditions.assert_class('rma_id', opts.delete(:rma_id), String)
|
17519
|
+
@carrier_tracking_number = HttpClient::Preconditions.assert_class('carrier_tracking_number', opts.delete(:carrier_tracking_number), String)
|
17520
|
+
@commercial_invoice = HttpClient::Preconditions.assert_class('commercial_invoice', opts.delete(:commercial_invoice), String)
|
17521
|
+
@flow_tracking_number = HttpClient::Preconditions.assert_class('flow_tracking_number', opts.delete(:flow_tracking_number), String)
|
17522
|
+
@destination = HttpClient::Preconditions.assert_class('destination', HttpClient::Helper.to_object(opts.delete(:destination)), Hash)
|
17523
|
+
@origin = HttpClient::Preconditions.assert_class('origin', HttpClient::Helper.to_object(opts.delete(:origin)), Hash)
|
17524
|
+
@order_number = HttpClient::Preconditions.assert_class('order_number', opts.delete(:order_number), String)
|
17525
|
+
@service = HttpClient::Preconditions.assert_class('service', opts.delete(:service), String)
|
17526
|
+
@zpl = (x = opts.delete(:zpl); x.nil? ? nil : HttpClient::Preconditions.assert_class('zpl', x, String))
|
17527
|
+
@pdf = (x = opts.delete(:pdf); x.nil? ? nil : HttpClient::Preconditions.assert_class('pdf', x, String))
|
17528
|
+
@png = (x = opts.delete(:png); x.nil? ? nil : HttpClient::Preconditions.assert_class('png', x, String))
|
17529
|
+
@created_at = HttpClient::Preconditions.assert_class('created_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:created_at)), DateTime)
|
17530
|
+
end
|
17531
|
+
|
17532
|
+
def to_json
|
17533
|
+
JSON.dump(to_hash)
|
17534
|
+
end
|
17535
|
+
|
17536
|
+
def copy(incoming={})
|
17537
|
+
RmaUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
17538
|
+
end
|
17539
|
+
|
17540
|
+
def subtype_to_hash
|
17541
|
+
{
|
17542
|
+
:event_id => event_id,
|
17543
|
+
:timestamp => timestamp,
|
17544
|
+
:organization => organization,
|
17545
|
+
:number => number,
|
17546
|
+
:rma_id => rma_id,
|
17547
|
+
:carrier_tracking_number => carrier_tracking_number,
|
17548
|
+
:commercial_invoice => commercial_invoice,
|
17549
|
+
:flow_tracking_number => flow_tracking_number,
|
17550
|
+
:destination => destination,
|
17551
|
+
:origin => origin,
|
17552
|
+
:order_number => order_number,
|
17553
|
+
:service => service,
|
17554
|
+
:zpl => zpl,
|
17555
|
+
:pdf => pdf,
|
17556
|
+
:png => png,
|
17557
|
+
:created_at => created_at
|
17558
|
+
}
|
17559
|
+
end
|
17560
|
+
|
17561
|
+
end
|
17562
|
+
|
17563
|
+
class RmaVersion
|
17564
|
+
|
17565
|
+
attr_reader :id, :timestamp, :type, :rma
|
17566
|
+
|
17567
|
+
def initialize(incoming={})
|
17568
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
17569
|
+
HttpClient::Preconditions.require_keys(opts, [:id, :timestamp, :type, :rma], 'RmaVersion')
|
17570
|
+
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
17571
|
+
@timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
|
17572
|
+
@type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::ChangeType) ? x : ::Io::Flow::V0::Models::ChangeType.apply(x))
|
17573
|
+
@rma = (x = opts.delete(:rma); x.is_a?(::Io::Flow::V0::Models::Rma) ? x : ::Io::Flow::V0::Models::Rma.new(x))
|
17574
|
+
end
|
17575
|
+
|
17576
|
+
def to_json
|
17577
|
+
JSON.dump(to_hash)
|
17578
|
+
end
|
17579
|
+
|
17580
|
+
def copy(incoming={})
|
17581
|
+
RmaVersion.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
17582
|
+
end
|
17583
|
+
|
17584
|
+
def to_hash
|
17585
|
+
{
|
17586
|
+
:id => id,
|
17587
|
+
:timestamp => timestamp,
|
17588
|
+
:type => type.value,
|
17589
|
+
:rma => rma.to_hash
|
17590
|
+
}
|
17591
|
+
end
|
17592
|
+
|
17593
|
+
end
|
17594
|
+
|
17298
17595
|
class Rounding
|
17299
17596
|
|
17300
17597
|
attr_reader :type, :method, :value
|
@@ -17482,22 +17779,22 @@ module Io
|
|
17482
17779
|
# shipper to transport a package from a given origin to destination
|
17483
17780
|
class ShippingLabel
|
17484
17781
|
|
17485
|
-
attr_reader :id, :attributes, :carrier_tracking_number, :
|
17782
|
+
attr_reader :id, :attributes, :carrier_tracking_number, :commercial_invoice, :cost, :destination, :flow_tracking_number, :origin, :service, :window, :zpl, :pdf, :png, :order
|
17486
17783
|
|
17487
17784
|
def initialize(incoming={})
|
17488
17785
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
17489
|
-
HttpClient::Preconditions.require_keys(opts, [:id, :carrier_tracking_number, :
|
17786
|
+
HttpClient::Preconditions.require_keys(opts, [:id, :carrier_tracking_number, :commercial_invoice, :cost, :destination, :flow_tracking_number, :origin, :service, :window], 'ShippingLabel')
|
17490
17787
|
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
17491
17788
|
@attributes = HttpClient::Preconditions.assert_class('attributes', (x = opts.delete(:attributes); x.nil? ? {} : x), Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h }
|
17492
17789
|
@carrier_tracking_number = HttpClient::Preconditions.assert_class('carrier_tracking_number', opts.delete(:carrier_tracking_number), String)
|
17790
|
+
@commercial_invoice = HttpClient::Preconditions.assert_class('commercial_invoice', opts.delete(:commercial_invoice), String)
|
17493
17791
|
@cost = (x = opts.delete(:cost); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x))
|
17494
|
-
@zpl = HttpClient::Preconditions.assert_class('zpl', opts.delete(:zpl), String)
|
17495
17792
|
@destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::ShippingAddress) ? x : ::Io::Flow::V0::Models::ShippingAddress.new(x))
|
17496
17793
|
@flow_tracking_number = HttpClient::Preconditions.assert_class('flow_tracking_number', opts.delete(:flow_tracking_number), String)
|
17497
17794
|
@origin = (x = opts.delete(:origin); x.is_a?(::Io::Flow::V0::Models::ShippingAddress) ? x : ::Io::Flow::V0::Models::ShippingAddress.new(x))
|
17498
17795
|
@service = (x = opts.delete(:service); x.is_a?(::Io::Flow::V0::Models::ServiceSummary) ? x : ::Io::Flow::V0::Models::ServiceSummary.new(x))
|
17499
17796
|
@window = (x = opts.delete(:window); x.is_a?(::Io::Flow::V0::Models::DatetimeRange) ? x : ::Io::Flow::V0::Models::DatetimeRange.new(x))
|
17500
|
-
@
|
17797
|
+
@zpl = (x = opts.delete(:zpl); x.nil? ? nil : HttpClient::Preconditions.assert_class('zpl', x, String))
|
17501
17798
|
@pdf = (x = opts.delete(:pdf); x.nil? ? nil : HttpClient::Preconditions.assert_class('pdf', x, String))
|
17502
17799
|
@png = (x = opts.delete(:png); x.nil? ? nil : HttpClient::Preconditions.assert_class('png', x, String))
|
17503
17800
|
@order = (x = opts.delete(:order); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::LabelOrderSummary) ? x : ::Io::Flow::V0::Models::LabelOrderSummary.new(x)))
|
@@ -17516,14 +17813,14 @@ module Io
|
|
17516
17813
|
:id => id,
|
17517
17814
|
:attributes => attributes,
|
17518
17815
|
:carrier_tracking_number => carrier_tracking_number,
|
17816
|
+
:commercial_invoice => commercial_invoice,
|
17519
17817
|
:cost => cost.to_hash,
|
17520
|
-
:zpl => zpl,
|
17521
17818
|
:destination => destination.to_hash,
|
17522
17819
|
:flow_tracking_number => flow_tracking_number,
|
17523
17820
|
:origin => origin.to_hash,
|
17524
17821
|
:service => service.to_hash,
|
17525
17822
|
:window => window.to_hash,
|
17526
|
-
:
|
17823
|
+
:zpl => zpl,
|
17527
17824
|
:pdf => pdf,
|
17528
17825
|
:png => png,
|
17529
17826
|
:order => order.nil? ? nil : order.to_hash
|
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.1.
|
4
|
+
version: 0.1.11
|
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-11-
|
11
|
+
date: 2016-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|