flowcommerce 0.0.28 → 0.0.29

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.
@@ -1,6 +1,6 @@
1
1
  # Generated by apidoc - http://www.apidoc.me
2
- # Service version: 0.0.85
3
- # apidoc:0.11.33 http://www.apidoc.me/flow/api/0.0.85/ruby_client
2
+ # Service version: 0.0.91
3
+ # apidoc:0.11.33 http://www.apidoc.me/flow/api/0.0.91/ruby_client
4
4
 
5
5
  require 'cgi'
6
6
  require 'net/http'
@@ -25,8 +25,8 @@ module Io
25
25
 
26
26
  BASE_URL = 'https://api.flow.io' unless defined?(Constants::BASE_URL)
27
27
  NAMESPACE = 'io.flow.v0' unless defined?(Constants::NAMESPACE)
28
- USER_AGENT = 'apidoc:0.11.33 http://www.apidoc.me/flow/api/0.0.85/ruby_client' unless defined?(Constants::USER_AGENT)
29
- VERSION = '0.0.85' unless defined?(Constants::VERSION)
28
+ USER_AGENT = 'apidoc:0.11.33 http://www.apidoc.me/flow/api/0.0.91/ruby_client' unless defined?(Constants::USER_AGENT)
29
+ VERSION = '0.0.91' unless defined?(Constants::VERSION)
30
30
  VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
31
31
 
32
32
  end
@@ -237,6 +237,14 @@ module Io
237
237
  @trackings ||= ::Io::Flow::V0::Clients::Trackings.new(self)
238
238
  end
239
239
 
240
+ def webhooks
241
+ @webhooks ||= ::Io::Flow::V0::Clients::Webhooks.new(self)
242
+ end
243
+
244
+ def webhook_requests
245
+ @webhook_requests ||= ::Io::Flow::V0::Clients::WebhookRequests.new(self)
246
+ end
247
+
240
248
  def addresses
241
249
  @addresses ||= ::Io::Flow::V0::Clients::Addresses.new(self)
242
250
  end
@@ -1989,6 +1997,7 @@ module Io
1989
1997
  opts = HttpClient::Helper.symbolize_keys(incoming)
1990
1998
  query = {
1991
1999
  :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
2000
+ :key => (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, Array).map { |v| HttpClient::Preconditions.assert_class('key', v, String) }),
1992
2001
  :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
1993
2002
  :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
1994
2003
  :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "name" : x), String)
@@ -2004,34 +2013,27 @@ module Io
2004
2013
  ::Io::Flow::V0::Models::Center.new(r)
2005
2014
  end
2006
2015
 
2007
- def get_by_id(organization, id)
2016
+ def get_by_key(organization, key)
2008
2017
  HttpClient::Preconditions.assert_class('organization', organization, String)
2009
- HttpClient::Preconditions.assert_class('id', id, String)
2010
- r = @client.request("/#{CGI.escape(organization)}/centers/#{CGI.escape(id)}").get
2018
+ HttpClient::Preconditions.assert_class('key', key, String)
2019
+ r = @client.request("/#{CGI.escape(organization)}/centers/#{CGI.escape(key)}").get
2011
2020
  ::Io::Flow::V0::Models::Center.new(r)
2012
2021
  end
2013
2022
 
2014
- def put_by_id(organization, id, center_form)
2023
+ def put_by_key(organization, key, center_form)
2015
2024
  HttpClient::Preconditions.assert_class('organization', organization, String)
2016
- HttpClient::Preconditions.assert_class('id', id, String)
2025
+ HttpClient::Preconditions.assert_class('key', key, String)
2017
2026
  HttpClient::Preconditions.assert_class('center_form', center_form, ::Io::Flow::V0::Models::CenterForm)
2018
- r = @client.request("/#{CGI.escape(organization)}/centers/#{CGI.escape(id)}").with_json(center_form.to_json).put
2027
+ r = @client.request("/#{CGI.escape(organization)}/centers/#{CGI.escape(key)}").with_json(center_form.to_json).put
2019
2028
  ::Io::Flow::V0::Models::Center.new(r)
2020
2029
  end
2021
2030
 
2022
- def delete_by_id(organization, id)
2023
- HttpClient::Preconditions.assert_class('organization', organization, String)
2024
- HttpClient::Preconditions.assert_class('id', id, String)
2025
- r = @client.request("/#{CGI.escape(organization)}/centers/#{CGI.escape(id)}").delete
2026
- nil
2027
- end
2028
-
2029
2031
  def get_versions(organization, incoming={})
2030
2032
  HttpClient::Preconditions.assert_class('organization', organization, String)
2031
2033
  opts = HttpClient::Helper.symbolize_keys(incoming)
2032
2034
  query = {
2033
2035
  :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
2034
- :center => (x = opts.delete(:center); x.nil? ? nil : HttpClient::Preconditions.assert_class('center', x, Array).map { |v| HttpClient::Preconditions.assert_class('center', v, String) }),
2036
+ :key => (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, Array).map { |v| HttpClient::Preconditions.assert_class('key', v, String) }),
2035
2037
  :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
2036
2038
  :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
2037
2039
  :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
@@ -2960,6 +2962,102 @@ module Io
2960
2962
 
2961
2963
  end
2962
2964
 
