ultracart_api 4.0.225 → 4.0.226

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3f648152f0c9f7594b722e3fa59baff17ea85ad19e7cd62d5418163e8941dd1c
4
- data.tar.gz: 8b0198d93e3fbb463f2e0c4927cdc75c1a8a475da05622f774aedb066e25ad82
3
+ metadata.gz: a04688dd66fd6c770680e8aea005e0f0bd6fe584c632a72aea4e9aea51b6ff04
4
+ data.tar.gz: 67d6838c5141f29a579323cbfb6fd26097cef6a70f29733b9e9a2f4a9b4962eb
5
5
  SHA512:
6
- metadata.gz: fc82dcdf2c098e1191709aa24ad86ce2a6e452c0f558a8b6c7320a3707466c1dbf51de76f0a000959bdb7c37f34d5520f7265177ced61777f4130089f2894ad6
7
- data.tar.gz: 27a5b9ca9a920080cc1c1630d2c04457a362b5e7b1e565ff069fc8b96302566d1278767eb7a7d52a5260f47f188cd027e9ed53748ff9b373971ae6292d10597d
6
+ metadata.gz: f90479911baeee644673103d6b0b1ff2085d2ed4b012083be51f2512ae1abf13901a11eee4f667235eada4cf542331b1c3a88b90fd70f5cc31f6ed3ad0652aee
7
+ data.tar.gz: f1e74794241f8817f4c2175343b499223373f353fb79938fcc4e3ce835946595f340877f5a9a799bd153e9e891fc091482c5a4d8b89924c7f49c0a9de6c4e721
data/README.md CHANGED
@@ -7,7 +7,7 @@ UltraCart REST API Version 2
7
7
  This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
8
8
 
9
9
  - API version: 2.0.0
10
- - Package version: 4.0.225
10
+ - Package version: 4.0.226
11
11
  - Build package: org.openapitools.codegen.languages.RubyClientCodegen
