flowcommerce 0.0.63 → 0.0.64

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: af13d7336fac680f7b272a0a062d76c53af9cef8
4
- data.tar.gz: 932641e7fecff83894d8dd84d5bd6b27087e8340
3
+ metadata.gz: b885bce15f83e8c20dcab02da0aac46cc7f87885
4
+ data.tar.gz: 3177e85579917736811ed4c79ef29b415212b8b8
5
5
  SHA512:
6
- metadata.gz: f94313b9e1206a24d73a1d39f471d1484e634459be18fc6eca634fca56624dffee807b81fb5df15a75b839499fd28b979ca353c4d36f20a496ba7bbcc98b3602
7
- data.tar.gz: 9a093d96b4603fd5feb6745aa3874bfbca80628eab8ccfbe68f26e47b3db5172be0178092fb925ff2f107d1a592b180e3dcb417d8c669cddc567c648891ac646
6
+ metadata.gz: 018e563fe8774673ec69cc4da12db06f62dec077f244fff6b7ad8982e12be2eb0868776f45eea2d11b5ea8df2f626f80631ad8fe2409b6bb783f193350b65c80
7
+ data.tar.gz: 8eb063628e4b78ff4338e1e01ec955c769263d35ded8a6401e160997d92d51d73c2ec0fb8f6e70397a636e8bc6c1141f92704ddeabec8b56fbc76c6bbc6ca9f1
@@ -1,6 +1,6 @@
1
1
  # Generated by apidoc - http://www.apidoc.me
2
2
  # Service version: 0.1.59
3
- # apidoc:0.11.37 http://www.apidoc.me/flow/api/0.1.63/ruby_client
3
+ # apidoc:0.11.37 http://www.apidoc.me/flow/api/0.1.64/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.63/ruby_client' unless defined?(Constants::USER_AGENT)
28
+ USER_AGENT = 'apidoc:0.11.37 http://www.apidoc.me/flow/api/0.1.64/ruby_client' unless defined?(Constants::USER_AGENT)
29
29
  VERSION = '0.1.59' unless defined?(Constants::VERSION)
30
30
  VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
31
31
 
@@ -189,14 +189,6 @@ module Io
189
189
  @inventory_updates ||= ::Io::Flow::V0::Clients::InventoryUpdates.new(self)
190
190
  end
191
191
 
192
- def labels
193
- @labels ||= ::Io::Flow::V0::Clients::Labels.new(self)
194
- end
195
-
196
- def label_events
197
- @label_events ||= ::Io::Flow::V0::Clients::LabelEvents.new(self)
198
- end
199
-
200
192
  def quotes
201
193
  @quotes ||= ::Io::Flow::V0::Clients::Quotes.new(self)
202
194
  end
@@ -229,6 +221,14 @@ module Io
229
221
  @trackings ||= ::Io::Flow::V0::Clients::Trackings.new(self)
230
222
  end
231
223
 
224
+ def tracking_events
225
+ @tracking_events ||= ::Io::Flow::V0::Clients::TrackingEvents.new(self)
226
+ end
227
+
228
+ def tracking_labels
229
+ @tracking_labels ||= ::Io::Flow::V0::Clients::TrackingLabels.new(self)
230
+ end
231
+
232
232
  def webhooks
233
233
  @webhooks ||= ::Io::Flow::V0::Clients::Webhooks.new(self)
234
234
  end
@@ -2229,100 +2229,6 @@ module Io
2229
2229
 
2230
2230
  end
2231
2231
 
