ultracart_api 4.1.83 → 4.1.84

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.
@@ -32,6 +32,70 @@ module UltracartClient
32
32
  UltracartClient::ItemApi.new(api_client)
33
33
  end
34
34
 
35
+ # Delete all gated access codes for an item
36
+ # Removes every gated access code currently configured for the item.
37
+ # @param merchant_item_oid [Integer] The item oid.
38
+ # @param [Hash] opts the optional parameters
39
+ # @return [BaseResponse]
40
+ def delete_all_gated_codes(merchant_item_oid, opts = {})
41
+ data, _status_code, _headers = delete_all_gated_codes_with_http_info(merchant_item_oid, opts)
42
+ data
43
+ end
44
+
45
+ # Delete all gated access codes for an item
46
+ # Removes every gated access code currently configured for the item.
47
+ # @param merchant_item_oid [Integer] The item oid.
48
+ # @param [Hash] opts the optional parameters
49
+ # @return [Array<(BaseResponse, Integer, Hash)>] BaseResponse data, response status code and response headers
50
+ def delete_all_gated_codes_with_http_info(merchant_item_oid, opts = {})
51
+ if @api_client.config.debugging
52
+ @api_client.config.logger.debug 'Calling API: ItemApi.delete_all_gated_codes ...'
53
+ end
54
+ # verify the required parameter 'merchant_item_oid' is set
55
+ if @api_client.config.client_side_validation && merchant_item_oid.nil?
56
+ fail ArgumentError, "Missing the required parameter 'merchant_item_oid' when calling ItemApi.delete_all_gated_codes"
57
+ end
58
+ # resource path
59
+ local_var_path = '/item/items/{merchant_item_oid}/gated_codes'.sub('{' + 'merchant_item_oid' + '}', CGI.escape(merchant_item_oid.to_s))
60
+
61
+ # query parameters
62
+ query_params = opts[:query_params] || {}
63
+
64
+ # header parameters
65
+ header_params = opts[:header_params] || {}
66
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
67
+ # HTTP header 'Accept' (if needed)
68
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
69
+
70
+ # form parameters
71
+ form_params = opts[:form_params] || {}
72
+
73
+ # http body (model)
74
+ post_body = opts[:debug_body]
75
+
76
+ # return_type
77
+ return_type = opts[:debug_return_type] || 'BaseResponse'
78
+
79
+ # auth_names
80
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
81
+
82
+ new_options = opts.merge(
83
+ :operation => :"ItemApi.delete_all_gated_codes",
84
+ :header_params => header_params,
85
+ :query_params => query_params,
86
+ :form_params => form_params,
87
+ :body => post_body,
88
+ :auth_names => auth_names,
89
+ :return_type => return_type
90
+ )
91
+
92
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
93
+ if @api_client.config.debugging
94
+ @api_client.config.logger.debug "API called: ItemApi#delete_all_gated_codes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
95
+ end
96
+ return data, status_code, headers
97
+ end
98
+
35
99
  # Delete a digital item, which is a file within the digital library, not an actual merchant item
36
100
  # Delete a digital item on the UltraCart account.
37
101
  # @param digital_item_oid [Integer] The digital item oid to delete.
@@ -96,6 +160,76 @@ module UltracartClient
96
160
  return data, status_code, headers
97
161
  end
98
162
 
