flowcommerce 0.0.57 → 0.0.58

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: 4930c802478cc4684b00252482f9e2ef08fd5f77
4
- data.tar.gz: c2dac04fc4b8e002c830a3e4f7841fa12c814e5d
3
+ metadata.gz: ac872a6d24b96c585b4d9965ac45417999ba3472
4
+ data.tar.gz: 5924225c5cf7f4f1b54b43c811861625c00e3c22
5
5
  SHA512:
6
- metadata.gz: a06b10fece32d3f5c0126ddc4553954d31013b25d610e56827233d8b93198c830e370c899d2116093f8356019e8ca6126843fae9295ae34967d778ce659c3e21
7
- data.tar.gz: 96b4edc1e275b6dcfc16fdd566b4b142b0e9d9d0a825bb4ebda4334ca07246bde09b96a83c319df34f3735ca0ef193ef3999c57c26b97fd762c34291a4a725d8
6
+ metadata.gz: 6751f5a87be52cfb0dea6ff86639cf310f621924a974994639ad6a9f195c8307959cd0087bc49aba7bf7767ec3f966ee55c306a6a0119c1c22cfa348b3539eaa
7
+ data.tar.gz: 7fbb61f17179fa2cd4c7a9b02e034ce7da3cd9fb45a802dce0d59992f609a2676155af447573efd63bff0df2d57dfa0ac4b01053eaadc892f6d47cd3df1156cb
@@ -1,6 +1,6 @@
1
1
  # Generated by apidoc - http://www.apidoc.me
2
2
  # Service version: 0.1.55
3
- # apidoc:0.11.37 http://www.apidoc.me/flow/api/0.1.54/ruby_client
3
+ # apidoc:0.11.37 http://www.apidoc.me/flow/api/0.1.57/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.54/ruby_client' unless defined?(Constants::USER_AGENT)
28
+ USER_AGENT = 'apidoc:0.11.37 http://www.apidoc.me/flow/api/0.1.57/ruby_client' unless defined?(Constants::USER_AGENT)
29
29
  VERSION = '0.1.55' unless defined?(Constants::VERSION)
30
30
  VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
31
31
 
@@ -233,8 +233,8 @@ module Io
233
233
  @webhooks ||= ::Io::Flow::V0::Clients::Webhooks.new(self)
234
234
  end
235
235
 
236
- def webhook_requests
237
- @webhook_requests ||= ::Io::Flow::V0::Clients::WebhookRequests.new(self)
236
+ def webhook_deliveries
237
+ @webhook_deliveries ||= ::Io::Flow::V0::Clients::WebhookDeliveries.new(self)
238
238
  end
239
239
 
240
240
  def addresses
@@ -503,6 +503,14 @@ module Io
503
503
  ::Io::Flow::V0::Models::ItemMargin.new(r)
504
504
  end
505
505
 
506
+ def put_margins_by_key(organization, key, item_margins)
507
+ HttpClient::Preconditions.assert_class('organization', organization, String)
508
+ HttpClient::Preconditions.assert_class('key', key, String)
509
+ HttpClient::Preconditions.assert_collection_of_class('item_margins', item_margins, ::Io::Flow::V0::Models::ItemMargin)
510
+ r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(key)}/margins").with_json(item_margins.map { |o| o.to_hash }.to_json).put
511
+ r.map { |x| ::Io::Flow::V0::Models::ItemMargin.new(x) }
512
+ end
513
+
506
514
  def get_margins_by_key_and_id(organization, key, id)
507
515
  HttpClient::Preconditions.assert_class('organization', organization, String)
508
516
  HttpClient::Preconditions.assert_class('key', key, String)
@@ -2409,6 +2417,7 @@ module Io
2409
2417
  :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
2410
2418
  :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) }),
2411
2419
  :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) }),
2420
+ :order_number => (x = opts.delete(:order_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('order_number', x, Array).map { |v| HttpClient::Preconditions.assert_class('order_number', v, String) }),
2412
2421
  :service => (x = opts.delete(:service); x.nil? ? nil : HttpClient::Preconditions.assert_class('service', x, Array).map { |v| HttpClient::Preconditions.assert_class('service', v, String) }),
2413
2422
  :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
2414
2423
  :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
@@ -2735,15 +2744,30 @@ module Io
2735
2744
  nil
2736
2745
  end
2737
2746
 
2747
+ # Returns the webhook settings for an organization
2748
+ def get_settings(organization)
2749
+ HttpClient::Preconditions.assert_class('organization', organization, String)
2750
+ r = @client.request("/#{CGI.escape(organization)}/webhooks/settings").get
2751
+ ::Io::Flow::V0::Models::WebhookSettings.new(r)
2752
+ end
2753
+
2754
+ # Updates the webhook settings for an organization
2755
+ def put_settings(organization, webhook_settings)
2756
+ HttpClient::Preconditions.assert_class('organization', organization, String)
2757
+ HttpClient::Preconditions.assert_class('webhook_settings', webhook_settings, ::Io::Flow::V0::Models::WebhookSettings)
2758
+ r = @client.request("/#{CGI.escape(organization)}/webhooks/settings").with_json(webhook_settings.to_json).put
2759
+ ::Io::Flow::V0::Models::WebhookSettings.new(r)
2760
+ end
2761
+
2738
2762
  end
2739
2763
 
2740
- class WebhookRequests
2764
+ class WebhookDeliveries
2741
2765
 
2742
2766
  def initialize(client)
2743
2767
  @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
2744
2768
  end
2745
2769
 
2746
- # Returns requests for an organization's webhook
2770
+ # Returns deliveries for an organization's webhook
2747
2771
  def get(organization, incoming={})
2748
2772
  HttpClient::Preconditions.assert_class('organization', organization, String)
2749
2773
  opts = HttpClient::Helper.symbolize_keys(incoming)
@@ -2754,25 +2778,25 @@ module Io
2754
2778
  :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
2755
2779
  :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
2756
2780
  }.delete_if { |k, v| v.nil? }
2757
- r = @client.request("/#{CGI.escape(organization)}/webhook/requests").with_query(query).get
2758
- r.map { |x| ::Io::Flow::V0::Models::WebhookRequest.new(x) }
2781
+ r = @client.request("/#{CGI.escape(organization)}/webhook/deliveries").with_query(query).get
2782
+ r.map { |x| ::Io::Flow::V0::Models::WebhookDelivery.new(x) }
2759
2783
  end
2760
2784
 
2761
- # Returns information about a specific webhook request
2785
+ # Returns information about a specific webhook delivery
2762
2786
  def get_by_id(organization, id)
2763
2787
  HttpClient::Preconditions.assert_class('organization', organization, String)
2764
2788
  HttpClient::Preconditions.assert_class('id', id, String)
2765
- r = @client.request("/#{CGI.escape(organization)}/webhook/requests/#{CGI.escape(id)}").get
2766
- ::Io::Flow::V0::Models::WebhookRequest.new(r)
2789
+ r = @client.request("/#{CGI.escape(organization)}/webhook/deliveries/#{CGI.escape(id)}").get
2790
+ ::Io::Flow::V0::Models::WebhookDelivery.new(r)
2767
2791
  end
2768
2792
 
2769
2793
  # Redeliver a webhook request. This created a new webhook request to requeue
2770
2794
  # delivery
