flowcommerce 0.2.27 → 0.2.28

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ab1dc95023a303ed964f0adb8f9eac0c288aee79
4
- data.tar.gz: e9060b2c5cec7fb264ded0f1078af480d0b639de
3
+ metadata.gz: 704e1da0aaf9c48ff6c2d9ab1b46575b5ada172a
4
+ data.tar.gz: 4c6f357bf6e7d9e6f649ee357969f14a71b1a8f7
5
5
  SHA512:
6
- metadata.gz: a49f4edbeed946b35f6d488afce063554dda1ac75db5ede54b34761cd02fdf577e81bc54ee62cb57a3cd1be7aeeb8f16813910fd0e12c4e50128f7d0527288fb
7
- data.tar.gz: 14faba779f9dd5652ccfc7852d8f8ef139c0d99833f760b74f2e5e23efb076b0e5f74c230b648452ce6f3a56c3f2c2409c446bb959116193a7daacdc04e8dca8
6
+ metadata.gz: 7d069a977d6b7320fd01f974aa7a38ac7ded982a5df5249272b33ce09a2fc8a5c66b08aba13e14fda41ccb360b735d06b683d2b2b7f5fa83da7518f5284ef110
7
+ data.tar.gz: 058203920f30e2306c03a857c4551dcb1a5627eacd7a53aa9c93527a37d2b7978ad6e2d9072cff555b9f0ff05f5b98a3edd3965acf2627b3b449ff6abfe38496
@@ -1,6 +1,6 @@
1
1
  # Generated by API Builder - https://www.apibuilder.io
2
2
  # Service version: 0.3.65
3
- # apibuilder:0.12.61 https://app.apibuilder.io/flow/api/0.3.69/ruby_client
3
+ # apibuilder:0.12.61 https://app.apibuilder.io/flow/api/0.3.71/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 = 'apibuilder:0.12.61 https://app.apibuilder.io/flow/api/0.3.69/ruby_client' unless defined?(Constants::USER_AGENT)
28
+ USER_AGENT = 'apibuilder:0.12.61 https://app.apibuilder.io/flow/api/0.3.71/ruby_client' unless defined?(Constants::USER_AGENT)
29
29
  VERSION = '0.3.65' unless defined?(Constants::VERSION)
30
30
  VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
31
31
 
@@ -172,6 +172,10 @@ module Io
172
172
  @hs_codes ||= ::Io::Flow::V0::Clients::HsCodes.new(self)
173
173
  end
174
174
 
175
+ def tariff_codes
176
+ @tariff_codes ||= ::Io::Flow::V0::Clients::TariffCodes.new(self)
177
+ end
178
+
175
179
  def authorizations
176
180
  @authorizations ||= ::Io::Flow::V0::Clients::Authorizations.new(self)
177
181
  end
@@ -2259,6 +2263,35 @@ module Io
2259
2263
 
2260
2264
  end
2261
2265
 
2266
+ class TariffCodes
2267
+
2268
+ def initialize(client)
2269
+ @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
2270
+ end
2271
+
2272
+ # Search harmonization codes. Always paginated.
2273
+ def get(destination, incoming={})
2274
+ HttpClient::Preconditions.assert_class('destination', destination, String)
2275
+ opts = HttpClient::Helper.symbolize_keys(incoming)
2276
+ query = {
2277
+ :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
2278
+ :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
2279
+ :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "tariff_code" : x), String)
2280
+ }.delete_if { |k, v| v.nil? }
2281
+ r = @client.request("/harmonization/tariff-codes/#{CGI.escape(destination)}").with_query(query).get
2282
+ r.map { |x| ::Io::Flow::V0::Models::TariffCode.new(x) }
2283
+ end
2284
+
2285
+ # Returns information about a specific tariff code.
2286
+ def get_by_code(destination, code)
2287
+ HttpClient::Preconditions.assert_class('destination', destination, String)
2288
+ HttpClient::Preconditions.assert_class('code', code, String)
2289
+ r = @client.request("/harmonization/tariff-codes/#{CGI.escape(destination)}/#{CGI.escape(code)}").get
2290
+ ::Io::Flow::V0::Models::TariffCode.new(r)
2291
+ end
2292
+
2293
+ end
2294
+
2262
2295
  class Authorizations
2263
2296
 
2264
2297
  def initialize(client)
@@ -16895,12 +16928,12 @@ module Io
16895
16928
  # Result of looking up a code using a hint.
16896
16929
  class HintResult
16897
16930
 
16898
- attr_reader :hs10_code, :likelihood
16931
+ attr_reader :tariff_code, :likelihood
16899
16932
 
16900
16933
  def initialize(incoming={})
16901
16934
  opts = HttpClient::Helper.symbolize_keys(incoming)
16902
- HttpClient::Preconditions.require_keys(opts, [:hs10_code, :likelihood], 'HintResult')
16903
- @hs10_code = (x = opts.delete(:hs10_code); x.is_a?(::Io::Flow::V0::Models::Hs10Code) ? x : ::Io::Flow::V0::Models::Hs10Code.new(x))
16935
+ HttpClient::Preconditions.require_keys(opts, [:tariff_code, :likelihood], 'HintResult')
16936
+ @tariff_code = (x = opts.delete(:tariff_code); x.is_a?(::Io::Flow::V0::Models::TariffCode) ? x : ::Io::Flow::V0::Models::TariffCode.new(x))
16904
16937
  @likelihood = HttpClient::Preconditions.assert_class('likelihood', HttpClient::Helper.to_big_decimal(opts.delete(:likelihood)), BigDecimal)