2232
- class Labels
2233
-
2234
- def initialize(client)
2235
- @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
2236
- end
2237
-
2238
- def get(organization, incoming={})
2239
- HttpClient::Preconditions.assert_class('organization', organization, String)
2240
- opts = HttpClient::Helper.symbolize_keys(incoming)
2241
- query = {
2242
- :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
2243
- :tracking_id => (x = opts.delete(:tracking_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('tracking_id', x, Array).map { |v| HttpClient::Preconditions.assert_class('tracking_id', v, String) }),
2244
- :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
2245
- :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
2246
- :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
2247
- }.delete_if { |k, v| v.nil? }
2248
- r = @client.request("/#{CGI.escape(organization)}/labels").with_query(query).get
2249
- r.map { |x| ::Io::Flow::V0::Models::Label.new(x) }
2250
- end
2251
-
2252
- def post(organization, label_form)
2253
- HttpClient::Preconditions.assert_class('organization', organization, String)
2254
- HttpClient::Preconditions.assert_class('label_form', label_form, ::Io::Flow::V0::Models::LabelForm)
2255
- r = @client.request("/#{CGI.escape(organization)}/labels").with_json(label_form.to_json).post
2256
- ::Io::Flow::V0::Models::Label.new(r)
2257
- end
2258
-
2259
- def get_by_id(organization, id)
2260
- HttpClient::Preconditions.assert_class('organization', organization, String)
2261
- HttpClient::Preconditions.assert_class('id', id, String)
2262
- r = @client.request("/#{CGI.escape(organization)}/labels/#{CGI.escape(id)}").get
2263
- ::Io::Flow::V0::Models::Label.new(r)
2264
- end
2265
-
2266
- def get_versions(organization, incoming={})
2267
- HttpClient::Preconditions.assert_class('organization', organization, String)
2268
- opts = HttpClient::Helper.symbolize_keys(incoming)
2269
- query = {
2270
- :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
2271
- :label_id => (x = opts.delete(:label_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('label_id', x, Array).map { |v| HttpClient::Preconditions.assert_class('label_id', v, String) }),
2272
- :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
2273
- :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
2274
- :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
2275
- }.delete_if { |k, v| v.nil? }
2276
- r = @client.request("/#{CGI.escape(organization)}/labels/versions").with_query(query).get
2277
- r.map { |x| ::Io::Flow::V0::Models::LabelVersion.new(x) }
2278
- end
2279
-
2280
- end
2281
-
2282
- class LabelEvents
2283
-
2284
- def initialize(client)
2285
- @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
2286
- end
2287
-
2288
- def get(organization, incoming={})
2289
- HttpClient::Preconditions.assert_class('organization', organization, String)
2290
- opts = HttpClient::Helper.symbolize_keys(incoming)
2291
- query = {
2292
- :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
2293
- :tracking_id => (x = opts.delete(:tracking_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('tracking_id', x, Array).map { |v| HttpClient::Preconditions.assert_class('tracking_id', v, String) }),
2294
- :label_id => (x = opts.delete(:label_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('label_id', x, Array).map { |v| HttpClient::Preconditions.assert_class('label_id', v, String) }),
2295
- :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
2296
- :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
2297
- :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
2298
- }.delete_if { |k, v| v.nil? }
2299
- r = @client.request("/#{CGI.escape(organization)}/label_events").with_query(query).get
2300
- r.map { |x| ::Io::Flow::V0::Models::LabelEvent.new(x) }
2301
- end
2302
-
2303
- def get_by_id(organization, id)
2304
- HttpClient::Preconditions.assert_class('organization', organization, String)
2305
- HttpClient::Preconditions.assert_class('id', id, String)
2306
- r = @client.request("/#{CGI.escape(organization)}/label_events/#{CGI.escape(id)}").get
2307
- ::Io::Flow::V0::Models::LabelEvent.new(r)
2308
- end
2309
-
2310
- def get_versions(organization, incoming={})
2311
- HttpClient::Preconditions.assert_class('organization', organization, String)
2312
- opts = HttpClient::Helper.symbolize_keys(incoming)
2313
- query = {
2314
- :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
2315
- :label_event_id => (x = opts.delete(:label_event_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('label_event_id', x, Array).map { |v| HttpClient::Preconditions.assert_class('label_event_id', v, String) }),
2316
- :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
2317
- :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
2318
- :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
2319
- }.delete_if { |k, v| v.nil? }
2320
- r = @client.request("/#{CGI.escape(organization)}/label_events/versions").with_query(query).get
2321
- r.map { |x| ::Io::Flow::V0::Models::LabelEventVersion.new(x) }
2322
- end
2323
-
2324
- end
2325
-
2326
2232
  class Quotes
2327
2233
 
2328
2234
  def initialize(client)
@@ -2658,7 +2564,7 @@ module Io
2658
2564
  @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
2659
2565
  end
2660
2566
 
2661
- def get(organization, incoming={})
2567
+ def get_trackings_by_organization(organization, incoming={})
2662
2568
  HttpClient::Preconditions.assert_class('organization', organization, String)
2663
2569
  opts = HttpClient::Helper.symbolize_keys(incoming)
2664
2570
  query = {
@@ -2667,25 +2573,92 @@ module Io
2667
2573
  :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
2668
2574
  :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
2669
2575
  }.delete_if { |k, v| v.nil? }
2670
- r = @client.request("/#{CGI.escape(organization)}/trackings").with_query(query).get
2576
+ r = @client.request("/trackings/#{CGI.escape(organization)}/trackings").with_query(query).get
2671
2577
  r.map { |x| ::Io::Flow::V0::Models::Tracking.new(x) }
2672
2578
  end
2673
2579
 
2674
- def post(organization, tracking_form)
2580
+ def post_trackings_by_organization(organization, tracking_form)
2675
2581
  HttpClient::Preconditions.assert_class('organization', organization, String)
2676
2582
  HttpClient::Preconditions.assert_class('tracking_form', tracking_form, ::Io::Flow::V0::Models::TrackingForm)
2677
- r = @client.request("/#{CGI.escape(organization)}/trackings").with_json(tracking_form.to_json).post
2583
+ r = @client.request("/trackings/#{CGI.escape(organization)}/trackings").with_json(tracking_form.to_json).post
2678
2584
  ::Io::Flow::V0::Models::Tracking.new(r)
2679
2585
  end
2680
2586
 
2681
- def get_by_id(organization, id)
2587
+ def get_trackings_and_versions_by_organization(organization, incoming={})
2682
2588
  HttpClient::Preconditions.assert_class('organization', organization, String)
2589
+ opts = HttpClient::Helper.symbolize_keys(incoming)
2590
+ query = {
2591
+ :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
2592
+ :tracking_id => (x = opts.delete(:tracking_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('tracking_id', x, Array).map { |v| HttpClient::Preconditions.assert_class('tracking_id', v, String) }),
2593
+ :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
2594
+ :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
2595
+ :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
2596
+ }.delete_if { |k, v| v.nil? }
2597
+ r = @client.request("/trackings/#{CGI.escape(organization)}/trackings/versions").with_query(query).get
2598
+ r.map { |x| ::Io::Flow::V0::Models::TrackingVersion.new(x) }
2599
+ end
2600
+
2601
+ # Public endpoint to get all relevant information about a tracking, label(s)
2602
+ # under it, and event(s) under those label(s)
2603
+ def get_trackings_by_id(id)
2683
2604
  HttpClient::Preconditions.assert_class('id', id, String)
2684
- r = @client.request("/#{CGI.escape(organization)}/trackings/#{CGI.escape(id)}").get
2605
+ r = @client.request("/trackings/trackings/#{CGI.escape(id)}").get
2685
2606
  ::Io::Flow::V0::Models::Tracking.new(r)
2686
2607
  end
2687
2608
 
2609
+ end
2610
+
2611
+ class TrackingEvents
2612
+
2613
+ def initialize(client)
2614
+ @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
2615
+ end
2616
+
2617
+ def get(organization, incoming={})
2618
+ HttpClient::Preconditions.assert_class('organization', organization, String)
2619
+ opts = HttpClient::Helper.symbolize_keys(incoming)
2620
+ query = {
2621
+ :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
2622
+ :tracking_id => (x = opts.delete(:tracking_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('tracking_id', x, Array).map { |v| HttpClient::Preconditions.assert_class('tracking_id', v, String) }),
2623
+ :tracking_label_id => (x = opts.delete(:tracking_label_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('tracking_label_id', x, Array).map { |v| HttpClient::Preconditions.assert_class('tracking_label_id', v, String) }),
2624
+ :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
2625
+ :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
2626
+ :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
2627
+ }.delete_if { |k, v| v.nil? }
2628
+ r = @client.request("/#{CGI.escape(organization)}/tracking-events").with_query(query).get
2629
+ r.map { |x| ::Io::Flow::V0::Models::TrackingEvent.new(x) }
2630
+ end
2631
+
2632
+ def get_by_id(organization, id)
2633
+ HttpClient::Preconditions.assert_class('organization', organization, String)
2634
+ HttpClient::Preconditions.assert_class('id', id, String)
2635
+ r = @client.request("/#{CGI.escape(organization)}/tracking-events/#{CGI.escape(id)}").get
2636
+ ::Io::Flow::V0::Models::TrackingEvent.new(r)
2637
+ end
2638
+
2688
2639
  def get_versions(organization, incoming={})
2640
+ HttpClient::Preconditions.assert_class('organization', organization, String)
2641
+ opts = HttpClient::Helper.symbolize_keys(incoming)
2642
+ query = {
2643
+ :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
2644
+ :tracking_event_id => (x = opts.delete(:tracking_event_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('tracking_event_id', x, Array).map { |v| HttpClient::Preconditions.assert_class('tracking_event_id', v, String) }),
2645
+ :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
2646
+ :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
2647
+ :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
2648
+ }.delete_if { |k, v| v.nil? }
2649
+ r = @client.request("/#{CGI.escape(organization)}/tracking-events/versions").with_query(query).get
2650
+ r.map { |x| ::Io::Flow::V0::Models::TrackingEventVersion.new(x) }
2651
+ end
2652
+
2653
+ end
2654
+
2655
+ class TrackingLabels
2656
+
2657
+ def initialize(client)
2658
+ @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
2659
+ end
2660
+
2661
+ def get(organization, incoming={})
2689
2662
  HttpClient::Preconditions.assert_class('organization', organization, String)
2690
2663
  opts = HttpClient::Helper.symbolize_keys(incoming)
2691
2664
  query = {
@@ -2693,10 +2666,38 @@ module Io
2693
2666
  :tracking_id => (x = opts.delete(:tracking_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('tracking_id', x, Array).map { |v| HttpClient::Preconditions.assert_class('tracking_id', v, String) }),
2694
2667
  :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
2695
2668
  :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
2669
+ :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
2670
+ }.delete_if { |k, v| v.nil? }
2671
+ r = @client.request("/#{CGI.escape(organization)}/tracking-labels").with_query(query).get
2672
+ r.map { |x| ::Io::Flow::V0::Models::TrackingLabel.new(x) }
2673
+ end
2674
+
2675
+ def post(organization, tracking_label_form)
2676
+ HttpClient::Preconditions.assert_class('organization', organization, String)
2677
+ HttpClient::Preconditions.assert_class('tracking_label_form', tracking_label_form, ::Io::Flow::V0::Models::TrackingLabelForm)
2678
+ r = @client.request("/#{CGI.escape(organization)}/tracking-labels").with_json(tracking_label_form.to_json).post
2679
+ ::Io::Flow::V0::Models::TrackingLabel.new(r)
2680
+ end
2681
+
2682
+ def get_by_id(organization, id)
2683
+ HttpClient::Preconditions.assert_class('organization', organization, String)
2684
+ HttpClient::Preconditions.assert_class('id', id, String)
2685
+ r = @client.request("/#{CGI.escape(organization)}/tracking-labels/#{CGI.escape(id)}").get
2686
+ ::Io::Flow::V0::Models::TrackingLabel.new(r)
2687
+ end
2688
+
2689
+ def get_versions(organization, incoming={})
2690
+ HttpClient::Preconditions.assert_class('organization', organization, String)
2691
+ opts = HttpClient::Helper.symbolize_keys(incoming)
2692
+ query = {
2693
+ :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
2694
+ :tracking_label_id => (x = opts.delete(:tracking_label_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('tracking_label_id', x, Array).map { |v| HttpClient::Preconditions.assert_class('tracking_label_id', v, String) }),
2695
+ :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
2696
+ :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
2696
2697
  :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
2697
2698
  }.delete_if { |k, v| v.nil? }
2698
- r = @client.request("/#{CGI.escape(organization)}/trackings/versions").with_query(query).get
2699
- r.map { |x| ::Io::Flow::V0::Models::TrackingVersion.new(x) }
2699
+ r = @client.request("/#{CGI.escape(organization)}/tracking-labels/versions").with_query(query).get
2700
+ r.map { |x| ::Io::Flow::V0::Models::TrackingLabelVersion.new(x) }
2700
2701
  end
2701
2702
 
2702
2703
  end
@@ -11742,22 +11743,15 @@ module Io
11742
11743
 
11743
11744
  end
11744
11745
 
11745
- # Represents a specific label being tracked as part of the tracking bucket
11746
- class Label
11746
+ class LabelOrderSummary
11747
11747
 
11748
- attr_reader :id, :tracking, :status, :carrier, :tracking_number, :timestamp, :delivery_estimate, :description
11748
+ attr_reader :id, :number
11749
11749
 
11750
11750
  def initialize(incoming={})
11751
11751
  opts = HttpClient::Helper.symbolize_keys(incoming)
11752
- HttpClient::Preconditions.require_keys(opts, [:id, :tracking, :status, :carrier, :tracking_number, :timestamp], 'Label')
11752
+ HttpClient::Preconditions.require_keys(opts, [:id, :number], 'LabelOrderSummary')
11753
11753
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
11754
- @tracking = (x = opts.delete(:tracking); x.is_a?(::Io::Flow::V0::Models::TrackingSummary) ? x : ::Io::Flow::V0::Models::TrackingSummary.new(x))
11755
- @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::TrackingStatus) ? x : ::Io::Flow::V0::Models::TrackingStatus.apply(x))
11756
- @carrier = HttpClient::Preconditions.assert_class('carrier', opts.delete(:carrier), String)
11757
- @tracking_number = HttpClient::Preconditions.assert_class('tracking_number', opts.delete(:tracking_number), String)
11758
- @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
11759
- @delivery_estimate = (x = opts.delete(:delivery_estimate); x.nil? ? nil : HttpClient::Preconditions.assert_class('delivery_estimate', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
11760
- @description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
11754
+ @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
11761
11755
  end
11762
11756
 
11763
11757
  def to_json
@@ -11765,37 +11759,41 @@ module Io
11765
11759
  end
11766
11760
 
11767
11761
  def copy(incoming={})
11768
- Label.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
11762
+ LabelOrderSummary.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
11769
11763
  end
11770
11764
 
11771
11765
  def to_hash
11772
11766
  {
11773
11767
  :id => id,
11774
- :tracking => tracking.to_hash,
11775
- :status => status.value,
11776
- :carrier => carrier,
11777
- :tracking_number => tracking_number,
11778
- :timestamp => timestamp,
11779
- :delivery_estimate => delivery_estimate,
11780
- :description => description
11768
+ :number => number
11781
11769
  }
11782
11770
  end
11783
11771
 
11784
11772
  end
11785
11773
 
11786
- class LabelEvent
11774
+ class LabelUpserted < Event
11787
11775
 
11788
- attr_reader :id, :label, :address, :status, :timestamp, :description
11776
+ attr_reader :event_id, :timestamp, :organization, :label_id, :carrier_tracking_number, :flow_tracking_number, :data, :destination, :origin, :carrier, :service, :commercial_invoice, :pdf, :png, :order
11789
11777
 
11790
11778
  def initialize(incoming={})
11779
+ super(:name => Event::Types::LABEL_UPSERTED)
11791
11780
  opts = HttpClient::Helper.symbolize_keys(incoming)
11792
- HttpClient::Preconditions.require_keys(opts, [:id, :label, :address, :status, :timestamp], 'LabelEvent')
11793
- @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
11794
- @label = (x = opts.delete(:label); x.is_a?(::Io::Flow::V0::Models::LabelSummary) ? x : ::Io::Flow::V0::Models::LabelSummary.new(x))
11795
- @address = (x = opts.delete(:address); x.is_a?(::Io::Flow::V0::Models::Address) ? x : ::Io::Flow::V0::Models::Address.new(x))
11796
- @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::TrackingStatus) ? x : ::Io::Flow::V0::Models::TrackingStatus.apply(x))
11781
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :label_id, :carrier_tracking_number, :flow_tracking_number, :data, :destination, :origin, :carrier, :service], 'LabelUpserted')
11782
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
11797
11783
  @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
11798
- @description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
11784
+ @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
11785
+ @label_id = HttpClient::Preconditions.assert_class('label_id', opts.delete(:label_id), String)
11786
+ @carrier_tracking_number = HttpClient::Preconditions.assert_class('carrier_tracking_number', opts.delete(:carrier_tracking_number), String)
11787
+ @flow_tracking_number = HttpClient::Preconditions.assert_class('flow_tracking_number', opts.delete(:flow_tracking_number), String)
11788
+ @data = HttpClient::Preconditions.assert_class('data', opts.delete(:data), String)
11789
+ @destination = HttpClient::Preconditions.assert_class('destination', HttpClient::Helper.to_object(opts.delete(:destination)), Hash)
11790
+ @origin = HttpClient::Preconditions.assert_class('origin', HttpClient::Helper.to_object(opts.delete(:origin)), Hash)
11791
+ @carrier = HttpClient::Preconditions.assert_class('carrier', opts.delete(:carrier), String)
11792
+ @service = HttpClient::Preconditions.assert_class('service', opts.delete(:service), String)
11793
+ @commercial_invoice = (x = opts.delete(:commercial_invoice); x.nil? ? nil : HttpClient::Preconditions.assert_class('commercial_invoice', x, String))
11794
+ @pdf = (x = opts.delete(:pdf); x.nil? ? nil : HttpClient::Preconditions.assert_class('pdf', x, String))
11795
+ @png = (x = opts.delete(:png); x.nil? ? nil : HttpClient::Preconditions.assert_class('png', x, String))
11796
+ @order = (x = opts.delete(:order); x.nil? ? nil : HttpClient::Preconditions.assert_class('order', x, String))
11799
11797
  end
11800
11798
 
11801
11799
  def to_json
@@ -11803,34 +11801,41 @@ module Io
11803
11801
  end
11804
11802
 
11805
11803
  def copy(incoming={})
11806
- LabelEvent.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
11804
+ LabelUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
11807
11805
  end
11808
11806
 
11809
- def to_hash
11807
+ def subtype_to_hash
11810
11808
  {
11811
- :id => id,
11812
- :label => label.to_hash,
11813
- :address => address.to_hash,
11814
- :status => status.value,
11809
+ :event_id => event_id,
11815
11810
  :timestamp => timestamp,
11816
- :description => description
11811
+ :organization => organization,
11812
+ :label_id => label_id,
11813
+ :carrier_tracking_number => carrier_tracking_number,
11814
+ :flow_tracking_number => flow_tracking_number,
11815
+ :data => data,
11816
+ :destination => destination,
11817
+ :origin => origin,
11818
+ :carrier => carrier,
11819
+ :service => service,
11820
+ :commercial_invoice => commercial_invoice,
11821
+ :pdf => pdf,
11822
+ :png => png,
11823
+ :order => order
11817
11824
  }
11818
11825
  end
11819
11826
 
11820
11827
  end
11821
11828
 
11822
- class LabelEventForm
11829
+ # ISO 639 2-character language code. See https://api.flow.io/reference/languages
11830
+ class Language
11823
11831
 
11824
- attr_reader :label_id, :timestamp, :status, :description, :address
11832
+ attr_reader :name, :iso_639_2
11825
11833
 
11826
11834
  def initialize(incoming={})
11827
11835
  opts = HttpClient::Helper.symbolize_keys(incoming)
11828
- HttpClient::Preconditions.require_keys(opts, [:label_id, :timestamp, :status], 'LabelEventForm')
11829
- @label_id = HttpClient::Preconditions.assert_class('label_id', opts.delete(:label_id), String)
11830
- @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
11831
- @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::TrackingStatus) ? x : ::Io::Flow::V0::Models::TrackingStatus.apply(x))
11832
- @description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
11833
- @address = (x = opts.delete(:address); x.nil? ? nil : HttpClient::Preconditions.assert_class('address', x, String))
11836
+ HttpClient::Preconditions.require_keys(opts, [:name, :iso_639_2], 'Language')
11837
+ @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
11838
+ @iso_639_2 = HttpClient::Preconditions.assert_class('iso_639_2', opts.delete(:iso_639_2), String)
11834
11839
  end
11835
11840
 
11836
11841
  def to_json
@@ -11838,31 +11843,34 @@ module Io
11838
11843
  end
11839
11844
 
11840
11845
  def copy(incoming={})
11841
- LabelEventForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
11846
+ Language.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
11842
11847
  end
11843
11848
 
11844
11849
  def to_hash
11845
11850
  {
11846
- :label_id => label_id,
11847
- :timestamp => timestamp,
11848
- :status => status.value,
11849
- :description => description,
11850
- :address => address
11851
+ :name => name,
11852
+ :iso_639_2 => iso_639_2
11851
11853
  }
11852
11854
  end
11853
11855
 
11854
11856
  end
11855
11857
 
11856
- class LabelEventSummary
11858
+ # Line items represent the items a consumer is purchasing, including additional
11859
+ # information to complete the transaction. Note that you may pass in as many
11860
+ # line items as you like - including repeating item numbers across line items.
11861
+ class LineItem
11857
11862
 
11858
- attr_reader :id, :status, :timestamp
11863
+ attr_reader :number, :quantity, :price, :attributes, :center, :discount
11859
11864
 
11860
11865
  def initialize(incoming={})
11861
11866
  opts = HttpClient::Helper.symbolize_keys(incoming)
11862
- HttpClient::Preconditions.require_keys(opts, [:id, :status, :timestamp], 'LabelEventSummary')
11863
- @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
11864
- @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::TrackingStatus) ? x : ::Io::Flow::V0::Models::TrackingStatus.apply(x))
11865
- @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
11867
+ HttpClient::Preconditions.require_keys(opts, [:number, :quantity, :price, :attributes], 'LineItem')
11868
+ @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
11869
+ @quantity = HttpClient::Preconditions.assert_class('quantity', opts.delete(:quantity), Integer)
11870
+ @price = (x = opts.delete(:price); x.is_a?(::Io::Flow::V0::Models::Money) ? x : ::Io::Flow::V0::Models::Money.new(x))
11871
+ @attributes = HttpClient::Preconditions.assert_class('attributes', opts.delete(:attributes), Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h }
11872
+ @center = (x = opts.delete(:center); x.nil? ? nil : HttpClient::Preconditions.assert_class('center', x, String))
11873
+ @discount = (x = opts.delete(:discount); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Money) ? x : ::Io::Flow::V0::Models::Money.new(x)))
11866
11874
  end
11867
11875
 
11868
11876
  def to_json
@@ -11870,292 +11878,7 @@ module Io
11870
11878
  end
11871
11879
 
11872
11880
  def copy(incoming={})
11873
- LabelEventSummary.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
11874
- end
11875
-
11876
- def to_hash
11877
- {
11878
- :id => id,
11879
- :status => status.value,
11880
- :timestamp => timestamp
11881
- }
11882
- end
11883
-
11884
- end
11885
-
11886
- class LabelEventVersion
11887
-
11888
- attr_reader :id, :timestamp, :type, :label_event
11889
-
11890
- def initialize(incoming={})
11891
- opts = HttpClient::Helper.symbolize_keys(incoming)
11892
- HttpClient::Preconditions.require_keys(opts, [:id, :timestamp, :type, :label_event], 'LabelEventVersion')
11893
- @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
11894
- @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
11895
- @type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::ChangeType) ? x : ::Io::Flow::V0::Models::ChangeType.apply(x))
11896
- @label_event = (x = opts.delete(:label_event); x.is_a?(::Io::Flow::V0::Models::LabelEventSummary) ? x : ::Io::Flow::V0::Models::LabelEventSummary.new(x))
11897
- end
11898
-
11899
- def to_json
11900
- JSON.dump(to_hash)
11901
- end
11902
-
11903
- def copy(incoming={})
11904
- LabelEventVersion.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
11905
- end
11906
-
11907
- def to_hash
11908
- {
11909
- :id => id,
11910
- :timestamp => timestamp,
11911
- :type => type.value,
11912
- :label_event => label_event.to_hash
11913
- }
11914
- end
11915
-
11916
- end
11917
-
11918
- # Represents a specific label being tracked as part of the tracking bucket
11919
- class LabelForm
11920
-
11921
- attr_reader :tracking_id, :status, :carrier, :tracking_number, :delivery_estimate, :description, :timestamp
11922
-
11923
- def initialize(incoming={})
11924
- opts = HttpClient::Helper.symbolize_keys(incoming)
11925
- HttpClient::Preconditions.require_keys(opts, [:tracking_id, :carrier, :tracking_number], 'LabelForm')
11926
- @tracking_id = HttpClient::Preconditions.assert_class('tracking_id', opts.delete(:tracking_id), String)
11927
- @status = (x = (x = opts.delete(:status); x.nil? ? "pending" : x); x.is_a?(::Io::Flow::V0::Models::TrackingStatus) ? x : ::Io::Flow::V0::Models::TrackingStatus.apply(x))
11928
- @carrier = HttpClient::Preconditions.assert_class('carrier', opts.delete(:carrier), String)
11929
- @tracking_number = HttpClient::Preconditions.assert_class('tracking_number', opts.delete(:tracking_number), String)
11930
- @delivery_estimate = (x = opts.delete(:delivery_estimate); x.nil? ? nil : HttpClient::Preconditions.assert_class('delivery_estimate', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
11931
- @description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
11932
- @timestamp = (x = opts.delete(:timestamp); x.nil? ? nil : HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
11933
- end
11934
-
11935
- def to_json
11936
- JSON.dump(to_hash)
11937
- end
11938
-
11939
- def copy(incoming={})
11940
- LabelForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
11941
- end
11942
-
11943
- def to_hash
11944
- {
11945
- :tracking_id => tracking_id,
11946
- :status => status.value,
11947
- :carrier => carrier,
11948
- :tracking_number => tracking_number,
11949
- :delivery_estimate => delivery_estimate,
11950
- :description => description,
11951
- :timestamp => timestamp
11952
- }
11953
- end
11954
-
11955
- end
11956
-
11957
- class LabelOrderSummary
11958
-
11959
- attr_reader :id, :number
11960
-
11961
- def initialize(incoming={})
11962
- opts = HttpClient::Helper.symbolize_keys(incoming)
11963
- HttpClient::Preconditions.require_keys(opts, [:id, :number], 'LabelOrderSummary')
11964
- @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
11965
- @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
11966
- end
11967
-
11968
- def to_json
11969
- JSON.dump(to_hash)
11970
- end
11971
-
11972
- def copy(incoming={})
11973
- LabelOrderSummary.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
11974
- end
11975
-
11976
- def to_hash
11977
- {
11978
- :id => id,
11979
- :number => number
11980
- }
11981
- end
11982
-
11983
- end
11984
-
11985
- class LabelSummary
11986
-
11987
- attr_reader :id, :tracking, :status, :carrier, :tracking_number
11988
-
11989
- def initialize(incoming={})
11990
- opts = HttpClient::Helper.symbolize_keys(incoming)
11991
- HttpClient::Preconditions.require_keys(opts, [:id, :tracking, :status, :carrier, :tracking_number], 'LabelSummary')
11992
- @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
11993
- @tracking = (x = opts.delete(:tracking); x.is_a?(::Io::Flow::V0::Models::TrackingSummary) ? x : ::Io::Flow::V0::Models::TrackingSummary.new(x))
11994
- @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::TrackingStatus) ? x : ::Io::Flow::V0::Models::TrackingStatus.apply(x))
11995
- @carrier = HttpClient::Preconditions.assert_class('carrier', opts.delete(:carrier), String)
11996
- @tracking_number = HttpClient::Preconditions.assert_class('tracking_number', opts.delete(:tracking_number), String)
11997
- end
11998
-
11999
- def to_json
12000
- JSON.dump(to_hash)
12001
- end
12002
-
12003
- def copy(incoming={})
12004
- LabelSummary.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
12005
- end
12006
-
12007
- def to_hash
12008
- {
12009
- :id => id,
12010
- :tracking => tracking.to_hash,
12011
- :status => status.value,
12012
- :carrier => carrier,
12013
- :tracking_number => tracking_number
12014
- }
12015
- end
12016
-
12017
- end
12018
-
12019
- class LabelUpserted < Event
12020
-
12021
- attr_reader :event_id, :timestamp, :organization, :label_id, :carrier_tracking_number, :flow_tracking_number, :data, :destination, :origin, :carrier, :service, :commercial_invoice, :pdf, :png, :order
12022
-
12023
- def initialize(incoming={})
12024
- super(:name => Event::Types::LABEL_UPSERTED)
12025
- opts = HttpClient::Helper.symbolize_keys(incoming)
12026
- HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :label_id, :carrier_tracking_number, :flow_tracking_number, :data, :destination, :origin, :carrier, :service], 'LabelUpserted')
12027
- @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
12028
- @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
12029
- @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
12030
- @label_id = HttpClient::Preconditions.assert_class('label_id', opts.delete(:label_id), String)
12031
- @carrier_tracking_number = HttpClient::Preconditions.assert_class('carrier_tracking_number', opts.delete(:carrier_tracking_number), String)
12032
- @flow_tracking_number = HttpClient::Preconditions.assert_class('flow_tracking_number', opts.delete(:flow_tracking_number), String)
12033
- @data = HttpClient::Preconditions.assert_class('data', opts.delete(:data), String)
12034
- @destination = HttpClient::Preconditions.assert_class('destination', HttpClient::Helper.to_object(opts.delete(:destination)), Hash)
12035
- @origin = HttpClient::Preconditions.assert_class('origin', HttpClient::Helper.to_object(opts.delete(:origin)), Hash)
12036
- @carrier = HttpClient::Preconditions.assert_class('carrier', opts.delete(:carrier), String)
12037
- @service = HttpClient::Preconditions.assert_class('service', opts.delete(:service), String)
12038
- @commercial_invoice = (x = opts.delete(:commercial_invoice); x.nil? ? nil : HttpClient::Preconditions.assert_class('commercial_invoice', x, String))
12039
- @pdf = (x = opts.delete(:pdf); x.nil? ? nil : HttpClient::Preconditions.assert_class('pdf', x, String))
12040
- @png = (x = opts.delete(:png); x.nil? ? nil : HttpClient::Preconditions.assert_class('png', x, String))
12041
- @order = (x = opts.delete(:order); x.nil? ? nil : HttpClient::Preconditions.assert_class('order', x, String))
12042
- end
12043
-
12044
- def to_json
12045
- JSON.dump(to_hash)
12046
- end
12047
-
12048
- def copy(incoming={})
12049
- LabelUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
12050
- end
12051
-
12052
- def subtype_to_hash
12053
- {
12054
- :event_id => event_id,
12055
- :timestamp => timestamp,
12056
- :organization => organization,
12057
- :label_id => label_id,
12058
- :carrier_tracking_number => carrier_tracking_number,
12059
- :flow_tracking_number => flow_tracking_number,
12060
- :data => data,
12061
- :destination => destination,
12062
- :origin => origin,
12063
- :carrier => carrier,
12064
- :service => service,
12065
- :commercial_invoice => commercial_invoice,
12066
- :pdf => pdf,
12067
- :png => png,
12068
- :order => order
12069
- }
12070
- end
12071
-
12072
- end
12073
-
12074
- class LabelVersion
12075
-
12076
- attr_reader :id, :timestamp, :type, :label
12077
-
12078
- def initialize(incoming={})
12079
- opts = HttpClient::Helper.symbolize_keys(incoming)
12080
- HttpClient::Preconditions.require_keys(opts, [:id, :timestamp, :type, :label], 'LabelVersion')
12081
- @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
12082
- @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
12083
- @type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::ChangeType) ? x : ::Io::Flow::V0::Models::ChangeType.apply(x))
12084
- @label = (x = opts.delete(:label); x.is_a?(::Io::Flow::V0::Models::LabelSummary) ? x : ::Io::Flow::V0::Models::LabelSummary.new(x))
12085
- end
12086
-
12087
- def to_json
12088
- JSON.dump(to_hash)
12089
- end
12090
-
12091
- def copy(incoming={})
12092
- LabelVersion.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
12093
- end
12094
-
12095
- def to_hash
12096
- {
12097
- :id => id,
12098
- :timestamp => timestamp,
12099
- :type => type.value,
12100
- :label => label.to_hash
12101
- }
12102
- end
12103
-
12104
- end
12105
-
12106
- # ISO 639 2-character language code. See https://api.flow.io/reference/languages
12107
- class Language
12108
-
12109
- attr_reader :name, :iso_639_2
12110
-
12111
- def initialize(incoming={})
12112
- opts = HttpClient::Helper.symbolize_keys(incoming)
12113
- HttpClient::Preconditions.require_keys(opts, [:name, :iso_639_2], 'Language')
12114
- @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
12115
- @iso_639_2 = HttpClient::Preconditions.assert_class('iso_639_2', opts.delete(:iso_639_2), String)
12116
- end
12117
-
12118
- def to_json
12119
- JSON.dump(to_hash)
12120
- end
12121
-
12122
- def copy(incoming={})
12123
- Language.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
12124
- end
12125
-
12126
- def to_hash
12127
- {
12128
- :name => name,
12129
- :iso_639_2 => iso_639_2
12130
- }
12131
- end
12132
-
12133
- end
12134
-
12135
- # Line items represent the items a consumer is purchasing, including additional
12136
- # information to complete the transaction. Note that you may pass in as many
12137
- # line items as you like - including repeating item numbers across line items.
12138
- class LineItem
12139
-
12140
- attr_reader :number, :quantity, :price, :attributes, :center, :discount
12141
-
12142
- def initialize(incoming={})
12143
- opts = HttpClient::Helper.symbolize_keys(incoming)
12144
- HttpClient::Preconditions.require_keys(opts, [:number, :quantity, :price, :attributes], 'LineItem')
12145
- @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
12146
- @quantity = HttpClient::Preconditions.assert_class('quantity', opts.delete(:quantity), Integer)
12147
- @price = (x = opts.delete(:price); x.is_a?(::Io::Flow::V0::Models::Money) ? x : ::Io::Flow::V0::Models::Money.new(x))
12148
- @attributes = HttpClient::Preconditions.assert_class('attributes', opts.delete(:attributes), Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h }
12149
- @center = (x = opts.delete(:center); x.nil? ? nil : HttpClient::Preconditions.assert_class('center', x, String))
12150
- @discount = (x = opts.delete(:discount); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Money) ? x : ::Io::Flow::V0::Models::Money.new(x)))
12151
- end
12152
-
12153
- def to_json
12154
- JSON.dump(to_hash)
12155
- end
12156
-
12157
- def copy(incoming={})
12158
- LineItem.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
11881
+ LineItem.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
12159
11882
  end