2771
- def post_redeliveries_by_id(organization, id, hash)
2795
+ def post_requests_by_id(organization, id, hash)
2772
2796
  HttpClient::Preconditions.assert_class('organization', organization, String)
2773
2797
  HttpClient::Preconditions.assert_class('id', id, String)
2774
2798
  HttpClient::Preconditions.assert_class('hash', hash, Hash)
2775
- r = @client.request("/#{CGI.escape(organization)}/webhook/requests/#{CGI.escape(id)}/redeliveries").with_json(hash.to_json).post
2799
+ r = @client.request("/#{CGI.escape(organization)}/webhook/deliveries/#{CGI.escape(id)}/requests").with_json(hash.to_json).post
2776
2800
  ::Io::Flow::V0::Models::WebhookRequest.new(r)
2777
2801
  end
2778
2802
 
@@ -3718,15 +3742,24 @@ module Io
3718
3742
  EXPERIENCE_UPSERTED = 'experience_upserted' unless defined?(EXPERIENCE_UPSERTED)
3719
3743
  ITEM_MARGIN_DELETED = 'item_margin_deleted' unless defined?(ITEM_MARGIN_DELETED)
3720
3744
  ITEM_MARGIN_UPSERTED = 'item_margin_upserted' unless defined?(ITEM_MARGIN_UPSERTED)
3745
+ ORDER_DELETED = 'order_deleted' unless defined?(ORDER_DELETED)
3746
+ ORDER_UPSERTED = 'order_upserted' unless defined?(ORDER_UPSERTED)
3747
+ ORDER_BOOKING_DELETED = 'order_booking_deleted' unless defined?(ORDER_BOOKING_DELETED)
3748
+ ORDER_BOOKING_UPSERTED = 'order_booking_upserted' unless defined?(ORDER_BOOKING_UPSERTED)
3721
3749
  HS6_CODE_UPSERTED = 'hs6_code_upserted' unless defined?(HS6_CODE_UPSERTED)
3722
3750
  HS6_CODE_DELETED = 'hs6_code_deleted' unless defined?(HS6_CODE_DELETED)
3723
3751
  HS10_CODE_UPSERTED = 'hs10_code_upserted' unless defined?(HS10_CODE_UPSERTED)
3724
3752
  HS10_CODE_DELETED = 'hs10_code_deleted' unless defined?(HS10_CODE_DELETED)
3753
+ LABEL_UPSERTED = 'label_upserted' unless defined?(LABEL_UPSERTED)
3725
3754
  LOCALIZED_ITEM_UPSERTED = 'localized_item_upserted' unless defined?(LOCALIZED_ITEM_UPSERTED)
3726
3755
  LOCALIZED_ITEM_DELETED = 'localized_item_deleted' unless defined?(LOCALIZED_ITEM_DELETED)
3727
3756
  LOCALIZED_ITEM_SNAPSHOT = 'localized_item_snapshot' unless defined?(LOCALIZED_ITEM_SNAPSHOT)
3728
3757
  ORGANIZATION_UPSERTED = 'organization_upserted' unless defined?(ORGANIZATION_UPSERTED)
3729
3758
  ORGANIZATION_DELETED = 'organization_deleted' unless defined?(ORGANIZATION_DELETED)
3759
+ AUTHORIZATION_UPSERTED = 'authorization_upserted' unless defined?(AUTHORIZATION_UPSERTED)
3760
+ AUTHORIZATION_DELETED = 'authorization_deleted' unless defined?(AUTHORIZATION_DELETED)
3761
+ CAPTURE_UPSERTED = 'capture_upserted' unless defined?(CAPTURE_UPSERTED)
3762
+ REFUND_UPSERTED = 'refund_upserted' unless defined?(REFUND_UPSERTED)
3730
3763
  TRACKING_LABEL_EVENT_UPSERTED = 'tracking_label_event_upserted' unless defined?(TRACKING_LABEL_EVENT_UPSERTED)
3731
3764
  end
3732
3765
 
@@ -3764,15 +3797,24 @@ module Io
3764
3797
  when Types::EXPERIENCE_UPSERTED; ExperienceUpserted.new(hash)
3765
3798
  when Types::ITEM_MARGIN_DELETED; ItemMarginDeleted.new(hash)
3766
3799
  when Types::ITEM_MARGIN_UPSERTED; ItemMarginUpserted.new(hash)
3800
+ when Types::ORDER_DELETED; OrderDeleted.new(hash)
3801
+ when Types::ORDER_UPSERTED; OrderUpserted.new(hash)
3802
+ when Types::ORDER_BOOKING_DELETED; OrderBookingDeleted.new(hash)
3803
+ when Types::ORDER_BOOKING_UPSERTED; OrderBookingUpserted.new(hash)
3767
3804
  when Types::HS6_CODE_UPSERTED; Hs6CodeUpserted.new(hash)
3768
3805
  when Types::HS6_CODE_DELETED; Hs6CodeDeleted.new(hash)
3769
3806
  when Types::HS10_CODE_UPSERTED; Hs10CodeUpserted.new(hash)
3770
3807
  when Types::HS10_CODE_DELETED; Hs10CodeDeleted.new(hash)
3808
+ when Types::LABEL_UPSERTED; LabelUpserted.new(hash)
3771
3809
  when Types::LOCALIZED_ITEM_UPSERTED; LocalizedItemUpserted.new(hash)
3772
3810
  when Types::LOCALIZED_ITEM_DELETED; LocalizedItemDeleted.new(hash)
3773
3811
  when Types::LOCALIZED_ITEM_SNAPSHOT; LocalizedItemSnapshot.new(hash)
3774
3812
  when Types::ORGANIZATION_UPSERTED; OrganizationUpserted.new(hash)
3775
3813
  when Types::ORGANIZATION_DELETED; OrganizationDeleted.new(hash)
3814
+ when Types::AUTHORIZATION_UPSERTED; AuthorizationUpserted.new(hash)
3815
+ when Types::AUTHORIZATION_DELETED; AuthorizationDeleted.new(hash)
3816
+ when Types::CAPTURE_UPSERTED; CaptureUpserted.new(hash)
3817
+ when Types::REFUND_UPSERTED; RefundUpserted.new(hash)
3776
3818
  when Types::TRACKING_LABEL_EVENT_UPSERTED; TrackingLabelEventUpserted.new(hash)
3777
3819
  else EventUndefinedType.new(:name => union_type_name)
3778
3820
  end
@@ -4863,7 +4905,7 @@ module Io
4863
4905
  end
4864
4906
 
4865
4907
  def EventType.ALL
