flowcommerce 0.0.54 → 0.0.55
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 +749 -53
- 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: 5d167ff1b4c20e941d36705eaed756ca3de6ab5d
|
4
|
+
data.tar.gz: ef38cea89253b7e7869708ed8bb34d8532744d4c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4540144065a686e19b92b415e4a115b5527ddc26e466e23e8edb9f23122f5a7addb4d8b18fc71717c28a6d666ff54d1cb4e7bf0aa60f17c0773bfc080190f05e
|
7
|
+
data.tar.gz: 5959bc452527192108ed970ab272715a12cc4c6cd7069944fb7e35a603172bae20685254a543fbb375eb1ae6e6e56b505e9ca596636a46adf16968cc8ee1d51a
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Generated by apidoc - http://www.apidoc.me
|
2
|
-
# Service version: 0.1.
|
3
|
-
# apidoc:0.11.37 http://www.apidoc.me/flow/api/0.1.
|
2
|
+
# Service version: 0.1.51
|
3
|
+
# apidoc:0.11.37 http://www.apidoc.me/flow/api/0.1.52/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.37 http://www.apidoc.me/flow/api/0.1.
|
29
|
-
VERSION = '0.1.
|
28
|
+
USER_AGENT = 'apidoc:0.11.37 http://www.apidoc.me/flow/api/0.1.52/ruby_client' unless defined?(Constants::USER_AGENT)
|
29
|
+
VERSION = '0.1.51' unless defined?(Constants::VERSION)
|
30
30
|
VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
|
31
31
|
|
32
32
|
end
|
@@ -81,6 +81,10 @@ module Io
|
|
81
81
|
@orders ||= ::Io::Flow::V0::Clients::Orders.new(self)
|
82
82
|
end
|
83
83
|
|
84
|
+
def order_estimates
|
85
|
+
@order_estimates ||= ::Io::Flow::V0::Clients::OrderEstimates.new(self)
|
86
|
+
end
|
87
|
+
|
84
88
|
def subcatalogs
|
85
89
|
@subcatalogs ||= ::Io::Flow::V0::Clients::Subcatalogs.new(self)
|
86
90
|
end
|
@@ -197,6 +201,10 @@ module Io
|
|
197
201
|
@quotes ||= ::Io::Flow::V0::Clients::Quotes.new(self)
|
198
202
|
end
|
199
203
|
|
204
|
+
def quote_estimates
|
205
|
+
@quote_estimates ||= ::Io::Flow::V0::Clients::QuoteEstimates.new(self)
|
206
|
+
end
|
207
|
+
|
200
208
|
def services
|
201
209
|
@services ||= ::Io::Flow::V0::Clients::Services.new(self)
|
202
210
|
end
|
@@ -265,6 +273,10 @@ module Io
|
|
265
273
|
@email_verifications ||= ::Io::Flow::V0::Clients::EmailVerifications.new(self)
|
266
274
|
end
|
267
275
|
|
276
|
+
def exports
|
277
|
+
@exports ||= ::Io::Flow::V0::Clients::Exports.new(self)
|
278
|
+
end
|
279
|
+
|
268
280
|
def healthchecks
|
269
281
|
@healthchecks ||= ::Io::Flow::V0::Clients::Healthchecks.new(self)
|
270
282
|
end
|
@@ -777,6 +789,32 @@ module Io
|
|
777
789
|
|
778
790
|
end
|
779
791
|
|
792
|
+
class OrderEstimates
|
793
|
+
|
794
|
+
def initialize(client)
|
795
|
+
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
|
796
|
+
end
|
797
|
+
|
798
|
+
# Create an order estimate, using the localized information from the
|
799
|
+
# experience selected by the query parameters. This is similar to the POST
|
800
|
+
# orders endpoint, except this just returns an estimate and cannot be booked.
|
801
|
+
def post(organization, order_estimate_form, incoming={})
|
802
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
803
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
804
|
+
query = {
|
805
|
+
:experience => (x = opts.delete(:experience); x.nil? ? nil : HttpClient::Preconditions.assert_class('experience', x, String)),
|
806
|
+
:country => (x = opts.delete(:country); x.nil? ? nil : HttpClient::Preconditions.assert_class('country', x, String)),
|
807
|
+
:ip => (x = opts.delete(:ip); x.nil? ? nil : HttpClient::Preconditions.assert_class('ip', x, String)),
|
808
|
+
:currency => (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, String)),
|
809
|
+
:language => (x = opts.delete(:language); x.nil? ? nil : HttpClient::Preconditions.assert_class('language', x, String))
|
810
|
+
}.delete_if { |k, v| v.nil? }
|
811
|
+
HttpClient::Preconditions.assert_class('order_estimate_form', order_estimate_form, ::Io::Flow::V0::Models::OrderEstimateForm)
|
812
|
+
r = @client.request("/#{CGI.escape(organization)}/order-estimates").with_query(query).with_json(order_estimate_form.to_json).post
|
813
|
+
::Io::Flow::V0::Models::OrderEstimate.new(r)
|
814
|
+
end
|
815
|
+
|
816
|
+
end
|
817
|
+
|
780
818
|
class Subcatalogs
|
781
819
|
|
782
820
|
def initialize(client)
|
@@ -2317,6 +2355,21 @@ module Io
|
|
2317
2355
|
|
2318
2356
|
end
|
2319
2357
|
|
2358
|
+
class QuoteEstimates
|
2359
|
+
|
2360
|
+
def initialize(client)
|
2361
|
+
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
|
2362
|
+
end
|
2363
|
+
|
2364
|
+
def post(organization, quote_estimate_form)
|
2365
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
2366
|
+
HttpClient::Preconditions.assert_class('quote_estimate_form', quote_estimate_form, ::Io::Flow::V0::Models::QuoteEstimateForm)
|
2367
|
+
r = @client.request("/#{CGI.escape(organization)}/quote-estimates").with_json(quote_estimate_form.to_json).post
|
2368
|
+
::Io::Flow::V0::Models::QuoteEstimate.new(r)
|
2369
|
+
end
|
2370
|
+
|
2371
|
+
end
|
2372
|
+
|
2320
2373
|
class Services
|
2321
2374
|
|
2322
2375
|
def initialize(client)
|
@@ -2929,6 +2982,68 @@ module Io
|
|
2929
2982
|
|
2930
2983
|
end
|
2931
2984
|
|
2985
|
+
class Exports
|
2986
|
+
|
2987
|
+
def initialize(client)
|
2988
|
+
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
|
2989
|
+
end
|
2990
|
+
|
2991
|
+
# Search exports. Always paginated.
|
2992
|
+
def get(organization, incoming={})
|
2993
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
2994
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
2995
|
+
query = {
|
2996
|
+
:id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
|
2997
|
+
:created_by_user_id => (x = opts.delete(:created_by_user_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('created_by_user_id', x, String)),
|
2998
|
+
:discriminator => (x = opts.delete(:discriminator); x.nil? ? nil : HttpClient::Preconditions.assert_class('discriminator', x, String)),
|
2999
|
+
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
3000
|
+
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
3001
|
+
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
|
3002
|
+
}.delete_if { |k, v| v.nil? }
|
3003
|
+
r = @client.request("/#{CGI.escape(organization)}/exports").with_query(query).get
|
3004
|
+
r.map { |x| ::Io::Flow::V0::Models::Export.new(x) }
|
3005
|
+
end
|
3006
|
+
|
3007
|
+
# Create an export.
|
3008
|
+
def post(organization, export_form)
|
3009
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
3010
|
+
HttpClient::Preconditions.assert_class('export_form', export_form, ::Io::Flow::V0::Models::ExportForm)
|
3011
|
+
r = @client.request("/#{CGI.escape(organization)}/exports").with_json(export_form.to_json).post
|
3012
|
+
::Io::Flow::V0::Models::Export.new(r)
|
3013
|
+
end
|
3014
|
+
|
3015
|
+
# Get a single export.
|
3016
|
+
def get_by_id(organization, id)
|
3017
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
3018
|
+
HttpClient::Preconditions.assert_class('id', id, String)
|
3019
|
+
r = @client.request("/#{CGI.escape(organization)}/exports/#{CGI.escape(id)}").get
|
3020
|
+
::Io::Flow::V0::Models::Export.new(r)
|
3021
|
+
end
|
3022
|
+
|
3023
|
+
def delete_by_id(organization, id)
|
3024
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
3025
|
+
HttpClient::Preconditions.assert_class('id', id, String)
|
3026
|
+
r = @client.request("/#{CGI.escape(organization)}/exports/#{CGI.escape(id)}").delete
|
3027
|
+
nil
|
3028
|
+
end
|
3029
|
+
|
3030
|
+
# Provides visibility into recent changes of each export, including deletion.
|
3031
|
+
def get_versions(organization, incoming={})
|
3032
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
3033
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
3034
|
+
query = {
|
3035
|
+
:id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
|
3036
|
+
:export_id => (x = opts.delete(:export_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('export_id', x, Array).map { |v| HttpClient::Preconditions.assert_class('export_id', v, String) }),
|
3037
|
+
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
3038
|
+
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
3039
|
+
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
|
3040
|
+
}.delete_if { |k, v| v.nil? }
|
3041
|
+
r = @client.request("/#{CGI.escape(organization)}/exports/versions").with_query(query).get
|
3042
|
+
r.map { |x| ::Io::Flow::V0::Models::ExportVersion.new(x) }
|
3043
|
+
end
|
3044
|
+
|
3045
|
+
end
|
3046
|
+
|
2932
3047
|
class Healthchecks
|
2933
3048
|
|
2934
3049
|
def initialize(client)
|
@@ -3609,6 +3724,7 @@ module Io
|
|
3609
3724
|
HS10_CODE_DELETED = 'hs10_code_deleted' unless defined?(HS10_CODE_DELETED)
|
3610
3725
|
LOCALIZED_ITEM_UPSERTED = 'localized_item_upserted' unless defined?(LOCALIZED_ITEM_UPSERTED)
|
3611
3726
|
LOCALIZED_ITEM_DELETED = 'localized_item_deleted' unless defined?(LOCALIZED_ITEM_DELETED)
|
3727
|
+
LOCALIZED_ITEM_SNAPSHOT = 'localized_item_snapshot' unless defined?(LOCALIZED_ITEM_SNAPSHOT)
|
3612
3728
|
ORGANIZATION_UPSERTED = 'organization_upserted' unless defined?(ORGANIZATION_UPSERTED)
|
3613
3729
|
ORGANIZATION_DELETED = 'organization_deleted' unless defined?(ORGANIZATION_DELETED)
|
3614
3730
|
TRACKING_LABEL_EVENT_UPSERTED = 'tracking_label_event_upserted' unless defined?(TRACKING_LABEL_EVENT_UPSERTED)
|
@@ -3654,6 +3770,7 @@ module Io
|
|
3654
3770
|
when Types::HS10_CODE_DELETED; Hs10CodeDeleted.new(hash)
|
3655
3771
|
when Types::LOCALIZED_ITEM_UPSERTED; LocalizedItemUpserted.new(hash)
|
3656
3772
|
when Types::LOCALIZED_ITEM_DELETED; LocalizedItemDeleted.new(hash)
|
3773
|
+
when Types::LOCALIZED_ITEM_SNAPSHOT; LocalizedItemSnapshot.new(hash)
|
3657
3774
|
when Types::ORGANIZATION_UPSERTED; OrganizationUpserted.new(hash)
|
3658
3775
|
when Types::ORGANIZATION_DELETED; OrganizationDeleted.new(hash)
|
3659
3776
|
when Types::TRACKING_LABEL_EVENT_UPSERTED; TrackingLabelEventUpserted.new(hash)
|
@@ -3897,6 +4014,116 @@ module Io
|
|
3897
4014
|
|
3898
4015
|
end
|
3899
4016
|
|
4017
|
+
# Export deliveries represent actions to take once a requested export has
|
4018
|
+
# completed. A common pattern would be to request delivery of the export via
|
4019
|
+
# email - you will then receive an email notification once the requested export
|
4020
|
+
# is ready
|
4021
|
+
class ExportDelivery
|
4022
|
+
|
4023
|
+
module Types
|
4024
|
+
EXPORT_DELIVERY_EMAIL = 'export_delivery_email' unless defined?(EXPORT_DELIVERY_EMAIL)
|
4025
|
+
end
|
4026
|
+
|
4027
|
+
def initialize(incoming={})
|
4028
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
4029
|
+
HttpClient::Preconditions.require_keys(opts, [:name], 'ExportDelivery')
|
4030
|
+
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
|
4031
|
+
end
|
4032
|
+
|
4033
|
+
def to_hash
|
4034
|
+
subtype_to_hash.merge(:discriminator => @name)
|
4035
|
+
end
|
4036
|
+
|
4037
|
+
def ExportDelivery.from_json(hash)
|
4038
|
+
HttpClient::Preconditions.assert_class('hash', hash, Hash)
|
4039
|
+
case HttpClient::Helper.symbolize_keys(hash)[:discriminator]
|
4040
|
+
when Types::EXPORT_DELIVERY_EMAIL; ExportDeliveryEmail.new(hash)
|
4041
|
+
else ExportDeliveryUndefinedType.new(:name => union_type_name)
|
4042
|
+
end
|
4043
|
+
end
|
4044
|
+
|
4045
|
+
end
|
4046
|
+
|
4047
|
+
class ExportDeliveryUndefinedType < ExportDelivery
|
4048
|
+
|
4049
|
+
attr_reader :name
|
4050
|
+
|
4051
|
+
def initialize(incoming={})
|
4052
|
+
super(:name => 'undefined_type')
|
4053
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
4054
|
+
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
|
4055
|
+
end
|
4056
|
+
|
4057
|
+
def subtype_to_hash
|
4058
|
+
raise 'Unable to serialize undefined type to json'
|
4059
|
+
end
|
4060
|
+
|
4061
|
+
def copy(incoming={})
|
4062
|
+
raise 'Operation not supported for undefined type'
|
4063
|
+
end
|
4064
|
+
|
4065
|
+
def to_hash
|
4066
|
+
raise 'Operation not supported for undefined type'
|
4067
|
+
end
|
4068
|
+
|
4069
|
+
end
|
4070
|
+
|
4071
|
+
# Defines the specific export data that defines which records are exported and
|
4072
|
+
# into which format
|
4073
|
+
class ExportType
|
4074
|
+
|
4075
|
+
module Types
|
4076
|
+
CATALOG_ITEM_EXPORT_TYPE = 'catalog_item_export_type' unless defined?(CATALOG_ITEM_EXPORT_TYPE)
|
4077
|
+
SOLIDUS_PRODUCT_EXPORT_TYPE = 'solidus_product_export_type' unless defined?(SOLIDUS_PRODUCT_EXPORT_TYPE)
|
4078
|
+
SOLIDUS_VARIANT_EXPORT_TYPE = 'solidus_variant_export_type' unless defined?(SOLIDUS_VARIANT_EXPORT_TYPE)
|
4079
|
+
end
|
4080
|
+
|
4081
|
+
def initialize(incoming={})
|
4082
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
4083
|
+
HttpClient::Preconditions.require_keys(opts, [:name], 'ExportType')
|
4084
|
+
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
|
4085
|
+
end
|
4086
|
+
|
4087
|
+
def to_hash
|
4088
|
+
subtype_to_hash.merge(:discriminator => @name)
|
4089
|
+
end
|
4090
|
+
|
4091
|
+
def ExportType.from_json(hash)
|
4092
|
+
HttpClient::Preconditions.assert_class('hash', hash, Hash)
|
4093
|
+
case HttpClient::Helper.symbolize_keys(hash)[:discriminator]
|
4094
|
+
when Types::CATALOG_ITEM_EXPORT_TYPE; CatalogItemExportType.new(hash)
|
4095
|
+
when Types::SOLIDUS_PRODUCT_EXPORT_TYPE; SolidusProductExportType.new(hash)
|
4096
|
+
when Types::SOLIDUS_VARIANT_EXPORT_TYPE; SolidusVariantExportType.new(hash)
|
4097
|
+
else ExportTypeUndefinedType.new(:name => union_type_name)
|
4098
|
+
end
|
4099
|
+
end
|
4100
|
+
|
4101
|
+
end
|
4102
|
+
|
4103
|
+
class ExportTypeUndefinedType < ExportType
|
4104
|
+
|
4105
|
+
attr_reader :name
|
4106
|
+
|
4107
|
+
def initialize(incoming={})
|
4108
|
+
super(:name => 'undefined_type')
|
4109
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
4110
|
+
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
|
4111
|
+
end
|
4112
|
+
|
4113
|
+
def subtype_to_hash
|
4114
|
+
raise 'Unable to serialize undefined type to json'
|
4115
|
+
end
|
4116
|
+
|
4117
|
+
def copy(incoming={})
|
4118
|
+
raise 'Operation not supported for undefined type'
|
4119
|
+
end
|
4120
|
+
|
4121
|
+
def to_hash
|
4122
|
+
raise 'Operation not supported for undefined type'
|
4123
|
+
end
|
4124
|
+
|
4125
|
+
end
|
4126
|
+
|
3900
4127
|
# Types of rules used to apply on inventory to calculate available quantity
|
3901
4128
|
class InventoryStrategy
|
3902
4129
|
|
@@ -4633,7 +4860,7 @@ module Io
|
|
4633
4860
|
end
|
4634
4861
|
|
4635
4862
|
def EventType.ALL
|
4636
|
-
@@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.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, EventType.tracking_label_event_upserted]
|
4863
|
+
@@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.hs6_code_upserted, EventType.hs6_code_deleted, EventType.hs10_code_upserted, EventType.hs10_code_deleted, EventType.localized_item_upserted, EventType.localized_item_deleted, EventType.localized_item_snapshot, EventType.organization_upserted, EventType.organization_deleted, EventType.tracking_label_event_upserted]
|
4637
4864
|
end
|
4638
4865
|
|
4639
4866
|
def EventType.catalog_upserted
|
@@ -4744,6 +4971,10 @@ module Io
|
|
4744
4971
|
@@_localized_item_deleted ||= EventType.new('localized_item_deleted')
|
4745
4972
|
end
|
4746
4973
|
|
4974
|
+
def EventType.localized_item_snapshot
|
4975
|
+
@@_localized_item_snapshot ||= EventType.new('localized_item_snapshot')
|
4976
|
+
end
|
4977
|
+
|
4747
4978
|
def EventType.organization_upserted
|
4748
4979
|
@@_organization_upserted ||= EventType.new('organization_upserted')
|
4749
4980
|
end
|
@@ -4804,6 +5035,56 @@ module Io
|
|
4804
5035
|
|
4805
5036
|
end
|
4806
5037
|
|
5038
|
+
class ExportStatus
|
5039
|
+
|
5040
|
+
attr_reader :value
|
5041
|
+
|
5042
|
+
def initialize(value)
|
5043
|
+
@value = HttpClient::Preconditions.assert_class('value', value, String)
|
5044
|
+
end
|
5045
|
+
|
5046
|
+
# Returns the instance of ExportStatus for this value, creating a new instance for an unknown value
|
5047
|
+
def ExportStatus.apply(value)
|
5048
|
+
if value.instance_of?(ExportStatus)
|
5049
|
+
value
|
5050
|
+
else
|
5051
|
+
HttpClient::Preconditions.assert_class_or_nil('value', value, String)
|
5052
|
+
value.nil? ? nil : (from_string(value) || ExportStatus.new(value))
|
5053
|
+
end
|
5054
|
+
end
|
5055
|
+
|
5056
|
+
# Returns the instance of ExportStatus for this value, or nil if not found
|
5057
|
+
def ExportStatus.from_string(value)
|
5058
|
+
HttpClient::Preconditions.assert_class('value', value, String)
|
5059
|
+
ExportStatus.ALL.find { |v| v.value == value }
|
5060
|
+
end
|
5061
|
+
|
5062
|
+
def ExportStatus.ALL
|
5063
|
+
@@all ||= [ExportStatus.created, ExportStatus.processing, ExportStatus.completed, ExportStatus.failed]
|
5064
|
+
end
|
5065
|
+
|
5066
|
+
def ExportStatus.created
|
5067
|
+
@@_created ||= ExportStatus.new('created')
|
5068
|
+
end
|
5069
|
+
|
5070
|
+
def ExportStatus.processing
|
5071
|
+
@@_processing ||= ExportStatus.new('processing')
|
5072
|
+
end
|
5073
|
+
|
5074
|
+
def ExportStatus.completed
|
5075
|
+
@@_completed ||= ExportStatus.new('completed')
|
5076
|
+
end
|
5077
|
+
|
5078
|
+
def ExportStatus.failed
|
5079
|
+
@@_failed ||= ExportStatus.new('failed')
|
5080
|
+
end
|
5081
|
+
|
5082
|
+
def to_hash
|
5083
|
+
value
|
5084
|
+
end
|
5085
|
+
|
5086
|
+
end
|
5087
|
+
|
4807
5088
|
class HolidayCalendar
|
4808
5089
|
|
4809
5090
|
attr_reader :value
|
@@ -6981,6 +7262,38 @@ module Io
|
|
6981
7262
|
|
6982
7263
|
end
|
6983
7264
|
|
7265
|
+
# Defines the filters that can be applied when requesting a catalog item data
|
7266
|
+
# export
|
7267
|
+
class CatalogItemExportType < ExportType
|
7268
|
+
|
7269
|
+
attr_reader :numbers, :q, :sort
|
7270
|
+
|
7271
|
+
def initialize(incoming={})
|
7272
|
+
super(:name => ExportType::Types::CATALOG_ITEM_EXPORT_TYPE)
|
7273
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
7274
|
+
@numbers = (x = opts.delete(:numbers); x.nil? ? nil : HttpClient::Preconditions.assert_class('numbers', x, Array).map { |v| HttpClient::Preconditions.assert_class('numbers', v, String) })
|
7275
|
+
@q = (x = opts.delete(:q); x.nil? ? nil : HttpClient::Preconditions.assert_class('q', x, String))
|
7276
|
+
@sort = HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "number" : x), String)
|
7277
|
+
end
|
7278
|
+
|
7279
|
+
def to_json
|
7280
|
+
JSON.dump(to_hash)
|
7281
|
+
end
|
7282
|
+
|
7283
|
+
def copy(incoming={})
|
7284
|
+
CatalogItemExportType.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
7285
|
+
end
|
7286
|
+
|
7287
|
+
def subtype_to_hash
|
7288
|
+
{
|
7289
|
+
:numbers => numbers.nil? ? nil : numbers,
|
7290
|
+
:q => q,
|
7291
|
+
:sort => sort
|
7292
|
+
}
|
7293
|
+
end
|
7294
|
+
|
7295
|
+
end
|
7296
|
+
|
6984
7297
|
class CatalogItemUpserted < Event
|
6985
7298
|
|
6986
7299
|
attr_reader :event_id, :timestamp, :organization, :number, :catalog, :locale, :name, :currency, :price, :categories, :description, :attributes, :dimensions, :images
|
@@ -7654,6 +7967,34 @@ module Io
|
|
7654
7967
|
|
7655
7968
|
end
|
7656
7969
|
|
7970
|
+
class DeliveryEstimate
|
7971
|
+
|
7972
|
+
attr_reader :items, :options
|
7973
|
+
|
7974
|
+
def initialize(incoming={})
|
7975
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
7976
|
+
HttpClient::Preconditions.require_keys(opts, [:items, :options], 'DeliveryEstimate')
|
7977
|
+
@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)) }
|
7978
|
+
@options = HttpClient::Preconditions.assert_class('options', opts.delete(:options), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::DeliveryOptionEstimate) ? x : ::Io::Flow::V0::Models::DeliveryOptionEstimate.new(x)) }
|
7979
|
+
end
|
7980
|
+
|
7981
|
+
def to_json
|
7982
|
+
JSON.dump(to_hash)
|
7983
|
+
end
|
7984
|
+
|
7985
|
+
def copy(incoming={})
|
7986
|
+
DeliveryEstimate.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
7987
|
+
end
|
7988
|
+
|
7989
|
+
def to_hash
|
7990
|
+
{
|
7991
|
+
:items => items.map { |o| o.to_hash },
|
7992
|
+
:options => options.map { |o| o.to_hash }
|
7993
|
+
}
|
7994
|
+
end
|
7995
|
+
|
7996
|
+
end
|
7997
|
+
|
7657
7998
|
# Represents a collection of items, the available delivery option tier for that
|
7658
7999
|
# collection of items, and metadata about those options
|
7659
8000
|
class DeliveryForm
|
@@ -7726,18 +8067,54 @@ module Io
|
|
7726
8067
|
|
7727
8068
|
end
|
7728
8069
|
|
7729
|
-
|
7730
|
-
# range and cost
|
7731
|
-
class DeliveryOptionForm
|
8070
|
+
class DeliveryOptionEstimate
|
7732
8071
|
|
7733
|
-
attr_reader :
|
8072
|
+
attr_reader :cost, :delivered_duty, :price, :service, :tier, :window
|
7734
8073
|
|
7735
8074
|
def initialize(incoming={})
|
7736
8075
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
7737
|
-
HttpClient::Preconditions.require_keys(opts, [:
|
7738
|
-
@
|
7739
|
-
@
|
7740
|
-
@
|
8076
|
+
HttpClient::Preconditions.require_keys(opts, [:cost, :delivered_duty, :price, :service, :tier, :window], 'DeliveryOptionEstimate')
|
8077
|
+
@cost = (x = opts.delete(:cost); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x))
|
8078
|
+
@delivered_duty = (x = opts.delete(:delivered_duty); x.is_a?(::Io::Flow::V0::Models::DeliveredDuty) ? x : ::Io::Flow::V0::Models::DeliveredDuty.apply(x))
|
8079
|
+
@price = (x = opts.delete(:price); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x))
|
8080
|
+
@service = (x = opts.delete(:service); x.is_a?(::Io::Flow::V0::Models::ServiceSummary) ? x : ::Io::Flow::V0::Models::ServiceSummary.new(x))
|
8081
|
+
@tier = (x = opts.delete(:tier); x.is_a?(::Io::Flow::V0::Models::TierSummary) ? x : ::Io::Flow::V0::Models::TierSummary.new(x))
|
8082
|
+
@window = (x = opts.delete(:window); x.is_a?(::Io::Flow::V0::Models::DatetimeRange) ? x : ::Io::Flow::V0::Models::DatetimeRange.new(x))
|
8083
|
+
end
|
8084
|
+
|
8085
|
+
def to_json
|
8086
|
+
JSON.dump(to_hash)
|
8087
|
+
end
|
8088
|
+
|
8089
|
+
def copy(incoming={})
|
8090
|
+
DeliveryOptionEstimate.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
8091
|
+
end
|
8092
|
+
|
8093
|
+
def to_hash
|
8094
|
+
{
|
8095
|
+
:cost => cost.to_hash,
|
8096
|
+
:delivered_duty => delivered_duty.value,
|
8097
|
+
:price => price.to_hash,
|
8098
|
+
:service => service.to_hash,
|
8099
|
+
:tier => tier.to_hash,
|
8100
|
+
:window => window.to_hash
|
8101
|
+
}
|
8102
|
+
end
|
8103
|
+
|
8104
|
+
end
|
8105
|
+
|
8106
|
+
# Represents a way to fulfill a delivery, including an estimates for the date
|
8107
|
+
# range and cost
|
8108
|
+
class DeliveryOptionForm
|
8109
|
+
|
8110
|
+
attr_reader :delivery, :items, :destination
|
8111
|
+
|
8112
|
+
def initialize(incoming={})
|
8113
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
8114
|
+
HttpClient::Preconditions.require_keys(opts, [:delivery, :items, :destination], 'DeliveryOptionForm')
|
8115
|
+
@delivery = HttpClient::Preconditions.assert_class('delivery', opts.delete(:delivery), String)
|
8116
|
+
@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)) }
|
8117
|
+
@destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::ShippingAddress) ? x : ::Io::Flow::V0::Models::ShippingAddress.new(x))
|
7741
8118
|
end
|
7742
8119
|
|
7743
8120
|
def to_json
|
@@ -8418,7 +8795,7 @@ module Io
|
|
8418
8795
|
# Some important fields related to experiences used in various APIs
|
8419
8796
|
class ExperienceSummary
|
8420
8797
|
|
8421
|
-
attr_reader :id, :key, :name
|
8798
|
+
attr_reader :id, :key, :name
|
8422
8799
|
|
8423
8800
|
def initialize(incoming={})
|
8424
8801
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
@@ -8426,8 +8803,6 @@ module Io
|
|
8426
8803
|
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
8427
8804
|
@key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
|
8428
8805
|
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
|
8429
|
-
@currency = (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, String))
|
8430
|
-
@country = (x = opts.delete(:country); x.nil? ? nil : HttpClient::Preconditions.assert_class('country', x, String))
|
8431
8806
|
end
|
8432
8807
|
|
8433
8808
|
def to_json
|
@@ -8442,9 +8817,7 @@ module Io
|
|
8442
8817
|
{
|
8443
8818
|
:id => id,
|
8444
8819
|
:key => key,
|
8445
|
-
:name => name
|
8446
|
-
:currency => currency,
|
8447
|
-
:country => country
|
8820
|
+
:name => name
|
8448
8821
|
}
|
8449
8822
|
end
|
8450
8823
|
|
@@ -8562,6 +8935,139 @@ module Io
|
|
8562
8935
|
|
8563
8936
|
end
|
8564
8937
|
|
8938
|
+
# Exports represent data extraction requests (e.g. download my catalog items to
|
8939
|
+
# a CSV file)
|
8940
|
+
class Export
|
8941
|
+
|
8942
|
+
attr_reader :id, :type, :status, :created_at, :started_at, :completed_at, :url, :deliveries
|
8943
|
+
|
8944
|
+
def initialize(incoming={})
|
8945
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
8946
|
+
HttpClient::Preconditions.require_keys(opts, [:id, :type, :status, :created_at, :deliveries], 'Export')
|
8947
|
+
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
8948
|
+
@type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::ExportType) ? x : ::Io::Flow::V0::Models::ExportType.from_json(x))
|
8949
|
+
@status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::ExportStatus) ? x : ::Io::Flow::V0::Models::ExportStatus.apply(x))
|
8950
|
+
@created_at = HttpClient::Preconditions.assert_class('created_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:created_at)), DateTime)
|
8951
|
+
@started_at = (x = opts.delete(:started_at); x.nil? ? nil : HttpClient::Preconditions.assert_class('started_at', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
|
8952
|
+
@completed_at = (x = opts.delete(:completed_at); x.nil? ? nil : HttpClient::Preconditions.assert_class('completed_at', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
|
8953
|
+
@url = (x = opts.delete(:url); x.nil? ? nil : HttpClient::Preconditions.assert_class('url', x, String))
|
8954
|
+
@deliveries = HttpClient::Preconditions.assert_class('deliveries', opts.delete(:deliveries), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::ExportDelivery) ? x : ::Io::Flow::V0::Models::ExportDelivery.from_json(x)) }
|
8955
|
+
end
|
8956
|
+
|
8957
|
+
def to_json
|
8958
|
+
JSON.dump(to_hash)
|
8959
|
+
end
|
8960
|
+
|
8961
|
+
def copy(incoming={})
|
8962
|
+
Export.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
8963
|
+
end
|
8964
|
+
|
8965
|
+
def to_hash
|
8966
|
+
{
|
8967
|
+
:id => id,
|
8968
|
+
:type => type.to_hash,
|
8969
|
+
:status => status.value,
|
8970
|
+
:created_at => created_at,
|
8971
|
+
:started_at => started_at,
|
8972
|
+
:completed_at => completed_at,
|
8973
|
+
:url => url,
|
8974
|
+
:deliveries => deliveries.map { |o| o.to_hash }
|
8975
|
+
}
|
8976
|
+
end
|
8977
|
+
|
8978
|
+
end
|
8979
|
+
|
8980
|
+
# Triggers an email notification once the requested export is ready
|
8981
|
+
class ExportDeliveryEmail < ExportDelivery
|
8982
|
+
|
8983
|
+
attr_reader :email
|
8984
|
+
|
8985
|
+
def initialize(incoming={})
|
8986
|
+
super(:name => ExportDelivery::Types::EXPORT_DELIVERY_EMAIL)
|
8987
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
8988
|
+
HttpClient::Preconditions.require_keys(opts, [:email], 'ExportDeliveryEmail')
|
8989
|
+
@email = HttpClient::Preconditions.assert_class('email', opts.delete(:email), String)
|
8990
|
+
end
|
8991
|
+
|
8992
|
+
def to_json
|
8993
|
+
JSON.dump(to_hash)
|
8994
|
+
end
|
8995
|
+
|
8996
|
+
def copy(incoming={})
|
8997
|
+
ExportDeliveryEmail.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
8998
|
+
end
|
8999
|
+
|
9000
|
+
def subtype_to_hash
|
9001
|
+
{
|
9002
|
+
:email => email
|
9003
|
+
}
|
9004
|
+
end
|
9005
|
+
|
9006
|
+
end
|
9007
|
+
|
9008
|
+
# Export forms are used to create exports. The export type defines both the type
|
9009
|
+
# of the export (e.g. the CSV File format) and the available parameters for each
|
9010
|
+
# export (e.g. the filters to apply to select the desired data).
|
9011
|
+
class ExportForm
|
9012
|
+
|
9013
|
+
attr_reader :type, :emails
|
9014
|
+
|
9015
|
+
def initialize(incoming={})
|
9016
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
9017
|
+
HttpClient::Preconditions.require_keys(opts, [:type], 'ExportForm')
|
9018
|
+
@type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::ExportType) ? x : ::Io::Flow::V0::Models::ExportType.from_json(x))
|
9019
|
+
@emails = (x = opts.delete(:emails); x.nil? ? nil : HttpClient::Preconditions.assert_class('emails', x, Array).map { |v| HttpClient::Preconditions.assert_class('emails', v, String) })
|
9020
|
+
end
|
9021
|
+
|
9022
|
+
def to_json
|
9023
|
+
JSON.dump(to_hash)
|
9024
|
+
end
|
9025
|
+
|
9026
|
+
def copy(incoming={})
|
9027
|
+
ExportForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
9028
|
+
end
|
9029
|
+
|
9030
|
+
def to_hash
|
9031
|
+
{
|
9032
|
+
:type => type.to_hash,
|
9033
|
+
:emails => emails.nil? ? nil : emails
|
9034
|
+
}
|
9035
|
+
end
|
9036
|
+
|
9037
|
+
end
|
9038
|
+
|
9039
|
+
class ExportVersion
|
9040
|
+
|
9041
|
+
attr_reader :id, :timestamp, :type, :export
|
9042
|
+
|
9043
|
+
def initialize(incoming={})
|
9044
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
9045
|
+
HttpClient::Preconditions.require_keys(opts, [:id, :timestamp, :type, :export], 'ExportVersion')
|
9046
|
+
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
9047
|
+
@timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
|
9048
|
+
@type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::ChangeType) ? x : ::Io::Flow::V0::Models::ChangeType.apply(x))
|
9049
|
+
@export = (x = opts.delete(:export); x.is_a?(::Io::Flow::V0::Models::Export) ? x : ::Io::Flow::V0::Models::Export.new(x))
|
9050
|
+
end
|
9051
|
+
|
9052
|
+
def to_json
|
9053
|
+
JSON.dump(to_hash)
|
9054
|
+
end
|
9055
|
+
|
9056
|
+
def copy(incoming={})
|
9057
|
+
ExportVersion.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
9058
|
+
end
|
9059
|
+
|
9060
|
+
def to_hash
|
9061
|
+
{
|
9062
|
+
:id => id,
|
9063
|
+
:timestamp => timestamp,
|
9064
|
+
:type => type.value,
|
9065
|
+
:export => export.to_hash
|
9066
|
+
}
|
9067
|
+
end
|
9068
|
+
|
9069
|
+
end
|
9070
|
+
|
8565
9071
|
# Rule outcome where shipping surfaced in quote is pre-defined flat rate
|
8566
9072
|
class FlatRate < TierRuleOutcome
|
8567
9073
|
|
@@ -11107,6 +11613,41 @@ module Io
|
|
11107
11613
|
|
11108
11614
|
end
|
11109
11615
|
|
11616
|
+
class LocalizedItemSnapshot < Event
|
11617
|
+
|
11618
|
+
attr_reader :event_id, :timestamp, :organization, :subcatalog_id, :url
|
11619
|
+
|
11620
|
+
def initialize(incoming={})
|
11621
|
+
super(:name => Event::Types::LOCALIZED_ITEM_SNAPSHOT)
|
11622
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
11623
|
+
HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :subcatalog_id, :url], 'LocalizedItemSnapshot')
|
11624
|
+
@event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
|
11625
|
+
@timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
|
11626
|
+
@organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
|
11627
|
+
@subcatalog_id = HttpClient::Preconditions.assert_class('subcatalog_id', opts.delete(:subcatalog_id), String)
|
11628
|
+
@url = HttpClient::Preconditions.assert_class('url', opts.delete(:url), String)
|
11629
|
+
end
|
11630
|
+
|
11631
|
+
def to_json
|
11632
|
+
JSON.dump(to_hash)
|
11633
|
+
end
|
11634
|
+
|
11635
|
+
def copy(incoming={})
|
11636
|
+
LocalizedItemSnapshot.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
11637
|
+
end
|
11638
|
+
|
11639
|
+
def subtype_to_hash
|
11640
|
+
{
|
11641
|
+
:event_id => event_id,
|
11642
|
+
:timestamp => timestamp,
|
11643
|
+
:organization => organization,
|
11644
|
+
:subcatalog_id => subcatalog_id,
|
11645
|
+
:url => url
|
11646
|
+
}
|
11647
|
+
end
|
11648
|
+
|
11649
|
+
end
|
11650
|
+
|
11110
11651
|
class LocalizedItemUpserted < Event
|
11111
11652
|
|
11112
11653
|
attr_reader :event_id, :timestamp, :organization, :number, :catalog, :locale, :name, :currency, :price, :categories, :description, :attributes, :dimensions, :images, :local
|
@@ -11652,6 +12193,72 @@ module Io
|
|
11652
12193
|
|
11653
12194
|
end
|
11654
12195
|
|
12196
|
+
# Lightweight estimate for a group of items without any customer-related
|
12197
|
+
# information. This will contain available estimates on shipping, taxes, and
|
12198
|
+
# duties.
|
12199
|
+
class OrderEstimate
|
12200
|
+
|
12201
|
+
attr_reader :items, :destination, :deliveries, :prices, :total
|
12202
|
+
|
12203
|
+
def initialize(incoming={})
|
12204
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
12205
|
+
HttpClient::Preconditions.require_keys(opts, [:items, :destination, :deliveries, :prices, :total], 'OrderEstimate')
|
12206
|
+
@items = HttpClient::Preconditions.assert_class('items', opts.delete(:items), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::LocalizedLineItem) ? x : ::Io::Flow::V0::Models::LocalizedLineItem.new(x)) }
|
12207
|
+
@destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::Address) ? x : ::Io::Flow::V0::Models::Address.new(x))
|
12208
|
+
@deliveries = HttpClient::Preconditions.assert_class('deliveries', opts.delete(:deliveries), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::DeliveryEstimate) ? x : ::Io::Flow::V0::Models::DeliveryEstimate.new(x)) }
|
12209
|
+
@prices = HttpClient::Preconditions.assert_class('prices', opts.delete(:prices), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::LocalizedPrice) ? x : ::Io::Flow::V0::Models::LocalizedPrice.new(x)) }
|
12210
|
+
@total = (x = opts.delete(:total); x.is_a?(::Io::Flow::V0::Models::LocalizedPrice) ? x : ::Io::Flow::V0::Models::LocalizedPrice.new(x))
|
12211
|
+
end
|
12212
|
+
|
12213
|
+
def to_json
|
12214
|
+
JSON.dump(to_hash)
|
12215
|
+
end
|
12216
|
+
|
12217
|
+
def copy(incoming={})
|
12218
|
+
OrderEstimate.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
12219
|
+
end
|
12220
|
+
|
12221
|
+
def to_hash
|
12222
|
+
{
|
12223
|
+
:items => items.map { |o| o.to_hash },
|
12224
|
+
:destination => destination.to_hash,
|
12225
|
+
:deliveries => deliveries.map { |o| o.to_hash },
|
12226
|
+
:prices => prices.map { |o| o.to_hash },
|
12227
|
+
:total => total.to_hash
|
12228
|
+
}
|
12229
|
+
end
|
12230
|
+
|
12231
|
+
end
|
12232
|
+
|
12233
|
+
# Form to get a lightweight estimate of an order.
|
12234
|
+
class OrderEstimateForm
|
12235
|
+
|
12236
|
+
attr_reader :destination, :items
|
12237
|
+
|
12238
|
+
def initialize(incoming={})
|
12239
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
12240
|
+
HttpClient::Preconditions.require_keys(opts, [:destination, :items], 'OrderEstimateForm')
|
12241
|
+
@destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::Address) ? x : ::Io::Flow::V0::Models::Address.new(x))
|
12242
|
+
@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)) }
|
12243
|
+
end
|
12244
|
+
|
12245
|
+
def to_json
|
12246
|
+
JSON.dump(to_hash)
|
12247
|
+
end
|
12248
|
+
|
12249
|
+
def copy(incoming={})
|
12250
|
+
OrderEstimateForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
12251
|
+
end
|
12252
|
+
|
12253
|
+
def to_hash
|
12254
|
+
{
|
12255
|
+
:destination => destination.to_hash,
|
12256
|
+
:items => items.map { |o| o.to_hash }
|
12257
|
+
}
|
12258
|
+
end
|
12259
|
+
|
12260
|
+
end
|
12261
|
+
|
11655
12262
|
# The order form is used to create an open order, providing the details on
|
11656
12263
|
# pricing and delivery options for destination and items/quantities specified
|
11657
12264
|
class OrderForm
|
@@ -12673,6 +13280,64 @@ module Io
|
|
12673
13280
|
|
12674
13281
|
end
|
12675
13282
|
|
13283
|
+
class QuoteEstimate
|
13284
|
+
|
13285
|
+
attr_reader :destination, :deliveries
|
13286
|
+
|
13287
|
+
def initialize(incoming={})
|
13288
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
13289
|
+
HttpClient::Preconditions.require_keys(opts, [:destination, :deliveries], 'QuoteEstimate')
|
13290
|
+
@destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::Address) ? x : ::Io::Flow::V0::Models::Address.new(x))
|
13291
|
+
@deliveries = HttpClient::Preconditions.assert_class('deliveries', opts.delete(:deliveries), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::DeliveryEstimate) ? x : ::Io::Flow::V0::Models::DeliveryEstimate.new(x)) }
|
13292
|
+
end
|
13293
|
+
|
13294
|
+
def to_json
|
13295
|
+
JSON.dump(to_hash)
|
13296
|
+
end
|
13297
|
+
|
13298
|
+
def copy(incoming={})
|
13299
|
+
QuoteEstimate.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
13300
|
+
end
|
13301
|
+
|
13302
|
+
def to_hash
|
13303
|
+
{
|
13304
|
+
:destination => destination.to_hash,
|
13305
|
+
:deliveries => deliveries.map { |o| o.to_hash }
|
13306
|
+
}
|
13307
|
+
end
|
13308
|
+
|
13309
|
+
end
|
13310
|
+
|
13311
|
+
class QuoteEstimateForm
|
13312
|
+
|
13313
|
+
attr_reader :destination, :experience, :items
|
13314
|
+
|
13315
|
+
def initialize(incoming={})
|
13316
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
13317
|
+
HttpClient::Preconditions.require_keys(opts, [:destination, :experience, :items], 'QuoteEstimateForm')
|
13318
|
+
@destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::Address) ? x : ::Io::Flow::V0::Models::Address.new(x))
|
13319
|
+
@experience = HttpClient::Preconditions.assert_class('experience', opts.delete(:experience), String)
|
13320
|
+
@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)) }
|
13321
|
+
end
|
13322
|
+
|
13323
|
+
def to_json
|
13324
|
+
JSON.dump(to_hash)
|
13325
|
+
end
|
13326
|
+
|
13327
|
+
def copy(incoming={})
|
13328
|
+
QuoteEstimateForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
13329
|
+
end
|
13330
|
+
|
13331
|
+
def to_hash
|
13332
|
+
{
|
13333
|
+
:destination => destination.to_hash,
|
13334
|
+
:experience => experience,
|
13335
|
+
:items => items.map { |o| o.to_hash }
|
13336
|
+
}
|
13337
|
+
end
|
13338
|
+
|
13339
|
+
end
|
13340
|
+
|
12676
13341
|
class QuoteForm
|
12677
13342
|
|
12678
13343
|
attr_reader :destination, :experience, :items
|
@@ -12970,15 +13635,17 @@ module Io
|
|
12970
13635
|
end
|
12971
13636
|
|
12972
13637
|
# Refund actually transfers funds. You can refund as many times as you'd like up
|
12973
|
-
# until the total amount of
|
13638
|
+
# until the total amount of captured funds has been refunded. Note when creating
|
13639
|
+
# a refund you can specify either an authorization id or a capture id (or both
|
13640
|
+
# as long as they match).
|
12974
13641
|
class RefundForm
|
12975
13642
|
|
12976
|
-
attr_reader :capture_id, :key, :amount, :currency
|
13643
|
+
attr_reader :authorization_id, :capture_id, :key, :amount, :currency
|
12977
13644
|
|
12978
13645
|
def initialize(incoming={})
|
12979
13646
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
12980
|
-
HttpClient::Preconditions.
|
12981
|
-
@capture_id = HttpClient::Preconditions.assert_class('capture_id',
|
13647
|
+
@authorization_id = (x = opts.delete(:authorization_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('authorization_id', x, String))
|
13648
|
+
@capture_id = (x = opts.delete(:capture_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('capture_id', x, String))
|
12982
13649
|
@key = (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, String))
|
12983
13650
|
@amount = (x = opts.delete(:amount); x.nil? ? nil : HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(x), BigDecimal))
|
12984
13651
|
@currency = (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, String))
|
@@ -12994,6 +13661,7 @@ module Io
|
|
12994
13661
|
|
12995
13662
|
def to_hash
|
12996
13663
|
{
|
13664
|
+
:authorization_id => authorization_id,
|
12997
13665
|
:capture_id => capture_id,
|
12998
13666
|
:key => key,
|
12999
13667
|
:amount => amount,
|
@@ -13425,6 +14093,64 @@ module Io
|
|
13425
14093
|
|
13426
14094
|
end
|
13427
14095
|
|
14096
|
+
# Exports product level data for import into solidus
|
14097
|
+
class SolidusProductExportType < ExportType
|
14098
|
+
|
14099
|
+
attr_reader :numbers, :sort
|
14100
|
+
|
14101
|
+
def initialize(incoming={})
|
14102
|
+
super(:name => ExportType::Types::SOLIDUS_PRODUCT_EXPORT_TYPE)
|
14103
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
14104
|
+
@numbers = (x = opts.delete(:numbers); x.nil? ? nil : HttpClient::Preconditions.assert_class('numbers', x, Array).map { |v| HttpClient::Preconditions.assert_class('numbers', v, String) })
|
14105
|
+
@sort = HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "number" : x), String)
|
14106
|
+
end
|
14107
|
+
|
14108
|
+
def to_json
|
14109
|
+
JSON.dump(to_hash)
|
14110
|
+
end
|
14111
|
+
|
14112
|
+
def copy(incoming={})
|
14113
|
+
SolidusProductExportType.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
14114
|
+
end
|
14115
|
+
|
14116
|
+
def subtype_to_hash
|
14117
|
+
{
|
14118
|
+
:numbers => numbers.nil? ? nil : numbers,
|
14119
|
+
:sort => sort
|
14120
|
+
}
|
14121
|
+
end
|
14122
|
+
|
14123
|
+
end
|
14124
|
+
|
14125
|
+
# Exports variant level data for import into solidus
|
14126
|
+
class SolidusVariantExportType < ExportType
|
14127
|
+
|
14128
|
+
attr_reader :numbers, :sort
|
14129
|
+
|
14130
|
+
def initialize(incoming={})
|
14131
|
+
super(:name => ExportType::Types::SOLIDUS_VARIANT_EXPORT_TYPE)
|
14132
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
14133
|
+
@numbers = (x = opts.delete(:numbers); x.nil? ? nil : HttpClient::Preconditions.assert_class('numbers', x, Array).map { |v| HttpClient::Preconditions.assert_class('numbers', v, String) })
|
14134
|
+
@sort = HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "number" : x), String)
|
14135
|
+
end
|
14136
|
+
|
14137
|
+
def to_json
|
14138
|
+
JSON.dump(to_hash)
|
14139
|
+
end
|
14140
|
+
|
14141
|
+
def copy(incoming={})
|
14142
|
+
SolidusVariantExportType.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
14143
|
+
end
|
14144
|
+
|
14145
|
+
def subtype_to_hash
|
14146
|
+
{
|
14147
|
+
:numbers => numbers.nil? ? nil : numbers,
|
14148
|
+
:sort => sort
|
14149
|
+
}
|
14150
|
+
end
|
14151
|
+
|
14152
|
+
end
|
14153
|
+
|
13428
14154
|
class SpotRate
|
13429
14155
|
|
13430
14156
|
attr_reader :id, :effective_at, :base, :target, :value
|
@@ -14972,36 +15698,6 @@ module Io
|
|
14972
15698
|
|
14973
15699
|
end
|
14974
15700
|
|
14975
|
-
class UserSummary
|
14976
|
-
|
14977
|
-
attr_reader :id, :email, :name
|
14978
|
-
|
14979
|
-
def initialize(incoming={})
|
14980
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
14981
|
-
HttpClient::Preconditions.require_keys(opts, [:id, :name], 'UserSummary')
|
14982
|
-
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
14983
|
-
@email = (x = opts.delete(:email); x.nil? ? nil : HttpClient::Preconditions.assert_class('email', x, String))
|
14984
|
-
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
|
14985
|
-
end
|
14986
|
-
|
14987
|
-
def to_json
|
14988
|
-
JSON.dump(to_hash)
|
14989
|
-
end
|
14990
|
-
|
14991
|
-
def copy(incoming={})
|
14992
|
-
UserSummary.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
14993
|
-
end
|
14994
|
-
|
14995
|
-
def to_hash
|
14996
|
-
{
|
14997
|
-
:id => id,
|
14998
|
-
:email => email,
|
14999
|
-
:name => name
|
15000
|
-
}
|
15001
|
-
end
|
15002
|
-
|
15003
|
-
end
|
15004
|
-
|
15005
15701
|
class UserVersion
|
15006
15702
|
|
15007
15703
|
attr_reader :id, :timestamp, :type, :user
|
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.55
|
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-09-
|
11
|
+
date: 2016-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|