2965
+ class Webhooks
2966
+
2967
+ def initialize(client)
2968
+ @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
2969
+ end
2970
+
2971
+ # Returns webhooks for an organization
2972
+ def get(organization, incoming={})
2973
+ HttpClient::Preconditions.assert_class('organization', organization, String)
2974
+ opts = HttpClient::Helper.symbolize_keys(incoming)
2975
+ query = {
2976
+ :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
2977
+ :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
2978
+ :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
2979
+ :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
2980
+ }.delete_if { |k, v| v.nil? }
2981
+ r = @client.request("/#{CGI.escape(organization)}/webhooks").with_query(query).get
2982
+ r.map { |x| ::Io::Flow::V0::Models::Webhook.new(x) }
2983
+ end
2984
+
2985
+ # Create a new webhook
2986
+ def post(organization, webhook_form)
2987
+ HttpClient::Preconditions.assert_class('organization', organization, String)
2988
+ HttpClient::Preconditions.assert_class('webhook_form', webhook_form, ::Io::Flow::V0::Models::WebhookForm)
2989
+ r = @client.request("/#{CGI.escape(organization)}/webhooks").with_json(webhook_form.to_json).post
2990
+ ::Io::Flow::V0::Models::Webhook.new(r)
2991
+ end
2992
+
2993
+ # Returns information about a specific webhook
2994
+ def get_by_id(organization, id)
2995
+ HttpClient::Preconditions.assert_class('organization', organization, String)
2996
+ HttpClient::Preconditions.assert_class('id', id, String)
2997
+ r = @client.request("/#{CGI.escape(organization)}/webhooks/#{CGI.escape(id)}").get
2998
+ ::Io::Flow::V0::Models::Webhook.new(r)
2999
+ end
3000
+
3001
+ # Update an existing webhook
3002
+ def put_by_id(organization, id, webhook_form)
3003
+ HttpClient::Preconditions.assert_class('organization', organization, String)
3004
+ HttpClient::Preconditions.assert_class('id', id, String)
3005
+ HttpClient::Preconditions.assert_class('webhook_form', webhook_form, ::Io::Flow::V0::Models::WebhookForm)
3006
+ r = @client.request("/#{CGI.escape(organization)}/webhooks/#{CGI.escape(id)}").with_json(webhook_form.to_json).put
3007
+ ::Io::Flow::V0::Models::Webhook.new(r)
3008
+ end
3009
+
3010
+ # Delete a webhook with the specified id
3011
+ def delete_by_id(organization, id)
3012
+ HttpClient::Preconditions.assert_class('organization', organization, String)
3013
+ HttpClient::Preconditions.assert_class('id', id, String)
3014
+ r = @client.request("/#{CGI.escape(organization)}/webhooks/#{CGI.escape(id)}").delete
3015
+ nil
3016
+ end
3017
+
3018
+ end
3019
+
3020
+ class WebhookRequests
3021
+
3022
+ def initialize(client)
3023
+ @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
3024
+ end
3025
+
3026
+ # Returns requests for an organization's webhook
3027
+ def get(organization, incoming={})
3028
+ HttpClient::Preconditions.assert_class('organization', organization, String)
3029
+ opts = HttpClient::Helper.symbolize_keys(incoming)
3030
+ query = {
3031
+ :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
3032
+ :webhook_id => (x = opts.delete(:webhook_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('webhook_id', x, String)),
3033
+ :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
3034
+ :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
3035
+ :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
3036
+ }.delete_if { |k, v| v.nil? }
3037
+ r = @client.request("/#{CGI.escape(organization)}/webhook/requests").with_query(query).get
3038
+ r.map { |x| ::Io::Flow::V0::Models::WebhookRequest.new(x) }
3039
+ end
3040
+
3041
+ # Returns information about a specific webhook request
3042
+ def get_by_id(organization, id)
3043
+ HttpClient::Preconditions.assert_class('organization', organization, String)
3044
+ HttpClient::Preconditions.assert_class('id', id, String)
3045
+ r = @client.request("/#{CGI.escape(organization)}/webhook/requests/#{CGI.escape(id)}").get
3046
+ ::Io::Flow::V0::Models::WebhookRequest.new(r)
3047
+ end
3048
+
3049
+ # Redeliver a webhook request. This created a new webhook request to requeue
3050
+ # delivery
3051
+ def post_redeliveries_by_id(organization, id, hash)
3052
+ HttpClient::Preconditions.assert_class('organization', organization, String)
3053
+ HttpClient::Preconditions.assert_class('id', id, String)
3054
+ HttpClient::Preconditions.assert_class('hash', hash, Hash)
3055
+ r = @client.request("/#{CGI.escape(organization)}/webhook/requests/#{CGI.escape(id)}/redeliveries").with_json(hash.to_json).post
3056
+ ::Io::Flow::V0::Models::WebhookRequest.new(r)
3057
+ end
3058
+
3059
+ end
3060
+
2963
3061
  class Addresses
2964
3062
 
2965
3063
  def initialize(client)
@@ -3799,6 +3897,82 @@ module Io
3799
3897
 
3800
3898
  end
3801
3899
 
3900
+ class Event
3901
+
3902
+ module Types
3903
+ CATALOG_UPSERTED = 'catalog_upserted' unless defined?(CATALOG_UPSERTED)
3904
+ CATALOG_DELETED = 'catalog_deleted' unless defined?(CATALOG_DELETED)
3905
+ SUBCATALOG_UPSERTED = 'subcatalog_upserted' unless defined?(SUBCATALOG_UPSERTED)
3906
+ SUBCATALOG_DELETED = 'subcatalog_deleted' unless defined?(SUBCATALOG_DELETED)
3907
+ CATALOG_ITEM_UPSERTED = 'catalog_item_upserted' unless defined?(CATALOG_ITEM_UPSERTED)
3908
+ CATALOG_ITEM_DELETED = 'catalog_item_deleted' unless defined?(CATALOG_ITEM_DELETED)
3909
+ SUBCATALOG_ITEM_UPSERTED = 'subcatalog_item_upserted' unless defined?(SUBCATALOG_ITEM_UPSERTED)
3910
+ SUBCATALOG_ITEM_DELETED = 'subcatalog_item_deleted' unless defined?(SUBCATALOG_ITEM_DELETED)
3911
+ EXPERIENCE_DELETED = 'experience_deleted' unless defined?(EXPERIENCE_DELETED)
3912
+ EXPERIENCE_UPSERTED = 'experience_upserted' unless defined?(EXPERIENCE_UPSERTED)
3913
+ HS6_CODE_UPSERTED = 'hs6_code_upserted' unless defined?(HS6_CODE_UPSERTED)
3914
+ HS6_CODE_DELETED = 'hs6_code_deleted' unless defined?(HS6_CODE_DELETED)
3915
+ HS10_CODE_UPSERTED = 'hs10_code_upserted' unless defined?(HS10_CODE_UPSERTED)
3916
+ HS10_CODE_DELETED = 'hs10_code_deleted' unless defined?(HS10_CODE_DELETED)
3917
+ end
3918
+
3919
+ def initialize(incoming={})
3920
+ opts = HttpClient::Helper.symbolize_keys(incoming)
3921
+ HttpClient::Preconditions.require_keys(opts, [:name], 'Event')
3922
+ @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
3923
+ end
3924
+
3925
+ def to_hash
3926
+ subtype_to_hash.merge(:discriminator => @name)
3927
+ end
3928
+
3929
+ def Event.from_json(hash)
3930
+ HttpClient::Preconditions.assert_class('hash', hash, Hash)
3931
+ case HttpClient::Helper.symbolize_keys(hash)[:discriminator]
3932
+ when Types::CATALOG_UPSERTED; CatalogUpserted.new(hash)
3933
+ when Types::CATALOG_DELETED; CatalogDeleted.new(hash)
3934
+ when Types::SUBCATALOG_UPSERTED; SubcatalogUpserted.new(hash)
3935
+ when Types::SUBCATALOG_DELETED; SubcatalogDeleted.new(hash)
3936
+ when Types::CATALOG_ITEM_UPSERTED; CatalogItemUpserted.new(hash)
3937
+ when Types::CATALOG_ITEM_DELETED; CatalogItemDeleted.new(hash)
3938
+ when Types::SUBCATALOG_ITEM_UPSERTED; SubcatalogItemUpserted.new(hash)
3939
+ when Types::SUBCATALOG_ITEM_DELETED; SubcatalogItemDeleted.new(hash)
3940
+ when Types::EXPERIENCE_DELETED; ExperienceDeleted.new(hash)
3941
+ when Types::EXPERIENCE_UPSERTED; ExperienceUpserted.new(hash)
3942
+ when Types::HS6_CODE_UPSERTED; Hs6CodeUpserted.new(hash)
3943
+ when Types::HS6_CODE_DELETED; Hs6CodeDeleted.new(hash)
3944
+ when Types::HS10_CODE_UPSERTED; Hs10CodeUpserted.new(hash)
3945
+ when Types::HS10_CODE_DELETED; Hs10CodeDeleted.new(hash)
3946
+ else EventUndefinedType.new(:name => union_type_name)
3947
+ end
3948
+ end
3949
+
3950
+ end
3951
+
3952
+ class EventUndefinedType < Event
3953
+
3954
+ attr_reader :name
3955
+
3956
+ def initialize(incoming={})
3957
+ super(:name => 'undefined_type')
3958
+ opts = HttpClient::Helper.symbolize_keys(incoming)
3959
+ @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
3960
+ end
3961
+
3962
+ def subtype_to_hash
3963
+ raise 'Unable to serialize undefined type to json'
3964
+ end
3965
+
3966
+ def copy(incoming={})
3967
+ raise 'Operation not supported for undefined type'
3968
+ end
3969
+
3970
+ def to_hash
3971
+ raise 'Operation not supported for undefined type'
3972
+ end
3973
+
3974
+ end
3975
+
3802
3976
  # An item function can be represented with just it's Id, or the entire model
3803
3977
  class ExpandableItemFunction
3804
3978
 
@@ -4471,6 +4645,96 @@ module Io
4471
4645
 
4472
4646
  end
4473
4647
 
4648
+ class EventType
4649
+
4650
+ attr_reader :value
4651
+
4652
+ def initialize(value)
4653
+ @value = HttpClient::Preconditions.assert_class('value', value, String)
4654
+ end
4655
+
4656
+ # Returns the instance of EventType for this value, creating a new instance for an unknown value
4657
+ def EventType.apply(value)
4658
+ if value.instance_of?(EventType)
4659
+ value
4660
+ else
4661
+ HttpClient::Preconditions.assert_class_or_nil('value', value, String)
4662
+ value.nil? ? nil : (from_string(value) || EventType.new(value))
4663
+ end
4664
+ end
4665
+
4666
+ # Returns the instance of EventType for this value, or nil if not found
4667
+ def EventType.from_string(value)
4668
+ HttpClient::Preconditions.assert_class('value', value, String)
4669
+ EventType.ALL.find { |v| v.value == value }
4670
+ end
4671
+
4672
+ def EventType.ALL
4673
+ @@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.experience_deleted, EventType.experience_upserted, EventType.hs6_code_upserted, EventType.hs6_code_deleted, EventType.hs10_code_upserted, EventType.hs10_code_deleted]
4674
+ end
4675
+
4676
+ def EventType.catalog_upserted
4677
+ @@_catalog_upserted ||= EventType.new('catalog_upserted')
4678
+ end
4679
+
4680
+ def EventType.catalog_deleted
4681
+ @@_catalog_deleted ||= EventType.new('catalog_deleted')
4682
+ end
4683
+
4684
+ def EventType.subcatalog_upserted
4685
+ @@_subcatalog_upserted ||= EventType.new('subcatalog_upserted')
4686
+ end
4687
+
4688
+ def EventType.subcatalog_deleted
4689
+ @@_subcatalog_deleted ||= EventType.new('subcatalog_deleted')
4690
+ end
4691
+
4692
+ def EventType.catalog_item_upserted
4693
+ @@_catalog_item_upserted ||= EventType.new('catalog_item_upserted')
4694
+ end
4695
+
4696
+ def EventType.catalog_item_deleted
4697
+ @@_catalog_item_deleted ||= EventType.new('catalog_item_deleted')
4698
+ end
4699
+
4700
+ def EventType.subcatalog_item_upserted
4701
+ @@_subcatalog_item_upserted ||= EventType.new('subcatalog_item_upserted')
4702
+ end
4703
+
4704
+ def EventType.subcatalog_item_deleted
4705
+ @@_subcatalog_item_deleted ||= EventType.new('subcatalog_item_deleted')
4706
+ end
4707
+
4708
+ def EventType.experience_deleted
4709
+ @@_experience_deleted ||= EventType.new('experience_deleted')
4710
+ end
4711
+
4712
+ def EventType.experience_upserted
4713
+ @@_experience_upserted ||= EventType.new('experience_upserted')
4714
+ end
4715
+
4716
+ def EventType.hs6_code_upserted
4717
+ @@_hs6_code_upserted ||= EventType.new('hs6_code_upserted')
4718
+ end
4719
+
4720
+ def EventType.hs6_code_deleted
4721
+ @@_hs6_code_deleted ||= EventType.new('hs6_code_deleted')
4722
+ end
4723
+
4724
+ def EventType.hs10_code_upserted
4725
+ @@_hs10_code_upserted ||= EventType.new('hs10_code_upserted')
4726
+ end
4727
+
4728
+ def EventType.hs10_code_deleted
4729
+ @@_hs10_code_deleted ||= EventType.new('hs10_code_deleted')
4730
+ end
4731
+
4732
+ def to_hash
4733
+ value
4734
+ end
4735
+
4736
+ end
4737
+
4474
4738
  class ExceptionType
