flowcommerce 0.0.33 → 0.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/flow_commerce/flow_api_v0_client.rb +8 -196
- 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: 1496684d9043683b8d9e268ace9c6d920af0f5a7
|
4
|
+
data.tar.gz: b92a5d013b47c969ece4255f874c20281668d182
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97f4c40351b61fc38f1237c1942ecf6e68cc2fad29b3a8526d8d2c20b9a406b2827b8dbcb41e9e0b282f439904809043fa49b9ab9f731bfc9a3febfb446c507c
|
7
|
+
data.tar.gz: 33804fffd141e10a899e681ce54baf77d1758f5f933ef2312f8d69d43e92b1d2078dea1f104734663a297450ea1f2ffc7a19e30be768f891716dfdb16ee1cead
|
@@ -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.100
|
3
|
+
# apidoc:0.11.33 http://www.apidoc.me/flow/api/0.1.0/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.1.0/ruby_client' unless defined?(Constants::USER_AGENT)
|
29
|
+
VERSION = '0.0.100' unless defined?(Constants::VERSION)
|
30
30
|
VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
|
31
31
|
|
32
32
|
end
|
@@ -1926,44 +1926,12 @@ module Io
|
|
1926
1926
|
r.map { |x| ::Io::Flow::V0::Models::Carrier.new(x) }
|
1927
1927
|
end
|
1928
1928
|
|
1929
|
-
def post(carrier_form)
|
1930
|
-
HttpClient::Preconditions.assert_class('carrier_form', carrier_form, ::Io::Flow::V0::Models::CarrierForm)
|
1931
|
-
r = @client.request("/carriers").with_json(carrier_form.to_json).post
|
1932
|
-
::Io::Flow::V0::Models::Carrier.new(r)
|
1933
|
-
end
|
1934
|
-
|
1935
1929
|
def get_by_id(id)
|
1936
1930
|
HttpClient::Preconditions.assert_class('id', id, String)
|
1937
1931
|
r = @client.request("/carriers/#{CGI.escape(id)}").get
|
1938
1932
|
::Io::Flow::V0::Models::Carrier.new(r)
|
1939
1933
|
end
|
1940
1934
|
|
1941
|
-
def put_by_id(id, carrier_form)
|
1942
|
-
HttpClient::Preconditions.assert_class('id', id, String)
|
1943
|
-
HttpClient::Preconditions.assert_class('carrier_form', carrier_form, ::Io::Flow::V0::Models::CarrierForm)
|
1944
|
-
r = @client.request("/carriers/#{CGI.escape(id)}").with_json(carrier_form.to_json).put
|
1945
|
-
::Io::Flow::V0::Models::Carrier.new(r)
|
1946
|
-
end
|
1947
|
-
|
1948
|
-
def delete_by_id(id)
|
1949
|
-
HttpClient::Preconditions.assert_class('id', id, String)
|
1950
|
-
r = @client.request("/carriers/#{CGI.escape(id)}").delete
|
1951
|
-
nil
|
1952
|
-
end
|
1953
|
-
|
1954
|
-
def get_versions(incoming={})
|
1955
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
1956
|
-
query = {
|
1957
|
-
:id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
|
1958
|
-
:carrier => (x = opts.delete(:carrier); x.nil? ? nil : HttpClient::Preconditions.assert_class('carrier', x, Array).map { |v| HttpClient::Preconditions.assert_class('carrier', v, String) }),
|
1959
|
-
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
1960
|
-
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
1961
|
-
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
|
1962
|
-
}.delete_if { |k, v| v.nil? }
|
1963
|
-
r = @client.request("/carriers/versions").with_query(query).get
|
1964
|
-
r.map { |x| ::Io::Flow::V0::Models::CarrierVersion.new(x) }
|
1965
|
-
end
|
1966
|
-
|
1967
1935
|
end
|
1968
1936
|
|
1969
1937
|
class Centers
|
@@ -2352,44 +2320,12 @@ module Io
|
|
2352
2320
|
r.map { |x| ::Io::Flow::V0::Models::Service.new(x) }
|
2353
2321
|
end
|
2354
2322
|
|
2355
|
-
def post(service_form)
|
2356
|
-
HttpClient::Preconditions.assert_class('service_form', service_form, ::Io::Flow::V0::Models::ServiceForm)
|
2357
|
-
r = @client.request("/services").with_json(service_form.to_json).post
|
2358
|
-
::Io::Flow::V0::Models::Service.new(r)
|
2359
|
-
end
|
2360
|
-
|
2361
2323
|
def get_by_id(id)
|
2362
2324
|
HttpClient::Preconditions.assert_class('id', id, String)
|
2363
2325
|
r = @client.request("/services/#{CGI.escape(id)}").get
|
2364
2326
|
::Io::Flow::V0::Models::Service.new(r)
|
2365
2327
|
end
|
2366
2328
|
|
2367
|
-
def put_by_id(id, service_form)
|
2368
|
-
HttpClient::Preconditions.assert_class('id', id, String)
|
2369
|
-
HttpClient::Preconditions.assert_class('service_form', service_form, ::Io::Flow::V0::Models::ServiceForm)
|
2370
|
-
r = @client.request("/services/#{CGI.escape(id)}").with_json(service_form.to_json).put
|
2371
|
-
::Io::Flow::V0::Models::Service.new(r)
|
2372
|
-
end
|
2373
|
-
|
2374
|
-
def delete_by_id(id)
|
2375
|
-
HttpClient::Preconditions.assert_class('id', id, String)
|
2376
|
-
r = @client.request("/services/#{CGI.escape(id)}").delete
|
2377
|
-
nil
|
2378
|
-
end
|
2379
|
-
|
2380
|
-
def get_versions(incoming={})
|
2381
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
2382
|
-
query = {
|
2383
|
-
:id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
|
2384
|
-
:service => (x = opts.delete(:service); x.nil? ? nil : HttpClient::Preconditions.assert_class('service', x, Array).map { |v| HttpClient::Preconditions.assert_class('service', v, String) }),
|
2385
|
-
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
2386
|
-
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
2387
|
-
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
|
2388
|
-
}.delete_if { |k, v| v.nil? }
|
2389
|
-
r = @client.request("/services/versions").with_query(query).get
|
2390
|
-
r.map { |x| ::Io::Flow::V0::Models::ServiceVersion.new(x) }
|
2391
|
-
end
|
2392
|
-
|
2393
2329
|
end
|
2394
2330
|
|
2395
2331
|
class Shipments
|
@@ -6671,38 +6607,6 @@ module Io
|
|
6671
6607
|
|
6672
6608
|
end
|
6673
6609
|
|
6674
|
-
# Partner that actually take a shipment between places (ex: FedEx, DHL, SF
|
6675
|
-
# Express)
|
6676
|
-
class CarrierForm
|
6677
|
-
|
6678
|
-
attr_reader :name, :facilities, :visibility
|
6679
|
-
|
6680
|
-
def initialize(incoming={})
|
6681
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
6682
|
-
HttpClient::Preconditions.require_keys(opts, [:name], 'CarrierForm')
|
6683
|
-
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
|
6684
|
-
@facilities = (x = opts.delete(:facilities); x.nil? ? nil : HttpClient::Preconditions.assert_class('facilities', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::ShippingAddress) ? x : ::Io::Flow::V0::Models::ShippingAddress.new(x)) })
|
6685
|
-
@visibility = (x = opts.delete(:visibility); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Visibility) ? x : ::Io::Flow::V0::Models::Visibility.apply(x)))
|
6686
|
-
end
|
6687
|
-
|
6688
|
-
def to_json
|
6689
|
-
JSON.dump(to_hash)
|
6690
|
-
end
|
6691
|
-
|
6692
|
-
def copy(incoming={})
|
6693
|
-
CarrierForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
6694
|
-
end
|
6695
|
-
|
6696
|
-
def to_hash
|
6697
|
-
{
|
6698
|
-
:name => name,
|
6699
|
-
:facilities => facilities.nil? ? nil : facilities.map { |o| o.to_hash },
|
6700
|
-
:visibility => visibility.nil? ? nil : visibility.value
|
6701
|
-
}
|
6702
|
-
end
|
6703
|
-
|
6704
|
-
end
|
6705
|
-
|
6706
6610
|
class CarrierReference
|
6707
6611
|
|
6708
6612
|
attr_reader :id
|
@@ -6729,38 +6633,6 @@ module Io
|
|
6729
6633
|
|
6730
6634
|
end
|
6731
6635
|
|
6732
|
-
class CarrierVersion
|
6733
|
-
|
6734
|
-
attr_reader :id, :timestamp, :type, :carrier
|
6735
|
-
|
6736
|
-
def initialize(incoming={})
|
6737
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
6738
|
-
HttpClient::Preconditions.require_keys(opts, [:id, :timestamp, :type, :carrier], 'CarrierVersion')
|
6739
|
-
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
6740
|
-
@timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
|
6741
|
-
@type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::ChangeType) ? x : ::Io::Flow::V0::Models::ChangeType.apply(x))
|
6742
|
-
@carrier = (x = opts.delete(:carrier); x.is_a?(::Io::Flow::V0::Models::Carrier) ? x : ::Io::Flow::V0::Models::Carrier.new(x))
|
6743
|
-
end
|
6744
|
-
|
6745
|
-
def to_json
|
6746
|
-
JSON.dump(to_hash)
|
6747
|
-
end
|
6748
|
-
|
6749
|
-
def copy(incoming={})
|
6750
|
-
CarrierVersion.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
6751
|
-
end
|
6752
|
-
|
6753
|
-
def to_hash
|
6754
|
-
{
|
6755
|
-
:id => id,
|
6756
|
-
:timestamp => timestamp,
|
6757
|
-
:type => type.value,
|
6758
|
-
:carrier => carrier.to_hash
|
6759
|
-
}
|
6760
|
-
end
|
6761
|
-
|
6762
|
-
end
|
6763
|
-
|
6764
6636
|
class Catalog
|
6765
6637
|
|
6766
6638
|
attr_reader :id
|
@@ -11069,15 +10941,16 @@ module Io
|
|
11069
10941
|
# then to book that order in order processing.
|
11070
10942
|
class Order
|
11071
10943
|
|
11072
|
-
attr_reader :id, :number, :customer, :expires_at, :destination, :deliveries, :selections, :prices, :total
|
10944
|
+
attr_reader :id, :number, :customer, :expires_at, :items, :destination, :deliveries, :selections, :prices, :total
|
11073
10945
|
|
11074
10946
|
def initialize(incoming={})
|
11075
10947
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
11076
|
-
HttpClient::Preconditions.require_keys(opts, [:id, :number, :customer, :expires_at, :destination, :deliveries, :selections, :prices, :total], 'Order')
|
10948
|
+
HttpClient::Preconditions.require_keys(opts, [:id, :number, :customer, :expires_at, :items, :destination, :deliveries, :selections, :prices, :total], 'Order')
|
11077
10949
|
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
11078
10950
|
@number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
|
11079
10951
|
@customer = (x = opts.delete(:customer); x.is_a?(::Io::Flow::V0::Models::Customer) ? x : ::Io::Flow::V0::Models::Customer.new(x))
|
11080
10952
|
@expires_at = HttpClient::Preconditions.assert_class('expires_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:expires_at)), DateTime)
|
10953
|
+
@items = HttpClient::Preconditions.assert_class('items', opts.delete(:items), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::LineItem) ? x : ::Io::Flow::V0::Models::LineItem.new(x)) }
|
11081
10954
|
@destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::Address) ? x : ::Io::Flow::V0::Models::Address.new(x))
|
11082
10955
|
@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)) }
|
11083
10956
|
@selections = HttpClient::Preconditions.assert_class('selections', opts.delete(:selections), Array).map { |v| HttpClient::Preconditions.assert_class('selections', v, String) }
|
@@ -11099,6 +10972,7 @@ module Io
|
|
11099
10972
|
:number => number,
|
11100
10973
|
:customer => customer.to_hash,
|
11101
10974
|
:expires_at => expires_at,
|
10975
|
+
:items => items.map { |o| o.to_hash },
|
11102
10976
|
:destination => destination.to_hash,
|
11103
10977
|
:deliveries => deliveries.map { |o| o.to_hash },
|
11104
10978
|
:selections => selections,
|
@@ -12585,36 +12459,6 @@ module Io
|
|
12585
12459
|
|
12586
12460
|
end
|
12587
12461
|
|
12588
|
-
# Specific service rendered by the carrier (fedex ground saturday, ups overnight
|
12589
|
-
# weekend, etc)
|
12590
|
-
class ServiceForm
|
12591
|
-
|
12592
|
-
attr_reader :name, :carrier
|
12593
|
-
|
12594
|
-
def initialize(incoming={})
|
12595
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
12596
|
-
HttpClient::Preconditions.require_keys(opts, [:name, :carrier], 'ServiceForm')
|
12597
|
-
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
|
12598
|
-
@carrier = HttpClient::Preconditions.assert_class('carrier', opts.delete(:carrier), String)
|
12599
|
-
end
|
12600
|
-
|
12601
|
-
def to_json
|
12602
|
-
JSON.dump(to_hash)
|
12603
|
-
end
|
12604
|
-
|
12605
|
-
def copy(incoming={})
|
12606
|
-
ServiceForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
12607
|
-
end
|
12608
|
-
|
12609
|
-
def to_hash
|
12610
|
-
{
|
12611
|
-
:name => name,
|
12612
|
-
:carrier => carrier
|
12613
|
-
}
|
12614
|
-
end
|
12615
|
-
|
12616
|
-
end
|
12617
|
-
|
12618
12462
|
class ServiceReference
|
12619
12463
|
|
12620
12464
|
attr_reader :id
|
@@ -12671,38 +12515,6 @@ module Io
|
|
12671
12515
|
|
12672
12516
|
end
|
12673
12517
|
|
12674
|
-
class ServiceVersion
|
12675
|
-
|
12676
|
-
attr_reader :id, :timestamp, :type, :service
|
12677
|
-
|
12678
|
-
def initialize(incoming={})
|
12679
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
12680
|
-
HttpClient::Preconditions.require_keys(opts, [:id, :timestamp, :type, :service], 'ServiceVersion')
|
12681
|
-
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
12682
|
-
@timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
|
12683
|
-
@type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::ChangeType) ? x : ::Io::Flow::V0::Models::ChangeType.apply(x))
|
12684
|
-
@service = (x = opts.delete(:service); x.is_a?(::Io::Flow::V0::Models::ServiceSummary) ? x : ::Io::Flow::V0::Models::ServiceSummary.new(x))
|
12685
|
-
end
|
12686
|
-
|
12687
|
-
def to_json
|
12688
|
-
JSON.dump(to_hash)
|
12689
|
-
end
|
12690
|
-
|
12691
|
-
def copy(incoming={})
|
12692
|
-
ServiceVersion.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
12693
|
-
end
|
12694
|
-
|
12695
|
-
def to_hash
|
12696
|
-
{
|
12697
|
-
:id => id,
|
12698
|
-
:timestamp => timestamp,
|
12699
|
-
:type => type.value,
|
12700
|
-
:service => service.to_hash
|
12701
|
-
}
|
12702
|
-
end
|
12703
|
-
|
12704
|
-
end
|
12705
|
-
|
12706
12518
|
# Represents a subset of items from an order grouped into a single physical
|
12707
12519
|
# shipment. Flow provides a generated tracking number to track this shipment
|
12708
12520
|
# across multiple possible hops and carriers.
|