flowcommerce 0.0.25 → 0.0.26
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/flow_commerce/flow_api_v0_client.rb +120 -221
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e98204cc3cfbdea5327930e9a5d14bc2e1296b08
|
4
|
+
data.tar.gz: 068456152943b1e9ecc1271472f0f516abe1aeab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cacfb3be1afec5231a458dc9a02517032b45cec056b5d18d0808da53465b6c557ff336a02a11069af6ed233c04d76df8cb8d372da0072196ed4a96ce7fa87dfc
|
7
|
+
data.tar.gz: 670dc71ce8bd8f3e52f3e3a0903a564078761ff65f9ce9ae12b4042bad633ee17f2381b0e9bae521a9850dce81782c68cc499a2446fcf0abc6188f1b1a076eab
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Generated by apidoc - http://www.apidoc.me
|
2
|
-
# Service version: 0.0.
|
3
|
-
# apidoc:0.11.33 http://www.apidoc.me/flow/api/0.0.
|
2
|
+
# Service version: 0.0.82
|
3
|
+
# apidoc:0.11.33 http://www.apidoc.me/flow/api/0.0.82/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.33 http://www.apidoc.me/flow/api/0.0.
|
29
|
-
VERSION = '0.0.
|
28
|
+
USER_AGENT = 'apidoc:0.11.33 http://www.apidoc.me/flow/api/0.0.82/ruby_client' unless defined?(Constants::USER_AGENT)
|
29
|
+
VERSION = '0.0.82' unless defined?(Constants::VERSION)
|
30
30
|
VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
|
31
31
|
|
32
32
|
end
|
@@ -89,10 +89,6 @@ module Io
|
|
89
89
|
@subcatalog_items ||= ::Io::Flow::V0::Clients::SubcatalogItems.new(self)
|
90
90
|
end
|
91
91
|
|
92
|
-
def flow_currency_settings
|
93
|
-
@flow_currency_settings ||= ::Io::Flow::V0::Clients::FlowCurrencySettings.new(self)
|
94
|
-
end
|
95
|
-
|
96
92
|
def item_functions
|
97
93
|
@item_functions ||= ::Io::Flow::V0::Clients::ItemFunctions.new(self)
|
98
94
|
end
|
@@ -209,6 +205,10 @@ module Io
|
|
209
205
|
@ratecards ||= ::Io::Flow::V0::Clients::Ratecards.new(self)
|
210
206
|
end
|
211
207
|
|
208
|
+
def ratecard_estimates
|
209
|
+
@ratecard_estimates ||= ::Io::Flow::V0::Clients::RatecardEstimates.new(self)
|
210
|
+
end
|
211
|
+
|
212
212
|
def ratecard_lanes
|
213
213
|
@ratecard_lanes ||= ::Io::Flow::V0::Clients::RatecardLanes.new(self)
|
214
214
|
end
|
@@ -1111,60 +1111,6 @@ module Io
|
|
1111
1111
|
|
1112
1112
|
end
|
1113
1113
|
|
1114
|
-
class FlowCurrencySettings
|
1115
|
-
|
1116
|
-
def initialize(client)
|
1117
|
-
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
|
1118
|
-
end
|
1119
|
-
|
1120
|
-
# Search Flow currency settings. Always paginated.
|
1121
|
-
def get(organization, incoming={})
|
1122
|
-
HttpClient::Preconditions.assert_class('organization', organization, String)
|
1123
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
1124
|
-
query = {
|
1125
|
-
:id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
|
1126
|
-
:base => (x = opts.delete(:base); x.nil? ? nil : HttpClient::Preconditions.assert_class('base', x, String)),
|
1127
|
-
:target => (x = opts.delete(:target); x.nil? ? nil : HttpClient::Preconditions.assert_class('target', x, String)),
|
1128
|
-
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
1129
|
-
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
1130
|
-
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
|
1131
|
-
}.delete_if { |k, v| v.nil? }
|
1132
|
-
r = @client.request("/#{CGI.escape(organization)}/flow/settings").with_query(query).get
|
1133
|
-
r.map { |x| ::Io::Flow::V0::Models::FlowCurrencySetting.new(x) }
|
1134
|
-
end
|
1135
|
-
|
1136
|
-
# Create Flow currency settings.
|
1137
|
-
def post(organization, flow_currency_setting_form)
|
1138
|
-
HttpClient::Preconditions.assert_class('organization', organization, String)
|
1139
|
-
HttpClient::Preconditions.assert_class('flow_currency_setting_form', flow_currency_setting_form, ::Io::Flow::V0::Models::FlowCurrencySettingForm)
|
1140
|
-
r = @client.request("/#{CGI.escape(organization)}/flow/settings").with_json(flow_currency_setting_form.to_json).post
|
1141
|
-
::Io::Flow::V0::Models::FlowCurrencySetting.new(r)
|
1142
|
-
end
|
1143
|
-
|
1144
|
-
# Create Flow currency settings, or update if they already exist.
|
1145
|
-
def put(organization, flow_currency_setting_form)
|
1146
|
-
HttpClient::Preconditions.assert_class('organization', organization, String)
|
1147
|
-
HttpClient::Preconditions.assert_class('flow_currency_setting_form', flow_currency_setting_form, ::Io::Flow::V0::Models::FlowCurrencySettingForm)
|
1148
|
-
r = @client.request("/#{CGI.escape(organization)}/flow/settings").with_json(flow_currency_setting_form.to_json).put
|
1149
|
-
::Io::Flow::V0::Models::FlowCurrencySetting.new(r)
|
1150
|
-
end
|
1151
|
-
|
1152
|
-
# Provides visibility into recent changes of each object, including deletion.
|
1153
|
-
def get_versions(organization, incoming={})
|
1154
|
-
HttpClient::Preconditions.assert_class('organization', organization, String)
|
1155
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
1156
|
-
query = {
|
1157
|
-
:id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
|
1158
|
-
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
1159
|
-
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
1160
|
-
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
|
1161
|
-
}.delete_if { |k, v| v.nil? }
|
1162
|
-
r = @client.request("/#{CGI.escape(organization)}/flow/settings/versions").with_query(query).get
|
1163
|
-
r.map { |x| ::Io::Flow::V0::Models::FlowCurrencySettingVersion.new(x) }
|
1164
|
-
end
|
1165
|
-
|
1166
|
-
end
|
1167
|
-
|
1168
1114
|
class ItemFunctions
|
1169
1115
|
|
1170
1116
|
def initialize(client)
|
@@ -1253,7 +1199,7 @@ module Io
|
|
1253
1199
|
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
1254
1200
|
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
|
1255
1201
|
}.delete_if { |k, v| v.nil? }
|
1256
|
-
r = @client.request("/#{CGI.escape(organization)}/settings").with_query(query).get
|
1202
|
+
r = @client.request("/#{CGI.escape(organization)}/currency/settings").with_query(query).get
|
1257
1203
|
r.map { |x| ::Io::Flow::V0::Models::OrganizationCurrencySetting.new(x) }
|
1258
1204
|
end
|
1259
1205
|
|
@@ -1261,7 +1207,7 @@ module Io
|
|
1261
1207
|
def post(organization, organization_currency_setting_form)
|
1262
1208
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
1263
1209
|
HttpClient::Preconditions.assert_class('organization_currency_setting_form', organization_currency_setting_form, ::Io::Flow::V0::Models::OrganizationCurrencySettingForm)
|
1264
|
-
r = @client.request("/#{CGI.escape(organization)}/settings").with_json(organization_currency_setting_form.to_json).post
|
1210
|
+
r = @client.request("/#{CGI.escape(organization)}/currency/settings").with_json(organization_currency_setting_form.to_json).post
|
1265
1211
|
::Io::Flow::V0::Models::OrganizationCurrencySetting.new(r)
|
1266
1212
|
end
|
1267
1213
|
|
@@ -1269,7 +1215,7 @@ module Io
|
|
1269
1215
|
def put(organization, organization_currency_setting_form)
|
1270
1216
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
1271
1217
|
HttpClient::Preconditions.assert_class('organization_currency_setting_form', organization_currency_setting_form, ::Io::Flow::V0::Models::OrganizationCurrencySettingForm)
|
1272
|
-
r = @client.request("/#{CGI.escape(organization)}/settings").with_json(organization_currency_setting_form.to_json).put
|
1218
|
+
r = @client.request("/#{CGI.escape(organization)}/currency/settings").with_json(organization_currency_setting_form.to_json).put
|
1273
1219
|
::Io::Flow::V0::Models::OrganizationCurrencySetting.new(r)
|
1274
1220
|
end
|
1275
1221
|
|
@@ -1283,7 +1229,7 @@ module Io
|
|
1283
1229
|
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
1284
1230
|
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
|
1285
1231
|
}.delete_if { |k, v| v.nil? }
|
1286
|
-
r = @client.request("/#{CGI.escape(organization)}/settings/versions").with_query(query).get
|
1232
|
+
r = @client.request("/#{CGI.escape(organization)}/currency/settings/versions").with_query(query).get
|
1287
1233
|
r.map { |x| ::Io::Flow::V0::Models::OrganizationCurrencySettingVersion.new(x) }
|
1288
1234
|
end
|
1289
1235
|
|
@@ -1301,13 +1247,13 @@ module Io
|
|
1301
1247
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
1302
1248
|
query = {
|
1303
1249
|
:id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
|
1304
|
-
:base => (x = opts.delete(:base); x.nil? ? nil : HttpClient::Preconditions.assert_class('base', x, String)),
|
1250
|
+
:base => (x = opts.delete(:base); x.nil? ? nil : HttpClient::Preconditions.assert_class('base', x, Array).map { |v| HttpClient::Preconditions.assert_class('base', v, String) }),
|
1305
1251
|
:target => (x = opts.delete(:target); x.nil? ? nil : HttpClient::Preconditions.assert_class('target', x, String)),
|
1306
1252
|
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
1307
1253
|
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
1308
1254
|
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
|
1309
1255
|
}.delete_if { |k, v| v.nil? }
|
1310
|
-
r = @client.request("/#{CGI.escape(organization)}/rates").with_query(query).get
|
1256
|
+
r = @client.request("/#{CGI.escape(organization)}/currency/rates").with_query(query).get
|
1311
1257
|
r.map { |x| ::Io::Flow::V0::Models::Rate.new(x) }
|
1312
1258
|
end
|
1313
1259
|
|
@@ -1315,7 +1261,7 @@ module Io
|
|
1315
1261
|
def post(organization, rate_form)
|
1316
1262
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
1317
1263
|
HttpClient::Preconditions.assert_class('rate_form', rate_form, ::Io::Flow::V0::Models::RateForm)
|
1318
|
-
r = @client.request("/#{CGI.escape(organization)}/rates").with_json(rate_form.to_json).post
|
1264
|
+
r = @client.request("/#{CGI.escape(organization)}/currency/rates").with_json(rate_form.to_json).post
|
1319
1265
|
::Io::Flow::V0::Models::Rate.new(r)
|
1320
1266
|
end
|
1321
1267
|
|
@@ -1324,7 +1270,7 @@ module Io
|
|
1324
1270
|
def put(organization, rate_form)
|
1325
1271
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
1326
1272
|
HttpClient::Preconditions.assert_class('rate_form', rate_form, ::Io::Flow::V0::Models::RateForm)
|
1327
|
-
r = @client.request("/#{CGI.escape(organization)}/rates").with_json(rate_form.to_json).put
|
1273
|
+
r = @client.request("/#{CGI.escape(organization)}/currency/rates").with_json(rate_form.to_json).put
|
1328
1274
|
::Io::Flow::V0::Models::Rate.new(r)
|
1329
1275
|
end
|
1330
1276
|
|
@@ -1340,7 +1286,7 @@ module Io
|
|
1340
1286
|
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
1341
1287
|
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
|
1342
1288
|
}.delete_if { |k, v| v.nil? }
|
1343
|
-
r = @client.request("/#{CGI.escape(organization)}/rates/versions").with_query(query).get
|
1289
|
+
r = @client.request("/#{CGI.escape(organization)}/currency/rates/versions").with_query(query).get
|
1344
1290
|
r.map { |x| ::Io::Flow::V0::Models::RateVersion.new(x) }
|
1345
1291
|
end
|
1346
1292
|
|
@@ -2583,6 +2529,41 @@ module Io
|
|
2583
2529
|
|
2584
2530
|
end
|
2585
2531
|
|
2532
|
+
class RatecardEstimates
|
2533
|
+
|
2534
|
+
def initialize(client)
|
2535
|
+
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
|
2536
|
+
end
|
2537
|
+
|
2538
|
+
# Endpoint to get shipment cost estimates based on applicable rate cards. An
|
2539
|
+
# origin and destination address must be provided. Final amounts are based on
|
2540
|
+
# either gravitational weight or dimensional weight. When estimating based off
|
2541
|
+
# gravitational weight, the weight field must be set. When estimating based
|
2542
|
+
# off dimensional weight, then length/width/depth must be set. For either one,
|
2543
|
+
# the appropriate unit of measurement must be given.
|
2544
|
+
def get(organization, incoming={})
|
2545
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
2546
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
2547
|
+
query = {
|
2548
|
+
:origin => (x = opts.delete(:origin); x.nil? ? nil : HttpClient::Preconditions.assert_class('origin', x, String)),
|
2549
|
+
:destination => (x = opts.delete(:destination); x.nil? ? nil : HttpClient::Preconditions.assert_class('destination', x, String)),
|
2550
|
+
:weight_unit => (x = opts.delete(:weight_unit); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::UnitOfMeasurement) ? x : ::Io::Flow::V0::Models::UnitOfMeasurement.apply(x)).value),
|
2551
|
+
:distance_unit => (x = opts.delete(:distance_unit); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::UnitOfMeasurement) ? x : ::Io::Flow::V0::Models::UnitOfMeasurement.apply(x)).value),
|
2552
|
+
:service => (x = opts.delete(:service); x.nil? ? nil : HttpClient::Preconditions.assert_class('service', x, String)),
|
2553
|
+
:weight => (x = opts.delete(:weight); x.nil? ? nil : HttpClient::Preconditions.assert_class('weight', x, Numeric)),
|
2554
|
+
:length => (x = opts.delete(:length); x.nil? ? nil : HttpClient::Preconditions.assert_class('length', x, Numeric)),
|
2555
|
+
:width => (x = opts.delete(:width); x.nil? ? nil : HttpClient::Preconditions.assert_class('width', x, Numeric)),
|
2556
|
+
:depth => (x = opts.delete(:depth); x.nil? ? nil : HttpClient::Preconditions.assert_class('depth', x, Numeric)),
|
2557
|
+
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
2558
|
+
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
2559
|
+
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
|
2560
|
+
}.delete_if { |k, v| v.nil? }
|
2561
|
+
r = @client.request("/#{CGI.escape(organization)}/ratecard_estimates").with_query(query).get
|
2562
|
+
r.map { |x| ::Io::Flow::V0::Models::RatecardEstimate.new(x) }
|
2563
|
+
end
|
2564
|
+
|
2565
|
+
end
|
2566
|
+
|
2586
2567
|
class RatecardLanes
|
2587
2568
|
|
2588
2569
|
def initialize(client)
|
@@ -6960,7 +6941,7 @@ module Io
|
|
6960
6941
|
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
|
6961
6942
|
@categories = HttpClient::Preconditions.assert_class('categories', opts.delete(:categories), Array).map { |v| HttpClient::Preconditions.assert_class('categories', v, String) }
|
6962
6943
|
@experiences = HttpClient::Preconditions.assert_class('experiences', opts.delete(:experiences), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::ExperienceSummary) ? x : ::Io::Flow::V0::Models::ExperienceSummary.new(x)) }
|
6963
|
-
@attributes = HttpClient::Preconditions.assert_class('attributes', opts.delete(:attributes),
|
6944
|
+
@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 }
|
6964
6945
|
end
|
6965
6946
|
|
6966
6947
|
def to_json
|
@@ -6977,7 +6958,7 @@ module Io
|
|
6977
6958
|
:name => name,
|
6978
6959
|
:categories => categories,
|
6979
6960
|
:experiences => experiences.map { |o| o.to_hash },
|
6980
|
-
:attributes => attributes
|
6961
|
+
:attributes => attributes
|
6981
6962
|
}
|
6982
6963
|
end
|
6983
6964
|
|
@@ -7900,34 +7881,6 @@ module Io
|
|
7900
7881
|
|
7901
7882
|
end
|
7902
7883
|
|
7903
|
-
class DocumentAttribute
|
7904
|
-
|
7905
|
-
attr_reader :name, :value
|
7906
|
-
|
7907
|
-
def initialize(incoming={})
|
7908
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
7909
|
-
HttpClient::Preconditions.require_keys(opts, [:name, :value], 'DocumentAttribute')
|
7910
|
-
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
|
7911
|
-
@value = HttpClient::Preconditions.assert_class('value', opts.delete(:value), String)
|
7912
|
-
end
|
7913
|
-
|
7914
|
-
def to_json
|
7915
|
-
JSON.dump(to_hash)
|
7916
|
-
end
|
7917
|
-
|
7918
|
-
def copy(incoming={})
|
7919
|
-
DocumentAttribute.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
7920
|
-
end
|
7921
|
-
|
7922
|
-
def to_hash
|
7923
|
-
{
|
7924
|
-
:name => name,
|
7925
|
-
:value => value
|
7926
|
-
}
|
7927
|
-
end
|
7928
|
-
|
7929
|
-
end
|
7930
|
-
|
7931
7884
|
# Represents a duration of time.
|
7932
7885
|
class Duration
|
7933
7886
|
|
@@ -8350,104 +8303,6 @@ module Io
|
|
8350
8303
|
|
8351
8304
|
end
|
8352
8305
|
|
8353
|
-
class FlowCurrencySetting
|
8354
|
-
|
8355
|
-
attr_reader :id, :base, :target, :margin, :rate_lock
|
8356
|
-
|
8357
|
-
def initialize(incoming={})
|
8358
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
8359
|
-
HttpClient::Preconditions.require_keys(opts, [:id, :base, :target, :margin, :rate_lock], 'FlowCurrencySetting')
|
8360
|
-
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
8361
|
-
@base = HttpClient::Preconditions.assert_class('base', opts.delete(:base), String)
|
8362
|
-
@target = HttpClient::Preconditions.assert_class('target', opts.delete(:target), String)
|
8363
|
-
@margin = HttpClient::Preconditions.assert_class('margin', HttpClient::Helper.to_big_decimal(opts.delete(:margin)), BigDecimal)
|
8364
|
-
@rate_lock = (x = opts.delete(:rate_lock); x.is_a?(::Io::Flow::V0::Models::Duration) ? x : ::Io::Flow::V0::Models::Duration.new(x))
|
8365
|
-
end
|
8366
|
-
|
8367
|
-
def to_json
|
8368
|
-
JSON.dump(to_hash)
|
8369
|
-
end
|
8370
|
-
|
8371
|
-
def copy(incoming={})
|
8372
|
-
FlowCurrencySetting.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
8373
|
-
end
|
8374
|
-
|
8375
|
-
def to_hash
|
8376
|
-
{
|
8377
|
-
:id => id,
|
8378
|
-
:base => base,
|
8379
|
-
:target => target,
|
8380
|
-
:margin => margin,
|
8381
|
-
:rate_lock => rate_lock.to_hash
|
8382
|
-
}
|
8383
|
-
end
|
8384
|
-
|
8385
|
-
end
|
8386
|
-
|
8387
|
-
class FlowCurrencySettingForm
|
8388
|
-
|
8389
|
-
attr_reader :base, :target, :margin, :rate_lock
|
8390
|
-
|
8391
|
-
def initialize(incoming={})
|
8392
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
8393
|
-
HttpClient::Preconditions.require_keys(opts, [:base, :target, :margin, :rate_lock], 'FlowCurrencySettingForm')
|
8394
|
-
@base = HttpClient::Preconditions.assert_class('base', opts.delete(:base), String)
|
8395
|
-
@target = HttpClient::Preconditions.assert_class('target', opts.delete(:target), String)
|
8396
|
-
@margin = HttpClient::Preconditions.assert_class('margin', HttpClient::Helper.to_big_decimal(opts.delete(:margin)), BigDecimal)
|
8397
|
-
@rate_lock = (x = opts.delete(:rate_lock); x.is_a?(::Io::Flow::V0::Models::Duration) ? x : ::Io::Flow::V0::Models::Duration.new(x))
|
8398
|
-
end
|
8399
|
-
|
8400
|
-
def to_json
|
8401
|
-
JSON.dump(to_hash)
|
8402
|
-
end
|
8403
|
-
|
8404
|
-
def copy(incoming={})
|
8405
|
-
FlowCurrencySettingForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
8406
|
-
end
|
8407
|
-
|
8408
|
-
def to_hash
|
8409
|
-
{
|
8410
|
-
:base => base,
|
8411
|
-
:target => target,
|
8412
|
-
:margin => margin,
|
8413
|
-
:rate_lock => rate_lock.to_hash
|
8414
|
-
}
|
8415
|
-
end
|
8416
|
-
|
8417
|
-
end
|
8418
|
-
|
8419
|
-
class FlowCurrencySettingVersion
|
8420
|
-
|
8421
|
-
attr_reader :id, :timestamp, :type, :flow_currency_setting
|
8422
|
-
|
8423
|
-
def initialize(incoming={})
|
8424
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
8425
|
-
HttpClient::Preconditions.require_keys(opts, [:id, :timestamp, :type, :flow_currency_setting], 'FlowCurrencySettingVersion')
|
8426
|
-
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
8427
|
-
@timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
|
8428
|
-
@type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::ChangeType) ? x : ::Io::Flow::V0::Models::ChangeType.apply(x))
|
8429
|
-
@flow_currency_setting = (x = opts.delete(:flow_currency_setting); x.is_a?(::Io::Flow::V0::Models::FlowCurrencySetting) ? x : ::Io::Flow::V0::Models::FlowCurrencySetting.new(x))
|
8430
|
-
end
|
8431
|
-
|
8432
|
-
def to_json
|
8433
|
-
JSON.dump(to_hash)
|
8434
|
-
end
|
8435
|
-
|
8436
|
-
def copy(incoming={})
|
8437
|
-
FlowCurrencySettingVersion.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
8438
|
-
end
|
8439
|
-
|
8440
|
-
def to_hash
|
8441
|
-
{
|
8442
|
-
:id => id,
|
8443
|
-
:timestamp => timestamp,
|
8444
|
-
:type => type.value,
|
8445
|
-
:flow_currency_setting => flow_currency_setting.to_hash
|
8446
|
-
}
|
8447
|
-
end
|
8448
|
-
|
8449
|
-
end
|
8450
|
-
|
8451
8306
|
class FlowItemIndexMetadata
|
8452
8307
|
|
8453
8308
|
attr_reader :status
|
@@ -12027,16 +11882,16 @@ module Io
|
|
12027
11882
|
# time.
|
12028
11883
|
class Rate
|
12029
11884
|
|
12030
|
-
attr_reader :id, :base, :target, :effective_at, :
|
11885
|
+
attr_reader :id, :base, :target, :effective_at, :value
|
12031
11886
|
|
12032
11887
|
def initialize(incoming={})
|
12033
11888
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
12034
|
-
HttpClient::Preconditions.require_keys(opts, [:id, :base, :target, :effective_at, :
|
11889
|
+
HttpClient::Preconditions.require_keys(opts, [:id, :base, :target, :effective_at, :value], 'Rate')
|
12035
11890
|
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
12036
11891
|
@base = HttpClient::Preconditions.assert_class('base', opts.delete(:base), String)
|
12037
11892
|
@target = HttpClient::Preconditions.assert_class('target', opts.delete(:target), String)
|
12038
11893
|
@effective_at = HttpClient::Preconditions.assert_class('effective_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:effective_at)), DateTime)
|
12039
|
-
@
|
11894
|
+
@value = HttpClient::Preconditions.assert_class('value', HttpClient::Helper.to_big_decimal(opts.delete(:value)), BigDecimal)
|
12040
11895
|
end
|
12041
11896
|
|
12042
11897
|
def to_json
|
@@ -12053,7 +11908,7 @@ module Io
|
|
12053
11908
|
:base => base,
|
12054
11909
|
:target => target,
|
12055
11910
|
:effective_at => effective_at,
|
12056
|
-
:
|
11911
|
+
:value => value
|
12057
11912
|
}
|
12058
11913
|
end
|
12059
11914
|
|
@@ -12159,6 +12014,44 @@ module Io
|
|
12159
12014
|
|
12160
12015
|
end
|
12161
12016
|
|
12017
|
+
# Represents a summary of a cost estimate based on rate card data for an
|
12018
|
+
# origin/destination and weight, either gravitational or dimensional
|
12019
|
+
class RatecardEstimate
|
12020
|
+
|
12021
|
+
attr_reader :service, :shipment_window, :currency, :amount, :fees, :total
|
12022
|
+
|
12023
|
+
def initialize(incoming={})
|
12024
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
12025
|
+
HttpClient::Preconditions.require_keys(opts, [:service, :shipment_window, :currency, :amount, :fees, :total], 'RatecardEstimate')
|
12026
|
+
@service = (x = opts.delete(:service); x.is_a?(::Io::Flow::V0::Models::RatecardServiceReference) ? x : ::Io::Flow::V0::Models::RatecardServiceReference.new(x))
|
12027
|
+
@shipment_window = (x = opts.delete(:shipment_window); x.is_a?(::Io::Flow::V0::Models::ShipmentWindow) ? x : ::Io::Flow::V0::Models::ShipmentWindow.new(x))
|
12028
|
+
@currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
|
12029
|
+
@amount = HttpClient::Preconditions.assert_class('amount', opts.delete(:amount), Numeric)
|
12030
|
+
@fees = HttpClient::Preconditions.assert_class('fees', opts.delete(:fees), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::RatecardFee) ? x : ::Io::Flow::V0::Models::RatecardFee.from_json(x)) }
|
12031
|
+
@total = HttpClient::Preconditions.assert_class('total', opts.delete(:total), Numeric)
|
12032
|
+
end
|
12033
|
+
|
12034
|
+
def to_json
|
12035
|
+
JSON.dump(to_hash)
|
12036
|
+
end
|
12037
|
+
|
12038
|
+
def copy(incoming={})
|
12039
|
+
RatecardEstimate.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
12040
|
+
end
|
12041
|
+
|
12042
|
+
def to_hash
|
12043
|
+
{
|
12044
|
+
:service => service.to_hash,
|
12045
|
+
:shipment_window => shipment_window.to_hash,
|
12046
|
+
:currency => currency,
|
12047
|
+
:amount => amount,
|
12048
|
+
:fees => fees.map { |o| o.to_hash },
|
12049
|
+
:total => total
|
12050
|
+
}
|
12051
|
+
end
|
12052
|
+
|
12053
|
+
end
|
12054
|
+
|
12162
12055
|
class RatecardForm
|
12163
12056
|
|
12164
12057
|
attr_reader :effective_at, :number, :origination_zones, :service
|
@@ -12195,11 +12088,11 @@ module Io
|
|
12195
12088
|
# origin and destination zone
|
12196
12089
|
class RatecardLane
|
12197
12090
|
|
12198
|
-
attr_reader :id, :currency, :delivered_duty, :shipment_window, :destination, :dim_factor, :fees, :origin, :rates, :rounding, :weight_unit
|
12091
|
+
attr_reader :id, :currency, :delivered_duty, :shipment_window, :destination, :dim_factor, :fees, :origin, :service, :rates, :rounding, :weight_unit, :distance_unit
|
12199
12092
|
|
12200
12093
|
def initialize(incoming={})
|
12201
12094
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
12202
|
-
HttpClient::Preconditions.require_keys(opts, [:id, :currency, :delivered_duty, :shipment_window, :destination, :dim_factor, :fees, :origin, :rates, :rounding, :weight_unit], 'RatecardLane')
|
12095
|
+
HttpClient::Preconditions.require_keys(opts, [:id, :currency, :delivered_duty, :shipment_window, :destination, :dim_factor, :fees, :origin, :service, :rates, :rounding, :weight_unit, :distance_unit], 'RatecardLane')
|
12203
12096
|
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
12204
12097
|
@currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
|
12205
12098
|
@delivered_duty = (x = opts.delete(:delivered_duty); x.is_a?(::Io::Flow::V0::Models::DeliveredDuty) ? x : ::Io::Flow::V0::Models::DeliveredDuty.apply(x))
|
@@ -12208,9 +12101,11 @@ module Io
|
|
12208
12101
|
@dim_factor = HttpClient::Preconditions.assert_class('dim_factor', opts.delete(:dim_factor), Numeric)
|
12209
12102
|
@fees = HttpClient::Preconditions.assert_class('fees', opts.delete(:fees), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::RatecardFee) ? x : ::Io::Flow::V0::Models::RatecardFee.from_json(x)) }
|
12210
12103
|
@origin = (x = opts.delete(:origin); x.is_a?(::Io::Flow::V0::Models::Zone) ? x : ::Io::Flow::V0::Models::Zone.new(x))
|
12104
|
+
@service = (x = opts.delete(:service); x.is_a?(::Io::Flow::V0::Models::RatecardServiceReference) ? x : ::Io::Flow::V0::Models::RatecardServiceReference.new(x))
|
12211
12105
|
@rates = HttpClient::Preconditions.assert_class('rates', opts.delete(:rates), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::RatecardRate) ? x : ::Io::Flow::V0::Models::RatecardRate.new(x)) }
|
12212
12106
|
@rounding = (x = opts.delete(:rounding); x.is_a?(::Io::Flow::V0::Models::Rounding) ? x : ::Io::Flow::V0::Models::Rounding.new(x))
|
12213
12107
|
@weight_unit = (x = opts.delete(:weight_unit); x.is_a?(::Io::Flow::V0::Models::UnitOfMeasurement) ? x : ::Io::Flow::V0::Models::UnitOfMeasurement.apply(x))
|
12108
|
+
@distance_unit = (x = opts.delete(:distance_unit); x.is_a?(::Io::Flow::V0::Models::UnitOfMeasurement) ? x : ::Io::Flow::V0::Models::UnitOfMeasurement.apply(x))
|
12214
12109
|
end
|
12215
12110
|
|
12216
12111
|
def to_json
|
@@ -12231,9 +12126,11 @@ module Io
|
|
12231
12126
|
:dim_factor => dim_factor,
|
12232
12127
|
:fees => fees.map { |o| o.to_hash },
|
12233
12128
|
:origin => origin.to_hash,
|
12129
|
+
:service => service.to_hash,
|
12234
12130
|
:rates => rates.map { |o| o.to_hash },
|
12235
12131
|
:rounding => rounding.to_hash,
|
12236
|
-
:weight_unit => weight_unit.value
|
12132
|
+
:weight_unit => weight_unit.value,
|
12133
|
+
:distance_unit => distance_unit.value
|
12237
12134
|
}
|
12238
12135
|
end
|
12239
12136
|
|
@@ -12241,11 +12138,11 @@ module Io
|
|
12241
12138
|
|
12242
12139
|
class RatecardLaneForm
|
12243
12140
|
|
12244
|
-
attr_reader :currency, :destination, :shipment_window, :delivered_duty, :dim_factor, :fees, :origin, :rounding, :rates, :weight_unit
|
12141
|
+
attr_reader :currency, :destination, :shipment_window, :delivered_duty, :dim_factor, :fees, :origin, :rounding, :rates, :weight_unit, :distance_unit
|
12245
12142
|
|
12246
12143
|
def initialize(incoming={})
|
12247
12144
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
12248
|
-
HttpClient::Preconditions.require_keys(opts, [:currency, :destination, :shipment_window, :delivered_duty, :dim_factor, :fees, :origin, :rounding, :rates, :weight_unit], 'RatecardLaneForm')
|
12145
|
+
HttpClient::Preconditions.require_keys(opts, [:currency, :destination, :shipment_window, :delivered_duty, :dim_factor, :fees, :origin, :rounding, :rates, :weight_unit, :distance_unit], 'RatecardLaneForm')
|
12249
12146
|
@currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
|
12250
12147
|
@destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::Zone) ? x : ::Io::Flow::V0::Models::Zone.new(x))
|
12251
12148
|
@shipment_window = (x = opts.delete(:shipment_window); x.is_a?(::Io::Flow::V0::Models::ShipmentWindow) ? x : ::Io::Flow::V0::Models::ShipmentWindow.new(x))
|
@@ -12256,6 +12153,7 @@ module Io
|
|
12256
12153
|
@rounding = (x = opts.delete(:rounding); x.is_a?(::Io::Flow::V0::Models::Rounding) ? x : ::Io::Flow::V0::Models::Rounding.new(x))
|
12257
12154
|
@rates = HttpClient::Preconditions.assert_class('rates', opts.delete(:rates), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::RatecardRateForm) ? x : ::Io::Flow::V0::Models::RatecardRateForm.new(x)) }
|
12258
12155
|
@weight_unit = (x = opts.delete(:weight_unit); x.is_a?(::Io::Flow::V0::Models::UnitOfMeasurement) ? x : ::Io::Flow::V0::Models::UnitOfMeasurement.apply(x))
|
12156
|
+
@distance_unit = (x = opts.delete(:distance_unit); x.is_a?(::Io::Flow::V0::Models::UnitOfMeasurement) ? x : ::Io::Flow::V0::Models::UnitOfMeasurement.apply(x))
|
12259
12157
|
end
|
12260
12158
|
|
12261
12159
|
def to_json
|
@@ -12277,7 +12175,8 @@ module Io
|
|
12277
12175
|
:origin => origin.to_hash,
|
12278
12176
|
:rounding => rounding.to_hash,
|
12279
12177
|
:rates => rates.map { |o| o.to_hash },
|
12280
|
-
:weight_unit => weight_unit.value
|
12178
|
+
:weight_unit => weight_unit.value,
|
12179
|
+
:distance_unit => distance_unit.value
|
12281
12180
|
}
|
12282
12181
|
end
|
12283
12182
|
|
@@ -13230,16 +13129,16 @@ module Io
|
|
13230
13129
|
|
13231
13130
|
class SpotRate
|
13232
13131
|
|
13233
|
-
attr_reader :id, :
|
13132
|
+
attr_reader :id, :effective_at, :base, :target, :value
|
13234
13133
|
|
13235
13134
|
def initialize(incoming={})
|
13236
13135
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
13237
|
-
HttpClient::Preconditions.require_keys(opts, [:id, :
|
13136
|
+
HttpClient::Preconditions.require_keys(opts, [:id, :effective_at, :base, :target, :value], 'SpotRate')
|
13238
13137
|
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
13239
|
-
@
|
13138
|
+
@effective_at = HttpClient::Preconditions.assert_class('effective_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:effective_at)), DateTime)
|
13240
13139
|
@base = HttpClient::Preconditions.assert_class('base', opts.delete(:base), String)
|
13241
13140
|
@target = HttpClient::Preconditions.assert_class('target', opts.delete(:target), String)
|
13242
|
-
@
|
13141
|
+
@value = HttpClient::Preconditions.assert_class('value', HttpClient::Helper.to_big_decimal(opts.delete(:value)), BigDecimal)
|
13243
13142
|
end
|
13244
13143
|
|
13245
13144
|
def to_json
|
@@ -13253,10 +13152,10 @@ module Io
|
|
13253
13152
|
def to_hash
|
13254
13153
|
{
|
13255
13154
|
:id => id,
|
13256
|
-
:
|
13155
|
+
:effective_at => effective_at,
|
13257
13156
|
:base => base,
|
13258
13157
|
:target => target,
|
13259
|
-
:
|
13158
|
+
:value => value
|
13260
13159
|
}
|
13261
13160
|
end
|
13262
13161
|
|
@@ -13264,15 +13163,15 @@ module Io
|
|
13264
13163
|
|
13265
13164
|
class SpotRateForm
|
13266
13165
|
|
13267
|
-
attr_reader :
|
13166
|
+
attr_reader :effective_at, :base, :target, :value
|
13268
13167
|
|
13269
13168
|
def initialize(incoming={})
|
13270
13169
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
13271
|
-
HttpClient::Preconditions.require_keys(opts, [:
|
13272
|
-
@
|
13170
|
+
HttpClient::Preconditions.require_keys(opts, [:effective_at, :base, :target, :value], 'SpotRateForm')
|
13171
|
+
@effective_at = HttpClient::Preconditions.assert_class('effective_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:effective_at)), DateTime)
|
13273
13172
|
@base = HttpClient::Preconditions.assert_class('base', opts.delete(:base), String)
|
13274
13173
|
@target = HttpClient::Preconditions.assert_class('target', opts.delete(:target), String)
|
13275
|
-
@
|
13174
|
+
@value = HttpClient::Preconditions.assert_class('value', HttpClient::Helper.to_big_decimal(opts.delete(:value)), BigDecimal)
|
13276
13175
|
end
|
13277
13176
|
|
13278
13177
|
def to_json
|
@@ -13285,10 +13184,10 @@ module Io
|
|
13285
13184
|
|
13286
13185
|
def to_hash
|
13287
13186
|
{
|
13288
|
-
:
|
13187
|
+
:effective_at => effective_at,
|
13289
13188
|
:base => base,
|
13290
13189
|
:target => target,
|
13291
|
-
:
|
13190
|
+
:value => value
|
13292
13191
|
}
|
13293
13192
|
end
|
13294
13193
|
|