4475
4739
 
4476
4740
  attr_reader :value
@@ -4805,6 +5069,44 @@ module Io
4805
5069
 
4806
5070
  end
4807
5071
 
5072
+ class Method
5073
+
5074
+ attr_reader :value
5075
+
5076
+ def initialize(value)
5077
+ @value = HttpClient::Preconditions.assert_class('value', value, String)
5078
+ end
5079
+
5080
+ # Returns the instance of Method for this value, creating a new instance for an unknown value
5081
+ def Method.apply(value)
5082
+ if value.instance_of?(Method)
5083
+ value
5084
+ else
5085
+ HttpClient::Preconditions.assert_class_or_nil('value', value, String)
5086
+ value.nil? ? nil : (from_string(value) || Method.new(value))
5087
+ end
5088
+ end
5089
+
5090
+ # Returns the instance of Method for this value, or nil if not found
5091
+ def Method.from_string(value)
5092
+ HttpClient::Preconditions.assert_class('value', value, String)
5093
+ Method.ALL.find { |v| v.value == value }
5094
+ end
5095
+
5096
+ def Method.ALL
5097
+ @@all ||= [Method.post]
5098
+ end
5099
+
5100
+ def Method.post
5101
+ @@_post ||= Method.new('post')
5102
+ end
5103
+
5104
+ def to_hash
5105
+ value
5106
+ end
5107
+
5108
+ end
5109
+
4808
5110
  class PricingLevySetting
4809
5111
 
4810
5112
  attr_reader :value
@@ -5684,6 +5986,52 @@ module Io
5684
5986
 
5685
5987
  end
5686
5988
 
5989
+ class WebhookRequestStatus
5990
+
5991
+ attr_reader :value
5992
+
5993
+ def initialize(value)
5994
+ @value = HttpClient::Preconditions.assert_class('value', value, String)
5995
+ end
5996
+
5997
+ # Returns the instance of WebhookRequestStatus for this value, creating a new instance for an unknown value
5998
+ def WebhookRequestStatus.apply(value)
5999
+ if value.instance_of?(WebhookRequestStatus)
6000
+ value
6001
+ else
6002
+ HttpClient::Preconditions.assert_class_or_nil('value', value, String)
6003
+ value.nil? ? nil : (from_string(value) || WebhookRequestStatus.new(value))
6004
+ end
6005
+ end
6006
+
6007
+ # Returns the instance of WebhookRequestStatus for this value, or nil if not found
6008
+ def WebhookRequestStatus.from_string(value)
6009
+ HttpClient::Preconditions.assert_class('value', value, String)
6010
+ WebhookRequestStatus.ALL.find { |v| v.value == value }
6011
+ end
6012
+
6013
+ def WebhookRequestStatus.ALL
6014
+ @@all ||= [WebhookRequestStatus.pending, WebhookRequestStatus.success, WebhookRequestStatus.failure]
6015
+ end
6016
+
6017
+ def WebhookRequestStatus.pending
6018
+ @@_pending ||= WebhookRequestStatus.new('pending')
6019
+ end
6020
+
6021
+ def WebhookRequestStatus.success
6022
+ @@_success ||= WebhookRequestStatus.new('success')
6023
+ end
6024
+
6025
+ def WebhookRequestStatus.failure
6026
+ @@_failure ||= WebhookRequestStatus.new('failure')
6027
+ end
6028
+
6029
+ def to_hash
6030
+ value
6031
+ end
6032
+
6033
+ end
6034
+
5687
6035
  # Defines structured fields for address to be used in user/form input. Either