163
+ # Delete a gated access code by OID
164
+ # Delete a specific gated access code by its OID.
165
+ # @param merchant_item_oid [Integer] The item oid.
166
+ # @param merchant_item_gated_code_oid [Integer] The gated code oid.
167
+ # @param [Hash] opts the optional parameters
168
+ # @return [BaseResponse]
169
+ def delete_gated_code(merchant_item_oid, merchant_item_gated_code_oid, opts = {})
170
+ data, _status_code, _headers = delete_gated_code_with_http_info(merchant_item_oid, merchant_item_gated_code_oid, opts)
171
+ data
172
+ end
173
+
174
+ # Delete a gated access code by OID
175
+ # Delete a specific gated access code by its OID.
176
+ # @param merchant_item_oid [Integer] The item oid.
177
+ # @param merchant_item_gated_code_oid [Integer] The gated code oid.
178
+ # @param [Hash] opts the optional parameters
179
+ # @return [Array<(BaseResponse, Integer, Hash)>] BaseResponse data, response status code and response headers
180
+ def delete_gated_code_with_http_info(merchant_item_oid, merchant_item_gated_code_oid, opts = {})
181
+ if @api_client.config.debugging
182
+ @api_client.config.logger.debug 'Calling API: ItemApi.delete_gated_code ...'
183
+ end
184
+ # verify the required parameter 'merchant_item_oid' is set
185
+ if @api_client.config.client_side_validation && merchant_item_oid.nil?
186
+ fail ArgumentError, "Missing the required parameter 'merchant_item_oid' when calling ItemApi.delete_gated_code"
187
+ end
188
+ # verify the required parameter 'merchant_item_gated_code_oid' is set
189
+ if @api_client.config.client_side_validation && merchant_item_gated_code_oid.nil?
190
+ fail ArgumentError, "Missing the required parameter 'merchant_item_gated_code_oid' when calling ItemApi.delete_gated_code"
191
+ end
192
+ # resource path
193
+ local_var_path = '/item/items/{merchant_item_oid}/gated_codes/{merchant_item_gated_code_oid}'.sub('{' + 'merchant_item_oid' + '}', CGI.escape(merchant_item_oid.to_s)).sub('{' + 'merchant_item_gated_code_oid' + '}', CGI.escape(merchant_item_gated_code_oid.to_s))
194
+
195
+ # query parameters
196
+ query_params = opts[:query_params] || {}
197
+
198
+ # header parameters
199
+ header_params = opts[:header_params] || {}
200
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
201
+ # HTTP header 'Accept' (if needed)
202
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
203
+
204
+ # form parameters
205
+ form_params = opts[:form_params] || {}
206
+
207
+ # http body (model)
208
+ post_body = opts[:debug_body]
209
+
210
+ # return_type
211
+ return_type = opts[:debug_return_type] || 'BaseResponse'
212
+
213
+ # auth_names
214
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
215
+
216
+ new_options = opts.merge(
217
+ :operation => :"ItemApi.delete_gated_code",
218
+ :header_params => header_params,
219
+ :query_params => query_params,
220
+ :form_params => form_params,
221
+ :body => post_body,
222
+ :auth_names => auth_names,
223
+ :return_type => return_type
224
+ )
225
+
226
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
227
+ if @api_client.config.debugging
228
+ @api_client.config.logger.debug "API called: ItemApi#delete_gated_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
229
+ end
230
+ return data, status_code, headers
231
+ end
232
+
99
233
  # Delete an item
100
234
  # Delete an item on the UltraCart account.
101
235
  # @param merchant_item_oid [Integer] The item oid to delete.
@@ -230,6 +364,81 @@ module UltracartClient
230
364
  return data, status_code, headers
231
365
  end
232
366
 