12160
11883
 
12161
11884
  def to_hash
@@ -13034,9 +12757,9 @@ module Io
13034
12757
 
13035
12758
  def initialize(incoming={})
13036
12759
  opts = HttpClient::Helper.symbolize_keys(incoming)
13037
- HttpClient::Preconditions.require_keys(opts, [:number, :customer, :destination, :items], 'OrderForm')
12760
+ HttpClient::Preconditions.require_keys(opts, [:number, :destination, :items], 'OrderForm')
13038
12761
  @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
13039
- @customer = (x = opts.delete(:customer); x.is_a?(::Io::Flow::V0::Models::Customer) ? x : ::Io::Flow::V0::Models::Customer.new(x))
12762
+ @customer = (x = opts.delete(:customer); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Customer) ? x : ::Io::Flow::V0::Models::Customer.new(x)))
13040
12763
  @destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::Address) ? x : ::Io::Flow::V0::Models::Address.new(x))
13041
12764
  @items = HttpClient::Preconditions.assert_class('items', opts.delete(:items), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::LineItemForm) ? x : ::Io::Flow::V0::Models::LineItemForm.new(x)) }
13042
12765
  @discount = (x = opts.delete(:discount); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Money) ? x : ::Io::Flow::V0::Models::Money.new(x)))