5688
6036
  # text or the structured input needs to be present.
5689
6037
  class Address
@@ -6684,19 +7032,18 @@ module Io
6684
7032
 
6685
7033
  end
6686
7034
 
6687
- class CatalogItemDocument < Document
7035
+ class CatalogDeleted < Event
6688
7036
 
6689
- attr_reader :number, :name, :categories, :experiences, :attributes
7037
+ attr_reader :event_id, :timestamp, :organization, :catalog
6690
7038
 
6691
7039
  def initialize(incoming={})
6692
- super(:name => Document::Types::CATALOG_ITEM_DOCUMENT)
7040
+ super(:name => Event::Types::CATALOG_DELETED)
6693
7041
  opts = HttpClient::Helper.symbolize_keys(incoming)
6694
- HttpClient::Preconditions.require_keys(opts, [:number, :name, :categories, :experiences, :attributes], 'CatalogItemDocument')
6695
- @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
6696
- @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
6697
- @categories = HttpClient::Preconditions.assert_class('categories', opts.delete(:categories), Array).map { |v| HttpClient::Preconditions.assert_class('categories', v, String) }
6698
- @experiences = HttpClient::Preconditions.assert_class('experiences', opts.delete(:experiences), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::ExperienceSummary) ? x : ::Io::Flow::V0::Models::ExperienceSummary.new(x)) }
6699
- @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 }
7042
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :catalog], 'CatalogDeleted')
7043
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
7044
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
7045
+ @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
7046
+ @catalog = HttpClient::Preconditions.assert_class('catalog', opts.delete(:catalog), String)
6700
7047
  end
6701
7048
 
6702
7049
  def to_json
@@ -6704,24 +7051,142 @@ module Io
6704
7051
  end
6705
7052
 
6706
7053
  def copy(incoming={})
6707
- CatalogItemDocument.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
7054
+ CatalogDeleted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
6708
7055
  end
6709
7056
 
6710
7057
  def subtype_to_hash
6711
7058
  {
6712
- :number => number,
6713
- :name => name,
6714
- :categories => categories,
6715
- :experiences => experiences.map { |o| o.to_hash },
6716
- :attributes => attributes
7059
+ :event_id => event_id,
7060
+ :timestamp => timestamp,
7061
+ :organization => organization,
7062
+ :catalog => catalog
6717
7063
  }
6718
7064
  end
6719
7065
 
6720
7066
  end
6721
7067
 
6722
- # Statistics covering product catalog item information, including total catalog
6723
- # item count, number of distinct categories, etc.
6724
- class CatalogStatistics
7068
+ class CatalogItemDeleted < Event
7069
+
7070
+ attr_reader :event_id, :timestamp, :organization, :number, :catalog
7071
+
7072
+ def initialize(incoming={})
7073
+ super(:name => Event::Types::CATALOG_ITEM_DELETED)
7074
+ opts = HttpClient::Helper.symbolize_keys(incoming)
7075
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :number, :catalog], 'CatalogItemDeleted')
7076
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
7077
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
7078
+ @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
7079
+ @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
7080
+ @catalog = HttpClient::Preconditions.assert_class('catalog', opts.delete(:catalog), String)
7081
+ end
7082
+
7083
+ def to_json
7084
+ JSON.dump(to_hash)
7085
+ end
7086
+
7087
+ def copy(incoming={})
7088
+ CatalogItemDeleted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
7089
+ end
7090
+
7091
+ def subtype_to_hash
7092
+ {
7093
+ :event_id => event_id,
7094
+ :timestamp => timestamp,
7095
+ :organization => organization,
7096
+ :number => number,
7097
+ :catalog => catalog
7098
+ }
7099
+ end
7100
+
7101
+ end
7102
+
7103
+ class CatalogItemDocument < Document
7104
+
7105
+ attr_reader :number, :name, :categories, :experiences, :attributes
7106
+
7107
+ def initialize(incoming={})
7108
+ super(:name => Document::Types::CATALOG_ITEM_DOCUMENT)
7109
+ opts = HttpClient::Helper.symbolize_keys(incoming)
7110
+ HttpClient::Preconditions.require_keys(opts, [:number, :name, :categories, :experiences, :attributes], 'CatalogItemDocument')
7111
+ @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
7112
+ @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
7113
+ @categories = HttpClient::Preconditions.assert_class('categories', opts.delete(:categories), Array).map { |v| HttpClient::Preconditions.assert_class('categories', v, String) }
7114
+ @experiences = HttpClient::Preconditions.assert_class('experiences', opts.delete(:experiences), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::ExperienceSummary) ? x : ::Io::Flow::V0::Models::ExperienceSummary.new(x)) }
7115
+ @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 }
7116
+ end
7117
+
7118
+ def to_json
7119
+ JSON.dump(to_hash)
7120
+ end
7121
+
7122
+ def copy(incoming={})
7123
+ CatalogItemDocument.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
7124
+ end
7125
+
7126
+ def subtype_to_hash
7127
+ {
7128
+ :number => number,
7129
+ :name => name,
7130
+ :categories => categories,
7131
+ :experiences => experiences.map { |o| o.to_hash },
7132
+ :attributes => attributes
7133
+ }
7134
+ end
7135
+
7136
+ end
7137
+
7138
+ class CatalogItemUpserted < Event
7139
+
7140
+ attr_reader :event_id, :timestamp, :organization, :number, :catalog, :locale, :name, :currency, :price, :categories, :attributes, :description
7141
+
7142
+ def initialize(incoming={})
7143
+ super(:name => Event::Types::CATALOG_ITEM_UPSERTED)
7144
+ opts = HttpClient::Helper.symbolize_keys(incoming)
7145
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :number, :catalog, :locale, :name, :currency, :price, :categories, :attributes], 'CatalogItemUpserted')
7146
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
7147
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
7148
+ @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
7149
+ @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
7150
+ @catalog = HttpClient::Preconditions.assert_class('catalog', opts.delete(:catalog), String)
7151
+ @locale = HttpClient::Preconditions.assert_class('locale', opts.delete(:locale), String)
7152
+ @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
7153
+ @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
7154
+ @price = HttpClient::Preconditions.assert_class('price', opts.delete(:price), Numeric)
7155
+ @categories = HttpClient::Preconditions.assert_class('categories', opts.delete(:categories), Array).map { |v| HttpClient::Preconditions.assert_class('categories', v, String) }
7156
+ @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 }
7157
+ @description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
7158
+ end
7159
+
7160
+ def to_json
7161
+ JSON.dump(to_hash)
7162
+ end
7163
+
7164
+ def copy(incoming={})
7165
+ CatalogItemUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
7166
+ end
7167
+
7168
+ def subtype_to_hash
7169
+ {
7170
+ :event_id => event_id,
7171
+ :timestamp => timestamp,
7172
+ :organization => organization,
7173
+ :number => number,
7174
+ :catalog => catalog,
7175
+ :locale => locale,
7176
+ :name => name,
7177
+ :currency => currency,
7178
+ :price => price,
7179
+ :categories => categories,
7180
+ :attributes => attributes,
7181
+ :description => description
7182
+ }
7183
+ end
7184
+
7185
+ end
7186
+
7187
+ # Statistics covering product catalog item information, including total catalog
7188
+ # item count, number of distinct categories, etc.
7189
+ class CatalogStatistics
6725
7190
 
6726
7191
  attr_reader :items, :categories
6727
7192
 
@@ -6749,6 +7214,39 @@ module Io
6749
7214
 
