flowcommerce 0.0.65 → 0.0.66
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 +85 -4
- 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: 3d160ee2c6a021a69a3d23aaa633a4d0debec30d
|
4
|
+
data.tar.gz: 6e8e6e9c094e6519eddbe13e5cf1fcca2ffa3036
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a75501ed693d75d7bd9708216cdb7c6e514b1d16d6f778709b1890a8ad14a94b6a721b6ca3c43fe7a1f1842a3bdcdebebb9db5e0a6199a1baef275c60b6d768b
|
7
|
+
data.tar.gz: c7f9c2952b8480a25b4553ec2f270291e61a7cb0a32358be3808dfa48d8218fb25de7ebe117e885ff34fc46c527998b41281ff25d29970ee68cbfbd1123281d8
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Generated by apidoc - http://www.apidoc.me
|
2
2
|
# Service version: 0.1.66
|
3
|
-
# apidoc:0.11.37 http://www.apidoc.me/flow/api/0.1.
|
3
|
+
# apidoc:0.11.37 http://www.apidoc.me/flow/api/0.1.67/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.37 http://www.apidoc.me/flow/api/0.1.
|
28
|
+
USER_AGENT = 'apidoc:0.11.37 http://www.apidoc.me/flow/api/0.1.67/ruby_client' unless defined?(Constants::USER_AGENT)
|
29
29
|
VERSION = '0.1.66' unless defined?(Constants::VERSION)
|
30
30
|
VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
|
31
31
|
|
@@ -2831,6 +2831,12 @@ module Io
|
|
2831
2831
|
r.map { |x| ::Io::Flow::V0::Models::Address.new(x) }
|
2832
2832
|
end
|
2833
2833
|
|
2834
|
+
def post_verifications(address)
|
2835
|
+
HttpClient::Preconditions.assert_class('address', address, ::Io::Flow::V0::Models::Address)
|
2836
|
+
r = @client.request("/addresses/verifications").with_json(address.to_json).post
|
2837
|
+
::Io::Flow::V0::Models::AddressVerification.new(r)
|
2838
|
+
end
|
2839
|
+
|
2834
2840
|
end
|
2835
2841
|
|
2836
2842
|
class CountryDefaults
|
@@ -6683,6 +6689,79 @@ module Io
|
|
6683
6689
|
|
6684
6690
|
end
|
6685
6691
|
|
6692
|
+
# A suggested address (usually providing more accurate information). This object
|
6693
|
+
# contains both the suggested address as well as metadata on which fields are
|
6694
|
+
# actually different
|
6695
|
+
class AddressSuggestion
|
6696
|
+
|
6697
|
+
attr_reader :address, :streets, :city, :province, :postal, :country
|
6698
|
+
|
6699
|
+
def initialize(incoming={})
|
6700
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
6701
|
+
HttpClient::Preconditions.require_keys(opts, [:address, :streets, :city, :province, :postal, :country], 'AddressSuggestion')
|
6702
|
+
@address = (x = opts.delete(:address); x.is_a?(::Io::Flow::V0::Models::Address) ? x : ::Io::Flow::V0::Models::Address.new(x))
|
6703
|
+
@streets = HttpClient::Preconditions.assert_boolean('streets', opts.delete(:streets))
|
6704
|
+
@city = HttpClient::Preconditions.assert_boolean('city', opts.delete(:city))
|
6705
|
+
@province = HttpClient::Preconditions.assert_boolean('province', opts.delete(:province))
|
6706
|
+
@postal = HttpClient::Preconditions.assert_boolean('postal', opts.delete(:postal))
|
6707
|
+
@country = HttpClient::Preconditions.assert_boolean('country', opts.delete(:country))
|
6708
|
+
end
|
6709
|
+
|
6710
|
+
def to_json
|
6711
|
+
JSON.dump(to_hash)
|
6712
|
+
end
|
6713
|
+
|
6714
|
+
def copy(incoming={})
|
6715
|
+
AddressSuggestion.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
6716
|
+
end
|
6717
|
+
|
6718
|
+
def to_hash
|
6719
|
+
{
|
6720
|
+
:address => address.to_hash,
|
6721
|
+
:streets => streets,
|
6722
|
+
:city => city,
|
6723
|
+
:province => province,
|
6724
|
+
:postal => postal,
|
6725
|
+
:country => country
|
6726
|
+
}
|
6727
|
+
end
|
6728
|
+
|
6729
|
+
end
|
6730
|
+
|
6731
|
+
# Address verification returns information on whether or not an address is valid
|
6732
|
+
# and deliverable - meaning carriers will accept this address. Also returns
|
6733
|
+
# suggestions for address correction, including data to highlight specific
|
6734
|
+
# fields to correct.
|
6735
|
+
class AddressVerification
|
6736
|
+
|
6737
|
+
attr_reader :address, :valid, :suggestions
|
6738
|
+
|
6739
|
+
def initialize(incoming={})
|
6740
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
6741
|
+
HttpClient::Preconditions.require_keys(opts, [:address, :valid], 'AddressVerification')
|
6742
|
+
@address = (x = opts.delete(:address); x.is_a?(::Io::Flow::V0::Models::Address) ? x : ::Io::Flow::V0::Models::Address.new(x))
|
6743
|
+
@valid = HttpClient::Preconditions.assert_boolean('valid', opts.delete(:valid))
|
6744
|
+
@suggestions = HttpClient::Preconditions.assert_class('suggestions', (x = opts.delete(:suggestions); x.nil? ? [] : x), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::AddressSuggestion) ? x : ::Io::Flow::V0::Models::AddressSuggestion.new(x)) }
|
6745
|
+
end
|
6746
|
+
|
6747
|
+
def to_json
|
6748
|
+
JSON.dump(to_hash)
|
6749
|
+
end
|
6750
|
+
|
6751
|
+
def copy(incoming={})
|
6752
|
+
AddressVerification.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
6753
|
+
end
|
6754
|
+
|
6755
|
+
def to_hash
|
6756
|
+
{
|
6757
|
+
:address => address.to_hash,
|
6758
|
+
:valid => valid,
|
6759
|
+
:suggestions => suggestions.map { |o| o.to_hash }
|
6760
|
+
}
|
6761
|
+
end
|
6762
|
+
|
6763
|
+
end
|
6764
|
+
|
6686
6765
|
# Rule outcome where shipping surfaced in quote is actual cost plus a predefined
|
6687
6766
|
# margin price
|
6688
6767
|
class AmountMargin < TierRuleOutcome
|
@@ -11937,7 +12016,7 @@ module Io
|
|
11937
12016
|
|
11938
12017
|
class Local
|
11939
12018
|
|
11940
|
-
attr_reader :experience, :prices, :rates, :spot_rates
|
12019
|
+
attr_reader :experience, :prices, :rates, :spot_rates, :status
|
11941
12020
|
|
11942
12021
|
def initialize(incoming={})
|
11943
12022
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
@@ -11946,6 +12025,7 @@ module Io
|
|
11946
12025
|
@prices = HttpClient::Preconditions.assert_class('prices', opts.delete(:prices), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::LocalizedPrice) ? x : ::Io::Flow::V0::Models::LocalizedPrice.new(x)) }
|
11947
12026
|
@rates = HttpClient::Preconditions.assert_class('rates', opts.delete(:rates), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::Rate) ? x : ::Io::Flow::V0::Models::Rate.new(x)) }
|
11948
12027
|
@spot_rates = HttpClient::Preconditions.assert_class('spot_rates', opts.delete(:spot_rates), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::SpotRate) ? x : ::Io::Flow::V0::Models::SpotRate.new(x)) }
|
12028
|
+
@status = (x = (x = opts.delete(:status); x.nil? ? "included" : x); x.is_a?(::Io::Flow::V0::Models::SubcatalogItemStatus) ? x : ::Io::Flow::V0::Models::SubcatalogItemStatus.apply(x))
|
11949
12029
|
end
|
11950
12030
|
|
11951
12031
|
def to_json
|
@@ -11961,7 +12041,8 @@ module Io
|
|
11961
12041
|
:experience => experience.to_hash,
|
11962
12042
|
:prices => prices.map { |o| o.to_hash },
|
11963
12043
|
:rates => rates.map { |o| o.to_hash },
|
11964
|
-
:spot_rates => spot_rates.map { |o| o.to_hash }
|
12044
|
+
:spot_rates => spot_rates.map { |o| o.to_hash },
|
12045
|
+
:status => status.value
|
11965
12046
|
}
|
11966
12047
|
end
|
11967
12048
|
|