class Yapstone::MarketplaceProductsApi
Attributes
Public Class Methods
# File lib/yapstone-so/api/marketplace_products_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Retrieves a MarketPlace Product
Retrieves a MarketPlace Product
@param product_id [String] The unique id of Product
Resource
. @param [Hash] opts the optional parameters @return [MarketplaceProductResource]
# File lib/yapstone-so/api/marketplace_products_api.rb, line 27 def get_marketplace_product(product_id, opts = {}) data, _status_code, _headers = get_marketplace_product_with_http_info(product_id, opts) data end
Retrieves a MarketPlace Product
Retrieves a MarketPlace Product
@param product_id [String] The unique id of Product
Resource
. @param [Hash] opts the optional parameters @return [Array<(MarketplaceProductResource
, Integer, Hash)>] MarketplaceProductResource
data, response status code and response headers
# File lib/yapstone-so/api/marketplace_products_api.rb, line 37 def get_marketplace_product_with_http_info(product_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MarketplaceProductsApi.get_marketplace_product ...' end # verify the required parameter 'product_id' is set if @api_client.config.client_side_validation && product_id.nil? fail ArgumentError, "Missing the required parameter 'product_id' when calling MarketplaceProductsApi.get_marketplace_product" end # resource path local_var_path = '/marketplace-products/{productId}'.sub('{' + 'productId' + '}', CGI.escape(product_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'MarketplaceProductResource' # auth_names auth_names = opts[:auth_names] || ['Bearer'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: MarketplaceProductsApi#get_marketplace_product\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Update selctive MarketPlace Product
details Update selctive MarketPlace Product
details @param product_id [String] The unique id of Product
Resource
. @param marketplace_product_resource [MarketplaceProductResource] The Marketplace product resource object with fields to be updated. @param [Hash] opts the optional parameters @return [MarketplaceProductResource]
# File lib/yapstone-so/api/marketplace_products_api.rb, line 90 def update_marketplace_product(product_id, marketplace_product_resource, opts = {}) data, _status_code, _headers = update_marketplace_product_with_http_info(product_id, marketplace_product_resource, opts) data end
Update selctive MarketPlace Product
details Update selctive MarketPlace Product
details @param product_id [String] The unique id of Product
Resource
. @param marketplace_product_resource [MarketplaceProductResource] The Marketplace product resource object with fields to be updated. @param [Hash] opts the optional parameters @return [Array<(MarketplaceProductResource
, Integer, Hash)>] MarketplaceProductResource
data, response status code and response headers
# File lib/yapstone-so/api/marketplace_products_api.rb, line 101 def update_marketplace_product_with_http_info(product_id, marketplace_product_resource, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MarketplaceProductsApi.update_marketplace_product ...' end # verify the required parameter 'product_id' is set if @api_client.config.client_side_validation && product_id.nil? fail ArgumentError, "Missing the required parameter 'product_id' when calling MarketplaceProductsApi.update_marketplace_product" end # verify the required parameter 'marketplace_product_resource' is set if @api_client.config.client_side_validation && marketplace_product_resource.nil? fail ArgumentError, "Missing the required parameter 'marketplace_product_resource' when calling MarketplaceProductsApi.update_marketplace_product" end # resource path local_var_path = '/marketplace-products/{productId}'.sub('{' + 'productId' + '}', CGI.escape(product_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json-patch+json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(marketplace_product_resource) # return_type return_type = opts[:return_type] || 'MarketplaceProductResource' # auth_names auth_names = opts[:auth_names] || ['Bearer'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: MarketplaceProductsApi#update_marketplace_product\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end