6750
7215
  end
6751
7216
 
7217
+ class CatalogUpserted < Event
7218
+
7219
+ attr_reader :event_id, :timestamp, :organization, :catalog
7220
+
7221
+ def initialize(incoming={})
7222
+ super(:name => Event::Types::CATALOG_UPSERTED)
7223
+ opts = HttpClient::Helper.symbolize_keys(incoming)
7224
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :catalog], 'CatalogUpserted')
7225
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
7226
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
7227
+ @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
7228
+ @catalog = HttpClient::Preconditions.assert_class('catalog', opts.delete(:catalog), String)
7229
+ end
7230
+
7231
+ def to_json
7232
+ JSON.dump(to_hash)
7233
+ end
7234
+
7235
+ def copy(incoming={})
7236
+ CatalogUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
7237
+ end
7238
+
7239
+ def subtype_to_hash
7240
+ {
7241
+ :event_id => event_id,
7242
+ :timestamp => timestamp,
7243
+ :organization => organization,
7244
+ :catalog => catalog
7245
+ }
7246
+ end
7247
+
7248
+ end
7249
+
6752
7250
  class CatalogVersion
6753
7251
 
6754
7252
  attr_reader :id, :timestamp, :type, :catalog
@@ -6812,12 +7310,13 @@ module Io
6812
7310
  # Represents a facility capable of fulfilling a shipment
6813
7311
  class Center
6814
7312
 
6815
- attr_reader :id, :address, :packaging, :name, :services, :schedule, :timezone
7313
+ attr_reader :id, :key, :address, :packaging, :name, :services, :schedule, :timezone
6816
7314
 
6817
7315
  def initialize(incoming={})
6818
7316
  opts = HttpClient::Helper.symbolize_keys(incoming)
6819
- HttpClient::Preconditions.require_keys(opts, [:id, :address, :packaging, :name, :services, :schedule, :timezone], 'Center')
7317
+ HttpClient::Preconditions.require_keys(opts, [:id, :key, :address, :packaging, :name, :services, :schedule, :timezone], 'Center')
6820
7318
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
7319
+ @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
6821
7320
  @address = (x = opts.delete(:address); x.is_a?(::Io::Flow::V0::Models::ShippingAddress) ? x : ::Io::Flow::V0::Models::ShippingAddress.new(x))
6822
7321
  @packaging = HttpClient::Preconditions.assert_class('packaging', opts.delete(:packaging), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::Packaging) ? x : ::Io::Flow::V0::Models::Packaging.new(x)) }
6823
7322
  @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
@@ -6837,6 +7336,7 @@ module Io
6837
7336
  def to_hash
6838
7337
  {
6839
7338
  :id => id,
7339
+ :key => key,
6840
7340
  :address => address.to_hash,
6841
7341
  :packaging => packaging.map { |o| o.to_hash },
6842
7342
  :name => name,
@@ -6850,7 +7350,7 @@ module Io
6850
7350
 
6851
7351
  class CenterForm
6852
7352
 
6853
- attr_reader :address, :packaging, :name, :services, :schedule, :timezone
7353
+ attr_reader :address, :packaging, :name, :services, :schedule, :timezone, :key
6854
7354
 
6855
7355
  def initialize(incoming={})
6856
7356
  opts = HttpClient::Helper.symbolize_keys(incoming)
@@ -6861,6 +7361,7 @@ module Io
6861
7361
  @services = HttpClient::Preconditions.assert_class('services', opts.delete(:services), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::AvailableService) ? x : ::Io::Flow::V0::Models::AvailableService.new(x)) }
6862
7362
  @schedule = (x = opts.delete(:schedule); x.is_a?(::Io::Flow::V0::Models::Schedule) ? x : ::Io::Flow::V0::Models::Schedule.new(x))
6863
7363
  @timezone = HttpClient::Preconditions.assert_class('timezone', opts.delete(:timezone), String)
7364
+ @key = (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, String))
6864
7365
  end
6865
7366
 
6866
7367
  def to_json
@@ -6878,7 +7379,8 @@ module Io
6878
7379
  :name => name,
6879
7380
  :services => services.map { |o| o.to_hash },
6880
7381
  :schedule => schedule.to_hash,
6881
- :timezone => timezone
7382
+ :timezone => timezone,
7383
+ :key => key
6882
7384
  }
6883
7385
  end
6884
7386
 
@@ -7894,6 +8396,39 @@ module Io
7894
8396
 
7895
8397
  end
7896
8398
 
8399
+ class ExperienceDeleted < Event
8400
+
8401
+ attr_reader :event_id, :timestamp, :organization, :key
8402
+
8403
+ def initialize(incoming={})
8404
+ super(:name => Event::Types::EXPERIENCE_DELETED)
8405
+ opts = HttpClient::Helper.symbolize_keys(incoming)
8406
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :key], 'ExperienceDeleted')
8407
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
8408
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
8409
+ @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
8410
+ @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
8411
+ end
8412
+
8413
+ def to_json
8414
+ JSON.dump(to_hash)
8415
+ end
8416
+
8417
+ def copy(incoming={})
8418
+ ExperienceDeleted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
8419
+ end
8420
+
8421
+ def subtype_to_hash
8422
+ {
8423
+ :event_id => event_id,
8424
+ :timestamp => timestamp,
8425
+ :organization => organization,
8426
+ :key => key
8427
+ }
8428
+ end
8429
+
8430
+ end
8431
+
7897
8432
  # Experiences define a local experience for a given geographic region
7898
8433
  class ExperienceForm
7899
8434
 
@@ -8000,6 +8535,53 @@ module Io
8000
8535
 
8001
8536
  end
8002
8537
 
8538
+ class ExperienceUpserted < Event
8539
+
8540
+ attr_reader :event_id, :timestamp, :organization, :key, :name, :subcatalog_id, :region_id, :country, :currency, :language, :measurement_system
8541
+
8542
+ def initialize(incoming={})
8543
+ super(:name => Event::Types::EXPERIENCE_UPSERTED)
8544
+ opts = HttpClient::Helper.symbolize_keys(incoming)
8545
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :key, :name, :subcatalog_id, :region_id, :country, :currency, :language, :measurement_system], 'ExperienceUpserted')
8546
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
8547
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
8548
+ @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
8549
+ @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
8550
+ @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
8551
+ @subcatalog_id = HttpClient::Preconditions.assert_class('subcatalog_id', opts.delete(:subcatalog_id), String)
8552
+ @region_id = HttpClient::Preconditions.assert_class('region_id', opts.delete(:region_id), String)
8553
+ @country = HttpClient::Preconditions.assert_class('country', opts.delete(:country), String)
8554
+ @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
8555
+ @language = HttpClient::Preconditions.assert_class('language', opts.delete(:language), String)
8556
+ @measurement_system = HttpClient::Preconditions.assert_class('measurement_system', opts.delete(:measurement_system), String)
8557
+ end
8558
+
8559
+ def to_json
8560
+ JSON.dump(to_hash)
8561
+ end
8562
+
8563
+ def copy(incoming={})
8564
+ ExperienceUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
8565
+ end
8566
+
8567
+ def subtype_to_hash
8568
+ {
8569
+ :event_id => event_id,
8570
+ :timestamp => timestamp,
8571
+ :organization => organization,
8572
+ :key => key,
8573
+ :name => name,
8574
+ :subcatalog_id => subcatalog_id,
8575
+ :region_id => region_id,
8576
+ :country => country,
8577
+ :currency => currency,
8578
+ :language => language,
8579
+ :measurement_system => measurement_system
8580
+ }
8581
+ end
8582
+
8583
+ end
8584
+
8003
8585
  class ExperienceVersion