367
+ # Generate a batch of gated access codes
368
+ # Returns randomly generated codes using a profanity-safe charset (vowel-free, 0/1 removed). Codes are NOT persisted; submit them via PUT or POST to commit.
369
+ # @param merchant_item_oid [Integer] The item oid.
370
+ # @param generate_request [ItemGenerateGatedCodesRequest] Generate request.
371
+ # @param [Hash] opts the optional parameters
372
+ # @return [ItemGatedCodesResponse]
373
+ def generate_gated_codes(merchant_item_oid, generate_request, opts = {})
374
+ data, _status_code, _headers = generate_gated_codes_with_http_info(merchant_item_oid, generate_request, opts)
375
+ data
376
+ end
377
+
378
+ # Generate a batch of gated access codes
379
+ # Returns randomly generated codes using a profanity-safe charset (vowel-free, 0/1 removed). Codes are NOT persisted; submit them via PUT or POST to commit.
380
+ # @param merchant_item_oid [Integer] The item oid.
381
+ # @param generate_request [ItemGenerateGatedCodesRequest] Generate request.
382
+ # @param [Hash] opts the optional parameters
383
+ # @return [Array<(ItemGatedCodesResponse, Integer, Hash)>] ItemGatedCodesResponse data, response status code and response headers
384
+ def generate_gated_codes_with_http_info(merchant_item_oid, generate_request, opts = {})
385
+ if @api_client.config.debugging
386
+ @api_client.config.logger.debug 'Calling API: ItemApi.generate_gated_codes ...'
387
+ end
388
+ # verify the required parameter 'merchant_item_oid' is set
389
+ if @api_client.config.client_side_validation && merchant_item_oid.nil?
390
+ fail ArgumentError, "Missing the required parameter 'merchant_item_oid' when calling ItemApi.generate_gated_codes"
391
+ end
392
+ # verify the required parameter 'generate_request' is set
393
+ if @api_client.config.client_side_validation && generate_request.nil?
394
+ fail ArgumentError, "Missing the required parameter 'generate_request' when calling ItemApi.generate_gated_codes"
395
+ end
396
+ # resource path
397
+ local_var_path = '/item/items/{merchant_item_oid}/gated_codes/generate'.sub('{' + 'merchant_item_oid' + '}', CGI.escape(merchant_item_oid.to_s))
398
+
399
+ # query parameters
400
+ query_params = opts[:query_params] || {}
401
+
402
+ # header parameters
403
+ header_params = opts[:header_params] || {}
404
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
405
+ # HTTP header 'Accept' (if needed)
406
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
407
+ # HTTP header 'Content-Type'
408
+ content_type = @api_client.select_header_content_type(['application/json; charset=UTF-8'])
409
+ if !content_type.nil?
410
+ header_params['Content-Type'] = content_type
411
+ end
412
+
413
+ # form parameters
414
+ form_params = opts[:form_params] || {}
415
+
416
+ # http body (model)
417
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(generate_request)
418
+
419
+ # return_type
420
+ return_type = opts[:debug_return_type] || 'ItemGatedCodesResponse'
421
+
422
+ # auth_names
423
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
424
+
425
+ new_options = opts.merge(
426
+ :operation => :"ItemApi.generate_gated_codes",
427
+ :header_params => header_params,
428
+ :query_params => query_params,
429
+ :form_params => form_params,
430
+ :body => post_body,
431
+ :auth_names => auth_names,
432
+ :return_type => return_type
433
+ )
434
+
435
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
436
+ if @api_client.config.debugging
437
+ @api_client.config.logger.debug "API called: ItemApi#generate_gated_codes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
438
+ end
439
+ return data, status_code, headers
440
+ end
441
+
233
442
  # Retrieve a digital item from the digital library, which are digital files that may be attached to normal items
234
443
  # Retrieves a digital item (file information) from the account. Be aware that these are not normal items that can be added to a shopping cart. Rather, they are digital files that may be associated with normal items.
235
444
  # @param digital_item_oid [Integer] The digital item oid to retrieve.
@@ -434,6 +643,70 @@ module UltracartClient
434
643
  return data, status_code, headers
435
644
  end
436
645
 
646
+ # Get gated access codes for an item
647
+ # Retrieve all unredeemed gated access codes configured for an item.
648
+ # @param merchant_item_oid [Integer] The item oid.
649
+ # @param [Hash] opts the optional parameters
650
+ # @return [ItemGatedCodesResponse]
651
+ def get_gated_codes(merchant_item_oid, opts = {})
652
+ data, _status_code, _headers = get_gated_codes_with_http_info(merchant_item_oid, opts)
653
+ data
654
+ end
655
+
656
+ # Get gated access codes for an item
657
+ # Retrieve all unredeemed gated access codes configured for an item.
658
+ # @param merchant_item_oid [Integer] The item oid.
659
+ # @param [Hash] opts the optional parameters
660
+ # @return [Array<(ItemGatedCodesResponse, Integer, Hash)>] ItemGatedCodesResponse data, response status code and response headers
661
+ def get_gated_codes_with_http_info(merchant_item_oid, opts = {})
662
+ if @api_client.config.debugging
663
+ @api_client.config.logger.debug 'Calling API: ItemApi.get_gated_codes ...'
664
+ end
665
+ # verify the required parameter 'merchant_item_oid' is set
666
+ if @api_client.config.client_side_validation && merchant_item_oid.nil?
667
+ fail ArgumentError, "Missing the required parameter 'merchant_item_oid' when calling ItemApi.get_gated_codes"
668
+ end
669
+ # resource path
670
+ local_var_path = '/item/items/{merchant_item_oid}/gated_codes'.sub('{' + 'merchant_item_oid' + '}', CGI.escape(merchant_item_oid.to_s))
671
+
672
+ # query parameters
673
+ query_params = opts[:query_params] || {}
674
+
675
+ # header parameters
676
+ header_params = opts[:header_params] || {}
677
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
678
+ # HTTP header 'Accept' (if needed)
679
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
680
+
681
+ # form parameters
682
+ form_params = opts[:form_params] || {}
683
+
684
+ # http body (model)
685
+ post_body = opts[:debug_body]
686
+
687
+ # return_type
688
+ return_type = opts[:debug_return_type] || 'ItemGatedCodesResponse'
689
+
690
+ # auth_names
691
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
692
+
693
+ new_options = opts.merge(
694
+ :operation => :"ItemApi.get_gated_codes",
695
+ :header_params => header_params,
696
+ :query_params => query_params,
697
+ :form_params => form_params,
698
+ :body => post_body,
699
+ :auth_names => auth_names,
700
+ :return_type => return_type
701
+ )
702
+
703
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
704
+ if @api_client.config.debugging
705
+ @api_client.config.logger.debug "API called: ItemApi#get_gated_codes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
706
+ end
707
+ return data, status_code, headers
708
+ end
709
+
437
710
  # Retrieve a list of item inventories. This method may be called once every 15 minutes. More than that will result in a 429 response.