4866
- @@all ||= [EventType.catalog_upserted, EventType.catalog_deleted, EventType.subcatalog_upserted, EventType.subcatalog_deleted, EventType.catalog_item_upserted, EventType.catalog_item_deleted, EventType.subcatalog_item_upserted, EventType.subcatalog_item_deleted, EventType.flow_currency_setting_deleted, EventType.flow_currency_setting_upserted, EventType.rate_deleted, EventType.rate_upserted, EventType.spot_rate_deleted, EventType.spot_rate_upserted, EventType.organization_currency_setting_deleted, EventType.organization_currency_setting_upserted, EventType.contracted_rate_upserted, EventType.experience_deleted, EventType.experience_upserted, EventType.item_margin_deleted, EventType.item_margin_upserted, EventType.hs6_code_upserted, EventType.hs6_code_deleted, EventType.hs10_code_upserted, EventType.hs10_code_deleted, EventType.localized_item_upserted, EventType.localized_item_deleted, EventType.localized_item_snapshot, EventType.organization_upserted, EventType.organization_deleted, EventType.tracking_label_event_upserted]
4908
+ @@all ||= [EventType.catalog_upserted, EventType.catalog_deleted, EventType.subcatalog_upserted, EventType.subcatalog_deleted, EventType.catalog_item_upserted, EventType.catalog_item_deleted, EventType.subcatalog_item_upserted, EventType.subcatalog_item_deleted, EventType.flow_currency_setting_deleted, EventType.flow_currency_setting_upserted, EventType.rate_deleted, EventType.rate_upserted, EventType.spot_rate_deleted, EventType.spot_rate_upserted, EventType.organization_currency_setting_deleted, EventType.organization_currency_setting_upserted, EventType.contracted_rate_upserted, EventType.experience_deleted, EventType.experience_upserted, EventType.item_margin_deleted, EventType.item_margin_upserted, EventType.order_deleted, EventType.order_upserted, EventType.order_booking_deleted, EventType.order_booking_upserted, EventType.hs6_code_upserted, EventType.hs6_code_deleted, EventType.hs10_code_upserted, EventType.hs10_code_deleted, EventType.label_upserted, EventType.localized_item_upserted, EventType.localized_item_deleted, EventType.localized_item_snapshot, EventType.organization_upserted, EventType.organization_deleted, EventType.authorization_upserted, EventType.authorization_deleted, EventType.capture_upserted, EventType.refund_upserted, EventType.tracking_label_event_upserted]
4867
4909
  end
4868
4910
 
4869
4911
  def EventType.catalog_upserted
@@ -4950,6 +4992,22 @@ module Io
4950
4992
  @@_item_margin_upserted ||= EventType.new('item_margin_upserted')
4951
4993
  end
4952
4994
 
4995
+ def EventType.order_deleted
4996
+ @@_order_deleted ||= EventType.new('order_deleted')
4997
+ end
4998
+
4999
+ def EventType.order_upserted
5000
+ @@_order_upserted ||= EventType.new('order_upserted')
5001
+ end
5002
+
5003
+ def EventType.order_booking_deleted
5004
+ @@_order_booking_deleted ||= EventType.new('order_booking_deleted')
5005
+ end
5006
+
5007
+ def EventType.order_booking_upserted
5008
+ @@_order_booking_upserted ||= EventType.new('order_booking_upserted')
5009
+ end
5010
+
4953
5011
  def EventType.hs6_code_upserted
4954
5012
  @@_hs6_code_upserted ||= EventType.new('hs6_code_upserted')
4955
5013
  end
@@ -4966,6 +5024,10 @@ module Io
4966
5024
  @@_hs10_code_deleted ||= EventType.new('hs10_code_deleted')
4967
5025
  end
4968
5026
 
5027
+ def EventType.label_upserted
5028
+ @@_label_upserted ||= EventType.new('label_upserted')
5029
+ end
5030
+
4969
5031
  def EventType.localized_item_upserted
4970
5032
  @@_localized_item_upserted ||= EventType.new('localized_item_upserted')
4971
5033
  end
@@ -4986,6 +5048,22 @@ module Io
4986
5048
  @@_organization_deleted ||= EventType.new('organization_deleted')
4987
5049
  end
4988
5050
 
5051
+ def EventType.authorization_upserted
5052
+ @@_authorization_upserted ||= EventType.new('authorization_upserted')
5053
+ end
5054
+
5055
+ def EventType.authorization_deleted
5056
+ @@_authorization_deleted ||= EventType.new('authorization_deleted')
5057
+ end
5058
+
5059
+ def EventType.capture_upserted
5060
+ @@_capture_upserted ||= EventType.new('capture_upserted')
5061
+ end
5062
+
5063
+ def EventType.refund_upserted
5064
+ @@_refund_upserted ||= EventType.new('refund_upserted')
5065
+ end
5066
+
4989
5067
  def EventType.tracking_label_event_upserted
4990
5068
  @@_tracking_label_event_upserted ||= EventType.new('tracking_label_event_upserted')
4991
5069
  end
@@ -6495,7 +6573,7 @@ module Io
6495
6573
 
6496
6574
  end
6497
6575
 
6498
- class WebhookRequestStatus
6576
+ class WebhookStatus
6499
6577
 
6500
6578
  attr_reader :value
6501
6579
 
@@ -6503,36 +6581,36 @@ module Io
6503
6581
  @value = HttpClient::Preconditions.assert_class('value', value, String)
6504
6582
  end
6505
6583
 
6506
- # Returns the instance of WebhookRequestStatus for this value, creating a new instance for an unknown value
6507
- def WebhookRequestStatus.apply(value)
6508
- if value.instance_of?(WebhookRequestStatus)
6584
+ # Returns the instance of WebhookStatus for this value, creating a new instance for an unknown value
6585
+ def WebhookStatus.apply(value)
6586
+ if value.instance_of?(WebhookStatus)
6509
6587
  value
6510
6588
  else
6511
6589
  HttpClient::Preconditions.assert_class_or_nil('value', value, String)
6512
- value.nil? ? nil : (from_string(value) || WebhookRequestStatus.new(value))
6590
+ value.nil? ? nil : (from_string(value) || WebhookStatus.new(value))
6513
6591
  end
6514
6592
  end
6515
6593
 
6516
- # Returns the instance of WebhookRequestStatus for this value, or nil if not found
6517
- def WebhookRequestStatus.from_string(value)
6594
+ # Returns the instance of WebhookStatus for this value, or nil if not found
6595
+ def WebhookStatus.from_string(value)
6518
6596
  HttpClient::Preconditions.assert_class('value', value, String)
6519
- WebhookRequestStatus.ALL.find { |v| v.value == value }
6597
+ WebhookStatus.ALL.find { |v| v.value == value }
6520
6598
  end
6521
6599
 
6522
- def WebhookRequestStatus.ALL
6523
- @@all ||= [WebhookRequestStatus.pending, WebhookRequestStatus.success, WebhookRequestStatus.failure]
6600
+ def WebhookStatus.ALL
6601
+ @@all ||= [WebhookStatus.pending, WebhookStatus.success, WebhookStatus.failure]
6524
6602
  end
6525
6603
 
6526
- def WebhookRequestStatus.pending
6527
- @@_pending ||= WebhookRequestStatus.new('pending')
6604
+ def WebhookStatus.pending
6605
+ @@_pending ||= WebhookStatus.new('pending')
6528
6606
  end
6529
6607
 
6530
- def WebhookRequestStatus.success
6531
- @@_success ||= WebhookRequestStatus.new('success')
6608
+ def WebhookStatus.success
6609
+ @@_success ||= WebhookStatus.new('success')
6532
6610
  end
6533
6611
 
6534
- def WebhookRequestStatus.failure
6535
- @@_failure ||= WebhookRequestStatus.new('failure')
6612
+ def WebhookStatus.failure
6613
+ @@_failure ||= WebhookStatus.new('failure')
6536
6614
  end
6537
6615
 
6538
6616
  def to_hash
@@ -6813,6 +6891,39 @@ module Io
6813
6891
 
