flowcommerce 0.2.19 → 0.2.20
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 +243 -2
- 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: 8428501e2efb49365c317cad3ab87935641a633c
|
4
|
+
data.tar.gz: 6e2c51771003a515df1f9dbb1ac4e374f03874e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ef2330e31b6c91229e54c590057d27ecbccdd3b879e731f5eadd22ed979fdc4073d5010be47c0a211bad3909697dff8041d10997d3d24ca8ae3332a93ebf4d3
|
7
|
+
data.tar.gz: 8950cc292dd9e72b7b35a5db2cd127cd9192d888aa384ad3616ac141a5632f02581a7c8b4aeeea678227048906d1e20c01330c1fe34ae86122e259bdf2df207d
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Generated by apidoc - http://www.apidoc.me
|
2
2
|
# Service version: 0.3.28
|
3
|
-
# apidoc:0.11.
|
3
|
+
# apidoc:0.11.92 http://www.apidoc.me/flow/api/0.3.34/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.
|
28
|
+
USER_AGENT = 'apidoc:0.11.92 http://www.apidoc.me/flow/api/0.3.34/ruby_client' unless defined?(Constants::USER_AGENT)
|
29
29
|
VERSION = '0.3.28' unless defined?(Constants::VERSION)
|
30
30
|
VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
|
31
31
|
|
@@ -212,6 +212,10 @@ module Io
|
|
212
212
|
@inventory_updates ||= ::Io::Flow::V0::Clients::InventoryUpdates.new(self)
|
213
213
|
end
|
214
214
|
|
215
|
+
def manifests
|
216
|
+
@manifests ||= ::Io::Flow::V0::Clients::Manifests.new(self)
|
217
|
+
end
|
218
|
+
|
215
219
|
def quotes
|
216
220
|
@quotes ||= ::Io::Flow::V0::Clients::Quotes.new(self)
|
217
221
|
end
|
@@ -2721,6 +2725,58 @@ module Io
|
|
2721
2725
|
|
2722
2726
|
end
|
2723
2727
|
|
2728
|
+
class Manifests
|
2729
|
+
|
2730
|
+
def initialize(client)
|
2731
|
+
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
|
2732
|
+
end
|
2733
|
+
|
2734
|
+
def get(organization, incoming={})
|
2735
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
2736
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
2737
|
+
query = {
|
2738
|
+
:id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
|
2739
|
+
:carrier_tracking_number => (x = opts.delete(:carrier_tracking_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('carrier_tracking_number', x, Array).map { |v| HttpClient::Preconditions.assert_class('carrier_tracking_number', v, String) }),
|
2740
|
+
:flow_tracking_number => (x = opts.delete(:flow_tracking_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('flow_tracking_number', x, Array).map { |v| HttpClient::Preconditions.assert_class('flow_tracking_number', v, String) }),
|
2741
|
+
:service => (x = opts.delete(:service); x.nil? ? nil : HttpClient::Preconditions.assert_class('service', x, Array).map { |v| HttpClient::Preconditions.assert_class('service', v, String) }),
|
2742
|
+
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
2743
|
+
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
2744
|
+
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
|
2745
|
+
}.delete_if { |k, v| v.nil? }
|
2746
|
+
r = @client.request("/#{CGI.escape(organization)}/manifests").with_query(query).get
|
2747
|
+
r.map { |x| ::Io::Flow::V0::Models::Manifest.new(x) }
|
2748
|
+
end
|
2749
|
+
|
2750
|
+
def get_by_id(organization, id)
|
2751
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
2752
|
+
HttpClient::Preconditions.assert_class('id', id, String)
|
2753
|
+
r = @client.request("/#{CGI.escape(organization)}/manifests/#{CGI.escape(id)}").get
|
2754
|
+
::Io::Flow::V0::Models::Manifest.new(r)
|
2755
|
+
end
|
2756
|
+
|
2757
|
+
# Generates a new manifest with all outstanding labels and redirects to a
|
2758
|
+
# downloadable PDF of carrier-generated manifest or bill of lading (BOL). If
|
2759
|
+
# no outstanding labels, this will generate a 422 error.
|
2760
|
+
def get_type_and_all(organization, incoming={})
|
2761
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
2762
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
2763
|
+
query = {
|
2764
|
+
:service => HttpClient::Preconditions.assert_class('service', opts.delete(:service), String)
|
2765
|
+
}.delete_if { |k, v| v.nil? }
|
2766
|
+
r = @client.request("/#{CGI.escape(organization)}/manifests/type/all").with_query(query).get
|
2767
|
+
r
|
2768
|
+
end
|
2769
|
+
|
2770
|
+
# Generate a new manifest/carrier BOL with specific tracking numbers
|
2771
|
+
def post_type_and_list(organization, manifest_form)
|
2772
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
2773
|
+
(x = manifest_form; x.is_a?(::Io::Flow::V0::Models::ManifestForm) ? x : ::Io::Flow::V0::Models::ManifestForm.new(x))
|
2774
|
+
r = @client.request("/#{CGI.escape(organization)}/manifests/type/list").with_json(manifest_form.to_json).post
|
2775
|
+
::Io::Flow::V0::Models::Manifest.new(r)
|
2776
|
+
end
|
2777
|
+
|
2778
|
+
end
|
2779
|
+
|
2724
2780
|
class Quotes
|
2725
2781
|
|
2726
2782
|
def initialize(client)
|
@@ -8539,6 +8595,51 @@ module Io
|
|
8539
8595
|
|
8540
8596
|
end
|
8541
8597
|
|
8598
|
+
class ManifestType
|
8599
|
+
|
8600
|
+
attr_reader :value
|
8601
|
+
|
8602
|
+
def initialize(value)
|
8603
|
+
@value = HttpClient::Preconditions.assert_class('value', value, String)
|
8604
|
+
end
|
8605
|
+
|
8606
|
+
# Returns the instance of ManifestType for this value, creating a new instance for an unknown value
|
8607
|
+
def ManifestType.apply(value)
|
8608
|
+
if value.instance_of?(ManifestType)
|
8609
|
+
value
|
8610
|
+
else
|
8611
|
+
HttpClient::Preconditions.assert_class_or_nil('value', value, String)
|
8612
|
+
value.nil? ? nil : (from_string(value) || ManifestType.new(value))
|
8613
|
+
end
|
8614
|
+
end
|
8615
|
+
|
8616
|
+
# Returns the instance of ManifestType for this value, or nil if not found
|
8617
|
+
def ManifestType.from_string(value)
|
8618
|
+
HttpClient::Preconditions.assert_class('value', value, String)
|
8619
|
+
ManifestType.ALL.find { |v| v.value == value }
|
8620
|
+
end
|
8621
|
+
|
8622
|
+
def ManifestType.ALL
|
8623
|
+
@@all ||= [ManifestType.all, ManifestType.list]
|
8624
|
+
end
|
8625
|
+
|
8626
|
+
# Manifest all open shipping labels that are not part of a manifest yet for the
|
8627
|
+
# organization and carrier service
|
8628
|
+
def ManifestType.all
|
8629
|
+
@@_all ||= ManifestType.new('all')
|
8630
|
+
end
|
8631
|
+
|
8632
|
+
# Manifest only the list of specified labels
|
8633
|
+
def ManifestType.list
|
8634
|
+
@@_list ||= ManifestType.new('list')
|
8635
|
+
end
|
8636
|
+
|
8637
|
+
def to_hash
|
8638
|
+
value
|
8639
|
+
end
|
8640
|
+
|
8641
|
+
end
|
8642
|
+
|
8542
8643
|
class MarginType
|
8543
8644
|
|
8544
8645
|
attr_reader :value
|
@@ -10354,6 +10455,48 @@ module Io
|
|
10354
10455
|
|
10355
10456
|
end
|
10356
10457
|
|
10458
|
+
class TrackingNumberType
|
10459
|
+
|
10460
|
+
attr_reader :value
|
10461
|
+
|
10462
|
+
def initialize(value)
|
10463
|
+
@value = HttpClient::Preconditions.assert_class('value', value, String)
|
10464
|
+
end
|
10465
|
+
|
10466
|
+
# Returns the instance of TrackingNumberType for this value, creating a new instance for an unknown value
|
10467
|
+
def TrackingNumberType.apply(value)
|
10468
|
+
if value.instance_of?(TrackingNumberType)
|
10469
|
+
value
|
10470
|
+
else
|
10471
|
+
HttpClient::Preconditions.assert_class_or_nil('value', value, String)
|
10472
|
+
value.nil? ? nil : (from_string(value) || TrackingNumberType.new(value))
|
10473
|
+
end
|
10474
|
+
end
|
10475
|
+
|
10476
|
+
# Returns the instance of TrackingNumberType for this value, or nil if not found
|
10477
|
+
def TrackingNumberType.from_string(value)
|
10478
|
+
HttpClient::Preconditions.assert_class('value', value, String)
|
10479
|
+
TrackingNumberType.ALL.find { |v| v.value == value }
|
10480
|
+
end
|
10481
|
+
|
10482
|
+
def TrackingNumberType.ALL
|
10483
|
+
@@all ||= [TrackingNumberType.flow, TrackingNumberType.carrier]
|
10484
|
+
end
|
10485
|
+
|
10486
|
+
def TrackingNumberType.flow
|
10487
|
+
@@_flow ||= TrackingNumberType.new('flow')
|
10488
|
+
end
|
10489
|
+
|
10490
|
+
def TrackingNumberType.carrier
|
10491
|
+
@@_carrier ||= TrackingNumberType.new('carrier')
|
10492
|
+
end
|
10493
|
+
|
10494
|
+
def to_hash
|
10495
|
+
value
|
10496
|
+
end
|
10497
|
+
|
10498
|
+
end
|
10499
|
+
|
10357
10500
|
class TrackingStatus
|
10358
10501
|
|
10359
10502
|
attr_reader :value
|
@@ -18704,6 +18847,74 @@ module Io
|
|
18704
18847
|
|
18705
18848
|
end
|
18706
18849
|
|
18850
|
+
# Represents closeout of a group of labels that have been transfered to the
|
18851
|
+
# carrier for shipping
|
18852
|
+
class Manifest
|
18853
|
+
|
18854
|
+
attr_reader :id, :type, :service, :timestamp, :shipping_labels, :pdf
|
18855
|
+
|
18856
|
+
def initialize(incoming={})
|
18857
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
18858
|
+
HttpClient::Preconditions.require_keys(opts, [:id, :type, :service, :timestamp, :shipping_labels], 'Manifest')
|
18859
|
+
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
18860
|
+
@type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::ManifestType) ? x : ::Io::Flow::V0::Models::ManifestType.apply(x))
|
18861
|
+
@service = (x = opts.delete(:service); x.is_a?(::Io::Flow::V0::Models::ServiceSummary) ? x : ::Io::Flow::V0::Models::ServiceSummary.new(x))
|
18862
|
+
@timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
|
18863
|
+
@shipping_labels = HttpClient::Preconditions.assert_class('shipping_labels', opts.delete(:shipping_labels), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::ShippingLabelSummary) ? x : ::Io::Flow::V0::Models::ShippingLabelSummary.new(x)) }
|
18864
|
+
@pdf = (x = opts.delete(:pdf); x.nil? ? nil : HttpClient::Preconditions.assert_class('pdf', x, String))
|
18865
|
+
end
|
18866
|
+
|
18867
|
+
def to_json
|
18868
|
+
JSON.dump(to_hash)
|
18869
|
+
end
|
18870
|
+
|
18871
|
+
def copy(incoming={})
|
18872
|
+
Manifest.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
18873
|
+
end
|
18874
|
+
|
18875
|
+
def to_hash
|
18876
|
+
{
|
18877
|
+
:id => id,
|
18878
|
+
:type => type.value,
|
18879
|
+
:service => service.to_hash,
|
18880
|
+
:timestamp => timestamp,
|
18881
|
+
:shipping_labels => shipping_labels.map { |o| o.to_hash },
|
18882
|
+
:pdf => pdf
|
18883
|
+
}
|
18884
|
+
end
|
18885
|
+
|
18886
|
+
end
|
18887
|
+
|
18888
|
+
class ManifestForm
|
18889
|
+
|
18890
|
+
attr_reader :service, :tracking_number_type, :tracking_numbers
|
18891
|
+
|
18892
|
+
def initialize(incoming={})
|
18893
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
18894
|
+
HttpClient::Preconditions.require_keys(opts, [:service, :tracking_number_type, :tracking_numbers], 'ManifestForm')
|
18895
|
+
@service = HttpClient::Preconditions.assert_class('service', opts.delete(:service), String)
|
18896
|
+
@tracking_number_type = (x = opts.delete(:tracking_number_type); x.is_a?(::Io::Flow::V0::Models::TrackingNumberType) ? x : ::Io::Flow::V0::Models::TrackingNumberType.apply(x))
|
18897
|
+
@tracking_numbers = HttpClient::Preconditions.assert_class('tracking_numbers', opts.delete(:tracking_numbers), Array).map { |v| HttpClient::Preconditions.assert_class('tracking_numbers', v, String) }
|
18898
|
+
end
|
18899
|
+
|
18900
|
+
def to_json
|
18901
|
+
JSON.dump(to_hash)
|
18902
|
+
end
|
18903
|
+
|
18904
|
+
def copy(incoming={})
|
18905
|
+
ManifestForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
18906
|
+
end
|
18907
|
+
|
18908
|
+
def to_hash
|
18909
|
+
{
|
18910
|
+
:service => service,
|
18911
|
+
:tracking_number_type => tracking_number_type.value,
|
18912
|
+
:tracking_numbers => tracking_numbers
|
18913
|
+
}
|
18914
|
+
end
|
18915
|
+
|
18916
|
+
end
|
18917
|
+
|
18707
18918
|
class Margin
|
18708
18919
|
|
18709
18920
|
attr_reader :type, :value
|
@@ -23686,6 +23897,36 @@ module Io
|
|
23686
23897
|
|
23687
23898
|
end
|
23688
23899
|
|
23900
|
+
class ShippingLabelSummary
|
23901
|
+
|
23902
|
+
attr_reader :id, :flow_tracking_number, :carrier_tracking_number
|
23903
|
+
|
23904
|
+
def initialize(incoming={})
|
23905
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
23906
|
+
HttpClient::Preconditions.require_keys(opts, [:id, :flow_tracking_number, :carrier_tracking_number], 'ShippingLabelSummary')
|
23907
|
+
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
23908
|
+
@flow_tracking_number = HttpClient::Preconditions.assert_class('flow_tracking_number', opts.delete(:flow_tracking_number), String)
|
23909
|
+
@carrier_tracking_number = HttpClient::Preconditions.assert_class('carrier_tracking_number', opts.delete(:carrier_tracking_number), String)
|
23910
|
+
end
|
23911
|
+
|
23912
|
+
def to_json
|
23913
|
+
JSON.dump(to_hash)
|
23914
|
+
end
|
23915
|
+
|
23916
|
+
def copy(incoming={})
|
23917
|
+
ShippingLabelSummary.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
23918
|
+
end
|
23919
|
+
|
23920
|
+
def to_hash
|
23921
|
+
{
|
23922
|
+
:id => id,
|
23923
|
+
:flow_tracking_number => flow_tracking_number,
|
23924
|
+
:carrier_tracking_number => carrier_tracking_number
|
23925
|
+
}
|
23926
|
+
end
|
23927
|
+
|
23928
|
+
end
|
23929
|
+
|
23689
23930
|
class ShippingLabelVersion
|
23690
23931
|
|
23691
23932
|
attr_reader :id, :timestamp, :type, :shipping_label
|
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.
|
4
|
+
version: 0.2.20
|
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-06-
|
11
|
+
date: 2017-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|