8004
8586
 
8005
8587
  attr_reader :id, :timestamp, :type, :experience
@@ -8641,6 +9223,34 @@ module Io
8641
9223
 
8642
9224
  end
8643
9225
 
9226
+ class Header
9227
+
9228
+ attr_reader :name, :value
9229
+
9230
+ def initialize(incoming={})
9231
+ opts = HttpClient::Helper.symbolize_keys(incoming)
9232
+ HttpClient::Preconditions.require_keys(opts, [:name, :value], 'Header')
9233
+ @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
9234
+ @value = HttpClient::Preconditions.assert_class('value', opts.delete(:value), String)
9235
+ end
9236
+
9237
+ def to_json
9238
+ JSON.dump(to_hash)
9239
+ end
9240
+
9241
+ def copy(incoming={})
9242
+ Header.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
9243
+ end
9244
+
9245
+ def to_hash
9246
+ {
9247
+ :name => name,
9248
+ :value => value
9249
+ }
9250
+ end
9251
+
9252
+ end
9253
+
8644
9254
  class Healthcheck
8645
9255
 
8646
9256
  attr_reader :status
@@ -8703,6 +9313,84 @@ module Io
8703
9313
 
8704
9314
  end
8705
9315
 
9316
+ # Event raised whenever an HS-10 code is unassigned from an item
9317
+ class Hs10CodeDeleted < Event
9318
+
9319
+ attr_reader :event_id, :timestamp, :organization, :number, :origin, :destination
9320
+
9321
+ def initialize(incoming={})
9322
+ super(:name => Event::Types::HS10_CODE_DELETED)
9323
+ opts = HttpClient::Helper.symbolize_keys(incoming)
9324
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :number, :origin, :destination], 'Hs10CodeDeleted')
9325
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
9326
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
9327
+ @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
9328
+ @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
9329
+ @origin = HttpClient::Preconditions.assert_class('origin', opts.delete(:origin), String)
9330
+ @destination = HttpClient::Preconditions.assert_class('destination', opts.delete(:destination), String)
9331
+ end
9332
+
9333
+ def to_json
9334
+ JSON.dump(to_hash)
9335
+ end
9336
+
9337
+ def copy(incoming={})
9338
+ Hs10CodeDeleted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
9339
+ end
9340
+
9341
+ def subtype_to_hash
9342
+ {
9343
+ :event_id => event_id,
9344
+ :timestamp => timestamp,
9345
+ :organization => organization,
9346
+ :number => number,
9347
+ :origin => origin,
9348
+ :destination => destination
9349
+ }
9350
+ end
9351
+
9352
+ end
9353
+
9354
+ # Event raised whenever an HS-10 code is assigned to an item
9355
+ class Hs10CodeUpserted < Event
9356
+
9357
+ attr_reader :event_id, :timestamp, :organization, :number, :origin, :destination, :code
9358
+
9359
+ def initialize(incoming={})
9360
+ super(:name => Event::Types::HS10_CODE_UPSERTED)
9361
+ opts = HttpClient::Helper.symbolize_keys(incoming)
9362
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :number, :origin, :destination, :code], 'Hs10CodeUpserted')
9363
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
9364
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
9365
+ @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
9366
+ @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
9367
+ @origin = HttpClient::Preconditions.assert_class('origin', opts.delete(:origin), String)
9368
+ @destination = HttpClient::Preconditions.assert_class('destination', opts.delete(:destination), String)
9369
+ @code = HttpClient::Preconditions.assert_class('code', opts.delete(:code), String)
9370
+ end
9371
+
9372
+ def to_json
9373
+ JSON.dump(to_hash)
9374
+ end
9375
+
9376
+ def copy(incoming={})
9377
+ Hs10CodeUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
9378
+ end
9379
+
9380
+ def subtype_to_hash
9381
+ {
9382
+ :event_id => event_id,
9383
+ :timestamp => timestamp,
9384
+ :organization => organization,
9385
+ :number => number,
9386
+ :origin => origin,
9387
+ :destination => destination,
9388
+ :code => code
9389
+ }
9390
+ end
9391
+
9392
+ end
9393
+
8706
9394
  class Hs10Version
8707
9395
 
8708
9396
  attr_reader :id, :timestamp, :type, :hs10
@@ -8738,13 +9426,81 @@ module Io
8738
9426
  # The (Harmonized System) HS-6 code assigned to an item.
8739
9427
  class Hs6
8740
9428
 
8741
- attr_reader :id, :item, :code
9429
+ attr_reader :id, :item, :code
9430
+
9431
+ def initialize(incoming={})
9432
+ opts = HttpClient::Helper.symbolize_keys(incoming)
9433
+ HttpClient::Preconditions.require_keys(opts, [:id, :item, :code], 'Hs6')
9434
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
9435
+ @item = (x = opts.delete(:item); x.is_a?(::Io::Flow::V0::Models::HarmonizedItemReference) ? x : ::Io::Flow::V0::Models::HarmonizedItemReference.new(x))
9436
+ @code = HttpClient::Preconditions.assert_class('code', opts.delete(:code), String)
9437
+ end
9438
+
9439
+ def to_json
9440
+ JSON.dump(to_hash)
9441
+ end
9442
+
9443
+ def copy(incoming={})
9444
+ Hs6.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
9445
+ end
9446
+
9447
+ def to_hash
9448
+ {
9449
+ :id => id,
9450
+ :item => item.to_hash,
9451
+ :code => code
9452
+ }
9453
+ end
9454
+
9455
+ end
9456
+
9457
+ # Event raised whenever an HS-6 code is deleted
9458
+ class Hs6CodeDeleted < Event
9459
+
9460
+ attr_reader :event_id, :timestamp, :organization, :number
9461
+
9462
+ def initialize(incoming={})
9463
+ super(:name => Event::Types::HS6_CODE_DELETED)
9464
+ opts = HttpClient::Helper.symbolize_keys(incoming)
9465
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :number], 'Hs6CodeDeleted')
9466
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
9467
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
9468
+ @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
9469
+ @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
9470
+ end
9471
+
9472
+ def to_json
9473
+ JSON.dump(to_hash)
9474
+ end
9475
+
9476
+ def copy(incoming={})
9477
+ Hs6CodeDeleted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
9478
+ end
9479
+
9480
+ def subtype_to_hash
9481
+ {
9482
+ :event_id => event_id,
9483
+ :timestamp => timestamp,
9484
+ :organization => organization,
9485
+ :number => number
9486
+ }
9487
+ end
9488
+
9489
+ end
9490
+
9491
+ # Event raised whenever an HS-6 code is assigned to an item
9492
+ class Hs6CodeUpserted < Event
9493
+
9494
+ attr_reader :event_id, :timestamp, :organization, :number, :code
8742
9495
 
8743
9496
  def initialize(incoming={})
9497
+ super(:name => Event::Types::HS6_CODE_UPSERTED)
8744
9498
  opts = HttpClient::Helper.symbolize_keys(incoming)
8745
- HttpClient::Preconditions.require_keys(opts, [:id, :item, :code], 'Hs6')
8746
- @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
8747
- @item = (x = opts.delete(:item); x.is_a?(::Io::Flow::V0::Models::HarmonizedItemReference) ? x : ::Io::Flow::V0::Models::HarmonizedItemReference.new(x))
9499
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :number, :code], 'Hs6CodeUpserted')
9500
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
9501
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
9502
+ @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
9503
+ @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
8748
9504
  @code = HttpClient::Preconditions.assert_class('code', opts.delete(:code), String)
