flowcommerce 0.0.91 → 0.0.92
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 +52 -55
- 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: 303d7b86a1796827450a2322c83add7bbe7b6251
|
4
|
+
data.tar.gz: e5bbf9b6e1ca64a1a2265da01413a147e48c27d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d943280cfa4f5837afaa684ae3ccb1e4b7aa9228f2f8edc47658e9b88d7d6d5eab4f2f899e6b4dca452a91f5e4d083b36c37e5a0bdad4f93b044f383f7324cc7
|
7
|
+
data.tar.gz: 7fc3831d4d613e5013f00a50678706179a4a93588a640e6465c13b17faf13cbdc1bea2079523bdbcee71c051c266e1b38bb4d79004c05d952124f1dcdd01b56c
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Generated by apidoc - http://www.apidoc.me
|
2
2
|
# Service version: 0.1.77
|
3
|
-
# apidoc:0.11.49 http://www.apidoc.me/flow/api/0.2.
|
3
|
+
# apidoc:0.11.49 http://www.apidoc.me/flow/api/0.2.8/ruby_client
|
4
4
|
|
5
5
|
require 'cgi'
|
6
6
|
require 'net/http'
|
@@ -25,7 +25,7 @@ module Io
|
|
25
25
|
|
26
26
|
BASE_URL = 'https://api.flow.io' unless defined?(Constants::BASE_URL)
|
27
27
|
NAMESPACE = 'io.flow.v0' unless defined?(Constants::NAMESPACE)
|
28
|
-
USER_AGENT = 'apidoc:0.11.49 http://www.apidoc.me/flow/api/0.2.
|
28
|
+
USER_AGENT = 'apidoc:0.11.49 http://www.apidoc.me/flow/api/0.2.8/ruby_client' unless defined?(Constants::USER_AGENT)
|
29
29
|
VERSION = '0.1.77' unless defined?(Constants::VERSION)
|
30
30
|
VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
|
31
31
|
|
@@ -2044,19 +2044,6 @@ module Io
|
|
2044
2044
|
nil
|
2045
2045
|
end
|
2046
2046
|
|
2047
|
-
# Updates are implemented as copy on write. This method is a convenience
|
2048
|
-
# method that will transactionally DELETE the card with the specified token,
|
2049
|
-
# then CREATE a new card with the data from this request. Note that this means
|
2050
|
-
# the returned credit card token will be DIFFERENT from the one used in the
|
2051
|
-
# request.
|
2052
|
-
def post_updates_by_token(organization, token, card_form)
|
2053
|
-
HttpClient::Preconditions.assert_class('organization', organization, String)
|
2054
|
-
HttpClient::Preconditions.assert_class('token', token, String)
|
2055
|
-
HttpClient::Preconditions.assert_class('card_form', card_form, ::Io::Flow::V0::Models::CardForm)
|
2056
|
-
r = @client.request("/#{CGI.escape(organization)}/cards/#{CGI.escape(token)}/updates").with_json(card_form.to_json).post
|
2057
|
-
::Io::Flow::V0::Models::Card.new(r)
|
2058
|
-
end
|
2059
|
-
|
2060
2047
|
# Creates a card from a one time nonce. Each nonce can be used at most once
|
2061
2048
|
# and you will receive a validation error if the nonce has already been
|
2062
2049
|
# exchanged.
|
@@ -3596,6 +3583,16 @@ module Io
|
|
3596
3583
|
::Io::Flow::V0::Models::OrganizationAuthorization.new(r)
|
3597
3584
|
end
|
3598
3585
|
|
3586
|
+
# For the authorized user and specific organization, if the user is an active
|
3587
|
+
# member of this organization, returns the authorization data used throughout
|
3588
|
+
# APIs at Flow, including the user's role in that organization and the
|
3589
|
+
# organization environment.
|
3590
|
+
def get_by_organization(organization)
|
3591
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
3592
|
+
r = @client.request("/organization-authorizations/#{CGI.escape(organization)}").get
|
3593
|
+
::Io::Flow::V0::Models::OrganizationAuthorization.new(r)
|
3594
|
+
end
|
3595
|
+
|
3599
3596
|
end
|
3600
3597
|
|
3601
3598
|
class PasswordResetForms
|
@@ -3899,41 +3896,41 @@ module Io
|
|
3899
3896
|
|
3900
3897
|
end
|
3901
3898
|
|
3902
|
-
class
|
3899
|
+
class Deminimis
|
3903
3900
|
|
3904
3901
|
module Types
|
3905
|
-
|
3902
|
+
DEMINIMIS_SIMPLE = 'deminimis_simple' unless defined?(DEMINIMIS_SIMPLE)
|
3906
3903
|
end
|
3907
3904
|
|
3908
3905
|
def initialize(incoming={})
|
3909
3906
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
3910
|
-
HttpClient::Preconditions.require_keys(opts, [:name], '
|
3907
|
+
HttpClient::Preconditions.require_keys(opts, [:name], 'Deminimis')
|
3911
3908
|
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
|
3912
3909
|
end
|
3913
3910
|
|
3914
3911
|
def subtype_to_hash
|
3915
|
-
raise 'Cannot serialize an instance of
|
3912
|
+
raise 'Cannot serialize an instance of deminimis directly - must use one of the specific types: deminimis_simple'
|
3916
3913
|
end
|
3917
3914
|
|
3918
3915
|
def to_hash
|
3919
3916
|
subtype_to_hash.merge(:discriminator => @name)
|
3920
3917
|
end
|
3921
3918
|
|
3922
|
-
def
|
3919
|
+
def Deminimis.from_json(hash)
|
3923
3920
|
HttpClient::Preconditions.assert_class('hash', hash, Hash)
|
3924
3921
|
discriminator = HttpClient::Helper.symbolize_keys(hash)[:discriminator].to_s.strip
|
3925
3922
|
if discriminator.empty?
|
3926
|
-
raise "Union type[
|
3923
|
+
raise "Union type[deminimis] requires a field named 'discriminator'"
|
3927
3924
|
end
|
3928
3925
|
case discriminator
|
3929
|
-
when Types::
|
3930
|
-
else
|
3926
|
+
when Types::DEMINIMIS_SIMPLE; DeminimisSimple.new(hash)
|
3927
|
+
else DeminimisUndefinedType.new(:name => discriminator)
|
3931
3928
|
end
|
3932
3929
|
end
|
3933
3930
|
|
3934
3931
|
end
|
3935
3932
|
|
3936
|
-
class
|
3933
|
+
class DeminimisUndefinedType < Deminimis
|
3937
3934
|
|
3938
3935
|
attr_reader :name
|
3939
3936
|
|
@@ -5002,19 +4999,19 @@ module Io
|
|
5002
4999
|
end
|
5003
5000
|
|
5004
5001
|
def AdjustmentReasonKey.ALL
|
5005
|
-
@@all ||= [AdjustmentReasonKey.
|
5002
|
+
@@all ||= [AdjustmentReasonKey.duty_deminimis, AdjustmentReasonKey.tax_deminimis]
|
5006
5003
|
end
|
5007
5004
|
|
5008
|
-
# If the duty
|
5005
|
+
# If the duty deminimis value has not been met, an adjustment may be made to
|
5009
5006
|
# offset any previously calculated duty.
|
5010
|
-
def AdjustmentReasonKey.
|
5011
|
-
@@
|
5007
|
+
def AdjustmentReasonKey.duty_deminimis
|
5008
|
+
@@_duty_deminimis ||= AdjustmentReasonKey.new('duty_deminimis')
|
5012
5009
|
end
|
5013
5010
|
|
5014
|
-
# If the tax
|
5011
|
+
# If the tax deminimis value has not been met, an adjustment may be made to
|
5015
5012
|
# offset any previously calculated tax.
|
5016
|
-
def AdjustmentReasonKey.
|
5017
|
-
@@
|
5013
|
+
def AdjustmentReasonKey.tax_deminimis
|
5014
|
+
@@_tax_deminimis ||= AdjustmentReasonKey.new('tax_deminimis')
|
5018
5015
|
end
|
5019
5016
|
|
5020
5017
|
def to_hash
|
@@ -6318,7 +6315,7 @@ module Io
|
|
6318
6315
|
end
|
6319
6316
|
|
6320
6317
|
def OrderPriceDetailComponentKey.ALL
|
6321
|
-
@@all ||= [OrderPriceDetailComponentKey.adjustment, OrderPriceDetailComponentKey.
|
6318
|
+
@@all ||= [OrderPriceDetailComponentKey.adjustment, OrderPriceDetailComponentKey.tax_deminimis, OrderPriceDetailComponentKey.duty_deminimis, OrderPriceDetailComponentKey.duties_item_price, OrderPriceDetailComponentKey.duties_freight, OrderPriceDetailComponentKey.duties_insurance, OrderPriceDetailComponentKey.vat_item_price, OrderPriceDetailComponentKey.vat_freight, OrderPriceDetailComponentKey.vat_insurance, OrderPriceDetailComponentKey.vat_duties_item_price, OrderPriceDetailComponentKey.vat_duties_freight, OrderPriceDetailComponentKey.vat_duties_insurance, OrderPriceDetailComponentKey.item_price, OrderPriceDetailComponentKey.rounding, OrderPriceDetailComponentKey.insurance, OrderPriceDetailComponentKey.shipping, OrderPriceDetailComponentKey.order_discount]
|
6322
6319
|
end
|
6323
6320
|
|
6324
6321
|
# A general purpose adjustment applied to the order.
|
@@ -6326,14 +6323,14 @@ module Io
|
|
6326
6323
|
@@_adjustment ||= OrderPriceDetailComponentKey.new('adjustment')
|
6327
6324
|
end
|
6328
6325
|
|
6329
|
-
# An adjustment based on whether the tax
|
6330
|
-
def OrderPriceDetailComponentKey.
|
6331
|
-
@@
|
6326
|
+
# An adjustment based on whether the tax deminimis applies to the order.
|
6327
|
+
def OrderPriceDetailComponentKey.tax_deminimis
|
6328
|
+
@@_tax_deminimis ||= OrderPriceDetailComponentKey.new('tax_deminimis')
|
6332
6329
|
end
|
6333
6330
|
|
6334
|
-
# An adjustment based on whether the duty
|
6335
|
-
def OrderPriceDetailComponentKey.
|
6336
|
-
@@
|
6331
|
+
# An adjustment based on whether the duty deminimis applies to the order.
|
6332
|
+
def OrderPriceDetailComponentKey.duty_deminimis
|
6333
|
+
@@_duty_deminimis ||= OrderPriceDetailComponentKey.new('duty_deminimis')
|
6337
6334
|
end
|
6338
6335
|
|
6339
6336
|
# The VAT owed on the price of the order's items, including any added margins
|
@@ -6511,7 +6508,7 @@ module Io
|
|
6511
6508
|
end
|
6512
6509
|
|
6513
6510
|
def PriceDetailComponentKey.ALL
|
6514
|
-
@@all ||= [PriceDetailComponentKey.base_price, PriceDetailComponentKey.discount, PriceDetailComponentKey.currency_margin, PriceDetailComponentKey.percent_item_margin, PriceDetailComponentKey.fixed_item_margin, PriceDetailComponentKey.duties_item_price, PriceDetailComponentKey.duties_added_margin, PriceDetailComponentKey.duties_rounding, PriceDetailComponentKey.
|
6511
|
+
@@all ||= [PriceDetailComponentKey.base_price, PriceDetailComponentKey.discount, PriceDetailComponentKey.currency_margin, PriceDetailComponentKey.percent_item_margin, PriceDetailComponentKey.fixed_item_margin, PriceDetailComponentKey.duties_item_price, PriceDetailComponentKey.duties_added_margin, PriceDetailComponentKey.duties_rounding, PriceDetailComponentKey.duties_deminimis, PriceDetailComponentKey.vat_item_price, PriceDetailComponentKey.vat_added_margin, PriceDetailComponentKey.vat_rounding, PriceDetailComponentKey.vat_duties_item_price, PriceDetailComponentKey.vat_duties_added_margin, PriceDetailComponentKey.vat_duties_rounding, PriceDetailComponentKey.vat_deminimis]
|
6515
6512
|
end
|
6516
6513
|
|
6517
6514
|
# The base price of the item.
|
@@ -6557,9 +6554,9 @@ module Io
|
|
6557
6554
|
@@_duties_rounding ||= PriceDetailComponentKey.new('duties_rounding')
|
6558
6555
|
end
|
6559
6556
|
|
6560
|
-
# An adjustment made if the item does not meet the duty
|
6561
|
-
def PriceDetailComponentKey.
|
6562
|
-
@@
|
6557
|
+
# An adjustment made if the item does not meet the duty deminimis rule.
|
6558
|
+
def PriceDetailComponentKey.duties_deminimis
|
6559
|
+
@@_duties_deminimis ||= PriceDetailComponentKey.new('duties_deminimis')
|
6563
6560
|
end
|
6564
6561
|
|
6565
6562
|
# The VAT owed on the post-discount base item price.
|
@@ -6594,9 +6591,9 @@ module Io
|
|
6594
6591
|
@@_vat_duties_rounding ||= PriceDetailComponentKey.new('vat_duties_rounding')
|
6595
6592
|
end
|
6596
6593
|
|
6597
|
-
# An adjustment made if the item does not meet the VAT
|
6598
|
-
def PriceDetailComponentKey.
|
6599
|
-
@@
|
6594
|
+
# An adjustment made if the item does not meet the VAT deminimis rule.
|
6595
|
+
def PriceDetailComponentKey.vat_deminimis
|
6596
|
+
@@_vat_deminimis ||= PriceDetailComponentKey.new('vat_deminimis')
|
6600
6597
|
end
|
6601
6598
|
|
6602
6599
|
def to_hash
|
@@ -10006,14 +10003,14 @@ module Io
|
|
10006
10003
|
|
10007
10004
|
end
|
10008
10005
|
|
10009
|
-
class
|
10006
|
+
class DeminimisSimple < Deminimis
|
10010
10007
|
|
10011
10008
|
attr_reader :value, :currency, :components, :minimum
|
10012
10009
|
|
10013
10010
|
def initialize(incoming={})
|
10014
|
-
super(:name =>
|
10011
|
+
super(:name => Deminimis::Types::DEMINIMIS_SIMPLE)
|
10015
10012
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
10016
|
-
HttpClient::Preconditions.require_keys(opts, [:value, :currency, :components, :minimum], '
|
10013
|
+
HttpClient::Preconditions.require_keys(opts, [:value, :currency, :components, :minimum], 'DeminimisSimple')
|
10017
10014
|
@value = HttpClient::Preconditions.assert_class('value', HttpClient::Helper.to_big_decimal(opts.delete(:value)), BigDecimal)
|
10018
10015
|
@currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
|
10019
10016
|
@components = HttpClient::Preconditions.assert_class('components', opts.delete(:components), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::LevyComponent) ? x : ::Io::Flow::V0::Models::LevyComponent.apply(x)) }
|
@@ -10025,7 +10022,7 @@ module Io
|
|
10025
10022
|
end
|
10026
10023
|
|
10027
10024
|
def copy(incoming={})
|
10028
|
-
|
10025
|
+
DeminimisSimple.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
10029
10026
|
end
|
10030
10027
|
|
10031
10028
|
def subtype_to_hash
|
@@ -10178,14 +10175,14 @@ module Io
|
|
10178
10175
|
# Represents a simple model of duties that apply to a given item / trade lane.
|
10179
10176
|
class Duty
|
10180
10177
|
|
10181
|
-
attr_reader :rate, :components, :
|
10178
|
+
attr_reader :rate, :components, :deminimis
|
10182
10179
|
|
10183
10180
|
def initialize(incoming={})
|
10184
10181
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
10185
10182
|
HttpClient::Preconditions.require_keys(opts, [:rate, :components], 'Duty')
|
10186
10183
|
@rate = HttpClient::Preconditions.assert_class('rate', HttpClient::Helper.to_big_decimal(opts.delete(:rate)), BigDecimal)
|
10187
10184
|
@components = HttpClient::Preconditions.assert_class('components', opts.delete(:components), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::LevyComponent) ? x : ::Io::Flow::V0::Models::LevyComponent.apply(x)) }
|
10188
|
-
@
|
10185
|
+
@deminimis = (x = opts.delete(:deminimis); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Deminimis) ? x : ::Io::Flow::V0::Models::Deminimis.from_json(x)))
|
10189
10186
|
end
|
10190
10187
|
|
10191
10188
|
def to_json
|
@@ -10200,7 +10197,7 @@ module Io
|
|
10200
10197
|
{
|
10201
10198
|
:rate => rate,
|
10202
10199
|
:components => components.map { |o| o.value },
|
10203
|
-
:
|
10200
|
+
:deminimis => deminimis.nil? ? nil : deminimis.to_hash
|
10204
10201
|
}
|
10205
10202
|
end
|
10206
10203
|
|
@@ -18124,7 +18121,7 @@ module Io
|
|
18124
18121
|
# Represents a simple model of taxes that apply to a given item / destination.
|
18125
18122
|
class Tax
|
18126
18123
|
|
18127
|
-
attr_reader :name, :rate, :components, :
|
18124
|
+
attr_reader :name, :rate, :components, :deminimis
|
18128
18125
|
|
18129
18126
|
def initialize(incoming={})
|
18130
18127
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
@@ -18132,7 +18129,7 @@ module Io
|
|
18132
18129
|
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
|
18133
18130
|
@rate = HttpClient::Preconditions.assert_class('rate', HttpClient::Helper.to_big_decimal(opts.delete(:rate)), BigDecimal)
|
18134
18131
|
@components = HttpClient::Preconditions.assert_class('components', opts.delete(:components), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::LevyComponent) ? x : ::Io::Flow::V0::Models::LevyComponent.apply(x)) }
|
18135
|
-
@
|
18132
|
+
@deminimis = (x = opts.delete(:deminimis); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Deminimis) ? x : ::Io::Flow::V0::Models::Deminimis.from_json(x)))
|
18136
18133
|
end
|
18137
18134
|
|
18138
18135
|
def to_json
|
@@ -18148,7 +18145,7 @@ module Io
|
|
18148
18145
|
:name => name,
|
18149
18146
|
:rate => rate,
|
18150
18147
|
:components => components.map { |o| o.value },
|
18151
|
-
:
|
18148
|
+
:deminimis => deminimis.nil? ? nil : deminimis.to_hash
|
18152
18149
|
}
|
18153
18150
|
end
|
18154
18151
|
|
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.92
|
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-10-
|
11
|
+
date: 2016-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|