Class: OrderCloud::ProductApi

Inherits:
Object
  • Object
show all
Defined in:
lib/order_cloud/api/product_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ProductApi

Returns a new instance of ProductApi.



30
31
32
# File 'lib/order_cloud/api/product_api.rb', line 30

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



28
29
30
# File 'lib/order_cloud/api/product_api.rb', line 28

def api_client
  @api_client
end

Instance Method Details

#create(product, opts = {}) ⇒ Product

Parameters:

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

    the optional parameters

Returns:



39
40
41
42
# File 'lib/order_cloud/api/product_api.rb', line 39

def create(product, opts = {})
  data, _status_code, _headers = create_with_http_info(product, opts)
  return data
end

#create_with_http_info(product, opts = {}) ⇒ Array<(Product, Fixnum, Hash)>

Returns Product data, response status code and response headers.

Parameters:

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

    the optional parameters

Returns:

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

    Product data, response status code and response headers



49
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
89
# File 'lib/order_cloud/api/product_api.rb', line 49

def create_with_http_info(product, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ProductApi.create ..."
  end
  # verify the required parameter 'product' is set
  fail ArgumentError, "Missing the required parameter 'product' when calling ProductApi.create" if product.nil?
  # resource path
  local_var_path = "/products".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(product)
  auth_names = ['oauth2']
  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 => 'Product')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete(product_id, opts = {}) ⇒ nil

Parameters:

  • product_id

    ID of the product.

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

    the optional parameters

Returns:

  • (nil)


96
97
98
99
# File 'lib/order_cloud/api/product_api.rb', line 96

def delete(product_id, opts = {})
  delete_with_http_info(product_id, opts)
  return nil
end

#delete_assignment(product_id, buyer_id, opts = {}) ⇒ nil

Parameters:

  • product_id

    ID of the product.

  • buyer_id

    ID of the buyer.

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

    the optional parameters

Options Hash (opts):

  • :user_id (String)

    ID of the user.

  • :user_group_id (String)

    ID of the user group.

Returns:

  • (nil)


155
156
157
158
# File 'lib/order_cloud/api/product_api.rb', line 155

def delete_assignment(product_id, buyer_id, opts = {})
  delete_assignment_with_http_info(product_id, buyer_id, opts)
  return nil
end

#delete_assignment_with_http_info(product_id, buyer_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Returns nil, response status code and response headers.

Parameters:

  • product_id

    ID of the product.

  • buyer_id

    ID of the buyer.

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

    the optional parameters

Options Hash (opts):

  • :user_id (String)

    ID of the user.

  • :user_group_id (String)

    ID of the user group.

Returns:

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

    nil, response status code and response headers



168
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
211
# File 'lib/order_cloud/api/product_api.rb', line 168