8749
9505
  end
8750
9506
 
@@ -8753,13 +9509,15 @@ module Io
8753
9509
  end
8754
9510
 
8755
9511
  def copy(incoming={})
8756
- Hs6.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
9512
+ Hs6CodeUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
8757
9513
  end
8758
9514
 
8759
- def to_hash
9515
+ def subtype_to_hash
8760
9516
  {
8761
- :id => id,
8762
- :item => item.to_hash,
9517
+ :event_id => event_id,
9518
+ :timestamp => timestamp,
9519
+ :organization => organization,
9520
+ :number => number,
8763
9521
  :code => code
8764
9522
  }
8765
9523
  end
@@ -12919,6 +13677,41 @@ module Io
12919
13677
 
12920
13678
  end
12921
13679
 
13680
+ class SubcatalogDeleted < Event
13681
+
13682
+ attr_reader :event_id, :timestamp, :organization, :catalog, :subcatalog_id
13683
+
13684
+ def initialize(incoming={})
13685
+ super(:name => Event::Types::SUBCATALOG_DELETED)
13686
+ opts = HttpClient::Helper.symbolize_keys(incoming)
13687
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :catalog, :subcatalog_id], 'SubcatalogDeleted')
13688
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
13689
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
13690
+ @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
13691
+ @catalog = HttpClient::Preconditions.assert_class('catalog', opts.delete(:catalog), String)
13692
+ @subcatalog_id = HttpClient::Preconditions.assert_class('subcatalog_id', opts.delete(:subcatalog_id), String)
13693
+ end
13694
+
13695
+ def to_json
13696
+ JSON.dump(to_hash)
13697
+ end
13698
+
13699
+ def copy(incoming={})
13700
+ SubcatalogDeleted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
13701
+ end
13702
+
13703
+ def subtype_to_hash
13704
+ {
13705
+ :event_id => event_id,
13706
+ :timestamp => timestamp,
13707
+ :organization => organization,
13708
+ :catalog => catalog,
13709
+ :subcatalog_id => subcatalog_id
13710
+ }
13711
+ end
13712
+
13713
+ end
13714
+
12922
13715
  class SubcatalogForm
12923
13716
 
12924
13717
  attr_reader :settings
@@ -13071,6 +13864,84 @@ module Io
13071
13864
 
13072
13865
  end
13073
13866
 
13867
+ class SubcatalogItemDeleted < Event
13868
+
13869
+ attr_reader :event_id, :timestamp, :organization, :number, :catalog, :subcatalog_id
13870
+
13871
+ def initialize(incoming={})
13872
+ super(:name => Event::Types::SUBCATALOG_ITEM_DELETED)
13873
+ opts = HttpClient::Helper.symbolize_keys(incoming)
13874
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :number, :catalog, :subcatalog_id], 'SubcatalogItemDeleted')
13875
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
13876
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
13877
+ @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
13878
+ @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
13879
+ @catalog = HttpClient::Preconditions.assert_class('catalog', opts.delete(:catalog), String)
13880
+ @subcatalog_id = HttpClient::Preconditions.assert_class('subcatalog_id', opts.delete(:subcatalog_id), String)
13881
+ end
13882
+
13883
+ def to_json
13884
+ JSON.dump(to_hash)
13885
+ end
13886
+
13887
+ def copy(incoming={})
13888
+ SubcatalogItemDeleted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
13889
+ end
13890
+
13891
+ def subtype_to_hash
13892
+ {
13893
+ :event_id => event_id,
13894
+ :timestamp => timestamp,
13895
+ :organization => organization,
13896
+ :number => number,
13897
+ :catalog => catalog,
13898
+ :subcatalog_id => subcatalog_id
13899
+ }
13900
+ end
13901
+
13902
+ end
13903
+
13904
+ class SubcatalogItemUpserted < Event
13905
+
13906
+ attr_reader :event_id, :timestamp, :organization, :number, :catalog, :subcatalog_id, :status, :function_id
13907
+
13908
+ def initialize(incoming={})
13909
+ super(:name => Event::Types::SUBCATALOG_ITEM_UPSERTED)
13910
+ opts = HttpClient::Helper.symbolize_keys(incoming)
13911
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :number, :catalog, :subcatalog_id, :status], 'SubcatalogItemUpserted')
13912
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
13913
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
13914
+ @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
13915
+ @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
13916
+ @catalog = HttpClient::Preconditions.assert_class('catalog', opts.delete(:catalog), String)
13917
+ @subcatalog_id = HttpClient::Preconditions.assert_class('subcatalog_id', opts.delete(:subcatalog_id), String)
13918
+ @status = HttpClient::Preconditions.assert_class('status', opts.delete(:status), String)
13919
+ @function_id = (x = opts.delete(:function_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('function_id', x, String))
13920
+ end
13921
+
13922
+ def to_json
13923
+ JSON.dump(to_hash)
13924
+ end
13925
+
13926
+ def copy(incoming={})
13927
+ SubcatalogItemUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
13928
+ end
13929
+
13930
+ def subtype_to_hash
13931
+ {
13932
+ :event_id => event_id,
13933
+ :timestamp => timestamp,
13934
+ :organization => organization,
13935
+ :number => number,
13936
+ :catalog => catalog,
13937
+ :subcatalog_id => subcatalog_id,
13938
+ :status => status,
13939
+ :function_id => function_id
13940
+ }
13941
+ end
13942
+
13943
+ end
13944
+
13074
13945
  class SubcatalogReference < ExpandableSubcatalog
13075
13946
 
13076
13947
  attr_reader :id
@@ -13184,6 +14055,41 @@ module Io
13184
14055
 
13185
14056
  end
13186
14057
 
14058
+ class SubcatalogUpserted < Event
14059
+
14060
+ attr_reader :event_id, :timestamp, :organization, :catalog, :subcatalog_id
14061
+
14062
+ def initialize(incoming={})
14063
+ super(:name => Event::Types::SUBCATALOG_UPSERTED)
14064
+ opts = HttpClient::Helper.symbolize_keys(incoming)
14065
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :catalog, :subcatalog_id], 'SubcatalogUpserted')
14066
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
14067
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
14068
+ @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
14069
+ @catalog = HttpClient::Preconditions.assert_class('catalog', opts.delete(:catalog), String)
14070
+ @subcatalog_id = HttpClient::Preconditions.assert_class('subcatalog_id', opts.delete(:subcatalog_id), String)
14071
+ end
14072
+
14073
+ def to_json
14074
+ JSON.dump(to_hash)
14075
+ end
14076
+
14077
+ def copy(incoming={})
14078
+ SubcatalogUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
14079
+ end
14080
+
14081
+ def subtype_to_hash
14082
+ {
14083
+ :event_id => event_id,
14084
+ :timestamp => timestamp,
14085
+ :organization => organization,
14086
+ :catalog => catalog,
14087
+ :subcatalog_id => subcatalog_id
14088
+ }
14089
+ end
14090
+
14091
+ end
14092
+
13187
14093
  class SubcatalogVersion
13188
14094
 
13189
14095
  attr_reader :id, :timestamp, :type, :subcatalog
@@ -14187,6 +15093,196 @@ module Io
14187
15093
 
14188
15094
  end
14189
15095
 