6814
6892
  end
6815
6893
 
6894
+ class AuthorizationDeleted < Event
6895
+
6896
+ attr_reader :event_id, :timestamp, :organization, :key
6897
+
6898
+ def initialize(incoming={})
6899
+ super(:name => Event::Types::AUTHORIZATION_DELETED)
6900
+ opts = HttpClient::Helper.symbolize_keys(incoming)
6901
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :key], 'AuthorizationDeleted')
6902
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
6903
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
6904
+ @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
6905
+ @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
6906
+ end
6907
+
6908
+ def to_json
6909
+ JSON.dump(to_hash)
6910
+ end
6911
+
6912
+ def copy(incoming={})
6913
+ AuthorizationDeleted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
6914
+ end
6915
+
6916
+ def subtype_to_hash
6917
+ {
6918
+ :event_id => event_id,
6919
+ :timestamp => timestamp,
6920
+ :organization => organization,
6921
+ :key => key
6922
+ }
6923
+ end
6924
+
6925
+ end
6926
+
6816
6927
  class AuthorizationReference
6817
6928
 
6818
6929
  attr_reader :id
@@ -6875,6 +6986,57 @@ module Io
6875
6986
 
6876
6987
  end
6877
6988
 
6989
+ class AuthorizationUpserted < Event
6990
+
6991
+ attr_reader :event_id, :timestamp, :organization, :key, :order_number, :card, :amount, :currency, :customer, :attributes, :destination, :result, :ip
6992
+
6993
+ def initialize(incoming={})
6994
+ super(:name => Event::Types::AUTHORIZATION_UPSERTED)
6995
+ opts = HttpClient::Helper.symbolize_keys(incoming)
6996
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :key, :card, :amount, :currency, :customer, :attributes, :result], 'AuthorizationUpserted')
6997
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
6998
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
6999
+ @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
7000
+ @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
7001
+ @order_number = (x = opts.delete(:order_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('order_number', x, String))
7002
+ @card = HttpClient::Preconditions.assert_class('card', HttpClient::Helper.to_object(opts.delete(:card)), Hash)
7003
+ @amount = HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(opts.delete(:amount)), BigDecimal)
7004
+ @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
7005
+ @customer = HttpClient::Preconditions.assert_class('customer', HttpClient::Helper.to_object(opts.delete(:customer)), Hash)
7006
+ @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 }
7007
+ @destination = (x = opts.delete(:destination); x.nil? ? nil : HttpClient::Preconditions.assert_class('destination', HttpClient::Helper.to_object(x), Hash))
7008
+ @result = HttpClient::Preconditions.assert_class('result', HttpClient::Helper.to_object(opts.delete(:result)), Hash)
7009
+ @ip = (x = opts.delete(:ip); x.nil? ? nil : HttpClient::Preconditions.assert_class('ip', x, String))
7010
+ end
7011
+
7012
+ def to_json
7013
+ JSON.dump(to_hash)
7014
+ end
7015
+
7016
+ def copy(incoming={})
7017
+ AuthorizationUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
7018
+ end
7019
+
7020
+ def subtype_to_hash
7021
+ {
7022
+ :event_id => event_id,
7023
+ :timestamp => timestamp,
7024
+ :organization => organization,
7025
+ :key => key,
7026
+ :order_number => order_number,
7027
+ :card => card,
7028
+ :amount => amount,
7029
+ :currency => currency,
7030
+ :customer => customer,
7031
+ :attributes => attributes,
7032
+ :destination => destination,
7033
+ :result => result,
7034
+ :ip => ip
7035
+ }
7036
+ end
7037
+
7038
+ end
7039
+
6878
7040
  class AuthorizationVersion
6879
7041
 
6880
7042
  attr_reader :id, :timestamp, :type, :authorization
@@ -7042,6 +7204,45 @@ module Io
7042
7204
 
7043
7205
  end
7044
7206
 
7207
+ class CaptureUpserted < Event
7208
+
7209
+ attr_reader :event_id, :timestamp, :organization, :key, :authorization_key, :amount, :currency
7210
+
7211
+ def initialize(incoming={})
7212
+ super(:name => Event::Types::CAPTURE_UPSERTED)
7213
+ opts = HttpClient::Helper.symbolize_keys(incoming)
7214
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :key, :authorization_key, :amount, :currency], 'CaptureUpserted')
7215
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
7216
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
7217
+ @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
7218
+ @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
7219
+ @authorization_key = HttpClient::Preconditions.assert_class('authorization_key', opts.delete(:authorization_key), String)
7220
+ @amount = HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(opts.delete(:amount)), BigDecimal)
7221
+ @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
7222
+ end
7223
+
7224
+ def to_json
7225
+ JSON.dump(to_hash)
7226
+ end
7227
+
7228
+ def copy(incoming={})
7229
+ CaptureUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
7230
+ end
7231
+
7232
+ def subtype_to_hash
7233
+ {
7234
+ :event_id => event_id,
7235
+ :timestamp => timestamp,
7236
+ :organization => organization,
7237
+ :key => key,
7238
+ :authorization_key => authorization_key,
7239
+ :amount => amount,
7240
+ :currency => currency
7241
+ }
7242
+ end
7243
+
7244
+ end
7245
+
7045
7246
  class CaptureVersion
7046
7247
 
7047
7248
  attr_reader :id, :timestamp, :type, :capture
@@ -7936,6 +8137,9 @@ module Io
7936
8137
 
7937
8138
  end
7938
8139
 
8140
+ # ISO 3166 country codes. Note Flow APIs will accept either the 2 or 3 character
8141
+ # country code, but internally we normalize data and store as the 3 character,
8142
+ # upper case ISO code. See https://api.flow.io/reference/countries
7939
8143
  class Country
7940
8144
 
7941
8145
  attr_reader :name, :iso_3166_2, :iso_3166_3, :languages, :measurement_system, :default_currency, :timezones
@@ -11611,6 +11815,34 @@ module Io
11611
11815
 
11612
11816
  end
11613
11817
 
11818
+ class LabelOrderSummary
11819
+
11820
+ attr_reader :id, :number
11821
+
11822
+ def initialize(incoming={})
11823
+ opts = HttpClient::Helper.symbolize_keys(incoming)
11824
+ HttpClient::Preconditions.require_keys(opts, [:id, :number], 'LabelOrderSummary')
11825
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
11826
+ @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
11827
+ end
11828
+
11829
+ def to_json
11830
+ JSON.dump(to_hash)
11831
+ end
11832
+
11833
+ def copy(incoming={})
11834
+ LabelOrderSummary.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
11835
+ end
11836
+
11837
+ def to_hash
11838
+ {
11839
+ :id => id,
11840
+ :number => number
11841
+ }
11842
+ end
11843
+
11844
+ end
11845
+
11614
11846
  class LabelSummary
11615
11847
 
11616
11848
  attr_reader :id, :tracking, :status, :carrier, :tracking_number
@@ -11645,6 +11877,61 @@ module Io
11645
11877
 
11646
11878
  end
11647
11879
 