@@ -13054,7 +12777,7 @@ module Io
13054
12777
  def to_hash
13055
12778
  {
13056
12779
  :number => number,
13057
- :customer => customer.to_hash,
12780
+ :customer => customer.nil? ? nil : customer.to_hash,
13058
12781
  :destination => destination.to_hash,
13059
12782
  :items => items.map { |o| o.to_hash },
13060
12783
  :discount => discount.nil? ? nil : discount.to_hash,
@@ -13178,14 +12901,14 @@ module Io
13178
12901
  # pricing and delivery options for destination and items/quantities specified.
13179
12902
  class OrderPutForm
13180
12903
 
13181
- attr_reader :customer, :destination, :items, :selections, :discount, :attributes
12904
+ attr_reader :destination, :items, :customer, :selections, :discount, :attributes
13182
12905
 
13183
12906
  def initialize(incoming={})
13184
12907
  opts = HttpClient::Helper.symbolize_keys(incoming)
13185
- HttpClient::Preconditions.require_keys(opts, [:customer, :destination, :items], 'OrderPutForm')
13186
- @customer = (x = opts.delete(:customer); x.is_a?(::Io::Flow::V0::Models::Customer) ? x : ::Io::Flow::V0::Models::Customer.new(x))
12908
+ HttpClient::Preconditions.require_keys(opts, [:destination, :items], 'OrderPutForm')
13187
12909
  @destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::Address) ? x : ::Io::Flow::V0::Models::Address.new(x))
