zippendo 1.2.3 → 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 (42) 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/ListAvailableCarriers200ResponseInner.md +5 -1
  10. data/docs/ListCarriers200ResponseDataInner.md +5 -1
  11. data/docs/ListOrderChannels200Response.md +26 -0
  12. data/docs/ListOrderChannels200ResponseDataInner.md +44 -0
  13. data/docs/ListOrderChannels200ResponseDataInnerSettings.md +50 -0
  14. data/docs/ListOrderChannels200ResponseDataInnerSettingsShippingMethodMappingsInner.md +22 -0
  15. data/docs/OrderChannelsApi.md +599 -0
  16. data/docs/RevokeOrderChannelWebhookSecret200Response.md +18 -0
  17. data/docs/UpdateOrderChannelRequest.md +28 -0
  18. data/docs/UpdateOrderChannelRequestSettings.md +42 -0
  19. data/lib/zippendo/api/order_channels_api.rb +629 -0
  20. data/lib/zippendo/models/batch_send_shipments200_response_results_inner.rb +2 -2
  21. data/lib/zippendo/models/create_order_channel_request.rb +266 -0
  22. data/lib/zippendo/models/create_order_channel_request_settings.rb +359 -0
  23. data/lib/zippendo/models/create_order_channel_request_settings_shipping_method_mappings_inner.rb +254 -0
  24. data/lib/zippendo/models/create_order_channel_webhook_secret201_response.rb +230 -0
  25. data/lib/zippendo/models/create_order_request.rb +23 -1
  26. data/lib/zippendo/models/get_order_channel_webhook_status200_response.rb +221 -0
  27. data/lib/zippendo/models/get_order_channel_webhook_status200_response_webhooks_inner.rb +266 -0
  28. data/lib/zippendo/models/list_api_tokens401_response.rb +2 -2
  29. data/lib/zippendo/models/list_available_carriers200_response_inner.rb +24 -4
  30. data/lib/zippendo/models/list_carriers200_response_data_inner.rb +24 -4
  31. data/lib/zippendo/models/list_order_channels200_response.rb +275 -0
  32. data/lib/zippendo/models/list_order_channels200_response_data_inner.rb +478 -0
  33. data/lib/zippendo/models/list_order_channels200_response_data_inner_settings.rb +509 -0
  34. data/lib/zippendo/models/list_order_channels200_response_data_inner_settings_shipping_method_mappings_inner.rb +254 -0
  35. data/lib/zippendo/models/list_orders200_response_data_inner_order_channel.rb +2 -2
  36. data/lib/zippendo/models/revoke_order_channel_webhook_secret200_response.rb +165 -0
  37. data/lib/zippendo/models/send_shipment422_response.rb +2 -2
  38. data/lib/zippendo/models/update_order_channel_request.rb +231 -0
  39. data/lib/zippendo/models/update_order_channel_request_settings.rb +360 -0
  40. data/lib/zippendo/version.rb +1 -1
  41. data/lib/zippendo.rb +14 -0
  42. metadata +29 -1