11880
+ class LabelUpserted < Event
11881
+
11882
+ attr_reader :event_id, :timestamp, :organization, :label_id, :carrier_tracking_number, :flow_tracking_number, :data, :destination, :origin, :carrier, :service, :commercial_invoice, :pdf, :png, :order
11883
+
11884
+ def initialize(incoming={})
11885
+ super(:name => Event::Types::LABEL_UPSERTED)
11886
+ opts = HttpClient::Helper.symbolize_keys(incoming)
11887
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :label_id, :carrier_tracking_number, :flow_tracking_number, :data, :destination, :origin, :carrier, :service], 'LabelUpserted')
11888
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
11889
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
11890
+ @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
11891
+ @label_id = HttpClient::Preconditions.assert_class('label_id', opts.delete(:label_id), String)
11892
+ @carrier_tracking_number = HttpClient::Preconditions.assert_class('carrier_tracking_number', opts.delete(:carrier_tracking_number), String)
11893
+ @flow_tracking_number = HttpClient::Preconditions.assert_class('flow_tracking_number', opts.delete(:flow_tracking_number), String)
11894
+ @data = HttpClient::Preconditions.assert_class('data', opts.delete(:data), String)
11895
+ @destination = HttpClient::Preconditions.assert_class('destination', HttpClient::Helper.to_object(opts.delete(:destination)), Hash)
11896
+ @origin = HttpClient::Preconditions.assert_class('origin', HttpClient::Helper.to_object(opts.delete(:origin)), Hash)
11897
+ @carrier = HttpClient::Preconditions.assert_class('carrier', opts.delete(:carrier), String)
11898
+ @service = HttpClient::Preconditions.assert_class('service', opts.delete(:service), String)
11899
+ @commercial_invoice = (x = opts.delete(:commercial_invoice); x.nil? ? nil : HttpClient::Preconditions.assert_class('commercial_invoice', x, String))
11900
+ @pdf = (x = opts.delete(:pdf); x.nil? ? nil : HttpClient::Preconditions.assert_class('pdf', x, String))
11901
+ @png = (x = opts.delete(:png); x.nil? ? nil : HttpClient::Preconditions.assert_class('png', x, String))
11902
+ @order = (x = opts.delete(:order); x.nil? ? nil : HttpClient::Preconditions.assert_class('order', x, String))
11903
+ end
11904
+
11905
+ def to_json
11906
+ JSON.dump(to_hash)
11907
+ end
11908
+
11909
+ def copy(incoming={})
11910
+ LabelUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
11911
+ end
11912
+
11913
+ def subtype_to_hash
11914
+ {
11915
+ :event_id => event_id,
11916
+ :timestamp => timestamp,
11917
+ :organization => organization,
11918
+ :label_id => label_id,
11919
+ :carrier_tracking_number => carrier_tracking_number,
11920
+ :flow_tracking_number => flow_tracking_number,
11921
+ :data => data,
11922
+ :destination => destination,
11923
+ :origin => origin,
11924
+ :carrier => carrier,
11925
+ :service => service,
11926
+ :commercial_invoice => commercial_invoice,
11927
+ :pdf => pdf,
11928
+ :png => png,
11929
+ :order => order
11930
+ }
11931
+ end
11932
+
11933
+ end
11934
+
11648
11935
  class LabelVersion
11649
11936
 
11650
11937
  attr_reader :id, :timestamp, :type, :label
@@ -12390,6 +12677,105 @@ module Io
12390
12677
 
12391
12678
  end
12392
12679
 
12680
+ class OrderBookingDeleted < Event
12681
+
12682
+ attr_reader :event_id, :timestamp, :organization, :order_number
12683
+
12684
+ def initialize(incoming={})
12685
+ super(:name => Event::Types::ORDER_BOOKING_DELETED)
12686
+ opts = HttpClient::Helper.symbolize_keys(incoming)
12687
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :order_number], 'OrderBookingDeleted')
12688
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
12689
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
12690
+ @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
12691
+ @order_number = HttpClient::Preconditions.assert_class('order_number', opts.delete(:order_number), String)
12692
+ end
12693
+
12694
+ def to_json
12695
+ JSON.dump(to_hash)
12696
+ end
12697
+
12698
+ def copy(incoming={})
12699
+ OrderBookingDeleted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
12700
+ end
12701
+
12702
+ def subtype_to_hash
12703
+ {
12704
+ :event_id => event_id,
12705
+ :timestamp => timestamp,
12706
+ :organization => organization,
12707
+ :order_number => order_number
12708
+ }
12709
+ end
12710
+
12711
+ end
12712
+
12713
+ class OrderBookingUpserted < Event
12714
+
12715
+ attr_reader :event_id, :timestamp, :organization, :order_number
12716
+
12717
+ def initialize(incoming={})
12718
+ super(:name => Event::Types::ORDER_BOOKING_UPSERTED)
12719
+ opts = HttpClient::Helper.symbolize_keys(incoming)
12720
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :order_number], 'OrderBookingUpserted')
12721
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
12722
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
12723
+ @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
12724
+ @order_number = HttpClient::Preconditions.assert_class('order_number', opts.delete(:order_number), String)
12725
+ end
12726
+
12727
+ def to_json
12728
+ JSON.dump(to_hash)
12729
+ end
12730
+
12731
+ def copy(incoming={})
12732
+ OrderBookingUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
12733
+ end
12734
+
12735
+ def subtype_to_hash
12736
+ {
12737
+ :event_id => event_id,
12738
+ :timestamp => timestamp,
12739
+ :organization => organization,
12740
+ :order_number => order_number
12741
+ }
12742
+ end
12743
+
12744
+ end
12745
+
12746
+ class OrderDeleted < Event
12747
+
12748
+ attr_reader :event_id, :timestamp, :organization, :number
12749
+
12750
+ def initialize(incoming={})
12751
+ super(:name => Event::Types::ORDER_DELETED)
12752
+ opts = HttpClient::Helper.symbolize_keys(incoming)
12753
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :number], 'OrderDeleted')
12754
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
12755
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
12756
+ @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
12757
+ @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
12758
+ end
12759
+
12760
+ def to_json
12761
+ JSON.dump(to_hash)
12762
+ end
12763
+
12764
+ def copy(incoming={})
12765
+ OrderDeleted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
12766
+ end
12767
+
12768
+ def subtype_to_hash
12769
+ {
12770
+ :event_id => event_id,
12771
+ :timestamp => timestamp,
12772
+ :organization => organization,
12773
+ :number => number
12774
+ }
12775
+ end
12776
+
12777
+ end
12778
+
12393
12779
  # Lightweight estimate for a group of items without any customer-related
12394
12780
  # information. This will contain available estimates on shipping, taxes, and
12395
12781
  # duties.
@@ -12664,6 +13050,61 @@ module Io
12664
13050
 
12665
13051
  end
12666
13052
 