12
12
  For more information, please visit [http://www.ultracart.com](http://www.ultracart.com)
13
13
 
@@ -24,16 +24,16 @@ gem build ultracart_api.gemspec
24
24
  Then either install the gem locally:
25
25
 
26
26
  ```shell
27
- gem install ./ultracart_api-4.0.225.gem
27
+ gem install ./ultracart_api-4.0.226.gem
28
28
  ```
29
29
 
30
- (for development, run `gem install --dev ./ultracart_api-4.0.225.gem` to install the development dependencies)
30
+ (for development, run `gem install --dev ./ultracart_api-4.0.226.gem` to install the development dependencies)
31
31
 
32
32
  or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
33
33
 
34
34
  Finally add this to the Gemfile:
35
35
 
36
- gem 'ultracart_api', '~> 4.0.225'
36
+ gem 'ultracart_api', '~> 4.0.226'
37
37
 
38
38
  ### Install from Git
39
39
 
@@ -311,6 +311,7 @@ Class | Method | HTTP request | Description
311
311
  *UltracartClient::ItemApi* | [**insert_item**](docs/ItemApi.md#insert_item) | **POST** /item/items | Create an item
312
312
  *UltracartClient::ItemApi* | [**insert_review**](docs/ItemApi.md#insert_review) | **POST** /item/items/{merchant_item_oid}/reviews | Insert a review
313
313
  *UltracartClient::ItemApi* | [**insert_update_item_content_attribute**](docs/ItemApi.md#insert_update_item_content_attribute) | **POST** /item/items/{merchant_item_oid}/content/attributes | Upsert an item content attribute
314
+ *UltracartClient::ItemApi* | [**rest_item_inventory_snapshot_response**](docs/ItemApi.md#rest_item_inventory_snapshot_response) | **GET** /item/items/inventory_snapshot | Retrieve a list of item inventories
314
315
  *UltracartClient::ItemApi* | [**update_digital_item**](docs/ItemApi.md#update_digital_item) | **PUT** /item/digital_library/{digital_item_oid} | Updates a file within the digital library
315
316
  *UltracartClient::ItemApi* | [**update_item**](docs/ItemApi.md#update_item) | **PUT** /item/items/{merchant_item_oid} | Update an item
316
317
  *UltracartClient::ItemApi* | [**update_items**](docs/ItemApi.md#update_items) | **PUT** /item/items/batch | Update multiple items
@@ -1125,6 +1126,9 @@ Class | Method | HTTP request | Description
1125
1126
  - [UltracartClient::ItemInstantPaymentNotification](docs/ItemInstantPaymentNotification.md)
1126
1127
  - [UltracartClient::ItemInstantPaymentNotifications](docs/ItemInstantPaymentNotifications.md)
1127
1128
  - [UltracartClient::ItemInternal](docs/ItemInternal.md)
1129
+ - [UltracartClient::ItemInventorySnapshot](docs/ItemInventorySnapshot.md)
1130
+ - [UltracartClient::ItemInventorySnapshotDistributionCenter](docs/ItemInventorySnapshotDistributionCenter.md)
1131
+ - [UltracartClient::ItemInventorySnapshotResponse](docs/ItemInventorySnapshotResponse.md)
1128
1132
  - [UltracartClient::ItemKitComponent](docs/ItemKitComponent.md)
1129
1133
  - [UltracartClient::ItemKitDefinition](docs/ItemKitDefinition.md)
1130
1134
  - [UltracartClient::ItemOption](docs/ItemOption.md)
@@ -1513,6 +1517,7 @@ Not every change is committed to every SDK.
1513
1517
 
1514
1518
  | Version | Date | Comments |
1515
1519
  | --: | :-: | --- |
1520
+ | 4.0.226 | 05/31/2024 | ItemApi.getInventorySnapshot method |
1516
1521
  | 4.0.225 | 05/30/2024 | add adult sig req. to the merchant item destination markup for items |
1517
1522
  | 4.0.224 | 05/29/2024 | added methods getEmailCommseqRateLimiters, resetEmailCommseqRateLimiters |
1518
1523
  | 4.0.223 | 05/28/2024 | added property to OrderQuery object to allow querying from cache |
data/docs/ItemApi.md CHANGED
@@ -21,6 +21,7 @@ All URIs are relative to *https://secure.ultracart.com/rest/v2*
21
21
  | [**insert_item**](ItemApi.md#insert_item) | **POST** /item/items | Create an item |
22
22
  | [**insert_review**](ItemApi.md#insert_review) | **POST** /item/items/{merchant_item_oid}/reviews | Insert a review |
23
23
  | [**insert_update_item_content_attribute**](ItemApi.md#insert_update_item_content_attribute) | **POST** /item/items/{merchant_item_oid}/content/attributes | Upsert an item content attribute |
24
+ | [**rest_item_inventory_snapshot_response**](ItemApi.md#rest_item_inventory_snapshot_response) | **GET** /item/items/inventory_snapshot | Retrieve a list of item inventories |
24
25
  | [**update_digital_item**](ItemApi.md#update_digital_item) | **PUT** /item/digital_library/{digital_item_oid} | Updates a file within the digital library |
25
26
  | [**update_item**](ItemApi.md#update_item) | **PUT** /item/items/{merchant_item_oid} | Update an item |
26
27
  | [**update_items**](ItemApi.md#update_items) | **PUT** /item/items/batch | Update multiple items |
@@ -1299,6 +1300,74 @@ nil (empty response body)
1299
1300
  - **Accept**: application/json
1300
1301
 
1301
1302
 
1303
+ ## rest_item_inventory_snapshot_response
1304
+
1305
+ > <ItemInventorySnapshotResponse> rest_item_inventory_snapshot_response
1306
+
1307
+ Retrieve a list of item inventories
1308
+
1309
+ Retrieves a list of item inventories.
1310
+
1311
+ ### Examples
1312
+
1313
+ ```ruby
1314
+ require 'time'
1315
+ require 'ultracart_api'
1316
+ require 'json'
1317
+ require 'yaml'
1318
+ require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
1319
+
1320
+ # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
1321
+ # As such, this might not be the best way to use this object.
1322
+ # Please see https://github.com/UltraCart/sdk_samples for working examples.
1323
+
1324
+ api = UltracartClient::ItemApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
1325
+
1326
+ begin
1327
+ # Retrieve a list of item inventories
1328
+ result = api_instance.rest_item_inventory_snapshot_response
1329
+ p result
1330
+ rescue UltracartClient::ApiError => e
1331
+ puts "Error when calling ItemApi->rest_item_inventory_snapshot_response: #{e}"
1332
+ end
1333
+ ```
1334
+
1335
+ #### Using the rest_item_inventory_snapshot_response_with_http_info variant
1336
+
1337
+ This returns an Array which contains the response data, status code and headers.
1338
+
1339
+ > <Array(<ItemInventorySnapshotResponse>, Integer, Hash)> rest_item_inventory_snapshot_response_with_http_info
1340
+
1341
+ ```ruby
1342
+ begin
1343
+ # Retrieve a list of item inventories
1344
+ data, status_code, headers = api_instance.rest_item_inventory_snapshot_response_with_http_info
1345
+ p status_code # => 2xx
1346
+ p headers # => { ... }
1347
+ p data # => <ItemInventorySnapshotResponse>
1348
+ rescue UltracartClient::ApiError => e
1349
+ puts "Error when calling ItemApi->rest_item_inventory_snapshot_response_with_http_info: #{e}"
1350
+ end
1351
+ ```
1352
+
1353
+ ### Parameters
1354
+
1355
+ This endpoint does not need any parameter.
1356
+
1357
+ ### Return type
1358
+
1359
+ [**ItemInventorySnapshotResponse**](ItemInventorySnapshotResponse.md)
1360
+
1361
+ ### Authorization
1362
+
1363
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1364
+
1365
+ ### HTTP request headers
1366
+
1367
+ - **Content-Type**: Not defined
1368
+ - **Accept**: application/json
1369
+
1370
+
1302
1371
  ## update_digital_item
1303
1372
 
1304
1373
  > <ItemDigitalItemResponse> update_digital_item(digital_item_oid, digital_item)
@@ -0,0 +1,28 @@
1
+ # UltracartClient::ItemInventorySnapshot
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **allocated_to_placed_orders** | **Integer** | | [optional] |
8
+ | **allocated_to_shopping_carts** | **Integer** | | [optional] |
9
+ | **available_to_allocate** | **Integer** | | [optional] |
10
+ | **distribution_centers** | [**Array&lt;ItemInventorySnapshotDistributionCenter&gt;**](ItemInventorySnapshotDistributionCenter.md) | | [optional] |
11
+ | **merchant_item_id** | **String** | | [optional] |
12
+ | **quantity** | **Integer** | | [optional] |
13
+
14
+ ## Example
15
+
16
+ ```ruby
17
+ require 'ultracart_api'
18
+
19
+ instance = UltracartClient::ItemInventorySnapshot.new(
20
+ allocated_to_placed_orders: null,
21
+ allocated_to_shopping_carts: null,
22
+ available_to_allocate: null,
23
+ distribution_centers: null,
24
+ merchant_item_id: null,
25
+ quantity: null
26
+ )
27
+ ```
28
+
@@ -0,0 +1,26 @@
1
+ # UltracartClient::ItemInventorySnapshotDistributionCenter
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **allocated_to_placed_orders** | **Integer** | | [optional] |
8
+ | **allocated_to_shopping_carts** | **Integer** | | [optional] |
9
+ | **available_to_allocate** | **Integer** | | [optional] |
10
+ | **code** | **String** | | [optional] |
11
+ | **quantity** | **Integer** | | [optional] |
12
+
13
+ ## Example
14
+
15
+ ```ruby
16
+ require 'ultracart_api'
17
+
18
+ instance = UltracartClient::ItemInventorySnapshotDistributionCenter.new(
19
+ allocated_to_placed_orders: null,
20
+ allocated_to_shopping_carts: null,
21
+ available_to_allocate: null,
22
+ code: null,
23
+ quantity: null
24
+ )
25
+ ```
26
+
@@ -0,0 +1,26 @@
1
+ # UltracartClient::ItemInventorySnapshotResponse
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **error** | [**Error**](Error.md) | | [optional] |
8
+ | **inventories** | [**Array&lt;ItemInventorySnapshot&gt;**](ItemInventorySnapshot.md) | inventories | [optional] |
9
+ | **metadata** | [**ResponseMetadata**](ResponseMetadata.md) | | [optional] |
10
+ | **success** | **Boolean** | Indicates if API call was successful | [optional] |
11
+ | **warning** | [**Warning**](Warning.md) | | [optional] |
12
+
13
+ ## Example
14
+
15
+ ```ruby
16
+ require 'ultracart_api'
17
+
18
+ instance = UltracartClient::ItemInventorySnapshotResponse.new(
19
+ error: null,
20
+ inventories: null,
21
+ metadata: null,
22
+ success: null,
23
+ warning: null
24
+ )
25
+ ```
26
+
@@ -1221,6 +1221,64 @@ module UltracartClient
1221
1221
  return data, status_code, headers
1222
1222
  end
1223
1223
 
1224
+ # Retrieve a list of item inventories
1225
+ # Retrieves a list of item inventories.
1226
+ # @param [Hash] opts the optional parameters
1227
+ # @return [ItemInventorySnapshotResponse]
1228
+ def rest_item_inventory_snapshot_response(opts = {})
1229
+ data, _status_code, _headers = rest_item_inventory_snapshot_response_with_http_info(opts)
1230
+ data
1231
+ end
1232
+
1233
+ # Retrieve a list of item inventories
1234
+ # Retrieves a list of item inventories.
1235
+ # @param [Hash] opts the optional parameters
1236
+ # @return [Array<(ItemInventorySnapshotResponse, Integer, Hash)>] ItemInventorySnapshotResponse data, response status code and response headers
1237
+ def rest_item_inventory_snapshot_response_with_http_info(opts = {})
1238
+ if @api_client.config.debugging
1239
+ @api_client.config.logger.debug 'Calling API: ItemApi.rest_item_inventory_snapshot_response ...'
1240
+ end
1241
+ # resource path
1242
+ local_var_path = '/item/items/inventory_snapshot'
1243
+
1244
+ # query parameters
1245
+ query_params = opts[:query_params] || {}
1246
+
1247
+ # header parameters
1248
+ header_params = opts[:header_params] || {}
1249
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
1250
+ # HTTP header 'Accept' (if needed)
1251
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1252
+
1253
+ # form parameters
1254
+ form_params = opts[:form_params] || {}
1255
+
1256
+ # http body (model)
1257
+ post_body = opts[:debug_body]
1258
+
1259
+ # return_type
1260
+ return_type = opts[:debug_return_type] || 'ItemInventorySnapshotResponse'
1261
+
1262
+ # auth_names
1263
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
1264
+
1265
+ new_options = opts.merge(
1266
+ :operation => :"ItemApi.rest_item_inventory_snapshot_response",
1267
+ :header_params => header_params,
1268
+ :query_params => query_params,
1269
+ :form_params => form_params,
1270
+ :body => post_body,
1271
+ :auth_names => auth_names,
1272
+ :return_type => return_type
1273
+ )
1274
+
1275
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1276
+ if @api_client.config.debugging
1277
+ @api_client.config.logger.debug "API called: ItemApi#rest_item_inventory_snapshot_response\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1278
+ end
1279
+ return data, status_code, headers
1280
+ end
1281
+
1224
1282
  # Updates a file within the digital library
1225
1283
  # Updates a file within the digital library. This does not update an item, but updates a digital file available and selectable as part (or all) of an item.
1226
1284
  # @param digital_item_oid [Integer] The digital item oid to update.
@@ -0,0 +1,266 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module UltracartClient
17
+ class ItemInventorySnapshot
18
+ attr_accessor :allocated_to_placed_orders
19
+
20
+ attr_accessor :allocated_to_shopping_carts
21
+
22
+ attr_accessor :available_to_allocate
23
+
24
+ attr_accessor :distribution_centers
25
+
26
+ attr_accessor :merchant_item_id
27
+
28
+ attr_accessor :quantity
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'allocated_to_placed_orders' => :'allocated_to_placed_orders',
34
+ :'allocated_to_shopping_carts' => :'allocated_to_shopping_carts',
35
+ :'available_to_allocate' => :'available_to_allocate',
36
+ :'distribution_centers' => :'distribution_centers',
37
+ :'merchant_item_id' => :'merchant_item_id',
38
+ :'quantity' => :'quantity'
39
+ }
40
+ end
41
+
42
+ # Returns all the JSON keys this model knows about
43
+ def self.acceptable_attributes
44
+ attribute_map.values
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'allocated_to_placed_orders' => :'Integer',
51
+ :'allocated_to_shopping_carts' => :'Integer',
52
+ :'available_to_allocate' => :'Integer',
53
+ :'distribution_centers' => :'Array<ItemInventorySnapshotDistributionCenter>',
54
+ :'merchant_item_id' => :'String',
55
+ :'quantity' => :'Integer'
56
+ }
57
+ end
58
+
59
+ # List of attributes with nullable: true
60
+ def self.openapi_nullable
61
+ Set.new([
62
+ ])
63
+ end
64
+
65
+ # Initializes the object
66
+ # @param [Hash] attributes Model attributes in the form of hash
67
+ def initialize(attributes = {})
68
+ if (!attributes.is_a?(Hash))
69
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ItemInventorySnapshot` initialize method"
70
+ end
71
+
72
+ # check to see if the attribute exists and convert string to symbol for hash key
73
+ attributes = attributes.each_with_object({}) { |(k, v), h|
74
+ if (!self.class.attribute_map.key?(k.to_sym))
75
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ItemInventorySnapshot`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
76
+ end
77
+ h[k.to_sym] = v
78
+ }
79
+
80
+ if attributes.key?(:'allocated_to_placed_orders')
81
+ self.allocated_to_placed_orders = attributes[:'allocated_to_placed_orders']
82
+ end
83
+
84
+ if attributes.key?(:'allocated_to_shopping_carts')
85
+ self.allocated_to_shopping_carts = attributes[:'allocated_to_shopping_carts']
86
+ end
87
+
88
+ if attributes.key?(:'available_to_allocate')
89
+ self.available_to_allocate = attributes[:'available_to_allocate']
90
+ end
91
+
92
+ if attributes.key?(:'distribution_centers')
93
+ if (value = attributes[:'distribution_centers']).is_a?(Array)
94
+ self.distribution_centers = value
95
+ end
96
+ end
97
+
98
+ if attributes.key?(:'merchant_item_id')
99
+ self.merchant_item_id = attributes[:'merchant_item_id']
100
+ end
101
+
102
+ if attributes.key?(:'quantity')
103
+ self.quantity = attributes[:'quantity']
104
+ end
105
+ end
106
+
107
+ # Show invalid properties with the reasons. Usually used together with valid?
108
+ # @return Array for valid properties with the reasons
109
+ def list_invalid_properties
110
+ invalid_properties = Array.new
111
+ invalid_properties
112
+ end
113
+
114
+ # Check to see if the all the properties in the model are valid
115
+ # @return true if the model is valid
116
+ def valid?
117
+ true
118
+ end
119
+
120
+ # Checks equality by comparing each attribute.
121
+ # @param [Object] Object to be compared
122
+ def ==(o)
123
+ return true if self.equal?(o)
124
+ self.class == o.class &&
125
+ allocated_to_placed_orders == o.allocated_to_placed_orders &&
126
+ allocated_to_shopping_carts == o.allocated_to_shopping_carts &&
127
+ available_to_allocate == o.available_to_allocate &&
128
+ distribution_centers == o.distribution_centers &&
129
+ merchant_item_id == o.merchant_item_id &&
130
+ quantity == o.quantity
131
+ end
132
+
133
+ # @see the `==` method
134
+ # @param [Object] Object to be compared
135
+ def eql?(o)
136
+ self == o
137
+ end
138
+
139
+ # Calculates hash code according to all attributes.
140
+ # @return [Integer] Hash code
141
+ def hash
142
+ [allocated_to_placed_orders, allocated_to_shopping_carts, available_to_allocate, distribution_centers, merchant_item_id, quantity].hash
143
+ end
144
+
145
+ # Builds the object from hash
146
+ # @param [Hash] attributes Model attributes in the form of hash
147
+ # @return [Object] Returns the model itself
148
+ def self.build_from_hash(attributes)
149
+ new.build_from_hash(attributes)
150
+ end
151
+
152
+ # Builds the object from hash
153
+ # @param [Hash] attributes Model attributes in the form of hash
154
+ # @return [Object] Returns the model itself
155
+ def build_from_hash(attributes)
156
+ return nil unless attributes.is_a?(Hash)
157
+ attributes = attributes.transform_keys(&:to_sym)
158
+ self.class.openapi_types.each_pair do |key, type|
159
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
160
+ self.send("#{key}=", nil)
161
+ elsif type =~ /\AArray<(.*)>/i
162
+ # check to ensure the input is an array given that the attribute
163
+ # is documented as an array but the input is not
164
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
165
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
166
+ end
167
+ elsif !attributes[self.class.attribute_map[key]].nil?
168
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
169
+ end
170
+ end
171
+
172
+ self
173
+ end
174
+
175
+ # Deserializes the data based on type
176
+ # @param string type Data type
177
+ # @param string value Value to be deserialized
178
+ # @return [Object] Deserialized data
179
+ def _deserialize(type, value)
180
+ case type.to_sym
181
+ when :Time
182
+ Time.parse(value)
183
+ when :Date
184
+ Date.parse(value)
185
+ when :String
186
+ value.to_s
187
+ when :Integer
188
+ value.to_i
189
+ when :Float
190
+ value.to_f
191
+ when :Boolean
192
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
193
+ true
194
+ else
195
+ false
196
+ end
197
+ when :Object
198
+ # generic object (usually a Hash), return directly
199
+ value
200
+ when /\AArray<(?<inner_type>.+)>\z/
201
+ inner_type = Regexp.last_match[:inner_type]
202
+ value.map { |v| _deserialize(inner_type, v) }
203
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
204
+ k_type = Regexp.last_match[:k_type]
205
+ v_type = Regexp.last_match[:v_type]
206
+ {}.tap do |hash|
207
+ value.each do |k, v|
208
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
209
+ end
210
+ end
211
+ else # model
212
+ # models (e.g. Pet) or oneOf
213
+ klass = UltracartClient.const_get(type)
214
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
215
+ end
216
+ end
217
+
218
+ # Returns the string representation of the object
219
+ # @return [String] String presentation of the object
220
+ def to_s
221
+ to_hash.to_s
222
+ end
223
+
224
+ # to_body is an alias to to_hash (backward compatibility)
225
+ # @return [Hash] Returns the object in the form of hash
226
+ def to_body
227
+ to_hash
228
+ end
229
+
230
+ # Returns the object in the form of hash
231
+ # @return [Hash] Returns the object in the form of hash
232
+ def to_hash
233
+ hash = {}
234
+ self.class.attribute_map.each_pair do |attr, param|
235
+ value = self.send(attr)
236
+ if value.nil?
237
+ is_nullable = self.class.openapi_nullable.include?(attr)
238
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
239
+ end
240
+
241
+ hash[param] = _to_hash(value)
242
+ end
243
+ hash
244
+ end
245
+
246
+ # Outputs non-array value in the form of hash
247
+ # For object, use to_hash. Otherwise, just return the value
248
+ # @param [Object] value Any valid value
249
+ # @return [Hash] Returns the value in the form of hash
250
+ def _to_hash(value)
251
+ if value.is_a?(Array)
252
+ value.compact.map { |v| _to_hash(v) }
253
+ elsif value.is_a?(Hash)
254
+ {}.tap do |hash|
255
+ value.each { |k, v| hash[k] = _to_hash(v) }
256
+ end
257
+ elsif value.respond_to? :to_hash
258
+ value.to_hash
259
+ else
260
+ value
261
+ end
262
+ end
263
+
264
+ end
265
+
266
+ end
@@ -0,0 +1,255 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module UltracartClient
17
+ class ItemInventorySnapshotDistributionCenter
18
+ attr_accessor :allocated_to_placed_orders
19
+
20
+ attr_accessor :allocated_to_shopping_carts
21
+
22
+ attr_accessor :available_to_allocate
23
+
24
+ attr_accessor :code
25
+
26
+ attr_accessor :quantity
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'allocated_to_placed_orders' => :'allocated_to_placed_orders',
32
+ :'allocated_to_shopping_carts' => :'allocated_to_shopping_carts',
33
+ :'available_to_allocate' => :'available_to_allocate',
34
+ :'code' => :'code',
35
+ :'quantity' => :'quantity'
36
+ }
37
+ end
38
+
39
+ # Returns all the JSON keys this model knows about
40
+ def self.acceptable_attributes
41
+ attribute_map.values
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.openapi_types
46
+ {
47
+ :'allocated_to_placed_orders' => :'Integer',
48
+ :'allocated_to_shopping_carts' => :'Integer',
49
+ :'available_to_allocate' => :'Integer',
50
+ :'code' => :'String',
51
+ :'quantity' => :'Integer'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ItemInventorySnapshotDistributionCenter` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ attributes = attributes.each_with_object({}) { |(k, v), h|
70
+ if (!self.class.attribute_map.key?(k.to_sym))
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ItemInventorySnapshotDistributionCenter`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
72
+ end
73
+ h[k.to_sym] = v
74
+ }
75
+
76
+ if attributes.key?(:'allocated_to_placed_orders')
77
+ self.allocated_to_placed_orders = attributes[:'allocated_to_placed_orders']
78
+ end
79
+
80
+ if attributes.key?(:'allocated_to_shopping_carts')
81
+ self.allocated_to_shopping_carts = attributes[:'allocated_to_shopping_carts']
82
+ end
83
+
84
+ if attributes.key?(:'available_to_allocate')
85
+ self.available_to_allocate = attributes[:'available_to_allocate']
86
+ end
87
+
88
+ if attributes.key?(:'code')
89
+ self.code = attributes[:'code']
90
+ end
91
+
92
+ if attributes.key?(:'quantity')
93
+ self.quantity = attributes[:'quantity']
94
+ end
95
+ end
96
+
97
+ # Show invalid properties with the reasons. Usually used together with valid?
98
+ # @return Array for valid properties with the reasons
99
+ def list_invalid_properties
100
+ invalid_properties = Array.new
101
+ invalid_properties
102
+ end
103
+
104
+ # Check to see if the all the properties in the model are valid
105
+ # @return true if the model is valid
106
+ def valid?
107
+ true
108
+ end
109
+
110
+ # Checks equality by comparing each attribute.
111
+ # @param [Object] Object to be compared
112
+ def ==(o)
113
+ return true if self.equal?(o)
114
+ self.class == o.class &&
115
+ allocated_to_placed_orders == o.allocated_to_placed_orders &&
116
+ allocated_to_shopping_carts == o.allocated_to_shopping_carts &&
117
+ available_to_allocate == o.available_to_allocate &&
118
+ code == o.code &&
119
+ quantity == o.quantity
120
+ end
121
+
122
+ # @see the `==` method
123
+ # @param [Object] Object to be compared
124
+ def eql?(o)
125
+ self == o
126
+ end
127
+
128
+ # Calculates hash code according to all attributes.
129
+ # @return [Integer] Hash code
130
+ def hash
131
+ [allocated_to_placed_orders, allocated_to_shopping_carts, available_to_allocate, code, quantity].hash
132
+ end
133
+
134
+ # Builds the object from hash
135
+ # @param [Hash] attributes Model attributes in the form of hash
136
+ # @return [Object] Returns the model itself
137
+ def self.build_from_hash(attributes)
138
+ new.build_from_hash(attributes)
139
+ end
140
+
141
+ # Builds the object from hash
142
+ # @param [Hash] attributes Model attributes in the form of hash
143
+ # @return [Object] Returns the model itself
144
+ def build_from_hash(attributes)
145
+ return nil unless attributes.is_a?(Hash)
146
+ attributes = attributes.transform_keys(&:to_sym)
147
+ self.class.openapi_types.each_pair do |key, type|
148
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
149
+ self.send("#{key}=", nil)
150
+ elsif type =~ /\AArray<(.*)>/i
151
+ # check to ensure the input is an array given that the attribute
152
+ # is documented as an array but the input is not
153
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
154
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
155
+ end
156
+ elsif !attributes[self.class.attribute_map[key]].nil?
157
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
158
+ end
159
+ end
160
+
161
+ self
162
+ end
163
+
164
+ # Deserializes the data based on type
165
+ # @param string type Data type
166
+ # @param string value Value to be deserialized
167
+ # @return [Object] Deserialized data
168
+ def _deserialize(type, value)
169
+ case type.to_sym
170
+ when :Time
171
+ Time.parse(value)
172
+ when :Date
173
+ Date.parse(value)
174
+ when :String
175
+ value.to_s
176
+ when :Integer
177
+ value.to_i
178
+ when :Float
179
+ value.to_f
180
+ when :Boolean
181
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
182
+ true
183
+ else
184
+ false
185
+ end
186
+ when :Object
187
+ # generic object (usually a Hash), return directly
188
+ value
189
+ when /\AArray<(?<inner_type>.+)>\z/
190
+ inner_type = Regexp.last_match[:inner_type]
191
+ value.map { |v| _deserialize(inner_type, v) }
192
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
193
+ k_type = Regexp.last_match[:k_type]
194
+ v_type = Regexp.last_match[:v_type]
195
+ {}.tap do |hash|
196
+ value.each do |k, v|
197
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
198
+ end
199
+ end
200
+ else # model
201
+ # models (e.g. Pet) or oneOf
202
+ klass = UltracartClient.const_get(type)
203
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
204
+ end
205
+ end
206
+
207
+ # Returns the string representation of the object
208
+ # @return [String] String presentation of the object
209
+ def to_s
210
+ to_hash.to_s
211
+ end
212
+
213
+ # to_body is an alias to to_hash (backward compatibility)
214
+ # @return [Hash] Returns the object in the form of hash
215
+ def to_body
216
+ to_hash
217
+ end
218
+
219
+ # Returns the object in the form of hash
220
+ # @return [Hash] Returns the object in the form of hash
221
+ def to_hash
222
+ hash = {}
223
+ self.class.attribute_map.each_pair do |attr, param|
224
+ value = self.send(attr)
225
+ if value.nil?
226
+ is_nullable = self.class.openapi_nullable.include?(attr)
227
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
228
+ end
229
+
230
+ hash[param] = _to_hash(value)
231
+ end
232
+ hash
233
+ end
234
+
235
+ # Outputs non-array value in the form of hash
236
+ # For object, use to_hash. Otherwise, just return the value
237
+ # @param [Object] value Any valid value
238
+ # @return [Hash] Returns the value in the form of hash
239
+ def _to_hash(value)
240
+ if value.is_a?(Array)
241
+ value.compact.map { |v| _to_hash(v) }
242
+ elsif value.is_a?(Hash)
243
+ {}.tap do |hash|
244
+ value.each { |k, v| hash[k] = _to_hash(v) }
245
+ end
246
+ elsif value.respond_to? :to_hash
247
+ value.to_hash
248
+ else
249
+ value
250
+ end
251
+ end
252
+
253
+ end
254
+
255
+ end
@@ -0,0 +1,259 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module UltracartClient
17
+ class ItemInventorySnapshotResponse
18
+ attr_accessor :error
19
+
20
+ # inventories
21
+ attr_accessor :inventories
22
+
23
+ attr_accessor :metadata
24
+
25
+ # Indicates if API call was successful
26
+ attr_accessor :success
27
+
28
+ attr_accessor :warning
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'error' => :'error',
34
+ :'inventories' => :'inventories',
35
+ :'metadata' => :'metadata',
36
+ :'success' => :'success',
37
+ :'warning' => :'warning'
38
+ }
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'error' => :'Error',
50
+ :'inventories' => :'Array<ItemInventorySnapshot>',
51
+ :'metadata' => :'ResponseMetadata',
52
+ :'success' => :'Boolean',
53
+ :'warning' => :'Warning'
54
+ }
55
+ end
56
+
57
+ # List of attributes with nullable: true
58
+ def self.openapi_nullable
59
+ Set.new([
60
+ ])
61
+ end
62
+
63
+ # Initializes the object
64
+ # @param [Hash] attributes Model attributes in the form of hash
65
+ def initialize(attributes = {})
66
+ if (!attributes.is_a?(Hash))
67
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ItemInventorySnapshotResponse` initialize method"
68
+ end
69
+
70
+ # check to see if the attribute exists and convert string to symbol for hash key
71
+ attributes = attributes.each_with_object({}) { |(k, v), h|
72
+ if (!self.class.attribute_map.key?(k.to_sym))
73
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ItemInventorySnapshotResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
74
+ end
75
+ h[k.to_sym] = v
76
+ }
77
+
78
+ if attributes.key?(:'error')
79
+ self.error = attributes[:'error']
80
+ end
81
+
82
+ if attributes.key?(:'inventories')
83
+ if (value = attributes[:'inventories']).is_a?(Array)
84
+ self.inventories = value
85
+ end
86
+ end
87
+
88
+ if attributes.key?(:'metadata')
89
+ self.metadata = attributes[:'metadata']
90
+ end
91
+
92
+ if attributes.key?(:'success')
93
+ self.success = attributes[:'success']
94
+ end
95
+
96
+ if attributes.key?(:'warning')
97
+ self.warning = attributes[:'warning']
98
+ end
99
+ end
100
+
101
+ # Show invalid properties with the reasons. Usually used together with valid?
102
+ # @return Array for valid properties with the reasons
103
+ def list_invalid_properties
104
+ invalid_properties = Array.new
105
+ invalid_properties
106
+ end
107
+
108
+ # Check to see if the all the properties in the model are valid
109
+ # @return true if the model is valid
110
+ def valid?
111
+ true
112
+ end
113
+
114
+ # Checks equality by comparing each attribute.
115
+ # @param [Object] Object to be compared
116
+ def ==(o)
117
+ return true if self.equal?(o)
118
+ self.class == o.class &&
119
+ error == o.error &&
120
+ inventories == o.inventories &&
121
+ metadata == o.metadata &&
122
+ success == o.success &&
123
+ warning == o.warning
124
+ end
125
+
126
+ # @see the `==` method
127
+ # @param [Object] Object to be compared
128
+ def eql?(o)
129
+ self == o
130
+ end
131
+
132
+ # Calculates hash code according to all attributes.
133
+ # @return [Integer] Hash code
134
+ def hash
135
+ [error, inventories, metadata, success, warning].hash
136
+ end
137
+
138
+ # Builds the object from hash
139
+ # @param [Hash] attributes Model attributes in the form of hash
140
+ # @return [Object] Returns the model itself
141
+ def self.build_from_hash(attributes)
142
+ new.build_from_hash(attributes)
143
+ end
144
+
145
+ # Builds the object from hash
146
+ # @param [Hash] attributes Model attributes in the form of hash
147
+ # @return [Object] Returns the model itself
148
+ def build_from_hash(attributes)
149
+ return nil unless attributes.is_a?(Hash)
150
+ attributes = attributes.transform_keys(&:to_sym)
151
+ self.class.openapi_types.each_pair do |key, type|
152
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
153
+ self.send("#{key}=", nil)
154
+ elsif type =~ /\AArray<(.*)>/i
155
+ # check to ensure the input is an array given that the attribute
156
+ # is documented as an array but the input is not
157
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
158
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
159
+ end
160
+ elsif !attributes[self.class.attribute_map[key]].nil?
161
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
162
+ end
163
+ end
164
+
165
+ self
166
+ end
167
+
168
+ # Deserializes the data based on type
169
+ # @param string type Data type
170
+ # @param string value Value to be deserialized
171
+ # @return [Object] Deserialized data
172
+ def _deserialize(type, value)
173
+ case type.to_sym
174
+ when :Time
175
+ Time.parse(value)
176
+ when :Date
177
+ Date.parse(value)
178
+ when :String
179
+ value.to_s
180
+ when :Integer
181
+ value.to_i
182
+ when :Float
183
+ value.to_f
184
+ when :Boolean
185
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
186
+ true
187
+ else
188
+ false
189
+ end
190
+ when :Object
191
+ # generic object (usually a Hash), return directly
192
+ value
193
+ when /\AArray<(?<inner_type>.+)>\z/
194
+ inner_type = Regexp.last_match[:inner_type]
195
+ value.map { |v| _deserialize(inner_type, v) }
196
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
197
+ k_type = Regexp.last_match[:k_type]
198
+ v_type = Regexp.last_match[:v_type]
199
+ {}.tap do |hash|
200
+ value.each do |k, v|
201
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
202
+ end
203
+ end
204
+ else # model
205
+ # models (e.g. Pet) or oneOf
206
+ klass = UltracartClient.const_get(type)
207
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
208
+ end
209
+ end
210
+
211
+ # Returns the string representation of the object
212
+ # @return [String] String presentation of the object
213
+ def to_s
214
+ to_hash.to_s
215
+ end
216
+
217
+ # to_body is an alias to to_hash (backward compatibility)
218
+ # @return [Hash] Returns the object in the form of hash
219
+ def to_body
220
+ to_hash
221
+ end
222
+
223
+ # Returns the object in the form of hash
224
+ # @return [Hash] Returns the object in the form of hash
225
+ def to_hash
226
+ hash = {}
227
+ self.class.attribute_map.each_pair do |attr, param|
228
+ value = self.send(attr)
229
+ if value.nil?
230
+ is_nullable = self.class.openapi_nullable.include?(attr)
231
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
232
+ end
233
+
234
+ hash[param] = _to_hash(value)
235
+ end
236
+ hash
237
+ end
238
+
239
+ # Outputs non-array value in the form of hash
240
+ # For object, use to_hash. Otherwise, just return the value
241
+ # @param [Object] value Any valid value
242
+ # @return [Hash] Returns the value in the form of hash
243
+ def _to_hash(value)
244
+ if value.is_a?(Array)
245
+ value.compact.map { |v| _to_hash(v) }
246
+ elsif value.is_a?(Hash)
247
+ {}.tap do |hash|
248
+ value.each { |k, v| hash[k] = _to_hash(v) }
249
+ end
250
+ elsif value.respond_to? :to_hash
251
+ value.to_hash
252
+ else
253
+ value
254
+ end
255
+ end
256
+
257
+ end
258
+
259
+ end
@@ -11,5 +11,5 @@ OpenAPI Generator version: 6.0.1-SNAPSHOT
11
11
  =end
12
12
 
13
13
  module UltracartClient
14
- VERSION = '4.0.225'
14
+ VERSION = '4.0.226'
15
15
  end
data/lib/ultracart_api.rb CHANGED
@@ -554,6 +554,9 @@ require 'ultracart_api/models/item_identifiers'
554
554
  require 'ultracart_api/models/item_instant_payment_notification'
555
555
  require 'ultracart_api/models/item_instant_payment_notifications'
556
556
  require 'ultracart_api/models/item_internal'
557
+ require 'ultracart_api/models/item_inventory_snapshot'
558
+ require 'ultracart_api/models/item_inventory_snapshot_distribution_center'
559
+ require 'ultracart_api/models/item_inventory_snapshot_response'
557
560
  require 'ultracart_api/models/item_kit_component'
558
561
  require 'ultracart_api/models/item_kit_definition'
559
562
  require 'ultracart_api/models/item_option'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ultracart_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.225
4
+ version: 4.0.226
5
5
  platform: ruby
6
6
  authors:
7
7
  - UltraCart
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-30 00:00:00.000000000 Z
11
+ date: 2024-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -611,6 +611,9 @@ files:
611
611
  - docs/ItemInstantPaymentNotification.md
612
612
  - docs/ItemInstantPaymentNotifications.md
613
613
  - docs/ItemInternal.md
614
+ - docs/ItemInventorySnapshot.md
615
+ - docs/ItemInventorySnapshotDistributionCenter.md
616
+ - docs/ItemInventorySnapshotResponse.md
614
617
  - docs/ItemKitComponent.md
615
618
  - docs/ItemKitDefinition.md
616
619
  - docs/ItemOption.md
@@ -1495,6 +1498,9 @@ files:
1495
1498
  - lib/ultracart_api/models/item_instant_payment_notification.rb
1496
1499
  - lib/ultracart_api/models/item_instant_payment_notifications.rb
1497
1500
  - lib/ultracart_api/models/item_internal.rb
1501
+ - lib/ultracart_api/models/item_inventory_snapshot.rb
1502
+ - lib/ultracart_api/models/item_inventory_snapshot_distribution_center.rb
1503
+ - lib/ultracart_api/models/item_inventory_snapshot_response.rb
1498
1504
  - lib/ultracart_api/models/item_kit_component.rb
1499
1505
  - lib/ultracart_api/models/item_kit_definition.rb
1500
1506
  - lib/ultracart_api/models/item_option.rb