Class: OrderCloud::ProductApi
- Inherits:
-
Object
- Object
- OrderCloud::ProductApi
- Defined in:
- lib/order_cloud/api/product_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
- #create(product, opts = {}) ⇒ Product
-
#create_with_http_info(product, opts = {}) ⇒ Array<(Product, Fixnum, Hash)>
Product data, response status code and response headers.
- #delete(product_id, opts = {}) ⇒ nil
- #delete_assignment(buyer_id, product_id, opts = {}) ⇒ nil
-
#delete_assignment_with_http_info(buyer_id, product_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Nil, response status code and response headers.
-
#delete_with_http_info(product_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Nil, response status code and response headers.
- #generate_variants(product_id, opts = {}) ⇒ Product
-
#generate_variants_with_http_info(product_id, opts = {}) ⇒ Array<(Product, Fixnum, Hash)>
Product data, response status code and response headers.
- #get(product_id, opts = {}) ⇒ Product
- #get_inventory(product_id, opts = {}) ⇒ Inventory
-
#get_inventory_with_http_info(product_id, opts = {}) ⇒ Array<(Inventory, Fixnum, Hash)>
Inventory data, response status code and response headers.
- #get_variant(product_id, variant_id, opts = {}) ⇒ Variant
- #get_variant_inventory(product_id, variant_id, opts = {}) ⇒ Inventory
-
#get_variant_inventory_with_http_info(product_id, variant_id, opts = {}) ⇒ Array<(Inventory, Fixnum, Hash)>
Inventory data, response status code and response headers.
-
#get_variant_with_http_info(product_id, variant_id, opts = {}) ⇒ Array<(Variant, Fixnum, Hash)>
Variant data, response status code and response headers.
-
#get_with_http_info(product_id, opts = {}) ⇒ Array<(Product, Fixnum, Hash)>
Product data, response status code and response headers.
-
#initialize(api_client = ApiClient.default) ⇒ ProductApi
constructor
A new instance of ProductApi.
- #list(opts = {}) ⇒ ListProduct
- #list_assignments(opts = {}) ⇒ ListProductAssignment
-
#list_assignments_with_http_info(opts = {}) ⇒ Array<(ListProductAssignment, Fixnum, Hash)>
ListProductAssignment data, response status code and response headers.
- #list_inventory(opts = {}) ⇒ ListInventory
-
#list_inventory_with_http_info(opts = {}) ⇒ Array<(ListInventory, Fixnum, Hash)>
ListInventory data, response status code and response headers.
- #list_variant_inventory(product_id, opts = {}) ⇒ ListInventory
-
#list_variant_inventory_with_http_info(product_id, opts = {}) ⇒ Array<(ListInventory, Fixnum, Hash)>
ListInventory data, response status code and response headers.
- #list_variants(product_id, opts = {}) ⇒ ListVariant
-
#list_variants_with_http_info(product_id, opts = {}) ⇒ Array<(ListVariant, Fixnum, Hash)>
ListVariant data, response status code and response headers.
-
#list_with_http_info(opts = {}) ⇒ Array<(ListProduct, Fixnum, Hash)>
ListProduct data, response status code and response headers.
- #patch(product_id, product, opts = {}) ⇒ nil
- #patch_variant(product_id, variant_id, variant, opts = {}) ⇒ Variant
-
#patch_variant_with_http_info(product_id, variant_id, variant, opts = {}) ⇒ Array<(Variant, Fixnum, Hash)>
Variant data, response status code and response headers.
-
#patch_with_http_info(product_id, product, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Nil, response status code and response headers.
- #save_assignment(product_assignment, opts = {}) ⇒ nil
-
#save_assignment_with_http_info(product_assignment, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Nil, response status code and response headers.
- #update(product_id, product, opts = {}) ⇒ Product
- #update_inventory(product_id, inventory, opts = {}) ⇒ Inventory
-
#update_inventory_with_http_info(product_id, inventory, opts = {}) ⇒ Array<(Inventory, Fixnum, Hash)>
Inventory data, response status code and response headers.
- #update_variant(product_id, variant_id, variant, opts = {}) ⇒ Variant
- #update_variant_inventory(product_id, variant_id, inventory, opts = {}) ⇒ Inventory
-
#update_variant_inventory_with_http_info(product_id, variant_id, inventory, opts = {}) ⇒ Array<(Inventory, Fixnum, Hash)>
Inventory data, response status code and response headers.
-
#update_variant_with_http_info(product_id, variant_id, variant, opts = {}) ⇒ Array<(Variant, Fixnum, Hash)>
Variant data, response status code and response headers.
-
#update_with_http_info(product_id, product, opts = {}) ⇒ Array<(Product, Fixnum, Hash)>
Product data, response status code and response headers.
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_client ⇒ Object
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
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.
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
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(buyer_id, product_id, opts = {}) ⇒ nil
155 156 157 158 |
# File 'lib/order_cloud/api/product_api.rb', line 155 def delete_assignment(buyer_id, product_id, opts = {}) delete_assignment_with_http_info(buyer_id, product_id, opts) return nil end |
#delete_assignment_with_http_info(buyer_id, product_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Returns 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(buyer_id, product_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ProductApi.delete_assignment ..." end # 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? # 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? # resource path local_var_path = "/products/{productID}/assignments/{buyerID}".sub('{format}','json').sub('{' + 'buyerID' + '}', buyer_id.to_s).sub('{' + 'productID' + '}', product_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.
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
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.
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
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_inventory(product_id, opts = {}) ⇒ Inventory
335 336 337 338 |
# File 'lib/order_cloud/api/product_api.rb', line 335 def get_inventory(product_id, opts = {}) data, _status_code, _headers = get_inventory_with_http_info(product_id, opts) return data end |
#get_inventory_with_http_info(product_id, opts = {}) ⇒ Array<(Inventory, Fixnum, Hash)>
Returns Inventory data, response status code and response headers.
345 346 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 |
# File 'lib/order_cloud/api/product_api.rb', line 345 def get_inventory_with_http_info(product_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ProductApi.get_inventory ..." end # verify the required parameter 'product_id' is set fail ArgumentError, "Missing the required parameter 'product_id' when calling ProductApi.get_inventory" if product_id.nil? # resource path local_var_path = "/products/{productID}/inventory".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 => 'Inventory') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProductApi#get_inventory\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_variant(product_id, variant_id, opts = {}) ⇒ Variant
393 394 395 396 |
# File 'lib/order_cloud/api/product_api.rb', line 393 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_inventory(product_id, variant_id, opts = {}) ⇒ Inventory
454 455 456 457 |
# File 'lib/order_cloud/api/product_api.rb', line 454 def get_variant_inventory(product_id, variant_id, opts = {}) data, _status_code, _headers = get_variant_inventory_with_http_info(product_id, variant_id, opts) return data end |
#get_variant_inventory_with_http_info(product_id, variant_id, opts = {}) ⇒ Array<(Inventory, Fixnum, Hash)>
Returns Inventory data, response status code and response headers.
465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 |
# File 'lib/order_cloud/api/product_api.rb', line 465 def get_variant_inventory_with_http_info(product_id, variant_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ProductApi.get_variant_inventory ..." end # verify the required parameter 'product_id' is set fail ArgumentError, "Missing the required parameter 'product_id' when calling ProductApi.get_variant_inventory" 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_inventory" if variant_id.nil? # resource path local_var_path = "/products/{productID}/variants/inventory/{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 => 'Inventory') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProductApi#get_variant_inventory\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_variant_with_http_info(product_id, variant_id, opts = {}) ⇒ Array<(Variant, Fixnum, Hash)>
Returns Variant data, response status code and response headers.
404 405 406 407 408 409 410 411 412 413 414 415 416 417 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 |
# File 'lib/order_cloud/api/product_api.rb', line 404 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.
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
519 520 521 522 |
# File 'lib/order_cloud/api/product_api.rb', line 519 def list(opts = {}) data, _status_code, _headers = list_with_http_info(opts) return data end |
#list_assignments(opts = {}) ⇒ ListProductAssignment
592 593 594 595 |
# File 'lib/order_cloud/api/product_api.rb', line 592 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.
609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 |
# File 'lib/order_cloud/api/product_api.rb', line 609 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[:'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[:'priceScheduleID'] = opts[:'price_schedule_id'] if !opts[:'price_schedule_id'].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_inventory(opts = {}) ⇒ ListInventory
667 668 669 670 |
# File 'lib/order_cloud/api/product_api.rb', line 667 def list_inventory(opts = {}) data, _status_code, _headers = list_inventory_with_http_info(opts) return data end |
#list_inventory_with_http_info(opts = {}) ⇒ Array<(ListInventory, Fixnum, Hash)>
Returns ListInventory data, response status code and response headers.
682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 |
# File 'lib/order_cloud/api/product_api.rb', line 682 def list_inventory_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ProductApi.list_inventory ..." end # resource path local_var_path = "/products/inventory".sub('{format}','json') # query parameters query_params = {} query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil? query_params[:'searchOn'] = opts[:'search_on'] if !opts[:'search_on'].nil? query_params[:'sortBy'] = opts[:'sort_by'] 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 => 'ListInventory') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProductApi#list_inventory\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_variant_inventory(product_id, opts = {}) ⇒ ListInventory
739 740 741 742 |
# File 'lib/order_cloud/api/product_api.rb', line 739 def list_variant_inventory(product_id, opts = {}) data, _status_code, _headers = list_variant_inventory_with_http_info(product_id, opts) return data end |
#list_variant_inventory_with_http_info(product_id, opts = {}) ⇒ Array<(ListInventory, Fixnum, Hash)>
Returns ListInventory data, response status code and response headers.
755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 |
# File 'lib/order_cloud/api/product_api.rb', line 755 def list_variant_inventory_with_http_info(product_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ProductApi.list_variant_inventory ..." end # verify the required parameter 'product_id' is set fail ArgumentError, "Missing the required parameter 'product_id' when calling ProductApi.list_variant_inventory" if product_id.nil? # resource path local_var_path = "/products/{productID}/variants/inventory".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'] = opts[:'search_on'] if !opts[:'search_on'].nil? query_params[:'sortBy'] = opts[:'sort_by'] 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 => 'ListInventory') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProductApi#list_variant_inventory\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_variants(product_id, opts = {}) ⇒ ListVariant
814 815 816 817 |
# File 'lib/order_cloud/api/product_api.rb', line 814 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.
830 831 832 833 834 835 836 837 838 839 840 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 |
# File 'lib/order_cloud/api/product_api.rb', line 830 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'] = opts[:'search_on'] if !opts[:'search_on'].nil? query_params[:'sortBy'] = opts[:'sort_by'] 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.
534 535 536 537 538 539 540 541 542 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 |
# File 'lib/order_cloud/api/product_api.rb', line 534 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[:'search'] = opts[:'search'] if !opts[:'search'].nil? query_params[:'searchOn'] = opts[:'search_on'] if !opts[:'search_on'].nil? query_params[:'sortBy'] = opts[:'sort_by'] 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 = {}) ⇒ nil
884 885 886 887 |
# File 'lib/order_cloud/api/product_api.rb', line 884 def patch(product_id, product, opts = {}) patch_with_http_info(product_id, product, opts) return nil end |
#patch_variant(product_id, variant_id, variant, opts = {}) ⇒ Variant
945 946 947 948 |
# File 'lib/order_cloud/api/product_api.rb', line 945 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.
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 999 1000 1001 |
# File 'lib/order_cloud/api/product_api.rb', line 957 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<(nil, Fixnum, Hash)>
Returns nil, response status code and response headers.
895 896 897 898 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 |
# File 'lib/order_cloud/api/product_api.rb', line 895 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) 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 |
#save_assignment(product_assignment, opts = {}) ⇒ nil
1008 1009 1010 1011 |
# File 'lib/order_cloud/api/product_api.rb', line 1008 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.
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 |
# File 'lib/order_cloud/api/product_api.rb', line 1018 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 |
#update(product_id, product, opts = {}) ⇒ Product
1065 1066 1067 1068 |
# File 'lib/order_cloud/api/product_api.rb', line 1065 def update(product_id, product, opts = {}) data, _status_code, _headers = update_with_http_info(product_id, product, opts) return data end |
#update_inventory(product_id, inventory, opts = {}) ⇒ Inventory
1126 1127 1128 1129 |
# File 'lib/order_cloud/api/product_api.rb', line 1126 def update_inventory(product_id, inventory, opts = {}) data, _status_code, _headers = update_inventory_with_http_info(product_id, inventory, opts) return data end |
#update_inventory_with_http_info(product_id, inventory, opts = {}) ⇒ Array<(Inventory, Fixnum, Hash)>
Returns Inventory data, response status code and response headers.
1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 |
# File 'lib/order_cloud/api/product_api.rb', line 1137 def update_inventory_with_http_info(product_id, inventory, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ProductApi.update_inventory ..." end # verify the required parameter 'product_id' is set fail ArgumentError, "Missing the required parameter 'product_id' when calling ProductApi.update_inventory" if product_id.nil? # verify the required parameter 'inventory' is set fail ArgumentError, "Missing the required parameter 'inventory' when calling ProductApi.update_inventory" if inventory.nil? # resource path local_var_path = "/products/{productID}/inventory/{inventory}".sub('{format}','json').sub('{' + 'productID' + '}', product_id.to_s).sub('{' + 'inventory' + '}', inventory.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, :return_type => 'Inventory') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProductApi#update_inventory\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_variant(product_id, variant_id, variant, opts = {}) ⇒ Variant
1188 1189 1190 1191 |
# File 'lib/order_cloud/api/product_api.rb', line 1188 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_inventory(product_id, variant_id, inventory, opts = {}) ⇒ Inventory
1253 1254 1255 1256 |
# File 'lib/order_cloud/api/product_api.rb', line 1253 def update_variant_inventory(product_id, variant_id, inventory, opts = {}) data, _status_code, _headers = update_variant_inventory_with_http_info(product_id, variant_id, inventory, opts) return data end |
#update_variant_inventory_with_http_info(product_id, variant_id, inventory, opts = {}) ⇒ Array<(Inventory, Fixnum, Hash)>
Returns Inventory data, response status code and response headers.
1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 |
# File 'lib/order_cloud/api/product_api.rb', line 1265 def update_variant_inventory_with_http_info(product_id, variant_id, inventory, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ProductApi.update_variant_inventory ..." end # verify the required parameter 'product_id' is set fail ArgumentError, "Missing the required parameter 'product_id' when calling ProductApi.update_variant_inventory" 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_inventory" if variant_id.nil? # verify the required parameter 'inventory' is set fail ArgumentError, "Missing the required parameter 'inventory' when calling ProductApi.update_variant_inventory" if inventory.nil? # resource path local_var_path = "/products/{productID}/variants/inventory/{variantID}/{inventory}".sub('{format}','json').sub('{' + 'productID' + '}', product_id.to_s).sub('{' + 'variantID' + '}', variant_id.to_s).sub('{' + 'inventory' + '}', inventory.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, :return_type => 'Inventory') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProductApi#update_variant_inventory\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers 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.
1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 |
# File 'lib/order_cloud/api/product_api.rb', line 1200 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.
1076 1077 1078 1079 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 |
# File 'lib/order_cloud/api/product_api.rb', line 1076 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 |