13053
+ class OrderUpserted < Event
13054
+
13055
+ attr_reader :event_id, :timestamp, :organization, :number, :environment, :experience_id, :expires_at, :customer, :selections, :items, :destination, :deliveries, :prices, :discount, :total
13056
+
13057
+ def initialize(incoming={})
13058
+ super(:name => Event::Types::ORDER_UPSERTED)
13059
+ opts = HttpClient::Helper.symbolize_keys(incoming)
13060
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :number, :environment, :experience_id, :expires_at, :customer, :selections, :items, :destination, :deliveries, :prices, :total], 'OrderUpserted')
13061
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
13062
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
13063
+ @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
13064
+ @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
13065
+ @environment = HttpClient::Preconditions.assert_class('environment', opts.delete(:environment), String)
13066
+ @experience_id = HttpClient::Preconditions.assert_class('experience_id', opts.delete(:experience_id), String)
13067
+ @expires_at = HttpClient::Preconditions.assert_class('expires_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:expires_at)), DateTime)
13068
+ @customer = HttpClient::Preconditions.assert_class('customer', HttpClient::Helper.to_object(opts.delete(:customer)), Hash)
13069
+ @selections = HttpClient::Preconditions.assert_class('selections', HttpClient::Helper.to_object(opts.delete(:selections)), Hash)
13070
+ @items = HttpClient::Preconditions.assert_class('items', HttpClient::Helper.to_object(opts.delete(:items)), Hash)
13071
+ @destination = HttpClient::Preconditions.assert_class('destination', HttpClient::Helper.to_object(opts.delete(:destination)), Hash)
13072
+ @deliveries = HttpClient::Preconditions.assert_class('deliveries', HttpClient::Helper.to_object(opts.delete(:deliveries)), Hash)
13073
+ @prices = HttpClient::Preconditions.assert_class('prices', HttpClient::Helper.to_object(opts.delete(:prices)), Hash)
13074
+ @discount = (x = opts.delete(:discount); x.nil? ? nil : HttpClient::Preconditions.assert_class('discount', HttpClient::Helper.to_object(x), Hash))
13075
+ @total = HttpClient::Preconditions.assert_class('total', HttpClient::Helper.to_object(opts.delete(:total)), Hash)
13076
+ end
13077
+
13078
+ def to_json
13079
+ JSON.dump(to_hash)
13080
+ end
13081
+
13082
+ def copy(incoming={})
13083
+ OrderUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
13084
+ end
13085
+
13086
+ def subtype_to_hash
13087
+ {
13088
+ :event_id => event_id,
13089
+ :timestamp => timestamp,
13090
+ :organization => organization,
13091
+ :number => number,
13092
+ :environment => environment,
13093
+ :experience_id => experience_id,
13094
+ :expires_at => expires_at,
13095
+ :customer => customer,
13096
+ :selections => selections,
13097
+ :items => items,
13098
+ :destination => destination,
13099
+ :deliveries => deliveries,
13100
+ :prices => prices,
13101
+ :discount => discount,
13102
+ :total => total
13103
+ }
13104
+ end
13105
+
13106
+ end
13107
+
12667
13108
  class OrderVersion
12668
13109
 
12669
13110
  attr_reader :id, :timestamp, :type, :order
@@ -14044,6 +14485,47 @@ module Io
14044
14485
 
14045
14486
  end
14046
14487
 
14488
+ class RefundUpserted < Event
14489
+
14490
+ attr_reader :event_id, :timestamp, :organization, :key, :authorization_key, :amount, :currency, :captures
14491
+
14492
+ def initialize(incoming={})
14493
+ super(:name => Event::Types::REFUND_UPSERTED)
14494
+ opts = HttpClient::Helper.symbolize_keys(incoming)
14495
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :key, :authorization_key, :amount, :currency, :captures], 'RefundUpserted')
14496
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
14497
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
14498
+ @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
14499
+ @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
14500
+ @authorization_key = HttpClient::Preconditions.assert_class('authorization_key', opts.delete(:authorization_key), String)
14501
+ @amount = HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(opts.delete(:amount)), BigDecimal)
14502
+ @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
14503
+ @captures = HttpClient::Preconditions.assert_class('captures', opts.delete(:captures), Array).map { |v| HttpClient::Preconditions.assert_class('captures', HttpClient::Helper.to_object(v), Hash) }
14504
+ end
14505
+
14506
+ def to_json
14507
+ JSON.dump(to_hash)
14508
+ end
14509
+
14510
+ def copy(incoming={})
14511
+ RefundUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
14512
+ end
14513
+
14514
+ def subtype_to_hash
14515
+ {
14516
+ :event_id => event_id,
14517
+ :timestamp => timestamp,
14518
+ :organization => organization,
14519
+ :key => key,
14520
+ :authorization_key => authorization_key,
14521
+ :amount => amount,
14522
+ :currency => currency,
14523
+ :captures => captures
14524
+ }
14525
+ end
14526
+
14527
+ end
14528
+
14047
14529
  class RefundVersion
14048
14530
 
14049
14531
  attr_reader :id, :timestamp, :type, :refund
@@ -14077,7 +14559,8 @@ module Io
14077
14559
  end
14078
14560
 
14079
14561
  # A region represents a geographic area of the world. Regions can be countries,
14080
- # continents or other political areas (like the Eurozone).
14562
+ # continents or other political areas (like the Eurozone). See
14563
+ # https://api.flow.io/reference/regions
14081
14564
  class Region
14082
14565
 
14083
14566
  attr_reader :id, :name, :countries, :currencies, :languages, :measurement_systems, :timezones
@@ -14325,14 +14808,14 @@ module Io
14325
14808
  # shipper to transport a package from a given origin to destination
14326
14809
  class ShippingLabel
14327
14810
 
14328
- attr_reader :id, :carrier_tracking_number, :data, :destination, :flow_tracking_number, :origin, :service, :window, :commercial_invoice, :pdf, :png
14811
+ attr_reader :id, :carrier_tracking_number, :zpl, :destination, :flow_tracking_number, :origin, :service, :window, :commercial_invoice, :pdf, :png, :order
14329
14812
 
14330
14813
  def initialize(incoming={})
14331
14814
  opts = HttpClient::Helper.symbolize_keys(incoming)
14332
- HttpClient::Preconditions.require_keys(opts, [:id, :carrier_tracking_number, :data, :destination, :flow_tracking_number, :origin, :service, :window], 'ShippingLabel')
14815
+ HttpClient::Preconditions.require_keys(opts, [:id, :carrier_tracking_number, :zpl, :destination, :flow_tracking_number, :origin, :service, :window], 'ShippingLabel')
14333
14816
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
14334
14817
  @carrier_tracking_number = HttpClient::Preconditions.assert_class('carrier_tracking_number', opts.delete(:carrier_tracking_number), String)
14335
- @data = HttpClient::Preconditions.assert_class('data', opts.delete(:data), String)
14818
+ @zpl = HttpClient::Preconditions.assert_class('zpl', opts.delete(:zpl), String)
14336
14819
  @destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::ShippingAddress) ? x : ::Io::Flow::V0::Models::ShippingAddress.new(x))
14337
14820
  @flow_tracking_number = HttpClient::Preconditions.assert_class('flow_tracking_number', opts.delete(:flow_tracking_number), String)
14338
14821
  @origin = (x = opts.delete(:origin); x.is_a?(::Io::Flow::V0::Models::ShippingAddress) ? x : ::Io::Flow::V0::Models::ShippingAddress.new(x))
@@ -14341,6 +14824,7 @@ module Io
14341
14824
  @commercial_invoice = (x = opts.delete(:commercial_invoice); x.nil? ? nil : HttpClient::Preconditions.assert_class('commercial_invoice', x, String))
14342
14825
  @pdf = (x = opts.delete(:pdf); x.nil? ? nil : HttpClient::Preconditions.assert_class('pdf', x, String))
14343
14826
  @png = (x = opts.delete(:png); x.nil? ? nil : HttpClient::Preconditions.assert_class('png', x, String))