def delete_assignment_with_http_info(product_id, buyer_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ProductApi.delete_assignment ..."
  end
  # verify the required parameter 'product_id' is set
  fail ArgumentError, "Missing the required parameter 'product_id' when calling ProductApi.delete_assignment" if product_id.nil?
  # verify the required parameter 'buyer_id' is set
  fail ArgumentError, "Missing the required parameter 'buyer_id' when calling ProductApi.delete_assignment" if buyer_id.nil?
  # resource path
  local_var_path = "/products/{productID}/assignments/{buyerID}".sub('{format}','json').sub('{' + 'productID' + '}', product_id.to_s).sub('{' + 'buyerID' + '}', buyer_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'userID'] = opts[:'user_id'] if !opts[:'user_id'].nil?
  query_params[:'userGroupID'] = opts[:'user_group_id'] if !opts[:'user_group_id'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  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: ProductApi#delete_assignment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_with_http_info(product_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Returns nil, response status code and response headers.

Parameters:

  • product_id

    ID of the product.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



106
107
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
# File 'lib/order_cloud/api/product_api.rb', line 106

def delete_with_http_info(product_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ProductApi.delete ..."
  end
  # verify the required parameter 'product_id' is set
  fail ArgumentError, "Missing the required parameter 'product_id' when calling ProductApi.delete" if product_id.nil?
  # resource path
  local_var_path = "/products/{productID}".sub('{format}','json').sub('{' + 'productID' + '}', product_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  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: ProductApi#delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#generate_variants(product_id, opts = {}) ⇒ Product

Parameters:

  • product_id

    ID of the product.

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

    the optional parameters

Options Hash (opts):

  • :overwrite_existing (BOOLEAN)

    Overwrite existing of the product.

Returns:



219
220
221
222
# File 'lib/order_cloud/api/product_api.rb', line 219

def generate_variants(product_id, opts = {})
  data, _status_code, _headers = generate_variants_with_http_info(product_id, opts)
  return data
end

#generate_variants_with_http_info(product_id, opts = {}) ⇒ Array<(Product, Fixnum, Hash)>

Returns Product data, response status code and response headers.

Parameters:

  • product_id

    ID of the product.

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

    the optional parameters

Options Hash (opts):

  • :overwrite_existing (BOOLEAN)

    Overwrite existing of the product.

Returns:

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

    Product data, response status code and response headers



230
231
232
233
234
235
236
237
238
239
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
# File 'lib/order_cloud/api/product_api.rb', line 230

def generate_variants_with_http_info(product_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ProductApi.generate_variants ..."
  end
  # verify the required parameter 'product_id' is set
  fail ArgumentError, "Missing the required parameter 'product_id' when calling ProductApi.generate_variants" if product_id.nil?
  # resource path
  local_var_path = "/products/{productID}/variants/generate".sub('{format}','json').sub('{' + 'productID' + '}', product_id.to_s)

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

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  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 => 'Product')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductApi#generate_variants\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get(product_id, opts = {}) ⇒ Product

Parameters:

  • product_id

    ID of the product.

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

    the optional parameters

Returns:



278
279
280
281
# File 'lib/order_cloud/api/product_api.rb', line 278

def get(product_id, opts = {})
  data, _status_code, _headers = get_with_http_info(product_id, opts)
  return data
end

#get_variant(product_id, variant_id, opts = {}) ⇒ Variant

Parameters:

  • product_id

    ID of the product.

  • variant_id

    ID of the variant.

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

    the optional parameters

Returns:



336
337
338
339
# File 'lib/order_cloud/api/product_api.rb', line 336

def get_variant(product_id, variant_id, opts = {})
  data, _status_code, _headers = get_variant_with_http_info(product_id, variant_id, opts)
  return data
end

#get_variant_with_http_info(product_id, variant_id, opts = {}) ⇒ Array<(Variant, Fixnum, Hash)>

Returns Variant data, response status code and response headers.

Parameters:

  • product_id

    ID of the product.

  • variant_id

    ID of the variant.

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

    the optional parameters

Returns:

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

    Variant data, response status code and response headers



347
348
349
350
351
352
353
354
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
# File 'lib/order_cloud/api/product_api.rb', line 347

def get_variant_with_http_info(product_id, variant_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ProductApi.get_variant ..."
  end
  # verify the required parameter 'product_id' is set
  fail ArgumentError, "Missing the required parameter 'product_id' when calling ProductApi.get_variant" if product_id.nil?
  # verify the required parameter 'variant_id' is set
  fail ArgumentError, "Missing the required parameter 'variant_id' when calling ProductApi.get_variant" if variant_id.nil?
  # resource path
  local_var_path = "/products/{productID}/variants/{variantID}".sub('{format}','json').sub('{' + 'productID' + '}', product_id.to_s).sub('{' + 'variantID' + '}', variant_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  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 => 'Variant')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductApi#get_variant\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_with_http_info(product_id, opts = {}) ⇒ Array<(Product, Fixnum, Hash)>

Returns Product data, response status code and response headers.

Parameters:

  • product_id

    ID of the product.

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

    the optional parameters

Returns:

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

    Product data, response status code and response headers



288
289
290
291
292
293
294
295
296
297
298
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
# File 'lib/order_cloud/api/product_api.rb', line 288

def get_with_http_info(product_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ProductApi.get ..."
  end
  # verify the required parameter 'product_id' is set
  fail ArgumentError, "Missing the required parameter 'product_id' when calling ProductApi.get" if product_id.nil?
  # resource path
  local_var_path = "/products/{productID}".sub('{format}','json').sub('{' + 'productID' + '}', product_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  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 => 'Product')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductApi#get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list(opts = {}) ⇒ ListProduct

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :catalog_id (String)

    ID of the catalog.

  • :category_id (String)

    ID of the category.

  • :supplier_id (String)

    ID of the supplier.

  • :search (String)

    Search of the product.

  • :search_on (Array<String>)

    Search on of the product.

  • :sort_by (Array<String>)

    Sort by of the product.

  • :page (Integer)

    Page of the product.

  • :page_size (Integer)

    Page size of the product.

  • :filters (Hash<String, String>)

    Filters of the product.

Returns:



404
405
406
407
# File 'lib/order_cloud/api/product_api.rb', line 404

def list(opts = {})
  data, _status_code, _headers = list_with_http_info(opts)
  return data
end

#list_assignments(opts = {}) ⇒ ListProductAssignment

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :product_id (String)

    ID of the product.

  • :price_schedule_id (String)

    ID of the price schedule.

  • :buyer_id (String)

    ID of the buyer.

  • :user_id (String)

    ID of the user.

  • :user_group_id (String)

    ID of the user group.

  • :level (String)

    Level of the product.

  • :page (Integer)

    Page of the product.

  • :page_size (Integer)

    Page size of the product.

Returns:



483
484
485
486
# File 'lib/order_cloud/api/product_api.rb', line 483

def list_assignments(opts = {})
  data, _status_code, _headers = list_assignments_with_http_info(opts)
  return data
end

#list_assignments_with_http_info(opts = {}) ⇒ Array<(ListProductAssignment, Fixnum, Hash)>

Returns ListProductAssignment data, response status code and response headers.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :product_id (String)

    ID of the product.

  • :price_schedule_id (String)

    ID of the price schedule.

  • :buyer_id (String)

    ID of the buyer.

  • :user_id (String)

    ID of the user.

  • :user_group_id (String)

    ID of the user group.

  • :level (String)

    Level of the product.

  • :page (Integer)

    Page of the product.

  • :page_size (Integer)

    Page size of the product.

Returns:

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

    ListProductAssignment data, response status code and response headers



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
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
# File 'lib/order_cloud/api/product_api.rb', line 500

def list_assignments_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ProductApi.list_assignments ..."
  end
  # resource path
  local_var_path = "/products/assignments".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'productID'] = opts[:'product_id'] if !opts[:'product_id'].nil?
  query_params[:'priceScheduleID'] = opts[:'price_schedule_id'] if !opts[:'price_schedule_id'].nil?
  query_params[:'buyerID'] = opts[:'buyer_id'] if !opts[:'buyer_id'].nil?
  query_params[:'userID'] = opts[:'user_id'] if !opts[:'user_id'].nil?
  query_params[:'userGroupID'] = opts[:'user_group_id'] if !opts[:'user_group_id'].nil?
  query_params[:'level'] = opts[:'level'] if !opts[:'level'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  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 => 'ListProductAssignment')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductApi#list_assignments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_suppliers(product_id, opts = {}) ⇒ ListSupplier

Parameters:

  • product_id

    ID of the product.

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

    the optional parameters

Options Hash (opts):

  • :search (String)

    Search of the product.

  • :search_on (Array<String>)

    Search on of the product.

  • :sort_by (Array<String>)

    Sort by of the product.

  • :page (Integer)

    Page of the product.

  • :page_size (Integer)

    Page size of the product.

  • :filters (Hash<String, String>)

    Filters of the product.

Returns:



559
560
561
562
# File 'lib/order_cloud/api/product_api.rb', line 559

def list_suppliers(product_id, opts = {})
  data, _status_code, _headers = list_suppliers_with_http_info(product_id, opts)
  return data
end

#list_suppliers_with_http_info(product_id, opts = {}) ⇒ Array<(ListSupplier, Fixnum, Hash)>

Returns ListSupplier data, response status code and response headers.

Parameters:

  • product_id

    ID of the product.

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

    the optional parameters

Options Hash (opts):

  • :search (String)

    Search of the product.

  • :search_on (Array<String>)

    Search on of the product.

  • :sort_by (Array<String>)

    Sort by of the product.

  • :page (Integer)

    Page of the product.

  • :page_size (Integer)

    Page size of the product.

  • :filters (Hash<String, String>)

    Filters of the product.

Returns:

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

    ListSupplier data, response status code and response headers



575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
# File 'lib/order_cloud/api/product_api.rb', line 575

def list_suppliers_with_http_info(product_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ProductApi.list_suppliers ..."
  end
  # verify the required parameter 'product_id' is set
  fail ArgumentError, "Missing the required parameter 'product_id' when calling ProductApi.list_suppliers" if product_id.nil?
  # resource path
  local_var_path = "/products/{productID}/suppliers".sub('{format}','json').sub('{' + 'productID' + '}', product_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
  query_params[:'searchOn'] = @api_client.build_collection_param(opts[:'search_on'], :csv) if !opts[:'search_on'].nil?
  query_params[:'sortBy'] = @api_client.build_collection_param(opts[:'sort_by'], :csv) if !opts[:'sort_by'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'filters'] = opts[:'filters'] if !opts[:'filters'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  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 => 'ListSupplier')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductApi#list_suppliers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_variants(product_id, opts = {}) ⇒ ListVariant

Parameters:

  • product_id

    ID of the product.

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

    the optional parameters

Options Hash (opts):

  • :search (String)

    Search of the product.

  • :search_on (Array<String>)

    Search on of the product.

  • :sort_by (Array<String>)

    Sort by of the product.

  • :page (Integer)

    Page of the product.

  • :page_size (Integer)

    Page size of the product.

  • :filters (Hash<String, String>)

    Filters of the product.

Returns:



634
635
636
637
# File 'lib/order_cloud/api/product_api.rb', line 634

def list_variants(product_id, opts = {})
  data, _status_code, _headers = list_variants_with_http_info(product_id, opts)
  return data
end

#list_variants_with_http_info(product_id, opts = {}) ⇒ Array<(ListVariant, Fixnum, Hash)>

Returns ListVariant data, response status code and response headers.

Parameters:

  • product_id

    ID of the product.

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

    the optional parameters

Options Hash (opts):

  • :search (String)

    Search of the product.

  • :search_on (Array<String>)

    Search on of the product.

  • :sort_by (Array<String>)

    Sort by of the product.

  • :page (Integer)

    Page of the product.

  • :page_size (Integer)

    Page size of the product.

  • :filters (Hash<String, String>)

    Filters of the product.

Returns:

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

    ListVariant data, response status code and response headers



650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
# File 'lib/order_cloud/api/product_api.rb', line 650

def list_variants_with_http_info(product_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ProductApi.list_variants ..."
  end
  # verify the required parameter 'product_id' is set
  fail ArgumentError, "Missing the required parameter 'product_id' when calling ProductApi.list_variants" if product_id.nil?
  # resource path
  local_var_path = "/products/{productID}/variants".sub('{format}','json').sub('{' + 'productID' + '}', product_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
  query_params[:'searchOn'] = @api_client.build_collection_param(opts[:'search_on'], :csv) if !opts[:'search_on'].nil?
  query_params[:'sortBy'] = @api_client.build_collection_param(opts[:'sort_by'], :csv) if !opts[:'sort_by'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'filters'] = opts[:'filters'] if !opts[:'filters'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  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 => 'ListVariant')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductApi#list_variants\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_with_http_info(opts = {}) ⇒ Array<(ListProduct, Fixnum, Hash)>

Returns ListProduct data, response status code and response headers.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :catalog_id (String)

    ID of the catalog.

  • :category_id (String)

    ID of the category.

  • :supplier_id (String)

    ID of the supplier.

  • :search (String)

    Search of the product.

  • :search_on (Array<String>)

    Search on of the product.

  • :sort_by (Array<String>)

    Sort by of the product.

  • :page (Integer)

    Page of the product.

  • :page_size (Integer)

    Page size of the product.

  • :filters (Hash<String, String>)

    Filters of the product.

Returns:

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

    ListProduct data, response status code and response headers



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
464
465
466
467
468
469
# File 'lib/order_cloud/api/product_api.rb', line 422

def list_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ProductApi.list ..."
  end
  # resource path
  local_var_path = "/products".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'catalogID'] = opts[:'catalog_id'] if !opts[:'catalog_id'].nil?
  query_params[:'categoryID'] = opts[:'category_id'] if !opts[:'category_id'].nil?
  query_params[:'supplierID'] = opts[:'supplier_id'] if !opts[:'supplier_id'].nil?
  query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
  query_params[:'searchOn'] = @api_client.build_collection_param(opts[:'search_on'], :csv) if !opts[:'search_on'].nil?
  query_params[:'sortBy'] = @api_client.build_collection_param(opts[:'sort_by'], :csv) if !opts[:'sort_by'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'filters'] = opts[:'filters'] if !opts[:'filters'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  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 => 'ListProduct')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductApi#list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#patch(product_id, product, opts = {}) ⇒ Product

Parameters:

  • product_id

    ID of the product.

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

    the optional parameters

Returns:



704
705
706
707
# File 'lib/order_cloud/api/product_api.rb', line 704

def patch(product_id, product, opts = {})
  data, _status_code, _headers = patch_with_http_info(product_id, product, opts)
  return data
end

#patch_variant(product_id, variant_id, variant, opts = {}) ⇒ Variant

Parameters:

  • product_id

    ID of the product.

  • variant_id

    ID of the variant.

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

    the optional parameters

Returns:



766
767
768
769
# File 'lib/order_cloud/api/product_api.rb', line 766

def patch_variant(product_id, variant_id, variant, opts = {})
  data, _status_code, _headers = patch_variant_with_http_info(product_id, variant_id, variant, opts)
  return data
end

#patch_variant_with_http_info(product_id, variant_id, variant, opts = {}) ⇒ Array<(Variant, Fixnum, Hash)>

Returns Variant data, response status code and response headers.

Parameters:

  • product_id

    ID of the product.

  • variant_id

    ID of the variant.

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

    the optional parameters

Returns:

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

    Variant data, response status code and response headers



778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
# File 'lib/order_cloud/api/product_api.rb', line 778

def patch_variant_with_http_info(product_id, variant_id, variant, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ProductApi.patch_variant ..."
  end
  # verify the required parameter 'product_id' is set
  fail ArgumentError, "Missing the required parameter 'product_id' when calling ProductApi.patch_variant" if product_id.nil?
  # verify the required parameter 'variant_id' is set
  fail ArgumentError, "Missing the required parameter 'variant_id' when calling ProductApi.patch_variant" if variant_id.nil?
  # verify the required parameter 'variant' is set
  fail ArgumentError, "Missing the required parameter 'variant' when calling ProductApi.patch_variant" if variant.nil?
  # resource path
  local_var_path = "/products/{productID}/variants/{variantID}".sub('{format}','json').sub('{' + 'productID' + '}', product_id.to_s).sub('{' + 'variantID' + '}', variant_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(variant)
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Variant')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductApi#patch_variant\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#patch_with_http_info(product_id, product, opts = {}) ⇒ Array<(Product, Fixnum, Hash)>

Returns Product data, response status code and response headers.

Parameters:

  • product_id

    ID of the product.

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

    the optional parameters

Returns:

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

    Product data, response status code and response headers



715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
# File 'lib/order_cloud/api/product_api.rb', line 715

def patch_with_http_info(product_id, product, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ProductApi.patch ..."
  end
  # verify the required parameter 'product_id' is set
  fail ArgumentError, "Missing the required parameter 'product_id' when calling ProductApi.patch" if product_id.nil?
  # verify the required parameter 'product' is set
  fail ArgumentError, "Missing the required parameter 'product' when calling ProductApi.patch" if product.nil?
  # resource path
  local_var_path = "/products/{productID}".sub('{format}','json').sub('{' + 'productID' + '}', product_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(product)
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Product')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductApi#patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#remove_supplier(product_id, supplier_id, opts = {}) ⇒ nil

Parameters:

  • product_id

    ID of the product.

  • supplier_id

    ID of the supplier.

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

    the optional parameters

Returns:

  • (nil)


830
831
832
833
# File 'lib/order_cloud/api/product_api.rb', line 830

def remove_supplier(product_id, supplier_id, opts = {})
  remove_supplier_with_http_info(product_id, supplier_id, opts)
  return nil
end

#remove_supplier_with_http_info(product_id, supplier_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Returns nil, response status code and response headers.

Parameters:

  • product_id

    ID of the product.

  • supplier_id

    ID of the supplier.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
# File 'lib/order_cloud/api/product_api.rb', line 841

def remove_supplier_with_http_info(product_id, supplier_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ProductApi.remove_supplier ..."
  end
  # verify the required parameter 'product_id' is set
  fail ArgumentError, "Missing the required parameter 'product_id' when calling ProductApi.remove_supplier" if product_id.nil?
  # verify the required parameter 'supplier_id' is set
  fail ArgumentError, "Missing the required parameter 'supplier_id' when calling ProductApi.remove_supplier" if supplier_id.nil?
  # resource path
  local_var_path = "/products/{productID}/suppliers/{supplierID}".sub('{format}','json').sub('{' + 'productID' + '}', product_id.to_s).sub('{' + 'supplierID' + '}', supplier_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  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: ProductApi#remove_supplier\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#save_assignment(product_assignment, opts = {}) ⇒ nil

Parameters:

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

    the optional parameters

Returns:

  • (nil)


889
890
891
892
# File 'lib/order_cloud/api/product_api.rb', line 889

def save_assignment(product_assignment, opts = {})
  save_assignment_with_http_info(product_assignment, opts)
  return nil
end

#save_assignment_with_http_info(product_assignment, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Returns nil, response status code and response headers.

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
# File 'lib/order_cloud/api/product_api.rb', line 899

def save_assignment_with_http_info(product_assignment, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ProductApi.save_assignment ..."
  end
  # verify the required parameter 'product_assignment' is set
  fail ArgumentError, "Missing the required parameter 'product_assignment' when calling ProductApi.save_assignment" if product_assignment.nil?
  # resource path
  local_var_path = "/products/assignments".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(product_assignment)
  auth_names = ['oauth2']
  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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductApi#save_assignment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#save_supplier(product_id, supplier_id, opts = {}) ⇒ nil

Parameters:

  • product_id

    ID of the product.

  • supplier_id

    ID of the supplier.

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

    the optional parameters

Returns:

  • (nil)


946
947
948
949
# File 'lib/order_cloud/api/product_api.rb', line 946

def save_supplier(product_id, supplier_id, opts = {})
  save_supplier_with_http_info(product_id, supplier_id, opts)
  return nil
end

#save_supplier_with_http_info(product_id, supplier_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Returns nil, response status code and response headers.

Parameters:

  • product_id

    ID of the product.

  • supplier_id

    ID of the supplier.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
# File 'lib/order_cloud/api/product_api.rb', line 957

def save_supplier_with_http_info(product_id, supplier_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ProductApi.save_supplier ..."
  end
  # verify the required parameter 'product_id' is set
  fail ArgumentError, "Missing the required parameter 'product_id' when calling ProductApi.save_supplier" if product_id.nil?
  # verify the required parameter 'supplier_id' is set
  fail ArgumentError, "Missing the required parameter 'supplier_id' when calling ProductApi.save_supplier" if supplier_id.nil?
  # resource path
  local_var_path = "/products/{productID}/suppliers/{supplierID}".sub('{format}','json').sub('{' + 'productID' + '}', product_id.to_s).sub('{' + 'supplierID' + '}', supplier_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductApi#save_supplier\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update(product_id, product, opts = {}) ⇒ Product

Parameters:

  • product_id

    ID of the product.

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

    the optional parameters

Returns:



1006
1007
1008
1009
# File 'lib/order_cloud/api/product_api.rb', line 1006

def update(product_id, product, opts = {})
  data, _status_code, _headers = update_with_http_info(product_id, product, opts)
  return data
end

#update_variant(product_id, variant_id, variant, opts = {}) ⇒ Variant

Parameters:

  • product_id

    ID of the product.

  • variant_id

    ID of the variant.

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

    the optional parameters

Returns:



1068
1069
1070
1071
# File 'lib/order_cloud/api/product_api.rb', line 1068

def update_variant(product_id, variant_id, variant, opts = {})
  data, _status_code, _headers = update_variant_with_http_info(product_id, variant_id, variant, opts)
  return data
end

#update_variant_with_http_info(product_id, variant_id, variant, opts = {}) ⇒ Array<(Variant, Fixnum, Hash)>

Returns Variant data, response status code and response headers.

Parameters:

  • product_id

    ID of the product.

  • variant_id

    ID of the variant.

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

    the optional parameters

Returns:

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

    Variant data, response status code and response headers



1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
# File 'lib/order_cloud/api/product_api.rb', line 1080

def update_variant_with_http_info(product_id, variant_id, variant, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ProductApi.update_variant ..."
  end
  # verify the required parameter 'product_id' is set
  fail ArgumentError, "Missing the required parameter 'product_id' when calling ProductApi.update_variant" if product_id.nil?
  # verify the required parameter 'variant_id' is set
  fail ArgumentError, "Missing the required parameter 'variant_id' when calling ProductApi.update_variant" if variant_id.nil?
  # verify the required parameter 'variant' is set
  fail ArgumentError, "Missing the required parameter 'variant' when calling ProductApi.update_variant" if variant.nil?
  # resource path
  local_var_path = "/products/{productID}/variants/{variantID}".sub('{format}','json').sub('{' + 'productID' + '}', product_id.to_s).sub('{' + 'variantID' + '}', variant_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(variant)
  auth_names = ['oauth2']
  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 => 'Variant')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductApi#update_variant\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_with_http_info(product_id, product, opts = {}) ⇒ Array<(Product, Fixnum, Hash)>

Returns Product data, response status code and response headers.

Parameters:

  • product_id

    ID of the product.

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

    the optional parameters

Returns:

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

    Product data, response status code and response headers



1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
# File 'lib/order_cloud/api/product_api.rb', line 1017

def update_with_http_info(product_id, product, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ProductApi.update ..."
  end
  # verify the required parameter 'product_id' is set
  fail ArgumentError, "Missing the required parameter 'product_id' when calling ProductApi.update" if product_id.nil?
  # verify the required parameter 'product' is set
  fail ArgumentError, "Missing the required parameter 'product' when calling ProductApi.update" if product.nil?
  # resource path
  local_var_path = "/products/{productID}".sub('{format}','json').sub('{' + 'productID' + '}', product_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(product)
  auth_names = ['oauth2']
  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 => 'Product')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductApi#update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end