16905
16938
  end
16906
16939
 
@@ -16914,7 +16947,7 @@ module Io
16914
16947
 
16915
16948
  def to_hash
16916
16949
  {
16917
- :hs10_code => hs10_code.to_hash,
16950
+ :tariff_code => tariff_code.to_hash,
16918
16951
  :likelihood => likelihood
16919
16952
  }
16920
16953
  end
@@ -16957,40 +16990,6 @@ module Io
16957
16990
 
16958
16991
  end
16959
16992
 
16960
- # Harmonized System codes for specific countries, up to 10 digits (HS-10). Not
16961
- # all countries use all 10 digits of precision.
16962
- class Hs10Code
16963
-
16964
- attr_reader :code, :destination, :parent, :description
16965
-
16966
- def initialize(incoming={})
16967
- opts = HttpClient::Helper.symbolize_keys(incoming)
16968
- HttpClient::Preconditions.require_keys(opts, [:code, :destination], 'Hs10Code')
16969
- @code = HttpClient::Preconditions.assert_class('code', opts.delete(:code), String)
16970
- @destination = HttpClient::Preconditions.assert_class('destination', opts.delete(:destination), String)
16971
- @parent = (x = opts.delete(:parent); x.nil? ? nil : HttpClient::Preconditions.assert_class('parent', x, String))
16972
- @description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
16973
- end
16974
-
16975
- def to_json
16976
- JSON.dump(to_hash)
16977
- end
16978
-
16979
- def copy(incoming={})
16980
- Hs10Code.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
16981
- end
16982
-
16983
- def to_hash
16984
- {
16985
- :code => code,
16986
- :destination => destination,
16987
- :parent => parent,
16988
- :description => description
16989
- }
16990
- end
16991
-
16992
- end
16993
-
16994
16993
  # Event raised whenever an HS-10 code is unassigned from an item
16995
16994
  class Hs10CodeDeleted < Event
16996
16995
 
@@ -22928,13 +22927,13 @@ module Io
22928
22927
 
22929
22928
  class PhraseHint
22930
22929
 
22931
- attr_reader :phrase, :hs10_code
22930
+ attr_reader :phrase, :tariff_code
22932
22931
 
22933
22932
  def initialize(incoming={})
22934
22933
  opts = HttpClient::Helper.symbolize_keys(incoming)
22935
- HttpClient::Preconditions.require_keys(opts, [:phrase, :hs10_code], 'PhraseHint')
22934
+ HttpClient::Preconditions.require_keys(opts, [:phrase, :tariff_code], 'PhraseHint')
22936
22935
  @phrase = HttpClient::Preconditions.assert_class('phrase', opts.delete(:phrase), String)
22937
- @hs10_code = (x = opts.delete(:hs10_code); x.is_a?(::Io::Flow::V0::Models::Hs10Code) ? x : ::Io::Flow::V0::Models::Hs10Code.new(x))
22936
+ @tariff_code = (x = opts.delete(:tariff_code); x.is_a?(::Io::Flow::V0::Models::TariffCode) ? x : ::Io::Flow::V0::Models::TariffCode.new(x))
22938
22937
  end
22939
22938
 
22940
22939
  def to_json
@@ -22948,7 +22947,7 @@ module Io
22948
22947
  def to_hash
22949
22948
  {
22950
22949
  :phrase => phrase,
22951
- :hs10_code => hs10_code.to_hash
22950
+ :tariff_code => tariff_code.to_hash
22952
22951
  }
22953
22952
  end
22954
22953
 
@@ -26571,6 +26570,39 @@ module Io
26571
26570
 
26572
26571
  end
26573
26572
 
26573
+ # Harmonized System codes for specific products imported into specific
26574
+ # countries. These are between 4 and 12 digits and are used to select the
26575
+ # correct duty rate.
26576
+ class TariffCode
26577
+
26578
+ attr_reader :code, :destination, :description
26579
+
26580
+ def initialize(incoming={})
26581
+ opts = HttpClient::Helper.symbolize_keys(incoming)
26582
+ HttpClient::Preconditions.require_keys(opts, [:code, :destination], 'TariffCode')
26583
+ @code = HttpClient::Preconditions.assert_class('code', opts.delete(:code), String)
26584
+ @destination = HttpClient::Preconditions.assert_class('destination', opts.delete(:destination), String)
26585
+ @description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
26586
+ end
26587
+
26588
+ def to_json
26589
+ JSON.dump(to_hash)
26590
+ end
26591
+
26592
+ def copy(incoming={})
26593
+ TariffCode.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
26594
+ end
26595
+
26596
+ def to_hash
26597
+ {
26598
+ :code => code,
26599
+ :destination => destination,
26600
+ :description => description
26601
+ }
26602
+ end
26603
+
26604
+ end
26605
+
26574
26606
  # Represents a simple model of taxes that apply to a given item / destination.
26575
26607
  class Tax
26576
26608
 
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.2.27
4
+ version: 0.2.28
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: 2017-08-11 00:00:00.000000000 Z
11
+ date: 2017-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json