438
711
  # Retrieve a list of item inventories. This method may be called once every 15 minutes. More than that will result in a 429 response.
439
712
  # @param [Hash] opts the optional parameters
@@ -632,82 +905,6 @@ module UltracartClient
632
905
  return data, status_code, headers
633
906
  end
634
907
 
635
- # Retrieve an item shipping distribution center
636
- # Retrieve an item shipping distribution center.
637
- # @param merchant_item_oid [Integer] The item oid to retrieve.
638
- # @param distribution_center_code [String]
639
- # @param [Hash] opts the optional parameters
640
- # @option opts [String] :_expand The object expansion to perform on the result. See documentation for examples
641
- # @option opts [Boolean] :_placeholders Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.
642
- # @return [ItemShippingDistributionCenterResponse]
643
- def get_item_shipping_distribution_center_by_code(merchant_item_oid, distribution_center_code, opts = {})
644
- data, _status_code, _headers = get_item_shipping_distribution_center_by_code_with_http_info(merchant_item_oid, distribution_center_code, opts)
645
- data
646
- end
647
-
648
- # Retrieve an item shipping distribution center
649
- # Retrieve an item shipping distribution center.
650
- # @param merchant_item_oid [Integer] The item oid to retrieve.
651
- # @param distribution_center_code [String]
652
- # @param [Hash] opts the optional parameters
653
- # @option opts [String] :_expand The object expansion to perform on the result. See documentation for examples
654
- # @option opts [Boolean] :_placeholders Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.
655
- # @return [Array<(ItemShippingDistributionCenterResponse, Integer, Hash)>] ItemShippingDistributionCenterResponse data, response status code and response headers
656
- def get_item_shipping_distribution_center_by_code_with_http_info(merchant_item_oid, distribution_center_code, opts = {})
657
- if @api_client.config.debugging
658
- @api_client.config.logger.debug 'Calling API: ItemApi.get_item_shipping_distribution_center_by_code ...'
659
- end
660
- # verify the required parameter 'merchant_item_oid' is set
661
- if @api_client.config.client_side_validation && merchant_item_oid.nil?
662
- fail ArgumentError, "Missing the required parameter 'merchant_item_oid' when calling ItemApi.get_item_shipping_distribution_center_by_code"
663
- end
664
- # verify the required parameter 'distribution_center_code' is set
665
- if @api_client.config.client_side_validation && distribution_center_code.nil?
666
- fail ArgumentError, "Missing the required parameter 'distribution_center_code' when calling ItemApi.get_item_shipping_distribution_center_by_code"
667
- end
668
- # resource path
669
- local_var_path = '/item/items/{merchant_item_oid}/shipping/distribution_centers/by_code/{distribution_center_code}'.sub('{' + 'merchant_item_oid' + '}', CGI.escape(merchant_item_oid.to_s)).sub('{' + 'distribution_center_code' + '}', CGI.escape(distribution_center_code.to_s))
670
-
671
- # query parameters
672
- query_params = opts[:query_params] || {}
673
- query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil?
674
- query_params[:'_placeholders'] = opts[:'_placeholders'] if !opts[:'_placeholders'].nil?
675
-
676
- # header parameters
677
- header_params = opts[:header_params] || {}
678
- header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
679
- # HTTP header 'Accept' (if needed)
680
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
681
-
682
- # form parameters
683
- form_params = opts[:form_params] || {}
684
-
685
- # http body (model)
686
- post_body = opts[:debug_body]
687
-
688
- # return_type
689
- return_type = opts[:debug_return_type] || 'ItemShippingDistributionCenterResponse'
690
-
691
- # auth_names
692
- auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
693
-
694
- new_options = opts.merge(
695
- :operation => :"ItemApi.get_item_shipping_distribution_center_by_code",
696
- :header_params => header_params,
697
- :query_params => query_params,
698
- :form_params => form_params,
699
- :body => post_body,
700
- :auth_names => auth_names,
701
- :return_type => return_type
702
- )
703
-
704
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
705
- if @api_client.config.debugging
706
- @api_client.config.logger.debug "API called: ItemApi#get_item_shipping_distribution_center_by_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
707
- end
708
- return data, status_code, headers
709
- end
710
-
711
908
  # Retrieve items