13188
12910
  @items = HttpClient::Preconditions.assert_class('items', opts.delete(:items), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::LineItemForm) ? x : ::Io::Flow::V0::Models::LineItemForm.new(x)) }
12911
+ @customer = (x = opts.delete(:customer); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Customer) ? x : ::Io::Flow::V0::Models::Customer.new(x)))
13189
12912
  @selections = (x = opts.delete(:selections); x.nil? ? nil : HttpClient::Preconditions.assert_class('selections', x, Array).map { |v| HttpClient::Preconditions.assert_class('selections', v, String) })
13190
12913
  @discount = (x = opts.delete(:discount); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Money) ? x : ::Io::Flow::V0::Models::Money.new(x)))
13191
12914
  @attributes = (x = opts.delete(:attributes); x.nil? ? nil : HttpClient::Preconditions.assert_class('attributes', x, Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h })
@@ -13201,9 +12924,9 @@ module Io
13201
12924
 
13202
12925
  def to_hash
13203
12926
  {
13204
- :customer => customer.to_hash,
13205
12927
  :destination => destination.to_hash,
13206
12928
  :items => items.map { |o| o.to_hash },
12929
+ :customer => customer.nil? ? nil : customer.to_hash,
13207
12930
  :selections => selections.nil? ? nil : selections,
13208
12931
  :discount => discount.nil? ? nil : discount.to_hash,
13209
12932
  :attributes => attributes.nil? ? nil : attributes
@@ -16469,12 +16192,13 @@ module Io
16469
16192
  # tracking number
16470
16193
  class Tracking
16471
16194
 
16472
- attr_reader :id, :status, :metadata, :order_number
16195
+ attr_reader :id, :labels, :status, :metadata, :order_number
16473
16196
 
16474
16197
  def initialize(incoming={})
16475
16198
  opts = HttpClient::Helper.symbolize_keys(incoming)
16476
- HttpClient::Preconditions.require_keys(opts, [:id, :status, :metadata], 'Tracking')
16199
+ HttpClient::Preconditions.require_keys(opts, [:id, :labels, :status, :metadata], 'Tracking')
16477
16200
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
16201
+ @labels = HttpClient::Preconditions.assert_class('labels', opts.delete(:labels), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::TrackingLabel) ? x : ::Io::Flow::V0::Models::TrackingLabel.new(x)) }
16478
16202
  @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::TrackingStatus) ? x : ::Io::Flow::V0::Models::TrackingStatus.apply(x))
