Class: UltracartClient::ItemApi

Inherits:
Object
  • Object
show all
Defined in:
lib/ultracart_api/api/item_api.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ItemApi

Returns a new instance of ItemApi.



19
20
21
# File 'lib/ultracart_api/api/item_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/ultracart_api/api/item_api.rb', line 17

def api_client
  @api_client
end

Class Method Details

.new_using_api_key(simple_key, verify_ssl = true, debugging = false) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/ultracart_api/api/item_api.rb', line 23

def self.new_using_api_key(simple_key, verify_ssl = true, debugging = false)
  api_config = Configuration.new
  api_config.api_key_prefix['x-ultracart-simple-key'] = simple_key
  api_config.api_version = '2017-03-01'
  api_config.verify_ssl = verify_ssl

  api_client = ApiClient.new(api_config)
  api_client.config.debugging = debugging

  UltracartClient::ItemApi.new(api_client)
end

Instance Method Details

#delete_item(merchant_item_oid, opts = {}) ⇒ nil

Delete an item Delete an item on the UltraCart account.

Parameters:

  • merchant_item_oid

    The item oid to delete.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


40
41
42
43
# File 'lib/ultracart_api/api/item_api.rb', line 40

def delete_item(merchant_item_oid, opts = {})
  delete_item_with_http_info(merchant_item_oid, opts)
  nil
end

#delete_item_with_http_info(merchant_item_oid, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete an item Delete an item on the UltraCart account.

Parameters:

  • merchant_item_oid

    The item oid to delete.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/ultracart_api/api/item_api.rb', line 50