712
909
  # Retrieves a group of items from the account. If no parameters are specified, all items will be returned. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination.
713
910
  # @param [Hash] opts the optional parameters
@@ -1130,6 +1327,81 @@ module UltracartClient
1130
1327
  return data, status_code, headers
1131
1328
  end
1132
1329
 
1330
+ # Add a single gated access code to an item
1331
+ # Insert a single gated access code; the server assigns the OID and created_dts.
1332
+ # @param merchant_item_oid [Integer] The item oid.
1333
+ # @param gated_code [ItemGatedCode] Gated code to insert.
1334
+ # @param [Hash] opts the optional parameters
1335
+ # @return [ItemGatedCodeResponse]
1336
+ def insert_gated_code(merchant_item_oid, gated_code, opts = {})
1337
+ data, _status_code, _headers = insert_gated_code_with_http_info(merchant_item_oid, gated_code, opts)
1338
+ data
1339
+ end
1340
+
1341
+ # Add a single gated access code to an item
1342
+ # Insert a single gated access code; the server assigns the OID and created_dts.
1343
+ # @param merchant_item_oid [Integer] The item oid.
1344
+ # @param gated_code [ItemGatedCode] Gated code to insert.
1345
+ # @param [Hash] opts the optional parameters
1346
+ # @return [Array<(ItemGatedCodeResponse, Integer, Hash)>] ItemGatedCodeResponse data, response status code and response headers
1347
+ def insert_gated_code_with_http_info(merchant_item_oid, gated_code, opts = {})
1348
+ if @api_client.config.debugging
1349
+ @api_client.config.logger.debug 'Calling API: ItemApi.insert_gated_code ...'
1350
+ end
1351
+ # verify the required parameter 'merchant_item_oid' is set
1352
+ if @api_client.config.client_side_validation && merchant_item_oid.nil?
1353
+ fail ArgumentError, "Missing the required parameter 'merchant_item_oid' when calling ItemApi.insert_gated_code"
1354
+ end
1355
+ # verify the required parameter 'gated_code' is set
1356
+ if @api_client.config.client_side_validation && gated_code.nil?
1357
+ fail ArgumentError, "Missing the required parameter 'gated_code' when calling ItemApi.insert_gated_code"
1358
+ end
1359
+ # resource path
1360
+ local_var_path = '/item/items/{merchant_item_oid}/gated_codes'.sub('{' + 'merchant_item_oid' + '}', CGI.escape(merchant_item_oid.to_s))
1361
+
1362
+ # query parameters
1363
+ query_params = opts[:query_params] || {}
1364
+
1365
+ # header parameters
1366
+ header_params = opts[:header_params] || {}
1367
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
1368
+ # HTTP header 'Accept' (if needed)
1369
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1370
+ # HTTP header 'Content-Type'
1371
+ content_type = @api_client.select_header_content_type(['application/json; charset=UTF-8'])
1372
+ if !content_type.nil?
1373
+ header_params['Content-Type'] = content_type
1374
+ end
1375
+
1376
+ # form parameters
1377
+ form_params = opts[:form_params] || {}
1378
+
1379
+ # http body (model)
1380
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(gated_code)
1381
+
1382
+ # return_type
1383
+ return_type = opts[:debug_return_type] || 'ItemGatedCodeResponse'
1384
+
1385
+ # auth_names
1386
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
1387
+
1388
+ new_options = opts.merge(
1389
+ :operation => :"ItemApi.insert_gated_code",
1390
+ :header_params => header_params,
1391
+ :query_params => query_params,
1392
+ :form_params => form_params,
1393
+ :body => post_body,
1394
+ :auth_names => auth_names,
1395
+ :return_type => return_type
1396
+ )
1397
+
1398
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1399
+ if @api_client.config.debugging
1400
+ @api_client.config.logger.debug "API called: ItemApi#insert_gated_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1401
+ end
1402
+ return data, status_code, headers
1403
+ end
1404
+
1133
1405
  # Create an item