@@ -0,0 +1,275 @@
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 ListOrderChannels200Response < ApiModelBase
18
+ # Page of results
19
+ attr_accessor :data
20
+
21
+ # Total matching items across all pages
22
+ attr_accessor :total
23
+
24
+ # Current page number (1-based)
25
+ attr_accessor :page
26
+
27
+ # Items per page
28
+ attr_accessor :limit
29
+
30
+ # Total number of pages
31
+ attr_accessor :total_pages
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'data' => :'data',
37
+ :'total' => :'total',
38
+ :'page' => :'page',
39
+ :'limit' => :'limit',
40
+ :'total_pages' => :'totalPages'
41
+ }
42
+ end
43
+
44
+ # Returns attribute mapping this model knows about
45
+ def self.acceptable_attribute_map
46
+ attribute_map
47
+ end
48
+
49
+ # Returns all the JSON keys this model knows about
50
+ def self.acceptable_attributes
51
+ acceptable_attribute_map.values
52
+ end
53
+
54
+ # Attribute type mapping.
55
+ def self.openapi_types
56
+ {
57
+ :'data' => :'Array<ListOrderChannels200ResponseDataInner>',
58
+ :'total' => :'Float',
59
+ :'page' => :'Float',
60
+ :'limit' => :'Float',
61
+ :'total_pages' => :'Float'
62
+ }
63
+ end
64
+
65
+ # List of attributes with nullable: true
66
+ def self.openapi_nullable
67
+ Set.new([
68
+ ])
69
+ end
70
+
71
+ # Initializes the object
72
+ # @param [Hash] attributes Model attributes in the form of hash
73
+ def initialize(attributes = {})
74
+ if (!attributes.is_a?(Hash))
75
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zippendo::ListOrderChannels200Response` initialize method"
76
+ end
77
+
78
+ # check to see if the attribute exists and convert string to symbol for hash key
79
+ acceptable_attribute_map = self.class.acceptable_attribute_map
80
+ attributes = attributes.each_with_object({}) { |(k, v), h|
81
+ if (!acceptable_attribute_map.key?(k.to_sym))
82
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zippendo::ListOrderChannels200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
83
+ end
84
+ h[k.to_sym] = v
85
+ }
86
+
87
+ if attributes.key?(:'data')
88
+ if (value = attributes[:'data']).is_a?(Array)
89
+ self.data = value
90
+ end
91
+ else
92
+ self.data = nil
93
+ end
94
+
95
+ if attributes.key?(:'total')
96
+ self.total = attributes[:'total']
97
+ else
98
+ self.total = nil
99
+ end
100
+
101
+ if attributes.key?(:'page')
102
+ self.page = attributes[:'page']
103
+ else
104
+ self.page = nil
105
+ end
106
+
107
+ if attributes.key?(:'limit')
108
+ self.limit = attributes[:'limit']
109
+ else
110
+ self.limit = nil
111
+ end
112
+
113
+ if attributes.key?(:'total_pages')
114
+ self.total_pages = attributes[:'total_pages']
115
+ else
116
+ self.total_pages = nil
117
+ end
118
+ end
119
+
120
+ # Show invalid properties with the reasons. Usually used together with valid?
121
+ # @return Array for valid properties with the reasons
122
+ def list_invalid_properties
123
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
124
+ invalid_properties = Array.new
125
+ if @data.nil?
126
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
127
+ end
128
+
129
+ if @total.nil?
130
+ invalid_properties.push('invalid value for "total", total cannot be nil.')
131
+ end
132
+
133
+ if @page.nil?
134
+ invalid_properties.push('invalid value for "page", page cannot be nil.')
135
+ end
136
+
137
+ if @limit.nil?
138
+ invalid_properties.push('invalid value for "limit", limit cannot be nil.')
139
+ end
140
+
141
+ if @total_pages.nil?
142
+ invalid_properties.push('invalid value for "total_pages", total_pages cannot be nil.')
143
+ end
144
+
145
+ invalid_properties
146
+ end
147
+
148
+ # Check to see if the all the properties in the model are valid
149
+ # @return true if the model is valid
150
+ def valid?
151
+ warn '[DEPRECATED] the `valid?` method is obsolete'
152
+ return false if @data.nil?
153
+ return false if @total.nil?
154
+ return false if @page.nil?
155
+ return false if @limit.nil?
156
+ return false if @total_pages.nil?
157
+ true
158
+ end
159
+
160
+ # Custom attribute writer method with validation
161
+ # @param [Object] data Value to be assigned
162
+ def data=(data)
163
+ if data.nil?
164
+ fail ArgumentError, 'data cannot be nil'
165
+ end
166
+
167
+ @data = data
168
+ end
169
+
170
+ # Custom attribute writer method with validation
171
+ # @param [Object] total Value to be assigned
172
+ def total=(total)
173
+ if total.nil?
174
+ fail ArgumentError, 'total cannot be nil'
175
+ end
176
+
177
+ @total = total
178
+ end
179
+
180
+ # Custom attribute writer method with validation
181
+ # @param [Object] page Value to be assigned
182
+ def page=(page)
183
+ if page.nil?
184
+ fail ArgumentError, 'page cannot be nil'
185
+ end
186
+
187
+ @page = page
188
+ end
189
+
190
+ # Custom attribute writer method with validation
191
+ # @param [Object] limit Value to be assigned
192
+ def limit=(limit)
193
+ if limit.nil?
194
+ fail ArgumentError, 'limit cannot be nil'
195
+ end
196
+
197
+ @limit = limit
198
+ end
199
+
200
+ # Custom attribute writer method with validation
201
+ # @param [Object] total_pages Value to be assigned
202
+ def total_pages=(total_pages)
203
+ if total_pages.nil?
204
+ fail ArgumentError, 'total_pages cannot be nil'
205
+ end
206
+
207
+ @total_pages = total_pages
208
+ end
209
+
210
+ # Checks equality by comparing each attribute.
211
+ # @param [Object] Object to be compared
212
+ def ==(o)
213
+ return true if self.equal?(o)
214
+ self.class == o.class &&
215
+ data == o.data &&
216
+ total == o.total &&
217
+ page == o.page &&
218
+ limit == o.limit &&
219
+ total_pages == o.total_pages
220
+ end
221
+
222
+ # @see the `==` method
223
+ # @param [Object] Object to be compared
224
+ def eql?(o)
225
+ self == o
226
+ end
227
+
228
+ # Calculates hash code according to all attributes.
229
+ # @return [Integer] Hash code
230
+ def hash
231
+ [data, total, page, limit, total_pages].hash
232
+ end
233
+
234
+ # Builds the object from hash
235
+ # @param [Hash] attributes Model attributes in the form of hash
236
+ # @return [Object] Returns the model itself
237
+ def self.build_from_hash(attributes)
238
+ return nil unless attributes.is_a?(Hash)
239
+ attributes = attributes.transform_keys(&:to_sym)
240
+ transformed_hash = {}
241
+ openapi_types.each_pair do |key, type|
242
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
243
+ transformed_hash["#{key}"] = nil
244
+ elsif type =~ /\AArray<(.*)>/i
245
+ # check to ensure the input is an array given that the attribute
246
+ # is documented as an array but the input is not
247
+ if attributes[attribute_map[key]].is_a?(Array)
248
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
249
+ end
250
+ elsif !attributes[attribute_map[key]].nil?
251
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
252
+ end
253
+ end
254
+ new(transformed_hash)
255
+ end
256
+
257
+ # Returns the object in the form of hash
258
+ # @return [Hash] Returns the object in the form of hash
259
+ def to_hash
260
+ hash = {}
261
+ self.class.attribute_map.each_pair do |attr, param|
262
+ value = self.send(attr)
263
+ if value.nil?
264
+ is_nullable = self.class.openapi_nullable.include?(attr)
265
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
266
+ end
267
+
268
+ hash[param] = _to_hash(value)
269
+ end
270
+ hash
271
+ end
272
+
273
+ end
274
+
275
+ end