zippendo 1.2.4 → 1.2.5

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.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/docs/CreateOrderChannelRequest.md +26 -0
  3. data/docs/CreateOrderChannelRequestSettings.md +42 -0
  4. data/docs/CreateOrderChannelRequestSettingsShippingMethodMappingsInner.md +22 -0
  5. data/docs/CreateOrderChannelWebhookSecret201Response.md +22 -0
  6. data/docs/CreateOrderRequest.md +4 -0
  7. data/docs/GetOrderChannelWebhookStatus200Response.md +22 -0
  8. data/docs/GetOrderChannelWebhookStatus200ResponseWebhooksInner.md +28 -0
  9. data/docs/ListOrderChannels200Response.md +26 -0
  10. data/docs/ListOrderChannels200ResponseDataInner.md +44 -0
  11. data/docs/ListOrderChannels200ResponseDataInnerSettings.md +50 -0
  12. data/docs/ListOrderChannels200ResponseDataInnerSettingsShippingMethodMappingsInner.md +22 -0
  13. data/docs/OrderChannelsApi.md +599 -0
  14. data/docs/RevokeOrderChannelWebhookSecret200Response.md +18 -0
  15. data/docs/UpdateOrderChannelRequest.md +28 -0
  16. data/docs/UpdateOrderChannelRequestSettings.md +42 -0
  17. data/lib/zippendo/api/order_channels_api.rb +629 -0
  18. data/lib/zippendo/models/batch_send_shipments200_response_results_inner.rb +2 -2
  19. data/lib/zippendo/models/create_order_channel_request.rb +266 -0
  20. data/lib/zippendo/models/create_order_channel_request_settings.rb +359 -0
  21. data/lib/zippendo/models/create_order_channel_request_settings_shipping_method_mappings_inner.rb +254 -0
  22. data/lib/zippendo/models/create_order_channel_webhook_secret201_response.rb +230 -0
  23. data/lib/zippendo/models/create_order_request.rb +23 -1
  24. data/lib/zippendo/models/get_order_channel_webhook_status200_response.rb +221 -0
  25. data/lib/zippendo/models/get_order_channel_webhook_status200_response_webhooks_inner.rb +266 -0
  26. data/lib/zippendo/models/list_api_tokens401_response.rb +2 -2
  27. data/lib/zippendo/models/list_order_channels200_response.rb +275 -0
  28. data/lib/zippendo/models/list_order_channels200_response_data_inner.rb +478 -0
  29. data/lib/zippendo/models/list_order_channels200_response_data_inner_settings.rb +509 -0
  30. data/lib/zippendo/models/list_order_channels200_response_data_inner_settings_shipping_method_mappings_inner.rb +254 -0
  31. data/lib/zippendo/models/list_orders200_response_data_inner_order_channel.rb +2 -2
  32. data/lib/zippendo/models/revoke_order_channel_webhook_secret200_response.rb +165 -0
  33. data/lib/zippendo/models/send_shipment422_response.rb +2 -2
  34. data/lib/zippendo/models/update_order_channel_request.rb +231 -0
  35. data/lib/zippendo/models/update_order_channel_request_settings.rb +360 -0
  36. data/lib/zippendo/version.rb +1 -1
  37. data/lib/zippendo.rb +14 -0
  38. metadata +29 -1
