flowcommerce 0.0.18 → 0.0.19
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 +196 -115
- 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: 3b92bf91f71330ca707d40dc304753db206910a1
|
4
|
+
data.tar.gz: 240876db6a950b588d838319faab4609d7e4e428
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19100dabe8a83d1fc692621bafcbfc4d2c7dbe6b6b04a76ff7819d4a7733c54bf87cd1b20596b0b2d6c213b6b96c05cf2db7183fda58411dbe6a25be52779d57
|
7
|
+
data.tar.gz: 579139b4d1ae1261bdcccd1c49118f1e2853795825e189027fe3bb852466cdca4e0e08bccaca56bd1c3c00e0b5bc016e6f231db32f39f9d3cfd1ce9897aeb10c
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Generated by apidoc - http://www.apidoc.me
|
2
|
-
# Service version: 0.0.
|
3
|
-
# apidoc:0.11.32 http://www.apidoc.me/flow/api/0.0.
|
2
|
+
# Service version: 0.0.60
|
3
|
+
# apidoc:0.11.32 http://www.apidoc.me/flow/api/0.0.60/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.32 http://www.apidoc.me/flow/api/0.0.
|
29
|
-
VERSION = '0.0.
|
28
|
+
USER_AGENT = 'apidoc:0.11.32 http://www.apidoc.me/flow/api/0.0.60/ruby_client' unless defined?(Constants::USER_AGENT)
|
29
|
+
VERSION = '0.0.60' unless defined?(Constants::VERSION)
|
30
30
|
VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
|
31
31
|
|
32
32
|
end
|
@@ -201,6 +201,10 @@ module Io
|
|
201
201
|
@tiers ||= ::Io::Flow::V0::Clients::Tiers.new(self)
|
202
202
|
end
|
203
203
|
|
204
|
+
def tier_defaults
|
205
|
+
@tier_defaults ||= ::Io::Flow::V0::Clients::TierDefaults.new(self)
|
206
|
+
end
|
207
|
+
|
204
208
|
def trackings
|
205
209
|
@trackings ||= ::Io::Flow::V0::Clients::Trackings.new(self)
|
206
210
|
end
|
@@ -688,16 +692,6 @@ module Io
|
|
688
692
|
nil
|
689
693
|
end
|
690
694
|
|
691
|
-
# Sync subcatalog
|
692
|
-
def post_events_by_id_and_event(organization, id, event, hash)
|
693
|
-
HttpClient::Preconditions.assert_class('organization', organization, String)
|
694
|
-
HttpClient::Preconditions.assert_class('id', id, String)
|
695
|
-
HttpClient::Preconditions.assert_class('event', event, String)
|
696
|
-
HttpClient::Preconditions.assert_class('hash', hash, Hash)
|
697
|
-
r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(id)}/events/#{CGI.escape(event)}").with_json(hash.to_json).post
|
698
|
-
nil
|
699
|
-
end
|
700
|
-
|
701
695
|
# Returns information about a specific subcatalog's settings.
|
702
696
|
def get_settings_by_id(organization, id)
|
703
697
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
@@ -878,19 +872,11 @@ module Io
|
|
878
872
|
:number => (x = opts.delete(:number); x.nil? ? nil : HttpClient::Preconditions.assert_class('number', x, Array).map { |v| HttpClient::Preconditions.assert_class('number', v, String) }),
|
879
873
|
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
880
874
|
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
881
|
-
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "
|
875
|
+
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String),
|
876
|
+
:expand => (x = opts.delete(:expand); x.nil? ? nil : HttpClient::Preconditions.assert_class('expand', x, Array).map { |v| HttpClient::Preconditions.assert_class('expand', v, String) })
|
882
877
|
}.delete_if { |k, v| v.nil? }
|
883
878
|
r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(subcatalog_id)}/items").with_query(query).get
|
884
|
-
r.map { |x| ::Io::Flow::V0::Models::
|
885
|
-
end
|
886
|
-
|
887
|
-
# Add subcatalog item
|
888
|
-
def post(organization, subcatalog_id, item_form)
|
889
|
-
HttpClient::Preconditions.assert_class('organization', organization, String)
|
890
|
-
HttpClient::Preconditions.assert_class('subcatalog_id', subcatalog_id, String)
|
891
|
-
HttpClient::Preconditions.assert_class('item_form', item_form, ::Io::Flow::V0::Models::ItemForm)
|
892
|
-
r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(subcatalog_id)}/items").with_json(item_form.to_json).post
|
893
|
-
::Io::Flow::V0::Models::Item.new(r)
|
879
|
+
r.map { |x| ::Io::Flow::V0::Models::SubcatalogItem.new(x) }
|
894
880
|
end
|
895
881
|
|
896
882
|
# Returns information about specific subcatalog items.
|
@@ -899,27 +885,7 @@ module Io
|
|
899
885
|
HttpClient::Preconditions.assert_class('subcatalog_id', subcatalog_id, String)
|
900
886
|
HttpClient::Preconditions.assert_class('number', number, String)
|
901
887
|
r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(subcatalog_id)}/items/#{CGI.escape(number)}").get
|
902
|
-
::Io::Flow::V0::Models::
|
903
|
-
end
|
904
|
-
|
905
|
-
# Update subcatalog item with the specified number, creating if it does not
|
906
|
-
# exist.
|
907
|
-
def put_by_number(organization, subcatalog_id, number, item_form)
|
908
|
-
HttpClient::Preconditions.assert_class('organization', organization, String)
|
909
|
-
HttpClient::Preconditions.assert_class('subcatalog_id', subcatalog_id, String)
|
910
|
-
HttpClient::Preconditions.assert_class('number', number, String)
|
911
|
-
HttpClient::Preconditions.assert_class('item_form', item_form, ::Io::Flow::V0::Models::ItemForm)
|
912
|
-
r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(subcatalog_id)}/items/#{CGI.escape(number)}").with_json(item_form.to_json).put
|
913
|
-
::Io::Flow::V0::Models::Item.new(r)
|
914
|
-
end
|
915
|
-
|
916
|
-
# Delete the subcatalog item with this number
|
917
|
-
def delete_by_number(organization, subcatalog_id, number)
|
918
|
-
HttpClient::Preconditions.assert_class('organization', organization, String)
|
919
|
-
HttpClient::Preconditions.assert_class('subcatalog_id', subcatalog_id, String)
|
920
|
-
HttpClient::Preconditions.assert_class('number', number, String)
|
921
|
-
r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(subcatalog_id)}/items/#{CGI.escape(number)}").delete
|
922
|
-
nil
|
888
|
+
::Io::Flow::V0::Models::SubcatalogItem.new(r)
|
923
889
|
end
|
924
890
|
|
925
891
|
# Provides visibility into recent changes of each object, including deletion
|
@@ -953,9 +919,7 @@ module Io
|
|
953
919
|
query = {
|
954
920
|
:id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
|
955
921
|
:key => (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, Array).map { |v| HttpClient::Preconditions.assert_class('key', v, String) }),
|
956
|
-
:
|
957
|
-
:position => (x = opts.delete(:position); x.nil? ? nil : HttpClient::Preconditions.assert_class('position', x, Array).map { |v| HttpClient::Preconditions.assert_class('position', v, Integer) }),
|
958
|
-
:subcatalog => (x = opts.delete(:subcatalog); x.nil? ? nil : HttpClient::Preconditions.assert_class('subcatalog', x, Array).map { |v| HttpClient::Preconditions.assert_class('subcatalog', v, String) }),
|
922
|
+
:subcatalog => (x = opts.delete(:subcatalog); x.nil? ? nil : HttpClient::Preconditions.assert_class('subcatalog', x, String)),
|
959
923
|
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
960
924
|
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
961
925
|
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "name" : x), String)
|
@@ -2359,6 +2323,56 @@ module Io
|
|
2359
2323
|
|
2360
2324
|
end
|
2361
2325
|
|
2326
|
+
class TierDefaults
|
2327
|
+
|
2328
|
+
def initialize(client)
|
2329
|
+
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
|
2330
|
+
end
|
2331
|
+
|
2332
|
+
def get(organization, incoming={})
|
2333
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
2334
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
2335
|
+
query = {
|
2336
|
+
:id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
|
2337
|
+
:experience => (x = opts.delete(:experience); x.nil? ? nil : HttpClient::Preconditions.assert_class('experience', x, Array).map { |v| HttpClient::Preconditions.assert_class('experience', v, String) }),
|
2338
|
+
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
2339
|
+
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
2340
|
+
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
|
2341
|
+
}.delete_if { |k, v| v.nil? }
|
2342
|
+
r = @client.request("/#{CGI.escape(organization)}/tier_defaults").with_query(query).get
|
2343
|
+
r.map { |x| ::Io::Flow::V0::Models::TierDefault.new(x) }
|
2344
|
+
end
|
2345
|
+
|
2346
|
+
def post(organization, tier_default_form)
|
2347
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
2348
|
+
HttpClient::Preconditions.assert_class('tier_default_form', tier_default_form, ::Io::Flow::V0::Models::TierDefaultForm)
|
2349
|
+
r = @client.request("/#{CGI.escape(organization)}/tier_defaults").with_json(tier_default_form.to_json).post
|
2350
|
+
::Io::Flow::V0::Models::TierDefault.new(r)
|
2351
|
+
end
|
2352
|
+
|
2353
|
+
def get_by_id(organization, id)
|
2354
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
2355
|
+
HttpClient::Preconditions.assert_class('id', id, String)
|
2356
|
+
r = @client.request("/#{CGI.escape(organization)}/tier_defaults/#{CGI.escape(id)}").get
|
2357
|
+
::Io::Flow::V0::Models::TierDefault.new(r)
|
2358
|
+
end
|
2359
|
+
|
2360
|
+
def get_versions(organization, incoming={})
|
2361
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
2362
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
2363
|
+
query = {
|
2364
|
+
:id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
|
2365
|
+
:tier_default => (x = opts.delete(:tier_default); x.nil? ? nil : HttpClient::Preconditions.assert_class('tier_default', x, Array).map { |v| HttpClient::Preconditions.assert_class('tier_default', v, String) }),
|
2366
|
+
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
2367
|
+
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
2368
|
+
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
|
2369
|
+
}.delete_if { |k, v| v.nil? }
|
2370
|
+
r = @client.request("/#{CGI.escape(organization)}/tier_defaults/versions").with_query(query).get
|
2371
|
+
r.map { |x| ::Io::Flow::V0::Models::TierDefaultVersion.new(x) }
|
2372
|
+
end
|
2373
|
+
|
2374
|
+
end
|
2375
|
+
|
2362
2376
|
class Trackings
|
2363
2377
|
|
2364
2378
|
def initialize(client)
|
@@ -5103,13 +5117,12 @@ module Io
|
|
5103
5117
|
# Rule outcome where shipping surfaced in quote is actual cost of the service
|
5104
5118
|
class AtCost < TierRuleOutcome
|
5105
5119
|
|
5106
|
-
attr_reader :
|
5120
|
+
attr_reader :ignore
|
5107
5121
|
|
5108
5122
|
def initialize(incoming={})
|
5109
5123
|
super(:name => TierRuleOutcome::Types::AT_COST)
|
5110
5124
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
5111
|
-
HttpClient::Preconditions.
|
5112
|
-
@at_cost = HttpClient::Preconditions.assert_class('at_cost', opts.delete(:at_cost), String)
|
5125
|
+
@ignore = (x = opts.delete(:ignore); x.nil? ? nil : HttpClient::Preconditions.assert_class('ignore', x, String))
|
5113
5126
|
end
|
5114
5127
|
|
5115
5128
|
def to_json
|
@@ -5122,7 +5135,7 @@ module Io
|
|
5122
5135
|
|
5123
5136
|
def subtype_to_hash
|
5124
5137
|
{
|
5125
|
-
:
|
5138
|
+
:ignore => ignore
|
5126
5139
|
}
|
5127
5140
|
end
|
5128
5141
|
|
@@ -5259,18 +5272,18 @@ module Io
|
|
5259
5272
|
# capture up to the amount of the authorization.
|
5260
5273
|
class Authorization
|
5261
5274
|
|
5262
|
-
attr_reader :id, :reference, :card, :amount, :currency, :customer, :
|
5275
|
+
attr_reader :id, :reference, :card, :amount, :currency, :customer, :attributes, :shipping, :ip, :cvv, :details
|
5263
5276
|
|
5264
5277
|
def initialize(incoming={})
|
5265
5278
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
5266
|
-
HttpClient::Preconditions.require_keys(opts, [:id, :card, :amount, :currency, :customer, :
|
5279
|
+
HttpClient::Preconditions.require_keys(opts, [:id, :card, :amount, :currency, :customer, :attributes, :details], 'Authorization')
|
5267
5280
|
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
5268
5281
|
@reference = (x = opts.delete(:reference); x.nil? ? nil : HttpClient::Preconditions.assert_class('reference', x, String))
|
5269
5282
|
@card = (x = opts.delete(:card); x.is_a?(::Io::Flow::V0::Models::CardReference) ? x : ::Io::Flow::V0::Models::CardReference.new(x))
|
5270
5283
|
@amount = HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(opts.delete(:amount)), BigDecimal)
|
5271
5284
|
@currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
|
5272
5285
|
@customer = (x = opts.delete(:customer); x.is_a?(::Io::Flow::V0::Models::Customer) ? x : ::Io::Flow::V0::Models::Customer.new(x))
|
5273
|
-
@
|
5286
|
+
@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 }
|
5274
5287
|
@shipping = (x = opts.delete(:shipping); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Location) ? x : ::Io::Flow::V0::Models::Location.new(x)))
|
5275
5288
|
@ip = (x = opts.delete(:ip); x.nil? ? nil : HttpClient::Preconditions.assert_class('ip', x, String))
|
5276
5289
|
@cvv = (x = opts.delete(:cvv); x.nil? ? nil : HttpClient::Preconditions.assert_class('cvv', x, String))
|
@@ -5293,7 +5306,7 @@ module Io
|
|
5293
5306
|
:amount => amount,
|
5294
5307
|
:currency => currency,
|
5295
5308
|
:customer => customer.to_hash,
|
5296
|
-
:
|
5309
|
+
:attributes => attributes,
|
5297
5310
|
:shipping => shipping.nil? ? nil : shipping.to_hash,
|
5298
5311
|
:ip => ip,
|
5299
5312
|
:cvv => cvv,
|
@@ -5369,7 +5382,7 @@ module Io
|
|
5369
5382
|
# capture up to the amount of the authorization.
|
5370
5383
|
class AuthorizationForm
|
5371
5384
|
|
5372
|
-
attr_reader :reference, :token, :amount, :currency, :customer, :cvv, :
|
5385
|
+
attr_reader :reference, :token, :amount, :currency, :customer, :cvv, :attributes, :shipping, :ip
|
5373
5386
|
|
5374
5387
|
def initialize(incoming={})
|
5375
5388
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
@@ -5380,7 +5393,7 @@ module Io
|
|
5380
5393
|
@currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
|
5381
5394
|
@customer = (x = opts.delete(:customer); x.is_a?(::Io::Flow::V0::Models::Customer) ? x : ::Io::Flow::V0::Models::Customer.new(x))
|
5382
5395
|
@cvv = (x = opts.delete(:cvv); x.nil? ? nil : HttpClient::Preconditions.assert_class('cvv', x, String))
|
5383
|
-
@
|
5396
|
+
@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 })
|
5384
5397
|
@shipping = (x = opts.delete(:shipping); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Location) ? x : ::Io::Flow::V0::Models::Location.new(x)))
|
5385
5398
|
@ip = (x = opts.delete(:ip); x.nil? ? nil : HttpClient::Preconditions.assert_class('ip', x, String))
|
5386
5399
|
end
|
@@ -5401,7 +5414,7 @@ module Io
|
|
5401
5414
|
:currency => currency,
|
5402
5415
|
:customer => customer.to_hash,
|
5403
5416
|
:cvv => cvv,
|
5404
|
-
:
|
5417
|
+
:attributes => attributes.nil? ? nil : attributes,
|
5405
5418
|
:shipping => shipping.nil? ? nil : shipping.to_hash,
|
5406
5419
|
:ip => ip
|
5407
5420
|
}
|
@@ -6766,7 +6779,7 @@ module Io
|
|
6766
6779
|
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
6767
6780
|
@cost = (x = opts.delete(:cost); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x))
|
6768
6781
|
@price = (x = opts.delete(:price); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x))
|
6769
|
-
@service = (x = opts.delete(:service); x.is_a?(::Io::Flow::V0::Models::
|
6782
|
+
@service = (x = opts.delete(:service); x.is_a?(::Io::Flow::V0::Models::ServiceSummary) ? x : ::Io::Flow::V0::Models::ServiceSummary.new(x))
|
6770
6783
|
@tier = (x = opts.delete(:tier); x.is_a?(::Io::Flow::V0::Models::TierReference) ? x : ::Io::Flow::V0::Models::TierReference.new(x))
|
6771
6784
|
@window = (x = opts.delete(:window); x.is_a?(::Io::Flow::V0::Models::DatetimeRange) ? x : ::Io::Flow::V0::Models::DatetimeRange.new(x))
|
6772
6785
|
end
|
@@ -7511,47 +7524,15 @@ module Io
|
|
7511
7524
|
|
7512
7525
|
end
|
7513
7526
|
|
7514
|
-
# Flow internal model containing an item's origin and classified harmonization
|
7515
|
-
# code (6 digit)
|
7516
|
-
class Flow
|
7517
|
-
|
7518
|
-
attr_reader :origin, :function, :hs6
|
7519
|
-
|
7520
|
-
def initialize(incoming={})
|
7521
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
7522
|
-
@origin = (x = opts.delete(:origin); x.nil? ? nil : HttpClient::Preconditions.assert_class('origin', x, String))
|
7523
|
-
@function = (x = opts.delete(:function); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::ExpandableFunction) ? x : ::Io::Flow::V0::Models::ExpandableFunction.from_json(x)))
|
7524
|
-
@hs6 = (x = opts.delete(:hs6); x.nil? ? nil : HttpClient::Preconditions.assert_class('hs6', x, String))
|
7525
|
-
end
|
7526
|
-
|
7527
|
-
def to_json
|
7528
|
-
JSON.dump(to_hash)
|
7529
|
-
end
|
7530
|
-
|
7531
|
-
def copy(incoming={})
|
7532
|
-
Flow.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
7533
|
-
end
|
7534
|
-
|
7535
|
-
def to_hash
|
7536
|
-
{
|
7537
|
-
:origin => origin,
|
7538
|
-
:function => function.nil? ? nil : function.to_hash,
|
7539
|
-
:hs6 => hs6
|
7540
|
-
}
|
7541
|
-
end
|
7542
|
-
|
7543
|
-
end
|
7544
|
-
|
7545
7527
|
# Rule outcome where shipping surfaced in quote is free
|
7546
7528
|
class FreeShipping < TierRuleOutcome
|
7547
7529
|
|
7548
|
-
attr_reader :
|
7530
|
+
attr_reader :ignore
|
7549
7531
|
|
7550
7532
|
def initialize(incoming={})
|
7551
7533
|
super(:name => TierRuleOutcome::Types::FREE_SHIPPING)
|
7552
7534
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
7553
|
-
HttpClient::Preconditions.
|
7554
|
-
@free_shipping = HttpClient::Preconditions.assert_class('free_shipping', opts.delete(:free_shipping), String)
|
7535
|
+
@ignore = (x = opts.delete(:ignore); x.nil? ? nil : HttpClient::Preconditions.assert_class('ignore', x, String))
|
7555
7536
|
end
|
7556
7537
|
|
7557
7538
|
def to_json
|
@@ -7564,7 +7545,7 @@ module Io
|
|
7564
7545
|
|
7565
7546
|
def subtype_to_hash
|
7566
7547
|
{
|
7567
|
-
:
|
7548
|
+
:ignore => ignore
|
7568
7549
|
}
|
7569
7550
|
end
|
7570
7551
|
|
@@ -7856,7 +7837,7 @@ module Io
|
|
7856
7837
|
# assigned, codes will be available via the hs6 and hs10 resources
|
7857
7838
|
class HarmonizedItem
|
7858
7839
|
|
7859
|
-
attr_reader :id, :number, :name, :description, :categories, :
|
7840
|
+
attr_reader :id, :number, :name, :description, :categories, :attributes
|
7860
7841
|
|
7861
7842
|
def initialize(incoming={})
|
7862
7843
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
@@ -7866,7 +7847,7 @@ module Io
|
|
7866
7847
|
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
|
7867
7848
|
@description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
|
7868
7849
|
@categories = HttpClient::Preconditions.assert_class('categories', (x = opts.delete(:categories); x.nil? ? [] : x), Array).map { |v| HttpClient::Preconditions.assert_class('categories', v, String) }
|
7869
|
-
@
|
7850
|
+
@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 }
|
7870
7851
|
end
|
7871
7852
|
|
7872
7853
|
def to_json
|
@@ -7884,7 +7865,7 @@ module Io
|
|
7884
7865
|
:name => name,
|
7885
7866
|
:description => description,
|
7886
7867
|
:categories => categories,
|
7887
|
-
:
|
7868
|
+
:attributes => attributes
|
7888
7869
|
}
|
7889
7870
|
end
|
7890
7871
|
|
@@ -7991,7 +7972,7 @@ module Io
|
|
7991
7972
|
|
7992
7973
|
class HarmonizedItemForm
|
7993
7974
|
|
7994
|
-
attr_reader :name, :number, :categories, :description, :
|
7975
|
+
attr_reader :name, :number, :categories, :description, :attributes
|
7995
7976
|
|
7996
7977
|
def initialize(incoming={})
|
7997
7978
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
@@ -8000,7 +7981,7 @@ module Io
|
|
8000
7981
|
@number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
|
8001
7982
|
@categories = (x = opts.delete(:categories); x.nil? ? nil : HttpClient::Preconditions.assert_class('categories', x, Array).map { |v| HttpClient::Preconditions.assert_class('categories', v, String) })
|
8002
7983
|
@description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
|
8003
|
-
@
|
7984
|
+
@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 })
|
8004
7985
|
end
|
8005
7986
|
|
8006
7987
|
def to_json
|
@@ -8017,7 +7998,7 @@ module Io
|
|
8017
7998
|
:number => number,
|
8018
7999
|
:categories => categories.nil? ? nil : categories,
|
8019
8000
|
:description => description,
|
8020
|
-
:
|
8001
|
+
:attributes => attributes.nil? ? nil : attributes
|
8021
8002
|
}
|
8022
8003
|
end
|
8023
8004
|
|
@@ -8025,7 +8006,7 @@ module Io
|
|
8025
8006
|
|
8026
8007
|
class HarmonizedItemPutForm
|
8027
8008
|
|
8028
|
-
attr_reader :name, :categories, :description, :
|
8009
|
+
attr_reader :name, :categories, :description, :attributes
|
8029
8010
|
|
8030
8011
|
def initialize(incoming={})
|
8031
8012
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
@@ -8033,7 +8014,7 @@ module Io
|
|
8033
8014
|
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
|
8034
8015
|
@categories = (x = opts.delete(:categories); x.nil? ? nil : HttpClient::Preconditions.assert_class('categories', x, Array).map { |v| HttpClient::Preconditions.assert_class('categories', v, String) })
|
8035
8016
|
@description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
|
8036
|
-
@
|
8017
|
+
@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 })
|
8037
8018
|
end
|
8038
8019
|
|
8039
8020
|
def to_json
|
@@ -8049,7 +8030,7 @@ module Io
|
|
8049
8030
|
:name => name,
|
8050
8031
|
:categories => categories.nil? ? nil : categories,
|
8051
8032
|
:description => description,
|
8052
|
-
:
|
8033
|
+
:attributes => attributes.nil? ? nil : attributes
|
8053
8034
|
}
|
8054
8035
|
end
|
8055
8036
|
|
@@ -8877,7 +8858,7 @@ module Io
|
|
8877
8858
|
# many clients, this will map to a Sku.
|
8878
8859
|
class Item
|
8879
8860
|
|
8880
|
-
attr_reader :id, :number, :locale, :name, :price, :categories, :description, :attributes, :dimensions, :images, :
|
8861
|
+
attr_reader :id, :number, :locale, :name, :price, :categories, :description, :attributes, :dimensions, :images, :local
|
8881
8862
|
|
8882
8863
|
def initialize(incoming={})
|
8883
8864
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
@@ -8892,7 +8873,6 @@ module Io
|
|
8892
8873
|
@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 }
|
8893
8874
|
@dimensions = (x = opts.delete(:dimensions); x.is_a?(::Io::Flow::V0::Models::Dimensions) ? x : ::Io::Flow::V0::Models::Dimensions.new(x))
|
8894
8875
|
@images = HttpClient::Preconditions.assert_class('images', (x = opts.delete(:images); x.nil? ? [] : x), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::Image) ? x : ::Io::Flow::V0::Models::Image.new(x)) }
|
8895
|
-
@flow = (x = opts.delete(:flow); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Flow) ? x : ::Io::Flow::V0::Models::Flow.new(x)))
|
8896
8876
|
@local = (x = opts.delete(:local); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Local) ? x : ::Io::Flow::V0::Models::Local.new(x)))
|
8897
8877
|
end
|
8898
8878
|
|
@@ -8916,7 +8896,6 @@ module Io
|
|
8916
8896
|
:attributes => attributes,
|
8917
8897
|
:dimensions => dimensions.to_hash,
|
8918
8898
|
:images => images.map { |o| o.to_hash },
|
8919
|
-
:flow => flow.nil? ? nil : flow.to_hash,
|
8920
8899
|
:local => local.nil? ? nil : local.to_hash
|
8921
8900
|
}
|
8922
8901
|
end
|
@@ -10672,14 +10651,15 @@ module Io
|
|
10672
10651
|
# that delivery
|
10673
10652
|
class Quote
|
10674
10653
|
|
10675
|
-
attr_reader :id, :destination, :deliveries
|
10654
|
+
attr_reader :id, :destination, :deliveries, :selections
|
10676
10655
|
|
10677
10656
|
def initialize(incoming={})
|
10678
10657
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
10679
|
-
HttpClient::Preconditions.require_keys(opts, [:id, :destination, :deliveries], 'Quote')
|
10658
|
+
HttpClient::Preconditions.require_keys(opts, [:id, :destination, :deliveries, :selections], 'Quote')
|
10680
10659
|
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
10681
10660
|
@destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::Address) ? x : ::Io::Flow::V0::Models::Address.new(x))
|
10682
10661
|
@deliveries = HttpClient::Preconditions.assert_class('deliveries', opts.delete(:deliveries), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::Delivery) ? x : ::Io::Flow::V0::Models::Delivery.new(x)) }
|
10662
|
+
@selections = HttpClient::Preconditions.assert_class('selections', opts.delete(:selections), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::DeliveryOptionReference) ? x : ::Io::Flow::V0::Models::DeliveryOptionReference.new(x)) }
|
10683
10663
|
end
|
10684
10664
|
|
10685
10665
|
def to_json
|
@@ -10694,7 +10674,8 @@ module Io
|
|
10694
10674
|
{
|
10695
10675
|
:id => id,
|
10696
10676
|
:destination => destination.to_hash,
|
10697
|
-
:deliveries => deliveries.map { |o| o.to_hash }
|
10677
|
+
:deliveries => deliveries.map { |o| o.to_hash },
|
10678
|
+
:selections => selections.map { |o| o.to_hash }
|
10698
10679
|
}
|
10699
10680
|
end
|
10700
10681
|
|
@@ -11249,7 +11230,7 @@ module Io
|
|
11249
11230
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
11250
11231
|
HttpClient::Preconditions.require_keys(opts, [:id, :service, :tracking_number], 'ShipmentLabel')
|
11251
11232
|
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
11252
|
-
@service = (x = opts.delete(:service); x.is_a?(::Io::Flow::V0::Models::
|
11233
|
+
@service = (x = opts.delete(:service); x.is_a?(::Io::Flow::V0::Models::ServiceSummary) ? x : ::Io::Flow::V0::Models::ServiceSummary.new(x))
|
11253
11234
|
@tracking_number = HttpClient::Preconditions.assert_class('tracking_number', opts.delete(:tracking_number), String)
|
11254
11235
|
@window = (x = opts.delete(:window); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::DatetimeRange) ? x : ::Io::Flow::V0::Models::DatetimeRange.new(x)))
|
11255
11236
|
@pdf = (x = opts.delete(:pdf); x.nil? ? nil : HttpClient::Preconditions.assert_class('pdf', x, String))
|
@@ -11556,14 +11537,17 @@ module Io
|
|
11556
11537
|
|
11557
11538
|
end
|
11558
11539
|
|
11540
|
+
# Represents information specific to an item in a given subcatalog
|
11559
11541
|
class SubcatalogItem
|
11560
11542
|
|
11561
|
-
attr_reader :id
|
11543
|
+
attr_reader :id, :item, :function
|
11562
11544
|
|
11563
11545
|
def initialize(incoming={})
|
11564
11546
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
11565
|
-
HttpClient::Preconditions.require_keys(opts, [:id], 'SubcatalogItem')
|
11547
|
+
HttpClient::Preconditions.require_keys(opts, [:id, :item], 'SubcatalogItem')
|
11566
11548
|
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
11549
|
+
@item = (x = opts.delete(:item); x.is_a?(::Io::Flow::V0::Models::Item) ? x : ::Io::Flow::V0::Models::Item.new(x))
|
11550
|
+
@function = (x = opts.delete(:function); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::ExpandableFunction) ? x : ::Io::Flow::V0::Models::ExpandableFunction.from_json(x)))
|
11567
11551
|
end
|
11568
11552
|
|
11569
11553
|
def to_json
|
@@ -11576,7 +11560,9 @@ module Io
|
|
11576
11560
|
|
11577
11561
|
def to_hash
|
11578
11562
|
{
|
11579
|
-
:id => id
|
11563
|
+
:id => id,
|
11564
|
+
:item => item.to_hash,
|
11565
|
+
:function => function.nil? ? nil : function.to_hash
|
11580
11566
|
}
|
11581
11567
|
end
|
11582
11568
|
|
@@ -11794,6 +11780,101 @@ module Io
|
|
11794
11780
|
|
11795
11781
|
end
|
11796
11782
|
|
11783
|
+
# Grouping of shipping tiers by experience to provide logical default
|
11784
|
+
# functionality.
|
11785
|
+
class TierDefault
|
11786
|
+
|
11787
|
+
attr_reader :id, :default_tier, :experience
|
11788
|
+
|
11789
|
+
def initialize(incoming={})
|
11790
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
11791
|
+
HttpClient::Preconditions.require_keys(opts, [:id, :default_tier, :experience], 'TierDefault')
|
11792
|
+
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
11793
|
+
@default_tier = (x = opts.delete(:default_tier); x.is_a?(::Io::Flow::V0::Models::TierReference) ? x : ::Io::Flow::V0::Models::TierReference.new(x))
|
11794
|
+
@experience = (x = opts.delete(:experience); x.is_a?(::Io::Flow::V0::Models::FulfillmentExperienceReference) ? x : ::Io::Flow::V0::Models::FulfillmentExperienceReference.new(x))
|
11795
|
+
end
|
11796
|
+
|
11797
|
+
def to_json
|
11798
|
+
JSON.dump(to_hash)
|
11799
|
+
end
|
11800
|
+
|
11801
|
+
def copy(incoming={})
|
11802
|
+
TierDefault.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
11803
|
+
end
|
11804
|
+
|
11805
|
+
def to_hash
|
11806
|
+
{
|
11807
|
+
:id => id,
|
11808
|
+
:default_tier => default_tier.to_hash,
|
11809
|
+
:experience => experience.to_hash
|
11810
|
+
}
|
11811
|
+
end
|
11812
|
+
|
11813
|
+
end
|
11814
|
+
|
11815
|
+
# Form to set the defualt tier for a given experience
|
11816
|
+
class TierDefaultForm
|
11817
|
+
|
11818
|
+
attr_reader :default_tier, :currency, :experience
|
11819
|
+
|
11820
|
+
def initialize(incoming={})
|
11821
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
11822
|
+
HttpClient::Preconditions.require_keys(opts, [:default_tier, :currency, :experience], 'TierDefaultForm')
|
11823
|
+
@default_tier = HttpClient::Preconditions.assert_class('default_tier', opts.delete(:default_tier), String)
|
11824
|
+
@currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
|
11825
|
+
@experience = HttpClient::Preconditions.assert_class('experience', opts.delete(:experience), String)
|
11826
|
+
end
|
11827
|
+
|
11828
|
+
def to_json
|
11829
|
+
JSON.dump(to_hash)
|
11830
|
+
end
|
11831
|
+
|
11832
|
+
def copy(incoming={})
|
11833
|
+
TierDefaultForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
11834
|
+
end
|
11835
|
+
|
11836
|
+
def to_hash
|
11837
|
+
{
|
11838
|
+
:default_tier => default_tier,
|
11839
|
+
:currency => currency,
|
11840
|
+
:experience => experience
|
11841
|
+
}
|
11842
|
+
end
|
11843
|
+
|
11844
|
+
end
|
11845
|
+
|
11846
|
+
class TierDefaultVersion
|
11847
|
+
|
11848
|
+
attr_reader :id, :timestamp, :type, :tier_default
|
11849
|
+
|
11850
|
+
def initialize(incoming={})
|
11851
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
11852
|
+
HttpClient::Preconditions.require_keys(opts, [:id, :timestamp, :type, :tier_default], 'TierDefaultVersion')
|
11853
|
+
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
11854
|
+
@timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
|
11855
|
+
@type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::ChangeType) ? x : ::Io::Flow::V0::Models::ChangeType.apply(x))
|
11856
|
+
@tier_default = (x = opts.delete(:tier_default); x.is_a?(::Io::Flow::V0::Models::TierDefault) ? x : ::Io::Flow::V0::Models::TierDefault.new(x))
|
11857
|
+
end
|
11858
|
+
|
11859
|
+
def to_json
|
11860
|
+
JSON.dump(to_hash)
|
11861
|
+
end
|
11862
|
+
|
11863
|
+
def copy(incoming={})
|
11864
|
+
TierDefaultVersion.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
11865
|
+
end
|
11866
|
+
|
11867
|
+
def to_hash
|
11868
|
+
{
|
11869
|
+
:id => id,
|
11870
|
+
:timestamp => timestamp,
|
11871
|
+
:type => type.value,
|
11872
|
+
:tier_default => tier_default.to_hash
|
11873
|
+
}
|
11874
|
+
end
|
11875
|
+
|
11876
|
+
end
|
11877
|
+
|
11797
11878
|
# Service shipping tier available in this tier gorup. e.g. Standard tier,
|
11798
11879
|
# Express tier, Economy tier
|
11799
11880
|
class TierForm
|
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.19
|
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-07-
|
11
|
+
date: 2016-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|