16479
16203
  @metadata = HttpClient::Preconditions.assert_class('metadata', HttpClient::Helper.to_object(opts.delete(:metadata)), Hash)
16480
16204
  @order_number = (x = opts.delete(:order_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('order_number', x, String))
@@ -16491,6 +16215,7 @@ module Io
16491
16215
  def to_hash
16492
16216
  {
16493
16217
  :id => id,
16218
+ :labels => labels.map { |o| o.to_hash },
16494
16219
  :status => status.value,
16495
16220
  :metadata => metadata,
16496
16221
  :order_number => order_number
@@ -16499,6 +16224,136 @@ module Io
16499
16224
 
16500
16225
  end
16501
16226
 
16227
+ class TrackingEvent
16228
+
16229
+ attr_reader :id, :address, :status, :timestamp, :description
16230
+
16231
+ def initialize(incoming={})
16232
+ opts = HttpClient::Helper.symbolize_keys(incoming)
16233
+ HttpClient::Preconditions.require_keys(opts, [:id, :address, :status, :timestamp], 'TrackingEvent')
16234
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
16235
+ @address = (x = opts.delete(:address); x.is_a?(::Io::Flow::V0::Models::Address) ? x : ::Io::Flow::V0::Models::Address.new(x))
16236
+ @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::TrackingStatus) ? x : ::Io::Flow::V0::Models::TrackingStatus.apply(x))
16237
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
16238
+ @description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
16239
+ end
16240
+
16241
+ def to_json
16242
+ JSON.dump(to_hash)
16243
+ end
16244
+
16245
+ def copy(incoming={})
16246
+ TrackingEvent.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
16247
+ end
16248
+
16249
+ def to_hash
16250
+ {
16251
+ :id => id,
16252
+ :address => address.to_hash,
16253
+ :status => status.value,
16254
+ :timestamp => timestamp,
16255
+ :description => description
16256
+ }
16257
+ end
16258
+
16259
+ end
16260
+
16261
+ class TrackingEventForm
16262
+
16263
+ attr_reader :tracking_label_id, :timestamp, :status, :description, :address
16264
+
16265
+ def initialize(incoming={})
16266
+ opts = HttpClient::Helper.symbolize_keys(incoming)
16267
+ HttpClient::Preconditions.require_keys(opts, [:tracking_label_id, :timestamp, :status], 'TrackingEventForm')
16268
+ @tracking_label_id = HttpClient::Preconditions.assert_class('tracking_label_id', opts.delete(:tracking_label_id), String)
16269
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
16270
+ @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::TrackingStatus) ? x : ::Io::Flow::V0::Models::TrackingStatus.apply(x))
16271
+ @description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
16272
+ @address = (x = opts.delete(:address); x.nil? ? nil : HttpClient::Preconditions.assert_class('address', x, String))
16273
+ end
16274
+
16275
+ def to_json
16276
+ JSON.dump(to_hash)
16277
+ end
16278
+
16279
+ def copy(incoming={})
16280
+ TrackingEventForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
16281
+ end
16282
+
16283
+ def to_hash
16284
+ {
16285
+ :tracking_label_id => tracking_label_id,
16286
+ :timestamp => timestamp,
16287
+ :status => status.value,
16288
+ :description => description,
16289
+ :address => address
16290
+ }
16291
+ end
16292
+
16293
+ end
16294
+
16295
+ class TrackingEventSummary
16296
+
16297
+ attr_reader :id, :status, :timestamp
16298
+
16299
+ def initialize(incoming={})
16300
+ opts = HttpClient::Helper.symbolize_keys(incoming)
16301
+ HttpClient::Preconditions.require_keys(opts, [:id, :status, :timestamp], 'TrackingEventSummary')
16302
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
16303
+ @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::TrackingStatus) ? x : ::Io::Flow::V0::Models::TrackingStatus.apply(x))
16304
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
16305
+ end
16306
+
16307
+ def to_json
16308
+ JSON.dump(to_hash)
16309
+ end
16310
+
16311
+ def copy(incoming={})
16312
+ TrackingEventSummary.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
16313
+ end
16314
+
16315
+ def to_hash
16316
+ {
16317
+ :id => id,
16318
+ :status => status.value,
16319
+ :timestamp => timestamp
16320
+ }
16321
+ end
16322
+
16323
+ end
16324
+
16325
+ class TrackingEventVersion
16326
+
16327
+ attr_reader :id, :timestamp, :type, :tracking_event
16328
+
16329
+ def initialize(incoming={})
16330
+ opts = HttpClient::Helper.symbolize_keys(incoming)
16331
+ HttpClient::Preconditions.require_keys(opts, [:id, :timestamp, :type, :tracking_event], 'TrackingEventVersion')
16332
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
16333
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
16334
+ @type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::ChangeType) ? x : ::Io::Flow::V0::Models::ChangeType.apply(x))
16335
+ @tracking_event = (x = opts.delete(:tracking_event); x.is_a?(::Io::Flow::V0::Models::TrackingEventSummary) ? x : ::Io::Flow::V0::Models::TrackingEventSummary.new(x))
16336
+ end
16337
+
16338
+ def to_json
16339
+ JSON.dump(to_hash)
16340
+ end
16341
+
16342
+ def copy(incoming={})
16343
+ TrackingEventVersion.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
16344
+ end
16345
+
16346
+ def to_hash
16347
+ {
16348
+ :id => id,
16349
+ :timestamp => timestamp,
16350
+ :type => type.value,
16351
+ :tracking_event => tracking_event.to_hash
16352
+ }
16353
+ end
16354
+
16355
+ end
16356
+
16502
16357
  # Top level tracking information which contains labels. In cases where shipments