def delete_item_with_http_info(merchant_item_oid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ItemApi.delete_item ...'
  end
  # verify the required parameter 'merchant_item_oid' is set
  if @api_client.config.client_side_validation && merchant_item_oid.nil?
    fail ArgumentError, "Missing the required parameter 'merchant_item_oid' when calling ItemApi.delete_item"
  end
  # resource path
  local_var_path = '/item/items/{merchant_item_oid}'.sub('{' + 'merchant_item_oid' + '}', merchant_item_oid.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ItemApi#delete_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_item(merchant_item_oid, opts = {}) ⇒ ItemResponse

Retrieve an item Retrieves a single item using the specified item oid.

Parameters:

  • merchant_item_oid

    The item oid to retrieve.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

  • :_placeholders (BOOLEAN)

    Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.

Returns:



96
97
98
99
# File 'lib/ultracart_api/api/item_api.rb', line 96

def get_item(merchant_item_oid, opts = {})
  data, _status_code, _headers = get_item_with_http_info(merchant_item_oid, opts)
  data
end

#get_item_by_merchant_item_id(merchant_item_id, opts = {}) ⇒ ItemResponse

Retrieve an item by item id Retrieves a single item using the specified item id.

Parameters:

  • merchant_item_id

    The item id to retrieve.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

  • :_placeholders (BOOLEAN)

    Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.

Returns:



157
158
159
160
# File 'lib/ultracart_api/api/item_api.rb', line 157

def get_item_by_merchant_item_id(merchant_item_id, opts = {})
  data, _status_code, _headers = get_item_by_merchant_item_id_with_http_info(merchant_item_id, opts)
  data
end

#get_item_by_merchant_item_id_with_http_info(merchant_item_id, opts = {}) ⇒ Array<(ItemResponse, Fixnum, Hash)>

Retrieve an item by item id Retrieves a single item using the specified item id.

Parameters:

  • merchant_item_id

    The item id to retrieve.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

  • :_placeholders (BOOLEAN)

    Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.

Returns:

  • (Array<(ItemResponse, Fixnum, Hash)>)

    ItemResponse data, response status code and response headers



169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# File 'lib/ultracart_api/api/item_api.rb', line 169

def get_item_by_merchant_item_id_with_http_info(merchant_item_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ItemApi.get_item_by_merchant_item_id ...'
  end
  # verify the required parameter 'merchant_item_id' is set
  if @api_client.config.client_side_validation && merchant_item_id.nil?
    fail ArgumentError, "Missing the required parameter 'merchant_item_id' when calling ItemApi.get_item_by_merchant_item_id"
  end
  # resource path
  local_var_path = '/item/items/merchant_item_id/{merchant_item_id}'.sub('{' + 'merchant_item_id' + '}', merchant_item_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil?
  query_params[:'_placeholders'] = opts[:'_placeholders'] if !opts[:'_placeholders'].nil?

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ItemResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ItemApi#get_item_by_merchant_item_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_item_with_http_info(merchant_item_oid, opts = {}) ⇒ Array<(ItemResponse, Fixnum, Hash)>

Retrieve an item Retrieves a single item using the specified item oid.

Parameters:

  • merchant_item_oid

    The item oid to retrieve.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

  • :_placeholders (BOOLEAN)

    Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.

Returns:

  • (Array<(ItemResponse, Fixnum, Hash)>)

    ItemResponse data, response status code and response headers



108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# File 'lib/ultracart_api/api/item_api.rb', line 108

def get_item_with_http_info(merchant_item_oid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ItemApi.get_item ...'
  end
  # verify the required parameter 'merchant_item_oid' is set
  if @api_client.config.client_side_validation && merchant_item_oid.nil?
    fail ArgumentError, "Missing the required parameter 'merchant_item_oid' when calling ItemApi.get_item"
  end
  # resource path
  local_var_path = '/item/items/{merchant_item_oid}'.sub('{' + 'merchant_item_oid' + '}', merchant_item_oid.to_s)

  # query parameters
  query_params = {}
  query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil?
  query_params[:'_placeholders'] = opts[:'_placeholders'] if !opts[:'_placeholders'].nil?

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ItemResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ItemApi#get_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_items(opts = {}) ⇒ ItemsResponse

Retrieve items 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.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :parent_category_id (Integer)

    The parent category object id to retrieve items for. Unspecified means all items on the account. 0 &#x3D; root

  • :parent_category_path (String)

    The parent category path to retrieve items for. Unspecified means all items on the account. / &#x3D; root

  • :_limit (Integer)

    The maximum number of records to return on this one API call. (Default 100, Max 2000) (default to 100)

  • :_offset (Integer)

    Pagination of the record set. Offset is a zero based index. (default to 0)

  • :_since (String)

    Fetch items that have been created/modified since this date/time.

  • :_sort (String)

    The sort order of the items. See Sorting documentation for examples of using multiple values and sorting by ascending and descending.

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

  • :_placeholders (BOOLEAN)

    Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.

Returns:



223
224
225
226
# File 'lib/ultracart_api/api/item_api.rb', line 223

def get_items(opts = {})
  data, _status_code, _headers = get_items_with_http_info(opts)
  data
end

#get_items_with_http_info(opts = {}) ⇒ Array<(ItemsResponse, Fixnum, Hash)>

Retrieve items 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.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :parent_category_id (Integer)

    The parent category object id to retrieve items for. Unspecified means all items on the account. 0 &#x3D; root

  • :parent_category_path (String)

    The parent category path to retrieve items for. Unspecified means all items on the account. / &#x3D; root

  • :_limit (Integer)

    The maximum number of records to return on this one API call. (Default 100, Max 2000)

  • :_offset (Integer)

    Pagination of the record set. Offset is a zero based index.

  • :_since (String)

    Fetch items that have been created/modified since this date/time.

  • :_sort (String)

    The sort order of the items. See Sorting documentation for examples of using multiple values and sorting by ascending and descending.

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

  • :_placeholders (BOOLEAN)

    Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.

Returns:

  • (Array<(ItemsResponse, Fixnum, Hash)>)

    ItemsResponse data, response status code and response headers



240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
# File 'lib/ultracart_api/api/item_api.rb', line 240

def get_items_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ItemApi.get_items ...'
  end
  # resource path
  local_var_path = '/item/items'

  # query parameters
  query_params = {}
  query_params[:'parent_category_id'] = opts[:'parent_category_id'] if !opts[:'parent_category_id'].nil?
  query_params[:'parent_category_path'] = opts[:'parent_category_path'] if !opts[:'parent_category_path'].nil?
  query_params[:'_limit'] = opts[:'_limit'] if !opts[:'_limit'].nil?
  query_params[:'_offset'] = opts[:'_offset'] if !opts[:'_offset'].nil?
  query_params[:'_since'] = opts[:'_since'] if !opts[:'_since'].nil?
  query_params[:'_sort'] = opts[:'_sort'] if !opts[:'_sort'].nil?
  query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil?
  query_params[:'_placeholders'] = opts[:'_placeholders'] if !opts[:'_placeholders'].nil?

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ItemsResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ItemApi#get_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_pricing_tiers(opts = {}) ⇒ PricingTiersResponse

Retrieve pricing tiers Retrieves the pricing tiers

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

Returns:



289
290
291
292
# File 'lib/ultracart_api/api/item_api.rb', line 289

def get_pricing_tiers(opts = {})
  data, _status_code, _headers = get_pricing_tiers_with_http_info(opts)
  data
end

#get_pricing_tiers_with_http_info(opts = {}) ⇒ Array<(PricingTiersResponse, Fixnum, Hash)>

Retrieve pricing tiers Retrieves the pricing tiers

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

Returns:

  • (Array<(PricingTiersResponse, Fixnum, Hash)>)

    PricingTiersResponse data, response status code and response headers



299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
# File 'lib/ultracart_api/api/item_api.rb', line 299

def get_pricing_tiers_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ItemApi.get_pricing_tiers ...'
  end
  # resource path
  local_var_path = '/item/pricing_tiers'

  # query parameters
  query_params = {}
  query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil?

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'PricingTiersResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ItemApi#get_pricing_tiers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#insert_item(item, opts = {}) ⇒ ItemResponse

Create an item Create a new item on the UltraCart account.

Parameters:

  • item

    Item to create

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

  • :_placeholders (BOOLEAN)

    Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.

Returns:



343
344
345
346
# File 'lib/ultracart_api/api/item_api.rb', line 343

def insert_item(item, opts = {})
  data, _status_code, _headers = insert_item_with_http_info(item, opts)
  data
end

#insert_item_with_http_info(item, opts = {}) ⇒ Array<(ItemResponse, Fixnum, Hash)>

Create an item Create a new item on the UltraCart account.

Parameters:

  • item

    Item to create

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

  • :_placeholders (BOOLEAN)

    Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.

Returns:

  • (Array<(ItemResponse, Fixnum, Hash)>)

    ItemResponse data, response status code and response headers



355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
# File 'lib/ultracart_api/api/item_api.rb', line 355

def insert_item_with_http_info(item, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ItemApi.insert_item ...'
  end
  # verify the required parameter 'item' is set
  if @api_client.config.client_side_validation && item.nil?
    fail ArgumentError, "Missing the required parameter 'item' when calling ItemApi.insert_item"
  end
  # resource path
  local_var_path = '/item/items'

  # query parameters
  query_params = {}
  query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil?
  query_params[:'_placeholders'] = opts[:'_placeholders'] if !opts[:'_placeholders'].nil?

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=UTF-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(item)
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ItemResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ItemApi#insert_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_item(item, merchant_item_oid, opts = {}) ⇒ ItemResponse

Update an item Update a new item on the UltraCart account.

Parameters:

  • item

    Item to update

  • merchant_item_oid

    The item oid to update.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

  • :_placeholders (BOOLEAN)

    Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.

Returns:



405
406
407
408
# File 'lib/ultracart_api/api/item_api.rb', line 405

def update_item(item, merchant_item_oid, opts = {})
  data, _status_code, _headers = update_item_with_http_info(item, merchant_item_oid, opts)
  data
end

#update_item_with_http_info(item, merchant_item_oid, opts = {}) ⇒ Array<(ItemResponse, Fixnum, Hash)>

Update an item Update a new item on the UltraCart account.

Parameters:

  • item

    Item to update

  • merchant_item_oid

    The item oid to update.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

  • :_placeholders (BOOLEAN)

    Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.

Returns:

  • (Array<(ItemResponse, Fixnum, Hash)>)

    ItemResponse data, response status code and response headers



418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
# File 'lib/ultracart_api/api/item_api.rb', line 418

def update_item_with_http_info(item, merchant_item_oid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ItemApi.update_item ...'
  end
  # verify the required parameter 'item' is set
  if @api_client.config.client_side_validation && item.nil?
    fail ArgumentError, "Missing the required parameter 'item' when calling ItemApi.update_item"
  end
  # verify the required parameter 'merchant_item_oid' is set
  if @api_client.config.client_side_validation && merchant_item_oid.nil?
    fail ArgumentError, "Missing the required parameter 'merchant_item_oid' when calling ItemApi.update_item"
  end
  # resource path
  local_var_path = '/item/items/{merchant_item_oid}'.sub('{' + 'merchant_item_oid' + '}', merchant_item_oid.to_s)

  # query parameters
  query_params = {}
  query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil?
  query_params[:'_placeholders'] = opts[:'_placeholders'] if !opts[:'_placeholders'].nil?

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=UTF-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(item)
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ItemResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ItemApi#update_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_items(items_request, opts = {}) ⇒ ItemsResponse

Update multiple items Update multiple item on the UltraCart account.

Parameters:

  • items_request

    Items to update (synchronous maximum 20 / asynchronous maximum 100)

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

  • :_placeholders (BOOLEAN)

    Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.

  • :_async (BOOLEAN)

    True if the operation should be run async. No result returned

Returns:



472
473
474
475
# File 'lib/ultracart_api/api/item_api.rb', line 472

def update_items(items_request, opts = {})
  data, _status_code, _headers = update_items_with_http_info(items_request, opts)
  data
end

#update_items_with_http_info(items_request, opts = {}) ⇒ Array<(ItemsResponse, Fixnum, Hash)>

Update multiple items Update multiple item on the UltraCart account.

Parameters:

  • items_request

    Items to update (synchronous maximum 20 / asynchronous maximum 100)

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

  • :_placeholders (BOOLEAN)

    Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.

  • :_async (BOOLEAN)

    True if the operation should be run async. No result returned

Returns:

  • (Array<(ItemsResponse, Fixnum, Hash)>)

    ItemsResponse data, response status code and response headers



485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
# File 'lib/ultracart_api/api/item_api.rb', line 485

def update_items_with_http_info(items_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ItemApi.update_items ...'
  end
  # verify the required parameter 'items_request' is set
  if @api_client.config.client_side_validation && items_request.nil?
    fail ArgumentError, "Missing the required parameter 'items_request' when calling ItemApi.update_items"
  end
  # resource path
  local_var_path = '/item/items/batch'

  # query parameters
  query_params = {}
  query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil?
  query_params[:'_placeholders'] = opts[:'_placeholders'] if !opts[:'_placeholders'].nil?
  query_params[:'_async'] = opts[:'_async'] if !opts[:'_async'].nil?

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=UTF-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(items_request)
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ItemsResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ItemApi#update_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#upload_temporary_multimedia(file, opts = {}) ⇒ TempMultimediaResponse

Upload an image to the temporary multimedia. Uploads an image and returns back meta information about the image as well as the identifier needed for the item update.

Parameters:

  • file

    File to upload

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



533
534
535
536
# File 'lib/ultracart_api/api/item_api.rb', line 533

def upload_temporary_multimedia(file, opts = {})
  data, _status_code, _headers = upload_temporary_multimedia_with_http_info(file, opts)
  data
end

#upload_temporary_multimedia_with_http_info(file, opts = {}) ⇒ Array<(TempMultimediaResponse, Fixnum, Hash)>

Upload an image to the temporary multimedia. Uploads an image and returns back meta information about the image as well as the identifier needed for the item update.

Parameters:

  • file

    File to upload

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(TempMultimediaResponse, Fixnum, Hash)>)

    TempMultimediaResponse data, response status code and response headers



543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
# File 'lib/ultracart_api/api/item_api.rb', line 543

def upload_temporary_multimedia_with_http_info(file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ItemApi.upload_temporary_multimedia ...'
  end
  # verify the required parameter 'file' is set
  if @api_client.config.client_side_validation && file.nil?
    fail ArgumentError, "Missing the required parameter 'file' when calling ItemApi.upload_temporary_multimedia"
  end
  # resource path
  local_var_path = '/item/temp_multimedia'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])

  # form parameters
  form_params = {}
  form_params['file'] = file

  # http body (model)
  post_body = nil
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'TempMultimediaResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ItemApi#upload_temporary_multimedia\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end