1134
1406
  # Create a new item on the UltraCart account.
1135
1407
  # @param item [Item] Item to create
@@ -1355,6 +1627,81 @@ module UltracartClient
1355
1627
  return data, status_code, headers
1356
1628
  end
1357
1629
 
1630
+ # Replace the full list of gated access codes for an item
1631
+ # Existing codes not present in the request body are deleted. New codes are inserted. Unchanged codes preserve their OID and created_dts.
1632
+ # @param merchant_item_oid [Integer] The item oid.
1633
+ # @param gated_codes_request [ItemGatedCodesRequest] Codes to replace the existing list with.
1634
+ # @param [Hash] opts the optional parameters
1635
+ # @return [ItemGatedCodesResponse]
1636
+ def replace_gated_codes(merchant_item_oid, gated_codes_request, opts = {})
1637
+ data, _status_code, _headers = replace_gated_codes_with_http_info(merchant_item_oid, gated_codes_request, opts)
1638
+ data
1639
+ end
1640
+
1641
+ # Replace the full list of gated access codes for an item
1642
+ # Existing codes not present in the request body are deleted. New codes are inserted. Unchanged codes preserve their OID and created_dts.
1643
+ # @param merchant_item_oid [Integer] The item oid.
1644
+ # @param gated_codes_request [ItemGatedCodesRequest] Codes to replace the existing list with.
1645
+ # @param [Hash] opts the optional parameters
1646
+ # @return [Array<(ItemGatedCodesResponse, Integer, Hash)>] ItemGatedCodesResponse data, response status code and response headers
1647
+ def replace_gated_codes_with_http_info(merchant_item_oid, gated_codes_request, opts = {})
1648
+ if @api_client.config.debugging
1649
+ @api_client.config.logger.debug 'Calling API: ItemApi.replace_gated_codes ...'
1650
+ end
1651
+ # verify the required parameter 'merchant_item_oid' is set
1652
+ if @api_client.config.client_side_validation && merchant_item_oid.nil?
1653
+ fail ArgumentError, "Missing the required parameter 'merchant_item_oid' when calling ItemApi.replace_gated_codes"
1654
+ end
1655
+ # verify the required parameter 'gated_codes_request' is set
1656
+ if @api_client.config.client_side_validation && gated_codes_request.nil?
1657
+ fail ArgumentError, "Missing the required parameter 'gated_codes_request' when calling ItemApi.replace_gated_codes"
1658
+ end
1659
+ # resource path
1660
+ local_var_path = '/item/items/{merchant_item_oid}/gated_codes'.sub('{' + 'merchant_item_oid' + '}', CGI.escape(merchant_item_oid.to_s))
1661
+
1662
+ # query parameters
1663
+ query_params = opts[:query_params] || {}
1664
+
1665
+ # header parameters
1666
+ header_params = opts[:header_params] || {}
1667
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
1668
+ # HTTP header 'Accept' (if needed)
1669
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1670
+ # HTTP header 'Content-Type'
1671
+ content_type = @api_client.select_header_content_type(['application/json; charset=UTF-8'])
1672
+ if !content_type.nil?
1673
+ header_params['Content-Type'] = content_type
1674
+ end
1675
+
1676
+ # form parameters
1677
+ form_params = opts[:form_params] || {}
1678
+
1679
+ # http body (model)
1680
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(gated_codes_request)
1681
+
1682
+ # return_type
1683
+ return_type = opts[:debug_return_type] || 'ItemGatedCodesResponse'
1684
+
1685
+ # auth_names
1686
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
1687
+
1688
+ new_options = opts.merge(
1689
+ :operation => :"ItemApi.replace_gated_codes",
1690
+ :header_params => header_params,
1691
+ :query_params => query_params,
1692
+ :form_params => form_params,
1693
+ :body => post_body,
1694
+ :auth_names => auth_names,
1695
+ :return_type => return_type
1696
+ )
1697
+
1698
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
1699
+ if @api_client.config.debugging
1700
+ @api_client.config.logger.debug "API called: ItemApi#replace_gated_codes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1701
+ end
1702
+ return data, status_code, headers
1703
+ end
1704
+
1358
1705
  # Updates a file within the digital library