15096
+ class Webhook
15097
+
15098
+ attr_reader :id, :url, :events
15099
+
15100
+ def initialize(incoming={})
15101
+ opts = HttpClient::Helper.symbolize_keys(incoming)
15102
+ HttpClient::Preconditions.require_keys(opts, [:id, :url, :events], 'Webhook')
15103
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
15104
+ @url = HttpClient::Preconditions.assert_class('url', opts.delete(:url), String)
15105
+ @events = HttpClient::Preconditions.assert_class('events', opts.delete(:events), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::EventType) ? x : ::Io::Flow::V0::Models::EventType.apply(x)) }
15106
+ end
15107
+
15108
+ def to_json
15109
+ JSON.dump(to_hash)
15110
+ end
15111
+
15112
+ def copy(incoming={})
15113
+ Webhook.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
15114
+ end
15115
+
15116
+ def to_hash
15117
+ {
15118
+ :id => id,
15119
+ :url => url,
15120
+ :events => events.map { |o| o.value }
15121
+ }
15122
+ end
15123
+
15124
+ end
15125
+
15126
+ class WebhookForm
15127
+
15128
+ attr_reader :url, :events
15129
+
15130
+ def initialize(incoming={})
15131
+ opts = HttpClient::Helper.symbolize_keys(incoming)
15132
+ HttpClient::Preconditions.require_keys(opts, [:url, :events], 'WebhookForm')
15133
+ @url = HttpClient::Preconditions.assert_class('url', opts.delete(:url), String)
15134
+ @events = HttpClient::Preconditions.assert_class('events', opts.delete(:events), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::EventType) ? x : ::Io::Flow::V0::Models::EventType.apply(x)) }
15135
+ end
15136
+
15137
+ def to_json
15138
+ JSON.dump(to_hash)
15139
+ end
15140
+
15141
+ def copy(incoming={})
15142
+ WebhookForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
15143
+ end
15144
+
15145
+ def to_hash
15146
+ {
15147
+ :url => url,
15148
+ :events => events.map { |o| o.value }
15149
+ }
15150
+ end
15151
+
15152
+ end
15153
+
15154
+ class WebhookReference
15155
+
15156
+ attr_reader :id
15157
+
15158
+ def initialize(incoming={})
15159
+ opts = HttpClient::Helper.symbolize_keys(incoming)
15160
+ HttpClient::Preconditions.require_keys(opts, [:id], 'WebhookReference')
15161
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
15162
+ end
15163
+
15164
+ def to_json
15165
+ JSON.dump(to_hash)
15166
+ end
15167
+
15168
+ def copy(incoming={})
15169
+ WebhookReference.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
15170
+ end
15171
+
15172
+ def to_hash
15173
+ {
15174
+ :id => id
15175
+ }
15176
+ end
15177
+
15178
+ end
15179
+
15180
+ class WebhookRequest
15181
+
15182
+ attr_reader :id, :webhook, :headers, :method, :body, :status, :started_at, :completed_at, :duration_ms, :response, :error
15183
+
15184
+ def initialize(incoming={})
15185
+ opts = HttpClient::Helper.symbolize_keys(incoming)
15186
+ HttpClient::Preconditions.require_keys(opts, [:id, :webhook, :headers, :method, :body, :status], 'WebhookRequest')
15187
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
15188
+ @webhook = (x = opts.delete(:webhook); x.is_a?(::Io::Flow::V0::Models::WebhookReference) ? x : ::Io::Flow::V0::Models::WebhookReference.new(x))
15189
+ @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)) }
15190
+ @method = (x = opts.delete(:method); x.is_a?(::Io::Flow::V0::Models::Method) ? x : ::Io::Flow::V0::Models::Method.apply(x))
15191
+ @body = HttpClient::Preconditions.assert_class('body', opts.delete(:body), String)
15192
+ @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::WebhookRequestStatus) ? x : ::Io::Flow::V0::Models::WebhookRequestStatus.apply(x))
15193
+ @started_at = (x = opts.delete(:started_at); x.nil? ? nil : HttpClient::Preconditions.assert_class('started_at', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
15194
+ @completed_at = (x = opts.delete(:completed_at); x.nil? ? nil : HttpClient::Preconditions.assert_class('completed_at', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
15195
+ @duration_ms = (x = opts.delete(:duration_ms); x.nil? ? nil : HttpClient::Preconditions.assert_class('duration_ms', x, Integer))
15196
+ @response = (x = opts.delete(:response); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::WebhookResponse) ? x : ::Io::Flow::V0::Models::WebhookResponse.new(x)))
15197
+ @error = (x = opts.delete(:error); x.nil? ? nil : HttpClient::Preconditions.assert_class('error', x, String))
15198
+ end
15199
+
15200
+ def to_json
15201
+ JSON.dump(to_hash)
15202
+ end
15203
+
15204
+ def copy(incoming={})
15205
+ WebhookRequest.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
15206
+ end
15207
+
15208
+ def to_hash
15209
+ {
15210
+ :id => id,
15211
+ :webhook => webhook.to_hash,
15212
+ :headers => headers.map { |o| o.to_hash },
15213
+ :method => method.value,
15214
+ :body => body,
15215
+ :status => status.value,
15216
+ :started_at => started_at,
15217
+ :completed_at => completed_at,
15218
+ :duration_ms => duration_ms,
15219
+ :response => response.nil? ? nil : response.to_hash,
15220
+ :error => error
15221
+ }
15222
+ end
15223
+
15224
+ end
15225
+
15226
+ class WebhookRequestReference
15227
+
15228
+ attr_reader :id
15229
+
15230
+ def initialize(incoming={})
15231
+ opts = HttpClient::Helper.symbolize_keys(incoming)
15232
+ HttpClient::Preconditions.require_keys(opts, [:id], 'WebhookRequestReference')
15233
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
15234
+ end
15235
+
15236
+ def to_json
15237
+ JSON.dump(to_hash)
15238
+ end
15239
+
15240
+ def copy(incoming={})
15241
+ WebhookRequestReference.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
15242
+ end
15243
+
15244
+ def to_hash
15245
+ {
15246
+ :id => id
15247
+ }
15248
+ end
15249
+
15250
+ end
15251
+
15252
+ class WebhookResponse
15253
+
15254
+ attr_reader :id, :request, :headers, :body, :status
15255
+
15256
+ def initialize(incoming={})
15257
+ opts = HttpClient::Helper.symbolize_keys(incoming)
15258
+ HttpClient::Preconditions.require_keys(opts, [:id, :request, :headers, :body, :status], 'WebhookResponse')
15259
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
15260
+ @request = (x = opts.delete(:request); x.is_a?(::Io::Flow::V0::Models::WebhookRequestReference) ? x : ::Io::Flow::V0::Models::WebhookRequestReference.new(x))
15261
+ @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)) }
15262
+ @body = HttpClient::Preconditions.assert_class('body', opts.delete(:body), String)
15263
+ @status = HttpClient::Preconditions.assert_class('status', opts.delete(:status), Integer)
15264
+ end
15265
+
15266
+ def to_json
15267
+ JSON.dump(to_hash)
15268
+ end
15269
+
15270
+ def copy(incoming={})
15271
+ WebhookResponse.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
15272
+ end
15273
+
15274
+ def to_hash
15275
+ {
15276
+ :id => id,
15277
+ :request => request.to_hash,
15278
+ :headers => headers.map { |o| o.to_hash },
15279
+ :body => body,
15280
+ :status => status
15281
+ }
15282
+ end
15283
+
15284
+ end
15285
+
14190
15286
  class Zone
14191
15287
 
14192
15288
  attr_reader :province, :country