class OrderCloud::ProductApi
Attributes
Public Class Methods
# File lib/order_cloud/api/product_api.rb, line 30 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
@param product @param [Hash] opts the optional parameters @return [Product]
# 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
@param product @param [Hash] opts the optional parameters @return [Array<(Product
, Fixnum, Hash)>] Product
data, response status code and response headers
# 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
@param product_id ID of the product. @param [Hash] opts the optional parameters @return [nil]
# 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
@param product_id ID of the product. @param buyer_id ID of the buyer. @param [Hash] opts the optional parameters @option opts [String] :user_id ID of the user. @option opts [String] :user_group_id ID of the user group. @return [nil]
# 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
@param product_id ID of the product. @param buyer_id ID of the buyer. @param [Hash] opts the optional parameters @option opts [String] :user_id ID of the user. @option opts [String] :user_group_id ID of the user group. @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# 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
@param product_id ID of the product. @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# 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
@param product_id ID of the product. @param [Hash] opts the optional parameters @option opts [BOOLEAN] :overwrite_existing Overwrite existing of the product. @return [Product]
# 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
@param product_id ID of the product. @param [Hash] opts the optional parameters @option opts [BOOLEAN] :overwrite_existing Overwrite existing of the product. @return [Array<(Product
, Fixnum, Hash)>] Product
data, response status code and response headers
# 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
@param product_id ID of the product. @param [Hash] opts the optional parameters @return [Product]
# 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
@param product_id ID of the product. @param variant_id ID of the variant. @param [Hash] opts the optional parameters @return [Variant]
# 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
@param product_id ID of the product. @param variant_id ID of the variant. @param [Hash] opts the optional parameters @return [Array<(Variant
, Fixnum, Hash)>] Variant
data, response status code and response headers
# 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
@param product_id ID of the product. @param [Hash] opts the optional parameters @return [Array<(Product
, Fixnum, Hash)>] Product
data, response status code and response headers
# 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
@param [Hash] opts the optional parameters @option opts [String] :catalog_id ID of the catalog. @option opts [String] :category_id ID of the category. @option opts [String] :supplier_id ID of the supplier. @option opts [String] :search Search of the product. @option opts [Array<String>] :search_on Search on of the product. @option opts [Array<String>] :sort_by Sort by of the product. @option opts [Integer] :page Page of the product. @option opts [Integer] :page_size Page size of the product. @option opts [Hash<String, String>] :filters Filters of the product. @return [ListProduct]
# 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
@param [Hash] opts the optional parameters @option opts [String] :product_id ID of the product. @option opts [String] :price_schedule_id ID of the price schedule. @option opts [String] :buyer_id ID of the buyer. @option opts [String] :user_id ID of the user. @option opts [String] :user_group_id ID of the user group. @option opts [String] :level Level of the product. @option opts [Integer] :page Page of the product. @option opts [Integer] :page_size Page size of the product. @return [ListProductAssignment]
# 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
@param [Hash] opts the optional parameters @option opts [String] :product_id ID of the product. @option opts [String] :price_schedule_id ID of the price schedule. @option opts [String] :buyer_id ID of the buyer. @option opts [String] :user_id ID of the user. @option opts [String] :user_group_id ID of the user group. @option opts [String] :level Level of the product. @option opts [Integer] :page Page of the product. @option opts [Integer] :page_size Page size of the product. @return [Array<(ListProductAssignment
, Fixnum, Hash)>] ListProductAssignment
data, response status code and response headers
# 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
@param product_id ID of the product. @param [Hash] opts the optional parameters @option opts [String] :search Search of the product. @option opts [Array<String>] :search_on Search on of the product. @option opts [Array<String>] :sort_by Sort by of the product. @option opts [Integer] :page Page of the product. @option opts [Integer] :page_size Page size of the product. @option opts [Hash<String, String>] :filters Filters of the product. @return [ListSupplier]
# 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
@param product_id ID of the product. @param [Hash] opts the optional parameters @option opts [String] :search Search of the product. @option opts [Array<String>] :search_on Search on of the product. @option opts [Array<String>] :sort_by Sort by of the product. @option opts [Integer] :page Page of the product. @option opts [Integer] :page_size Page size of the product. @option opts [Hash<String, String>] :filters Filters of the product. @return [Array<(ListSupplier
, Fixnum, Hash)>] ListSupplier
data, response status code and response headers
# 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
@param product_id ID of the product. @param [Hash] opts the optional parameters @option opts [String] :search Search of the product. @option opts [Array<String>] :search_on Search on of the product. @option opts [Array<String>] :sort_by Sort by of the product. @option opts [Integer] :page Page of the product. @option opts [Integer] :page_size Page size of the product. @option opts [Hash<String, String>] :filters Filters of the product. @return [ListVariant]
# 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
@param product_id ID of the product. @param [Hash] opts the optional parameters @option opts [String] :search Search of the product. @option opts [Array<String>] :search_on Search on of the product. @option opts [Array<String>] :sort_by Sort by of the product. @option opts [Integer] :page Page of the product. @option opts [Integer] :page_size Page size of the product. @option opts [Hash<String, String>] :filters Filters of the product. @return [Array<(ListVariant
, Fixnum, Hash)>] ListVariant
data, response status code and response headers
# 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
@param [Hash] opts the optional parameters @option opts [String] :catalog_id ID of the catalog. @option opts [String] :category_id ID of the category. @option opts [String] :supplier_id ID of the supplier. @option opts [String] :search Search of the product. @option opts [Array<String>] :search_on Search on of the product. @option opts [Array<String>] :sort_by Sort by of the product. @option opts [Integer] :page Page of the product. @option opts [Integer] :page_size Page size of the product. @option opts [Hash<String, String>] :filters Filters of the product. @return [Array<(ListProduct
, Fixnum, Hash)>] ListProduct
data, response status code and response headers
# 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
@param product_id ID of the product. @param product @param [Hash] opts the optional parameters @return [Product]
# 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
@param product_id ID of the product. @param variant_id ID of the variant. @param variant @param [Hash] opts the optional parameters @return [Variant]
# 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
@param product_id ID of the product. @param variant_id ID of the variant. @param variant @param [Hash] opts the optional parameters @return [Array<(Variant
, Fixnum, Hash)>] Variant
data, response status code and response headers
# 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
@param product_id ID of the product. @param product @param [Hash] opts the optional parameters @return [Array<(Product
, Fixnum, Hash)>] Product
data, response status code and response headers
# 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
@param product_id ID of the product. @param supplier_id ID of the supplier. @param [Hash] opts the optional parameters @return [nil]
# 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
@param product_id ID of the product. @param supplier_id ID of the supplier. @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# 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
@param product_assignment @param [Hash] opts the optional parameters @return [nil]
# 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
@param product_assignment @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# 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
@param product_id ID of the product. @param supplier_id ID of the supplier. @param [Hash] opts the optional parameters @return [nil]
# 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
@param product_id ID of the product. @param supplier_id ID of the supplier. @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# 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
@param product_id ID of the product. @param product @param [Hash] opts the optional parameters @return [Product]
# 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
@param product_id ID of the product. @param variant_id ID of the variant. @param variant @param [Hash] opts the optional parameters @return [Variant]
# 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
@param product_id ID of the product. @param variant_id ID of the variant. @param variant @param [Hash] opts the optional parameters @return [Array<(Variant
, Fixnum, Hash)>] Variant
data, response status code and response headers
# 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
@param product_id ID of the product. @param product @param [Hash] opts the optional parameters @return [Array<(Product
, Fixnum, Hash)>] Product
data, response status code and response headers
# 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