1359
1706
  # 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.
1360
1707
  # @param digital_item_oid [Integer] The digital item oid to update.
@@ -1511,156 +1858,6 @@ module UltracartClient
1511
1858
  return data, status_code, headers
1512
1859
  end
1513
1860
 
1514
- # Update item inventories for a distribution center
1515
- # Update item inventories for a distribution center
1516
- # @param item_inventory_update_request [ItemInventoryUpdateRequest] Item inventory updates
1517
- # @param [Hash] opts the optional parameters
1518
- # @return [nil]
1519
- def update_item_inventories(item_inventory_update_request, opts = {})
1520
- update_item_inventories_with_http_info(item_inventory_update_request, opts)
1521
- nil
1522
- end
1523
-
1524
- # Update item inventories for a distribution center
1525
- # Update item inventories for a distribution center
1526
- # @param item_inventory_update_request [ItemInventoryUpdateRequest] Item inventory updates
1527
- # @param [Hash] opts the optional parameters
1528
- # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
1529
- def update_item_inventories_with_http_info(item_inventory_update_request, opts = {})
1530
- if @api_client.config.debugging
1531
- @api_client.config.logger.debug 'Calling API: ItemApi.update_item_inventories ...'
1532
- end
1533
- # verify the required parameter 'item_inventory_update_request' is set
1534
- if @api_client.config.client_side_validation && item_inventory_update_request.nil?
1535
- fail ArgumentError, "Missing the required parameter 'item_inventory_update_request' when calling ItemApi.update_item_inventories"
1536
- end
1537
- # resource path
1538
- local_var_path = '/item/items/update_item_inventories'
1539
-
1540
- # query parameters
1541
- query_params = opts[:query_params] || {}
1542
-
1543
- # header parameters
1544
- header_params = opts[:header_params] || {}
1545
- header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
1546
- # HTTP header 'Accept' (if needed)
1547
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1548
- # HTTP header 'Content-Type'
1549
- content_type = @api_client.select_header_content_type(['application/json; charset=UTF-8'])
1550
- if !content_type.nil?
1551
- header_params['Content-Type'] = content_type
1552
- end
1553
-
1554
- # form parameters
1555
- form_params = opts[:form_params] || {}
1556
-
1557
- # http body (model)
1558
- post_body = opts[:debug_body] || @api_client.object_to_http_body(item_inventory_update_request)
1559
-
1560
- # return_type
1561
- return_type = opts[:debug_return_type]
1562
-
1563
- # auth_names
1564
- auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
1565
-
1566
- new_options = opts.merge(
1567
- :operation => :"ItemApi.update_item_inventories",
1568
- :header_params => header_params,
1569
- :query_params => query_params,
1570
- :form_params => form_params,
1571
- :body => post_body,
1572
- :auth_names => auth_names,
1573
- :return_type => return_type
1574
- )
1575
-
1576
- data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
1577
- if @api_client.config.debugging
1578
- @api_client.config.logger.debug "API called: ItemApi#update_item_inventories\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1579
- end
1580
- return data, status_code, headers
1581
- end
1582
-
1583
- # Update an item shipping distribution center
1584
- # Update an item shipping distribution center
1585
- # @param merchant_item_oid [Integer] The item oid to update.
1586
- # @param distribution_center_code [String]
1587
- # @param item_shipping_distribution_center [ItemShippingDistributionCenter] Item shipping distribution center
1588
- # @param [Hash] opts the optional parameters
1589
- # @return [nil]
1590
- def update_item_shipping_distribution_center_by_code(merchant_item_oid, distribution_center_code, item_shipping_distribution_center, opts = {})
1591
- update_item_shipping_distribution_center_by_code_with_http_info(merchant_item_oid, distribution_center_code, item_shipping_distribution_center, opts)
1592
- nil
1593
- end
1594
-
1595
- # Update an item shipping distribution center
1596
- # Update an item shipping distribution center
1597
- # @param merchant_item_oid [Integer] The item oid to update.
1598
- # @param distribution_center_code [String]
1599
- # @param item_shipping_distribution_center [ItemShippingDistributionCenter] Item shipping distribution center
1600
- # @param [Hash] opts the optional parameters
1601
- # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
1602
- def update_item_shipping_distribution_center_by_code_with_http_info(merchant_item_oid, distribution_center_code, item_shipping_distribution_center, opts = {})
1603
- if @api_client.config.debugging
1604
- @api_client.config.logger.debug 'Calling API: ItemApi.update_item_shipping_distribution_center_by_code ...'
1605
- end
1606
- # verify the required parameter 'merchant_item_oid' is set
1607
- if @api_client.config.client_side_validation && merchant_item_oid.nil?
1608
- fail ArgumentError, "Missing the required parameter 'merchant_item_oid' when calling ItemApi.update_item_shipping_distribution_center_by_code"
1609
- end
1610
- # verify the required parameter 'distribution_center_code' is set
1611
- if @api_client.config.client_side_validation && distribution_center_code.nil?
1612
- fail ArgumentError, "Missing the required parameter 'distribution_center_code' when calling ItemApi.update_item_shipping_distribution_center_by_code"
1613
- end
1614
- # verify the required parameter 'item_shipping_distribution_center' is set
1615
- if @api_client.config.client_side_validation && item_shipping_distribution_center.nil?
1616
- fail ArgumentError, "Missing the required parameter 'item_shipping_distribution_center' when calling ItemApi.update_item_shipping_distribution_center_by_code"
1617
- end
1618
- # resource path
1619
- local_var_path = '/item/items/{merchant_item_oid}/shipping/distribution_centers/by_code/{distribution_center_code}'.sub('{' + 'merchant_item_oid' + '}', CGI.escape(merchant_item_oid.to_s)).sub('{' + 'distribution_center_code' + '}', CGI.escape(distribution_center_code.to_s))
1620
-
1621
- # query parameters
1622
- query_params = opts[:query_params] || {}
1623
-
1624
- # header parameters
1625
- header_params = opts[:header_params] || {}
1626
- header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
1627
- # HTTP header 'Accept' (if needed)
1628
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1629
- # HTTP header 'Content-Type'
1630
- content_type = @api_client.select_header_content_type(['application/json; charset=UTF-8'])
1631
- if !content_type.nil?
1632
- header_params['Content-Type'] = content_type
1633
- end
1634
-
1635
- # form parameters
1636
- form_params = opts[:form_params] || {}
1637
-
1638
- # http body (model)
1639
- post_body = opts[:debug_body] || @api_client.object_to_http_body(item_shipping_distribution_center)
1640
-
1641
- # return_type
1642
- return_type = opts[:debug_return_type]
1643
-
1644
- # auth_names
1645
- auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
1646
-
1647
- new_options = opts.merge(
1648
- :operation => :"ItemApi.update_item_shipping_distribution_center_by_code",
1649
- :header_params => header_params,
1650
- :query_params => query_params,
1651
- :form_params => form_params,
1652
- :body => post_body,
1653
- :auth_names => auth_names,
1654
- :return_type => return_type
1655
- )
1656
-
1657
- data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
1658
- if @api_client.config.debugging
1659
- @api_client.config.logger.debug "API called: ItemApi#update_item_shipping_distribution_center_by_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1660
- end
1661
- return data, status_code, headers
1662
- end
1663
-
1664
1861
  # Update multiple items
1665
1862
  # Update multiple item on the UltraCart account.
1666
1863
  # @param items_request [ItemsRequest] Items to update (synchronous maximum 20 / asynchronous maximum 100)