@@ -0,0 +1,231 @@
1
+ =begin
2
+ #Zippendo Public API
3
+
4
+ #Public API documentation for Zippendo. Authenticate using your API token (Bearer token prefixed with zipp_). **Brands (sub-accounts).** An organization can be split into brands, each keeping its own orders, shipments and configuration separate. There are two ways to scope requests to one brand, and NEITHER changes any request body: 1. **Bind the token.** Create an API token with a `brandId` and every request it makes is confined to that brand — reads filtered, writes stamped. This is the recommended way to give a single brand's team its own credential. 2. **Send the `X-Zippendo-Brand` header.** An organization-wide token can scope an individual request by sending the brand's id or slug in this header. Most SDKs let you set it once on the client so every call inherits it. A brand-bound token that receives an `X-Zippendo-Brand` header naming a different brand is rejected with `403 BRAND_ACCESS_DENIED` — the binding is never widened. Omit both and requests cover the whole organization, which is the behaviour of every existing token. Records that belong to no brand carry `brandId: null`. Configuration (carriers, shipping rules, addresses) with a null brand is organization-wide and remains visible inside every brand; orders and shipments with a null brand are only visible organization-wide. List endpoints additionally take a `?brandScope=own|shared|both` parameter to narrow further within whichever brand context already applies. `own` returns only rows assigned to that brand, and requires a brand context — a brand-bound token, a resolved brand session, or the `X-Zippendo-Brand` header above — otherwise `400`. `shared` returns only the organization-wide rows (equivalent to filtering `brandId=none`). The default, `both`, keeps the existing behaviour: a brand context sees its own rows plus the organization-wide ones. Set `X-Zippendo-Brand-Scope` as a client default to apply the same choice to every request instead of repeating the query parameter on each call — an explicit `brandScope` query parameter always wins over the header, and a blank header value is ignored. Brands themselves are managed under the **Brands** tag. Retiring a brand is done with `POST /orgs/{orgId}/brands/{brandId}/archive` — permanent deletion is a dashboard-only action, since it is refused while any order, shipment, member or token still references the brand. Brands require a plan that includes them; creating one beyond your plan's limit returns `403`.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: support@zippendo.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.24.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Zippendo
17
+ class UpdateOrderChannelRequest < ApiModelBase
18
+ # Brand this channel belongs to; null for organization-wide
19
+ attr_accessor :brand_id
20
+
21
+ # Display name for the channel.
22
+ attr_accessor :name
23
+
24
+ # Whether the channel is active.
25
+ attr_accessor :enabled
26
+
27
+ # Type-specific platform credentials.
28
+ attr_accessor :credentials
29
+
30
+ attr_accessor :settings
31
+
32
+ # IDs of shipping rules linked to this channel.
33
+ attr_accessor :shipping_rule_ids
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'brand_id' => :'brandId',
39
+ :'name' => :'name',
40
+ :'enabled' => :'enabled',
41
+ :'credentials' => :'credentials',
42
+ :'settings' => :'settings',
43
+ :'shipping_rule_ids' => :'shippingRuleIds'
44
+ }
45
+ end
46
+
47
+ # Returns attribute mapping this model knows about
48
+ def self.acceptable_attribute_map
49
+ attribute_map
50
+ end
51
+
52
+ # Returns all the JSON keys this model knows about
53
+ def self.acceptable_attributes
54
+ acceptable_attribute_map.values
55
+ end
56
+
57
+ # Attribute type mapping.
58
+ def self.openapi_types
59
+ {
60
+ :'brand_id' => :'String',
61
+ :'name' => :'String',
62
+ :'enabled' => :'Boolean',
63
+ :'credentials' => :'Hash<String, Object>',
64
+ :'settings' => :'UpdateOrderChannelRequestSettings',
65
+ :'shipping_rule_ids' => :'Array<String>'
66
+ }
67
+ end
68
+
69
+ # List of attributes with nullable: true
70
+ def self.openapi_nullable
71
+ Set.new([
72
+ :'brand_id',
73
+ :'credentials',
74
+ ])
75
+ end
76
+
77
+ # Initializes the object
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ def initialize(attributes = {})
80
+ if (!attributes.is_a?(Hash))
81
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zippendo::UpdateOrderChannelRequest` initialize method"
82
+ end
83
+
84
+ # check to see if the attribute exists and convert string to symbol for hash key
85
+ acceptable_attribute_map = self.class.acceptable_attribute_map
86
+ attributes = attributes.each_with_object({}) { |(k, v), h|
87
+ if (!acceptable_attribute_map.key?(k.to_sym))
88
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zippendo::UpdateOrderChannelRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
89
+ end
90
+ h[k.to_sym] = v
91
+ }
92
+
93
+ if attributes.key?(:'brand_id')
94
+ self.brand_id = attributes[:'brand_id']
95
+ end
96
+
97
+ if attributes.key?(:'name')
98
+ self.name = attributes[:'name']
99
+ end
100
+
101
+ if attributes.key?(:'enabled')
102
+ self.enabled = attributes[:'enabled']
103
+ end
104
+
105
+ if attributes.key?(:'credentials')
106
+ if (value = attributes[:'credentials']).is_a?(Hash)
107
+ self.credentials = value
108
+ end
109
+ end
110
+
111
+ if attributes.key?(:'settings')
112
+ self.settings = attributes[:'settings']
113
+ end
114
+
115
+ if attributes.key?(:'shipping_rule_ids')
116
+ if (value = attributes[:'shipping_rule_ids']).is_a?(Array)
117
+ self.shipping_rule_ids = value
118
+ end
119
+ end
120
+ end
121
+
122
+ # Show invalid properties with the reasons. Usually used together with valid?
123
+ # @return Array for valid properties with the reasons
124
+ def list_invalid_properties
125
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
126
+ invalid_properties = Array.new
127
+ if !@name.nil? && @name.to_s.length > 100
128
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 100.')
129
+ end
130
+
131
+ if !@name.nil? && @name.to_s.length < 1
132
+ invalid_properties.push('invalid value for "name", the character length must be greater than or equal to 1.')
133
+ end
134
+
135
+ invalid_properties
136
+ end
137
+
138
+ # Check to see if the all the properties in the model are valid
139
+ # @return true if the model is valid
140
+ def valid?
141
+ warn '[DEPRECATED] the `valid?` method is obsolete'
142
+ return false if !@name.nil? && @name.to_s.length > 100
143
+ return false if !@name.nil? && @name.to_s.length < 1
144
+ true
145
+ end
146
+
147
+ # Custom attribute writer method with validation
148
+ # @param [Object] name Value to be assigned
149
+ def name=(name)
150
+ if name.nil?
151
+ fail ArgumentError, 'name cannot be nil'
152
+ end
153
+
154
+ if name.to_s.length > 100
155
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 100.'
156
+ end
157
+
158
+ if name.to_s.length < 1
159
+ fail ArgumentError, 'invalid value for "name", the character length must be greater than or equal to 1.'
160
+ end
161
+
162
+ @name = name
163
+ end
164
+
165
+ # Checks equality by comparing each attribute.
166
+ # @param [Object] Object to be compared
167
+ def ==(o)
168
+ return true if self.equal?(o)
169
+ self.class == o.class &&
170
+ brand_id == o.brand_id &&
171
+ name == o.name &&
172
+ enabled == o.enabled &&
173
+ credentials == o.credentials &&
174
+ settings == o.settings &&
175
+ shipping_rule_ids == o.shipping_rule_ids
176
+ end
177
+
178
+ # @see the `==` method
179
+ # @param [Object] Object to be compared
180
+ def eql?(o)
181
+ self == o
182
+ end
183
+
184
+ # Calculates hash code according to all attributes.
185
+ # @return [Integer] Hash code
186
+ def hash
187
+ [brand_id, name, enabled, credentials, settings, shipping_rule_ids].hash
188
+ end
189
+
190
+ # Builds the object from hash
191
+ # @param [Hash] attributes Model attributes in the form of hash
192
+ # @return [Object] Returns the model itself
193
+ def self.build_from_hash(attributes)
194
+ return nil unless attributes.is_a?(Hash)
195
+ attributes = attributes.transform_keys(&:to_sym)
196
+ transformed_hash = {}
197
+ openapi_types.each_pair do |key, type|
198
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
199
+ transformed_hash["#{key}"] = nil
200
+ elsif type =~ /\AArray<(.*)>/i
201
+ # check to ensure the input is an array given that the attribute
202
+ # is documented as an array but the input is not
203
+ if attributes[attribute_map[key]].is_a?(Array)
204
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
205
+ end
206
+ elsif !attributes[attribute_map[key]].nil?
207
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
208
+ end
209
+ end
210
+ new(transformed_hash)
211
+ end
212
+
213
+ # Returns the object in the form of hash
214
+ # @return [Hash] Returns the object in the form of hash
215
+ def to_hash
216
+ hash = {}
217
+ self.class.attribute_map.each_pair do |attr, param|
218
+ value = self.send(attr)
219
+ if value.nil?
220
+ is_nullable = self.class.openapi_nullable.include?(attr)
221
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
222
+ end
223
+
224
+ hash[param] = _to_hash(value)
225
+ end
226
+ hash
227
+ end
228
+
229
+ end
230
+
231
+ end
@@ -0,0 +1,360 @@
1
+ =begin
2
+ #Zippendo Public API
3
+
4
+ #Public API documentation for Zippendo. Authenticate using your API token (Bearer token prefixed with zipp_). **Brands (sub-accounts).** An organization can be split into brands, each keeping its own orders, shipments and configuration separate. There are two ways to scope requests to one brand, and NEITHER changes any request body: 1. **Bind the token.** Create an API token with a `brandId` and every request it makes is confined to that brand — reads filtered, writes stamped. This is the recommended way to give a single brand's team its own credential. 2. **Send the `X-Zippendo-Brand` header.** An organization-wide token can scope an individual request by sending the brand's id or slug in this header. Most SDKs let you set it once on the client so every call inherits it. A brand-bound token that receives an `X-Zippendo-Brand` header naming a different brand is rejected with `403 BRAND_ACCESS_DENIED` — the binding is never widened. Omit both and requests cover the whole organization, which is the behaviour of every existing token. Records that belong to no brand carry `brandId: null`. Configuration (carriers, shipping rules, addresses) with a null brand is organization-wide and remains visible inside every brand; orders and shipments with a null brand are only visible organization-wide. List endpoints additionally take a `?brandScope=own|shared|both` parameter to narrow further within whichever brand context already applies. `own` returns only rows assigned to that brand, and requires a brand context — a brand-bound token, a resolved brand session, or the `X-Zippendo-Brand` header above — otherwise `400`. `shared` returns only the organization-wide rows (equivalent to filtering `brandId=none`). The default, `both`, keeps the existing behaviour: a brand context sees its own rows plus the organization-wide ones. Set `X-Zippendo-Brand-Scope` as a client default to apply the same choice to every request instead of repeating the query parameter on each call — an explicit `brandScope` query parameter always wins over the header, and a blank header value is ignored. Brands themselves are managed under the **Brands** tag. Retiring a brand is done with `POST /orgs/{orgId}/brands/{brandId}/archive` — permanent deletion is a dashboard-only action, since it is refused while any order, shipment, member or token still references the brand. Brands require a plan that includes them; creating one beyond your plan's limit returns `403`.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: support@zippendo.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.24.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Zippendo
17
+ # Partial channel settings to merge into existing settings. Server-managed fields (webhook secret/ids, checkout token) cannot be set here.
18
+ class UpdateOrderChannelRequestSettings < ApiModelBase
19
+ # Use webhooks for real-time order sync.
20
+ attr_accessor :use_webhooks
21
+
22
+ # WooCommerce store URL.
23
+ attr_accessor :site_url
24
+
25
+ # Push tracking back to the platform when a shipment is dispatched. Enabled by default (opt-out) — set to false to disable write-back; an unset value still syncs.
26
+ attr_accessor :auto_fulfill
27
+
28
+ # Periodically poll the channel for new orders.
29
+ attr_accessor :auto_sync
30
+
31
+ # Polling interval in minutes (5-1440).
32
+ attr_accessor :sync_interval_minutes
33
+
34
+ # Create a shipment automatically when an order arrives.
35
+ attr_accessor :auto_ship_on_create
36
+
37
+ # Default carrier ID for auto-shipping.
38
+ attr_accessor :default_carrier_id
39
+
40
+ # Default carrier product ID for auto-shipping.
41
+ attr_accessor :default_product_id
42
+
43
+ # Default sender address ID for auto-shipping.
44
+ attr_accessor :default_address_id
45
+
46
+ # Map imported shipping-method titles to shipping rules, for channels without checkout rate integration.
47
+ attr_accessor :shipping_method_mappings
48
+
49
+ # Only import orders that are not yet fulfilled.
50
+ attr_accessor :sync_only_unfulfilled
51
+
52
+ # Only sync orders placed at or after this timestamp.
53
+ attr_accessor :sync_orders_since
54
+
55
+ # Number of service points to show at checkout (1-20).
56
+ attr_accessor :service_point_count
57
+
58
+ # Attribute mapping from ruby-style variable name to JSON key.
59
+ def self.attribute_map
60
+ {
61
+ :'use_webhooks' => :'useWebhooks',
62
+ :'site_url' => :'siteUrl',
63
+ :'auto_fulfill' => :'autoFulfill',
64
+ :'auto_sync' => :'autoSync',
65
+ :'sync_interval_minutes' => :'syncIntervalMinutes',
66
+ :'auto_ship_on_create' => :'autoShipOnCreate',
67
+ :'default_carrier_id' => :'defaultCarrierId',
68
+ :'default_product_id' => :'defaultProductId',
69
+ :'default_address_id' => :'defaultAddressId',
70
+ :'shipping_method_mappings' => :'shippingMethodMappings',
71
+ :'sync_only_unfulfilled' => :'syncOnlyUnfulfilled',
72
+ :'sync_orders_since' => :'syncOrdersSince',
73
+ :'service_point_count' => :'servicePointCount'
74
+ }
75
+ end
76
+
77
+ # Returns attribute mapping this model knows about
78
+ def self.acceptable_attribute_map
79
+ attribute_map
80
+ end
81
+
82
+ # Returns all the JSON keys this model knows about
83
+ def self.acceptable_attributes
84
+ acceptable_attribute_map.values
85
+ end
86
+
87
+ # Attribute type mapping.
88
+ def self.openapi_types
89
+ {
90
+ :'use_webhooks' => :'Boolean',
91
+ :'site_url' => :'String',
92
+ :'auto_fulfill' => :'Boolean',
93
+ :'auto_sync' => :'Boolean',
94
+ :'sync_interval_minutes' => :'Integer',
95
+ :'auto_ship_on_create' => :'Boolean',
96
+ :'default_carrier_id' => :'String',
97
+ :'default_product_id' => :'String',
98
+ :'default_address_id' => :'String',
99
+ :'shipping_method_mappings' => :'Array<CreateOrderChannelRequestSettingsShippingMethodMappingsInner>',
100
+ :'sync_only_unfulfilled' => :'Boolean',
101
+ :'sync_orders_since' => :'Time',
102
+ :'service_point_count' => :'Integer'
103
+ }
104
+ end
105
+
106
+ # List of attributes with nullable: true
107
+ def self.openapi_nullable
108
+ Set.new([
109
+ :'default_carrier_id',
110
+ :'default_product_id',
111
+ :'default_address_id',
112
+ :'sync_orders_since',
113
+ ])
114
+ end
115
+
116
+ # Initializes the object
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ def initialize(attributes = {})
119
+ if (!attributes.is_a?(Hash))
120
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zippendo::UpdateOrderChannelRequestSettings` initialize method"
121
+ end
122
+
123
+ # check to see if the attribute exists and convert string to symbol for hash key
124
+ acceptable_attribute_map = self.class.acceptable_attribute_map
125
+ attributes = attributes.each_with_object({}) { |(k, v), h|
126
+ if (!acceptable_attribute_map.key?(k.to_sym))
127
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zippendo::UpdateOrderChannelRequestSettings`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
128
+ end
129
+ h[k.to_sym] = v
130
+ }
131
+
132
+ if attributes.key?(:'use_webhooks')
133
+ self.use_webhooks = attributes[:'use_webhooks']
134
+ else
135
+ self.use_webhooks = true
136
+ end
137
+
138
+ if attributes.key?(:'site_url')
139
+ self.site_url = attributes[:'site_url']
140
+ end
141
+
142
+ if attributes.key?(:'auto_fulfill')
143
+ self.auto_fulfill = attributes[:'auto_fulfill']
144
+ end
145
+
146
+ if attributes.key?(:'auto_sync')
147
+ self.auto_sync = attributes[:'auto_sync']
148
+ else
149
+ self.auto_sync = false
150
+ end
151
+
152
+ if attributes.key?(:'sync_interval_minutes')
153
+ self.sync_interval_minutes = attributes[:'sync_interval_minutes']
154
+ else
155
+ self.sync_interval_minutes = 15
156
+ end
157
+
158
+ if attributes.key?(:'auto_ship_on_create')
159
+ self.auto_ship_on_create = attributes[:'auto_ship_on_create']
160
+ else
161
+ self.auto_ship_on_create = false
162
+ end
163
+
164
+ if attributes.key?(:'default_carrier_id')
165
+ self.default_carrier_id = attributes[:'default_carrier_id']
166
+ end
167
+
168
+ if attributes.key?(:'default_product_id')
169
+ self.default_product_id = attributes[:'default_product_id']
170
+ end
171
+
172
+ if attributes.key?(:'default_address_id')
173
+ self.default_address_id = attributes[:'default_address_id']
174
+ end
175
+
176
+ if attributes.key?(:'shipping_method_mappings')
177
+ if (value = attributes[:'shipping_method_mappings']).is_a?(Array)
178
+ self.shipping_method_mappings = value
179
+ end
180
+ end
181
+
182
+ if attributes.key?(:'sync_only_unfulfilled')
183
+ self.sync_only_unfulfilled = attributes[:'sync_only_unfulfilled']
184
+ else
185
+ self.sync_only_unfulfilled = true
186
+ end
187
+
188
+ if attributes.key?(:'sync_orders_since')
189
+ self.sync_orders_since = attributes[:'sync_orders_since']
190
+ end
191
+
192
+ if attributes.key?(:'service_point_count')
193
+ self.service_point_count = attributes[:'service_point_count']
194
+ else
195
+ self.service_point_count = 6
196
+ end
197
+ end
198
+
199
+ # Show invalid properties with the reasons. Usually used together with valid?
200
+ # @return Array for valid properties with the reasons
201
+ def list_invalid_properties
202
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
203
+ invalid_properties = Array.new
204
+ if !@sync_interval_minutes.nil? && @sync_interval_minutes > 1440
205
+ invalid_properties.push('invalid value for "sync_interval_minutes", must be smaller than or equal to 1440.')
206
+ end
207
+
208
+ if !@sync_interval_minutes.nil? && @sync_interval_minutes < 5
209
+ invalid_properties.push('invalid value for "sync_interval_minutes", must be greater than or equal to 5.')
210
+ end
211
+
212
+ pattern = Regexp.new(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/)
213
+ if !@sync_orders_since.nil? && @sync_orders_since !~ pattern
214
+ invalid_properties.push("invalid value for \"sync_orders_since\", must conform to the pattern #{pattern}.")
215
+ end
216
+
217
+ if !@service_point_count.nil? && @service_point_count > 20
218
+ invalid_properties.push('invalid value for "service_point_count", must be smaller than or equal to 20.')
219
+ end
220
+
221
+ if !@service_point_count.nil? && @service_point_count < 1
222
+ invalid_properties.push('invalid value for "service_point_count", must be greater than or equal to 1.')
223
+ end
224
+
225
+ invalid_properties
226
+ end
227
+
228
+ # Check to see if the all the properties in the model are valid
229
+ # @return true if the model is valid
230
+ def valid?
231
+ warn '[DEPRECATED] the `valid?` method is obsolete'
232
+ return false if !@sync_interval_minutes.nil? && @sync_interval_minutes > 1440
233
+ return false if !@sync_interval_minutes.nil? && @sync_interval_minutes < 5
234
+ return false if !@sync_orders_since.nil? && @sync_orders_since !~ Regexp.new(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/)
235
+ return false if !@service_point_count.nil? && @service_point_count > 20
236
+ return false if !@service_point_count.nil? && @service_point_count < 1
237
+ true
238
+ end
239
+
240
+ # Custom attribute writer method with validation
241
+ # @param [Object] sync_interval_minutes Value to be assigned
242
+ def sync_interval_minutes=(sync_interval_minutes)
243
+ if sync_interval_minutes.nil?
244
+ fail ArgumentError, 'sync_interval_minutes cannot be nil'
245
+ end
246
+
247
+ if sync_interval_minutes > 1440
248
+ fail ArgumentError, 'invalid value for "sync_interval_minutes", must be smaller than or equal to 1440.'
249
+ end
250
+
251
+ if sync_interval_minutes < 5
252
+ fail ArgumentError, 'invalid value for "sync_interval_minutes", must be greater than or equal to 5.'
253
+ end
254
+
255
+ @sync_interval_minutes = sync_interval_minutes
256
+ end
257
+
258
+ # Custom attribute writer method with validation
259
+ # @param [Object] sync_orders_since Value to be assigned
260
+ def sync_orders_since=(sync_orders_since)
261
+ pattern = Regexp.new(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/)
262
+ if !sync_orders_since.nil? && sync_orders_since !~ pattern
263
+ fail ArgumentError, "invalid value for \"sync_orders_since\", must conform to the pattern #{pattern}."
264
+ end
265
+
266
+ @sync_orders_since = sync_orders_since
267
+ end
268
+
269
+ # Custom attribute writer method with validation
270
+ # @param [Object] service_point_count Value to be assigned
271
+ def service_point_count=(service_point_count)
272
+ if service_point_count.nil?
273
+ fail ArgumentError, 'service_point_count cannot be nil'
274
+ end
275
+
276
+ if service_point_count > 20
277
+ fail ArgumentError, 'invalid value for "service_point_count", must be smaller than or equal to 20.'
278
+ end
279
+
280
+ if service_point_count < 1
281
+ fail ArgumentError, 'invalid value for "service_point_count", must be greater than or equal to 1.'
282
+ end
283
+
284
+ @service_point_count = service_point_count
285
+ end
286
+
287
+ # Checks equality by comparing each attribute.
288
+ # @param [Object] Object to be compared
289
+ def ==(o)
290
+ return true if self.equal?(o)
291
+ self.class == o.class &&
292
+ use_webhooks == o.use_webhooks &&
293
+ site_url == o.site_url &&
294
+ auto_fulfill == o.auto_fulfill &&
295
+ auto_sync == o.auto_sync &&
296
+ sync_interval_minutes == o.sync_interval_minutes &&
297
+ auto_ship_on_create == o.auto_ship_on_create &&
298
+ default_carrier_id == o.default_carrier_id &&
299
+ default_product_id == o.default_product_id &&
300
+ default_address_id == o.default_address_id &&
301
+ shipping_method_mappings == o.shipping_method_mappings &&
302
+ sync_only_unfulfilled == o.sync_only_unfulfilled &&
303
+ sync_orders_since == o.sync_orders_since &&
304
+ service_point_count == o.service_point_count
305
+ end
306
+
307
+ # @see the `==` method
308
+ # @param [Object] Object to be compared
309
+ def eql?(o)
310
+ self == o
311
+ end
312
+
313
+ # Calculates hash code according to all attributes.
314
+ # @return [Integer] Hash code
315
+ def hash
316
+ [use_webhooks, site_url, auto_fulfill, auto_sync, sync_interval_minutes, auto_ship_on_create, default_carrier_id, default_product_id, default_address_id, shipping_method_mappings, sync_only_unfulfilled, sync_orders_since, service_point_count].hash
317
+ end
318
+
319
+ # Builds the object from hash
320
+ # @param [Hash] attributes Model attributes in the form of hash
321
+ # @return [Object] Returns the model itself
322
+ def self.build_from_hash(attributes)
323
+ return nil unless attributes.is_a?(Hash)
324
+ attributes = attributes.transform_keys(&:to_sym)
325
+ transformed_hash = {}
326
+ openapi_types.each_pair do |key, type|
327
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
328
+ transformed_hash["#{key}"] = nil
329
+ elsif type =~ /\AArray<(.*)>/i
330
+ # check to ensure the input is an array given that the attribute
331
+ # is documented as an array but the input is not
332
+ if attributes[attribute_map[key]].is_a?(Array)
333
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
334
+ end
335
+ elsif !attributes[attribute_map[key]].nil?
336
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
337
+ end
338
+ end
339
+ new(transformed_hash)
340
+ end
341
+
342
+ # Returns the object in the form of hash
343
+ # @return [Hash] Returns the object in the form of hash
344
+ def to_hash
345
+ hash = {}
346
+ self.class.attribute_map.each_pair do |attr, param|
347
+ value = self.send(attr)
348
+ if value.nil?
349
+ is_nullable = self.class.openapi_nullable.include?(attr)
350
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
351
+ end
352
+
353
+ hash[param] = _to_hash(value)
354
+ end
355
+ hash
356
+ end
357
+
358
+ end
359
+
360
+ end
@@ -11,5 +11,5 @@ Generator version: 7.24.0
11
11
  =end
12
12
 
13
13
  module Zippendo
14
- VERSION = '1.2.4'
14
+ VERSION = '1.2.5'
15
15
  end
data/lib/zippendo.rb CHANGED
@@ -34,6 +34,10 @@ require 'zippendo/models/create_api_token_request'
34
34
  require 'zippendo/models/create_order201_response'
35
35
  require 'zippendo/models/create_order201_response_order_lines_inner'
36
36
  require 'zippendo/models/create_order201_response_shipping_address'
37
+ require 'zippendo/models/create_order_channel_request'
38
+ require 'zippendo/models/create_order_channel_request_settings'
39
+ require 'zippendo/models/create_order_channel_request_settings_shipping_method_mappings_inner'
40
+ require 'zippendo/models/create_order_channel_webhook_secret201_response'
37
41
  require 'zippendo/models/create_order_request'
38
42
  require 'zippendo/models/create_order_request_order_lines_inner'
39
43
  require 'zippendo/models/create_order_request_shipping_address'
@@ -91,6 +95,8 @@ require 'zippendo/models/get_billing_usage200_response_zippy_messages'
91
95
  require 'zippendo/models/get_order200_response'
92
96
  require 'zippendo/models/get_order200_response_shipments_inner'
93
97
  require 'zippendo/models/get_order200_response_shipping_rule'
98
+ require 'zippendo/models/get_order_channel_webhook_status200_response'
99
+ require 'zippendo/models/get_order_channel_webhook_status200_response_webhooks_inner'
94
100
  require 'zippendo/models/get_org200_response'
95
101
  require 'zippendo/models/get_org200_response_count'
96
102
  require 'zippendo/models/get_org_branding200_response'
@@ -114,6 +120,10 @@ require 'zippendo/models/list_carrier_products200_response_inner_weight_limits'
114
120
  require 'zippendo/models/list_carriers200_response'
115
121
  require 'zippendo/models/list_carriers200_response_data_inner'
116
122
  require 'zippendo/models/list_carriers200_response_data_inner_config_value'
123
+ require 'zippendo/models/list_order_channels200_response'
124
+ require 'zippendo/models/list_order_channels200_response_data_inner'
125
+ require 'zippendo/models/list_order_channels200_response_data_inner_settings'
126
+ require 'zippendo/models/list_order_channels200_response_data_inner_settings_shipping_method_mappings_inner'
117
127
  require 'zippendo/models/list_orders200_response'
118
128
  require 'zippendo/models/list_orders200_response_data_inner'
119
129
  require 'zippendo/models/list_orders200_response_data_inner_order_channel'
@@ -142,6 +152,7 @@ require 'zippendo/models/list_shipping_rules200_response_data_inner_conditions_i
142
152
  require 'zippendo/models/list_shipping_rules200_response_data_inner_label_printer'
143
153
  require 'zippendo/models/list_shipping_rules200_response_data_inner_return_shipping_rule'
144
154
  require 'zippendo/models/revoke_api_token200_response'
155
+ require 'zippendo/models/revoke_order_channel_webhook_secret200_response'
145
156
  require 'zippendo/models/send_shipment422_response'
146
157
  require 'zippendo/models/send_shipment422_response_errors_inner'
147
158
  require 'zippendo/models/split_shipment201_response'
@@ -155,6 +166,8 @@ require 'zippendo/models/track_shipment200_response_events_inner'
155
166
  require 'zippendo/models/update_address_request'
156
167
  require 'zippendo/models/update_api_token_request'
157
168
  require 'zippendo/models/update_carrier_request'
169
+ require 'zippendo/models/update_order_channel_request'
170
+ require 'zippendo/models/update_order_channel_request_settings'
158
171
  require 'zippendo/models/update_order_request'
159
172
  require 'zippendo/models/update_org200_response'
160
173
  require 'zippendo/models/update_org_brand_request'
@@ -174,6 +187,7 @@ require 'zippendo/api/billing_api'
174
187
  require 'zippendo/api/brands_api'
175
188
  require 'zippendo/api/carrier_catalog_api'
176
189
  require 'zippendo/api/carriers_api'
190
+ require 'zippendo/api/order_channels_api'
177
191
  require 'zippendo/api/orders_api'
178
192
  require 'zippendo/api/orgs_api'
179
193
  require 'zippendo/api/quotes_api'