14827
+ @order = (x = opts.delete(:order); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::LabelOrderSummary) ? x : ::Io::Flow::V0::Models::LabelOrderSummary.new(x)))
14344
14828
  end
14345
14829
 
14346
14830
  def to_json
@@ -14355,7 +14839,7 @@ module Io
14355
14839
  {
14356
14840
  :id => id,
14357
14841
  :carrier_tracking_number => carrier_tracking_number,
14358
- :data => data,
14842
+ :zpl => zpl,
14359
14843
  :destination => destination.to_hash,
14360
14844
  :flow_tracking_number => flow_tracking_number,
14361
14845
  :origin => origin.to_hash,
@@ -14363,7 +14847,8 @@ module Io
14363
14847
  :window => window.to_hash,
14364
14848
  :commercial_invoice => commercial_invoice,
14365
14849
  :pdf => pdf,
14366
- :png => png
14850
+ :png => png,
14851
+ :order => order.nil? ? nil : order.to_hash
14367
14852
  }
14368
14853
  end
14369
14854
 
@@ -14371,7 +14856,7 @@ module Io
14371
14856
 
14372
14857
  class ShippingLabelForm
14373
14858
 
14374
- attr_reader :service, :delivered_duty, :destination, :origin, :packages, :insurance
14859
+ attr_reader :service, :delivered_duty, :destination, :origin, :packages, :insurance, :order_number
14375
14860
 
14376
14861
  def initialize(incoming={})
14377
14862
  opts = HttpClient::Helper.symbolize_keys(incoming)
@@ -14382,6 +14867,7 @@ module Io
14382
14867
  @origin = (x = opts.delete(:origin); x.is_a?(::Io::Flow::V0::Models::ShippingAddress) ? x : ::Io::Flow::V0::Models::ShippingAddress.new(x))
14383
14868
  @packages = HttpClient::Preconditions.assert_class('packages', opts.delete(:packages), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::ShippingLabelPackage) ? x : ::Io::Flow::V0::Models::ShippingLabelPackage.new(x)) }
14384
14869
  @insurance = (x = opts.delete(:insurance); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x)))
14870
+ @order_number = (x = opts.delete(:order_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('order_number', x, String))
14385
14871
  end
14386
14872
 
14387
14873
  def to_json
@@ -14399,7 +14885,8 @@ module Io
14399
14885
  :destination => destination.to_hash,
14400
14886
  :origin => origin.to_hash,
14401
14887
  :packages => packages.map { |o| o.to_hash },
14402
- :insurance => insurance.nil? ? nil : insurance.to_hash
14888
+ :insurance => insurance.nil? ? nil : insurance.to_hash,
14889
+ :order_number => order_number
14403
14890
  }
14404
14891
  end
14405
14892
 
@@ -15790,7 +16277,7 @@ module Io
15790
16277
  # tracking number
15791
16278
  class Tracking
15792
16279
 
15793
- attr_reader :id, :status, :metadata
16280
+ attr_reader :id, :status, :metadata, :order_number
15794
16281
 
15795
16282
  def initialize(incoming={})
15796
16283
  opts = HttpClient::Helper.symbolize_keys(incoming)
@@ -15798,6 +16285,7 @@ module Io
15798
16285
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
15799
16286
  @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::TrackingStatus) ? x : ::Io::Flow::V0::Models::TrackingStatus.apply(x))
15800
16287
  @metadata = HttpClient::Preconditions.assert_class('metadata', HttpClient::Helper.to_object(opts.delete(:metadata)), Hash)
16288
+ @order_number = (x = opts.delete(:order_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('order_number', x, String))
15801
16289
  end
15802
16290
 
15803
16291
  def to_json
@@ -15812,7 +16300,8 @@ module Io
15812
16300
  {
15813
16301
  :id => id,
15814
16302
  :status => status.value,
15815
- :metadata => metadata
16303
+ :metadata => metadata,
16304
+ :order_number => order_number
15816
16305
  }
15817
16306
  end
15818
16307
 
@@ -15824,11 +16313,12 @@ module Io
15824
16313
  # tracking number
15825
16314
  class TrackingForm
15826
16315
 
15827
- attr_reader :status, :metadata
16316
+ attr_reader :status, :order_number, :metadata
15828
16317
 
15829
16318
  def initialize(incoming={})
15830
16319
  opts = HttpClient::Helper.symbolize_keys(incoming)
15831
16320
  @status = (x = opts.delete(:status); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::TrackingStatus) ? x : ::Io::Flow::V0::Models::TrackingStatus.apply(x)))