16503
16358
  # are re-labeled, you will see multiple labels for each tracking allowing simple
16504
16359
  # access to see where a shipment is - with which carrier and with the local
@@ -16532,6 +16387,47 @@ module Io
16532
16387
 
16533
16388
  end
16534
16389
 
16390
+ # Represents a specific label being tracked as part of the tracking bucket
16391
+ class TrackingLabel
16392
+
16393
+ attr_reader :id, :carrier, :carrier_tracking_number, :events, :status, :timestamp, :delivery_estimate, :description
16394
+
16395
+ def initialize(incoming={})
16396
+ opts = HttpClient::Helper.symbolize_keys(incoming)
16397
+ HttpClient::Preconditions.require_keys(opts, [:id, :carrier, :carrier_tracking_number, :events, :status, :timestamp], 'TrackingLabel')
16398
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
16399
+ @carrier = HttpClient::Preconditions.assert_class('carrier', opts.delete(:carrier), String)
16400
+ @carrier_tracking_number = HttpClient::Preconditions.assert_class('carrier_tracking_number', opts.delete(:carrier_tracking_number), String)
16401
+ @events = HttpClient::Preconditions.assert_class('events', opts.delete(:events), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::TrackingEvent) ? x : ::Io::Flow::V0::Models::TrackingEvent.new(x)) }
16402
+ @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::TrackingStatus) ? x : ::Io::Flow::V0::Models::TrackingStatus.apply(x))
16403
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
16404
+ @delivery_estimate = (x = opts.delete(:delivery_estimate); x.nil? ? nil : HttpClient::Preconditions.assert_class('delivery_estimate', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
16405
+ @description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
16406
+ end
16407
+
16408
+ def to_json
16409
+ JSON.dump(to_hash)
16410
+ end
16411
+
16412
+ def copy(incoming={})
16413
+ TrackingLabel.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
16414
+ end
16415
+
16416
+ def to_hash
16417
+ {
16418
+ :id => id,
16419
+ :carrier => carrier,
16420
+ :carrier_tracking_number => carrier_tracking_number,
16421
+ :events => events.map { |o| o.to_hash },
16422
+ :status => status.value,
16423
+ :timestamp => timestamp,
16424
+ :delivery_estimate => delivery_estimate,
16425
+ :description => description
16426
+ }
16427
+ end
16428
+
16429
+ end
16430
+
16535
16431
  class TrackingLabelEventUpserted < Event
16536
16432
 
16537
16433
  attr_reader :event_id, :timestamp, :organization, :address, :carrier, :carrier_timestamp, :carrier_tracking_number, :flow_tracking_number, :status, :delivery_estimate, :description, :order_number
@@ -16581,6 +16477,111 @@ module Io
16581
16477
 
16582
16478
  end
16583
16479
 
16480
+ # Represents a specific label being tracked as part of the tracking bucket
16481
+ class TrackingLabelForm
16482
+
16483
+ attr_reader :tracking_id, :status, :carrier, :carrier_tracking_number, :delivery_estimate, :description, :timestamp
16484
+
16485
+ def initialize(incoming={})
16486
+ opts = HttpClient::Helper.symbolize_keys(incoming)
16487
+ HttpClient::Preconditions.require_keys(opts, [:tracking_id, :carrier, :carrier_tracking_number], 'TrackingLabelForm')
16488
+ @tracking_id = HttpClient::Preconditions.assert_class('tracking_id', opts.delete(:tracking_id), String)
16489
+ @status = (x = (x = opts.delete(:status); x.nil? ? "pending" : x); x.is_a?(::Io::Flow::V0::Models::TrackingStatus) ? x : ::Io::Flow::V0::Models::TrackingStatus.apply(x))
16490
+ @carrier = HttpClient::Preconditions.assert_class('carrier', opts.delete(:carrier), String)
16491
+ @carrier_tracking_number = HttpClient::Preconditions.assert_class('carrier_tracking_number', opts.delete(:carrier_tracking_number), String)
16492
+ @delivery_estimate = (x = opts.delete(:delivery_estimate); x.nil? ? nil : HttpClient::Preconditions.assert_class('delivery_estimate', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
16493
+ @description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
16494
+ @timestamp = (x = opts.delete(:timestamp); x.nil? ? nil : HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
16495
+ end
16496
+
16497
+ def to_json
16498
+ JSON.dump(to_hash)
16499
+ end
16500
+
16501
+ def copy(incoming={})
16502
+ TrackingLabelForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
16503
+ end
16504
+
16505
+ def to_hash
16506
+ {
16507
+ :tracking_id => tracking_id,
16508
+ :status => status.value,
16509
+ :carrier => carrier,
16510
+ :carrier_tracking_number => carrier_tracking_number,
16511
+ :delivery_estimate => delivery_estimate,
16512
+ :description => description,
16513
+ :timestamp => timestamp
16514
+ }
16515
+ end
16516
+
16517
+ end
16518
+
16519
+ class TrackingLabelSummary
16520
+
16521
+ attr_reader :id, :tracking, :status, :carrier, :tracking_number
16522
+
16523
+ def initialize(incoming={})
16524
+ opts = HttpClient::Helper.symbolize_keys(incoming)
16525
+ HttpClient::Preconditions.require_keys(opts, [:id, :tracking, :status, :carrier, :tracking_number], 'TrackingLabelSummary')
16526
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
16527
+ @tracking = (x = opts.delete(:tracking); x.is_a?(::Io::Flow::V0::Models::TrackingSummary) ? x : ::Io::Flow::V0::Models::TrackingSummary.new(x))
16528
+ @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::TrackingStatus) ? x : ::Io::Flow::V0::Models::TrackingStatus.apply(x))
16529
+ @carrier = HttpClient::Preconditions.assert_class('carrier', opts.delete(:carrier), String)
16530
+ @tracking_number = HttpClient::Preconditions.assert_class('tracking_number', opts.delete(:tracking_number), String)
16531
+ end
16532
+
16533
+ def to_json
16534
+ JSON.dump(to_hash)
16535
+ end
16536
+
16537
+ def copy(incoming={})
16538
+ TrackingLabelSummary.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
16539
+ end
16540
+
16541
+ def to_hash
16542
+ {
16543
+ :id => id,
16544
+ :tracking => tracking.to_hash,
16545
+ :status => status.value,
16546
+ :carrier => carrier,
16547
+ :tracking_number => tracking_number
16548
+ }
16549
+ end
16550
+
16551
+ end
16552
+
16553
+ class TrackingLabelVersion
16554
+
16555
+ attr_reader :id, :timestamp, :type, :tracking_label
16556
+
16557
+ def initialize(incoming={})
16558
+ opts = HttpClient::Helper.symbolize_keys(incoming)
16559
+ HttpClient::Preconditions.require_keys(opts, [:id, :timestamp, :type, :tracking_label], 'TrackingLabelVersion')
16560
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
16561
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
16562
+ @type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::ChangeType) ? x : ::Io::Flow::V0::Models::ChangeType.apply(x))
16563
+ @tracking_label = (x = opts.delete(:tracking_label); x.is_a?(::Io::Flow::V0::Models::TrackingLabelSummary) ? x : ::Io::Flow::V0::Models::TrackingLabelSummary.new(x))
16564
+ end
16565
+
16566
+ def to_json
16567
+ JSON.dump(to_hash)
16568
+ end
16569
+
16570
+ def copy(incoming={})
16571
+ TrackingLabelVersion.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
16572
+ end
16573
+
16574
+ def to_hash
16575
+ {
16576
+ :id => id,
16577
+ :timestamp => timestamp,
16578
+ :type => type.value,
16579
+ :tracking_label => tracking_label.to_hash
16580
+ }
16581
+ end
16582
+
16583
+ end
16584
+
16584
16585
  class TrackingSummary
16585
16586
 
16586
16587
  attr_reader :id, :status, :order_number
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flowcommerce
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.63
4
+ version: 0.0.64
5
5
  platform: ruby
6
6
  authors:
7
7
  - Flow Commerce, Inc.