16321
+ @order_number = (x = opts.delete(:order_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('order_number', x, String))
15832
16322
  @metadata = (x = opts.delete(:metadata); x.nil? ? nil : HttpClient::Preconditions.assert_class('metadata', HttpClient::Helper.to_object(x), Hash))
15833
16323
  end
15834
16324
 
@@ -15843,6 +16333,7 @@ module Io
15843
16333
  def to_hash
15844
16334
  {
15845
16335
  :status => status.nil? ? nil : status.value,
16336
+ :order_number => order_number,
15846
16337
  :metadata => metadata
15847
16338
  }
15848
16339
  end
@@ -15851,7 +16342,7 @@ module Io
15851
16342
 
15852
16343
  class TrackingLabelEventUpserted < Event
15853
16344
 
15854
- attr_reader :event_id, :timestamp, :organization, :address, :carrier, :carrier_timestamp, :carrier_tracking_number, :flow_tracking_number, :status, :delivery_estimate, :description
16345
+ attr_reader :event_id, :timestamp, :organization, :address, :carrier, :carrier_timestamp, :carrier_tracking_number, :flow_tracking_number, :status, :delivery_estimate, :description, :order_number
15855
16346
 
15856
16347
  def initialize(incoming={})
15857
16348
  super(:name => Event::Types::TRACKING_LABEL_EVENT_UPSERTED)
@@ -15868,6 +16359,7 @@ module Io
15868
16359
  @status = HttpClient::Preconditions.assert_class('status', opts.delete(:status), String)
15869
16360
  @delivery_estimate = (x = opts.delete(:delivery_estimate); x.nil? ? nil : HttpClient::Preconditions.assert_class('delivery_estimate', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
15870
16361
  @description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
16362
+ @order_number = (x = opts.delete(:order_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('order_number', x, String))
15871
16363
  end
15872
16364
 
15873
16365
  def to_json
@@ -15890,7 +16382,8 @@ module Io
15890
16382
  :flow_tracking_number => flow_tracking_number,
15891
16383
  :status => status,
15892
16384
  :delivery_estimate => delivery_estimate,
15893
- :description => description
16385
+ :description => description,
16386
+ :order_number => order_number
15894
16387
  }
15895
16388
  end
15896
16389
 
@@ -15898,13 +16391,14 @@ module Io
15898
16391
 
15899
16392
  class TrackingSummary
15900
16393
 
15901
- attr_reader :id, :status
16394
+ attr_reader :id, :status, :order_number
15902
16395
 
15903
16396
  def initialize(incoming={})
15904
16397
  opts = HttpClient::Helper.symbolize_keys(incoming)
15905
16398
  HttpClient::Preconditions.require_keys(opts, [:id, :status], 'TrackingSummary')
15906
16399
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
15907
16400
  @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::TrackingStatus) ? x : ::Io::Flow::V0::Models::TrackingStatus.apply(x))
16401
+ @order_number = (x = opts.delete(:order_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('order_number', x, String))
15908
16402
  end
15909
16403
 
15910
16404
  def to_json
@@ -15918,7 +16412,8 @@ module Io
15918
16412
  def to_hash
15919
16413
  {
15920
16414
  :id => id,
15921
- :status => status.value
16415
+ :status => status.value,
16416
+ :order_number => order_number
15922
16417
  }
15923
16418
  end
15924
16419
 
@@ -16188,6 +16683,45 @@ module Io
16188
16683
 
16189
16684
  end
16190
16685
 
16686
+ # A webhook delivery represents an event that matched a webhook's event types.
16687
+ # Each delivery will be attempted one or more times subject to the settings of
16688
+ # your webhook.
16689
+ class WebhookDelivery
16690
+
16691
+ attr_reader :id, :webhook, :status, :created_at, :latest, :next_attempt_at
16692
+
16693
+ def initialize(incoming={})
16694
+ opts = HttpClient::Helper.symbolize_keys(incoming)
16695
+ HttpClient::Preconditions.require_keys(opts, [:id, :webhook, :status, :created_at], 'WebhookDelivery')
16696
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
16697
+ @webhook = (x = opts.delete(:webhook); x.is_a?(::Io::Flow::V0::Models::WebhookReference) ? x : ::Io::Flow::V0::Models::WebhookReference.new(x))
16698
+ @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::WebhookStatus) ? x : ::Io::Flow::V0::Models::WebhookStatus.apply(x))
16699
+ @created_at = HttpClient::Preconditions.assert_class('created_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:created_at)), DateTime)
16700
+ @latest = (x = opts.delete(:latest); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::WebhookRequest) ? x : ::Io::Flow::V0::Models::WebhookRequest.new(x)))
16701
+ @next_attempt_at = (x = opts.delete(:next_attempt_at); x.nil? ? nil : HttpClient::Preconditions.assert_class('next_attempt_at', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
16702
+ end
16703
+
16704
+ def to_json
16705
+ JSON.dump(to_hash)
16706
+ end
16707
+
16708
+ def copy(incoming={})
16709
+ WebhookDelivery.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
16710
+ end
16711
+
16712
+ def to_hash
16713
+ {
16714
+ :id => id,
16715
+ :webhook => webhook.to_hash,
16716
+ :status => status.value,
16717
+ :created_at => created_at,
16718
+ :latest => latest.nil? ? nil : latest.to_hash,
16719
+ :next_attempt_at => next_attempt_at
16720
+ }
16721
+ end
16722
+
16723
+ end
16724
+
16191
16725
  class WebhookForm
16192
16726
 
16193
16727
  attr_reader :url, :events
@@ -16244,17 +16778,16 @@ module Io
16244
16778
 
16245
16779
  class WebhookRequest
16246
16780
 
16247
- attr_reader :id, :webhook, :headers, :method, :body, :status, :started_at, :completed_at, :duration_ms, :response, :error
16781
+ attr_reader :id, :headers, :method, :body, :status, :started_at, :completed_at, :duration_ms, :response, :error
16248
16782
 
16249
16783
  def initialize(incoming={})
16250
16784
  opts = HttpClient::Helper.symbolize_keys(incoming)
16251
- HttpClient::Preconditions.require_keys(opts, [:id, :webhook, :headers, :method, :body, :status], 'WebhookRequest')
16785
+ HttpClient::Preconditions.require_keys(opts, [:id, :headers, :method, :body, :status], 'WebhookRequest')
16252
16786
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
16253
- @webhook = (x = opts.delete(:webhook); x.is_a?(::Io::Flow::V0::Models::WebhookReference) ? x : ::Io::Flow::V0::Models::WebhookReference.new(x))
16254
16787
  @headers = HttpClient::Preconditions.assert_class('headers', opts.delete(:headers), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::Header) ? x : ::Io::Flow::V0::Models::Header.new(x)) }
16255
16788
  @method = (x = opts.delete(:method); x.is_a?(::Io::Flow::V0::Models::Method) ? x : ::Io::Flow::V0::Models::Method.apply(x))
16256
16789
  @body = HttpClient::Preconditions.assert_class('body', opts.delete(:body), String)
16257
- @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::WebhookRequestStatus) ? x : ::Io::Flow::V0::Models::WebhookRequestStatus.apply(x))
16790
+ @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::WebhookStatus) ? x : ::Io::Flow::V0::Models::WebhookStatus.apply(x))
16258
16791
  @started_at = (x = opts.delete(:started_at); x.nil? ? nil : HttpClient::Preconditions.assert_class('started_at', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
16259
16792
  @completed_at = (x = opts.delete(:completed_at); x.nil? ? nil : HttpClient::Preconditions.assert_class('completed_at', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
16260
16793
  @duration_ms = (x = opts.delete(:duration_ms); x.nil? ? nil : HttpClient::Preconditions.assert_class('duration_ms', x, Integer))
@@ -16273,7 +16806,6 @@ module Io
16273
16806
  def to_hash
16274
16807
  {
16275
16808
  :id => id,
16276
- :webhook => webhook.to_hash,
16277
16809
  :headers => headers.map { |o| o.to_hash },
16278
16810
  :method => method.value,
16279
16811
  :body => body,
@@ -16348,6 +16880,37 @@ module Io
16348
16880
 
16349
16881
  end
16350
16882
 
16883
+ class WebhookSettings
16884
+
16885
+ attr_reader :secret, :retry_max_attempts, :retry_sleep_ms, :sleep_ms
16886
+
16887
+ def initialize(incoming={})
16888
+ opts = HttpClient::Helper.symbolize_keys(incoming)
16889
+ @secret = (x = opts.delete(:secret); x.nil? ? nil : HttpClient::Preconditions.assert_class('secret', x, String))
16890
+ @retry_max_attempts = HttpClient::Preconditions.assert_class('retry_max_attempts', (x = opts.delete(:retry_max_attempts); x.nil? ? 5 : x), Integer)
16891
+ @retry_sleep_ms = HttpClient::Preconditions.assert_class('retry_sleep_ms', (x = opts.delete(:retry_sleep_ms); x.nil? ? 60000 : x), Integer)
16892
+ @sleep_ms = HttpClient::Preconditions.assert_class('sleep_ms', (x = opts.delete(:sleep_ms); x.nil? ? 0 : x), Integer)
16893
+ end
16894
+
16895
+ def to_json
16896
+ JSON.dump(to_hash)
16897
+ end
16898
+
16899
+ def copy(incoming={})
16900
+ WebhookSettings.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
16901
+ end
16902
+
16903
+ def to_hash
16904
+ {
16905
+ :secret => secret,
16906
+ :retry_max_attempts => retry_max_attempts,
16907
+ :retry_sleep_ms => retry_sleep_ms,
16908
+ :sleep_ms => sleep_ms
16909
+ }
16910
+ end
16911
+
16912
+ end
16913
+
16351
16914
  class Zone
16352
16915
 
16353
16916
  attr_reader :province, :country
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.0.57
4
+ version: 0.0.58
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: 2016-09-19 00:00:00.000000000 Z
11
+ date: 2016-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json