class OrderCloud::CategoryApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/order_cloud/api/category_api.rb, line 30
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

create(catalog_id, category, opts = {}) click to toggle source

@param catalog_id ID of the catalog. @param category @param [Hash] opts the optional parameters @return [Category]

# File lib/order_cloud/api/category_api.rb, line 40
def create(catalog_id, category, opts = {})
  data, _status_code, _headers = create_with_http_info(catalog_id, category, opts)
  return data
end
create_with_http_info(catalog_id, category, opts = {}) click to toggle source

@param catalog_id ID of the catalog. @param category @param [Hash] opts the optional parameters @return [Array<(Category, Fixnum, Hash)>] Category data, response status code and response headers

# File lib/order_cloud/api/category_api.rb, line 51
def create_with_http_info(catalog_id, category, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: CategoryApi.create ..."
  end
  # verify the required parameter 'catalog_id' is set
  fail ArgumentError, "Missing the required parameter 'catalog_id' when calling CategoryApi.create" if catalog_id.nil?
  # verify the required parameter 'category' is set
  fail ArgumentError, "Missing the required parameter 'category' when calling CategoryApi.create" if category.nil?
  # resource path
  local_var_path = "/catalogs/{catalogID}/categories".sub('{format}','json').sub('{' + 'catalogID' + '}', catalog_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(category)
  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 => 'Category')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CategoryApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete(catalog_id, category_id, opts = {}) click to toggle source

@param catalog_id ID of the catalog. @param category_id ID of the category. @param [Hash] opts the optional parameters @return [nil]

# File lib/order_cloud/api/category_api.rb, line 101
def delete(catalog_id, category_id, opts = {})
  delete_with_http_info(catalog_id, category_id, opts)
  return nil
end
delete_assignment(catalog_id, category_id, buyer_id, opts = {}) click to toggle source

@param catalog_id ID of the catalog. @param category_id ID of the category. @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/category_api.rb, line 164
def delete_assignment(catalog_id, category_id, buyer_id, opts = {})
  delete_assignment_with_http_info(catalog_id, category_id, buyer_id, opts)
  return nil
end
delete_assignment_with_http_info(catalog_id, category_id, buyer_id, opts = {}) click to toggle source

@param catalog_id ID of the catalog. @param category_id ID of the category. @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/category_api.rb, line 178
def delete_assignment_with_http_info(catalog_id, category_id, buyer_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: CategoryApi.delete_assignment ..."
  end
  # verify the required parameter 'catalog_id' is set
  fail ArgumentError, "Missing the required parameter 'catalog_id' when calling CategoryApi.delete_assignment" if catalog_id.nil?
  # verify the required parameter 'category_id' is set
  fail ArgumentError, "Missing the required parameter 'category_id' when calling CategoryApi.delete_assignment" if category_id.nil?
  # verify the required parameter 'buyer_id' is set
  fail ArgumentError, "Missing the required parameter 'buyer_id' when calling CategoryApi.delete_assignment" if buyer_id.nil?
  # resource path
  local_var_path = "/catalogs/{catalogID}/categories/{categoryID}/assignments".sub('{format}','json').sub('{' + 'catalogID' + '}', catalog_id.to_s).sub('{' + 'categoryID' + '}', category_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'buyerID'] = buyer_id
  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: CategoryApi#delete_assignment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete_product_assignment(catalog_id, category_id, product_id, opts = {}) click to toggle source

@param catalog_id ID of the catalog. @param category_id ID of the category. @param product_id ID of the product. @param [Hash] opts the optional parameters @return [nil]

# File lib/order_cloud/api/category_api.rb, line 233
def delete_product_assignment(catalog_id, category_id, product_id, opts = {})
  delete_product_assignment_with_http_info(catalog_id, category_id, product_id, opts)
  return nil
end
delete_product_assignment_with_http_info(catalog_id, category_id, product_id, opts = {}) click to toggle source

@param catalog_id ID of the catalog. @param category_id ID of the category. @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/category_api.rb, line 245
def delete_product_assignment_with_http_info(catalog_id, category_id, product_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: CategoryApi.delete_product_assignment ..."
  end
  # verify the required parameter 'catalog_id' is set
  fail ArgumentError, "Missing the required parameter 'catalog_id' when calling CategoryApi.delete_product_assignment" if catalog_id.nil?
  # verify the required parameter 'category_id' is set
  fail ArgumentError, "Missing the required parameter 'category_id' when calling CategoryApi.delete_product_assignment" if category_id.nil?
  # verify the required parameter 'product_id' is set
  fail ArgumentError, "Missing the required parameter 'product_id' when calling CategoryApi.delete_product_assignment" if product_id.nil?
  # resource path
  local_var_path = "/catalogs/{catalogID}/categories/{categoryID}/productassignments/{productID}".sub('{format}','json').sub('{' + 'catalogID' + '}', catalog_id.to_s).sub('{' + 'categoryID' + '}', category_id.to_s).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: CategoryApi#delete_product_assignment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete_with_http_info(catalog_id, category_id, opts = {}) click to toggle source

@param catalog_id ID of the catalog. @param category_id ID of the category. @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers

# File lib/order_cloud/api/category_api.rb, line 112
def delete_with_http_info(catalog_id, category_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: CategoryApi.delete ..."
  end
  # verify the required parameter 'catalog_id' is set
  fail ArgumentError, "Missing the required parameter 'catalog_id' when calling CategoryApi.delete" if catalog_id.nil?
  # verify the required parameter 'category_id' is set
  fail ArgumentError, "Missing the required parameter 'category_id' when calling CategoryApi.delete" if category_id.nil?
  # resource path
  local_var_path = "/catalogs/{catalogID}/categories/{categoryID}".sub('{format}','json').sub('{' + 'catalogID' + '}', catalog_id.to_s).sub('{' + 'categoryID' + '}', category_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: CategoryApi#delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get(catalog_id, category_id, opts = {}) click to toggle source

@param catalog_id ID of the catalog. @param category_id ID of the category. @param [Hash] opts the optional parameters @return [Category]

# File lib/order_cloud/api/category_api.rb, line 296
def get(catalog_id, category_id, opts = {})
  data, _status_code, _headers = get_with_http_info(catalog_id, category_id, opts)
  return data
end
get_with_http_info(catalog_id, category_id, opts = {}) click to toggle source

@param catalog_id ID of the catalog. @param category_id ID of the category. @param [Hash] opts the optional parameters @return [Array<(Category, Fixnum, Hash)>] Category data, response status code and response headers

# File lib/order_cloud/api/category_api.rb, line 307
def get_with_http_info(catalog_id, category_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: CategoryApi.get ..."
  end
  # verify the required parameter 'catalog_id' is set
  fail ArgumentError, "Missing the required parameter 'catalog_id' when calling CategoryApi.get" if catalog_id.nil?
  # verify the required parameter 'category_id' is set
  fail ArgumentError, "Missing the required parameter 'category_id' when calling CategoryApi.get" if category_id.nil?
  # resource path
  local_var_path = "/catalogs/{catalogID}/categories/{categoryID}".sub('{format}','json').sub('{' + 'catalogID' + '}', catalog_id.to_s).sub('{' + 'categoryID' + '}', category_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 => 'Category')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CategoryApi#get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list(catalog_id, opts = {}) click to toggle source

@param catalog_id ID of the catalog. @param [Hash] opts the optional parameters @option opts [String] :depth Depth of the category. @option opts [String] :search Search of the category. @option opts [Array<String>] :search_on Search on of the category. @option opts [Array<String>] :sort_by Sort by of the category. @option opts [Integer] :page Page of the category. @option opts [Integer] :page_size Page size of the category. @option opts [Hash<String, String>] :filters Filters of the category. @return [ListCategory]

# File lib/order_cloud/api/category_api.rb, line 363
def list(catalog_id, opts = {})
  data, _status_code, _headers = list_with_http_info(catalog_id, opts)
  return data
end
list_assignments(catalog_id, opts = {}) click to toggle source

@param catalog_id ID of the catalog. @param [Hash] opts the optional parameters @option opts [String] :category_id ID of the category. @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 category. @option opts [Integer] :page Page of the category. @option opts [Integer] :page_size Page size of the category. @return [ListCategoryAssignment]

# File lib/order_cloud/api/category_api.rb, line 441
def list_assignments(catalog_id, opts = {})
  data, _status_code, _headers = list_assignments_with_http_info(catalog_id, opts)
  return data
end
list_assignments_with_http_info(catalog_id, opts = {}) click to toggle source

@param catalog_id ID of the catalog. @param [Hash] opts the optional parameters @option opts [String] :category_id ID of the category. @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 category. @option opts [Integer] :page Page of the category. @option opts [Integer] :page_size Page size of the category. @return [Array<(ListCategoryAssignment, Fixnum, Hash)>] ListCategoryAssignment data, response status code and response headers

# File lib/order_cloud/api/category_api.rb, line 458
def list_assignments_with_http_info(catalog_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: CategoryApi.list_assignments ..."
  end
  # verify the required parameter 'catalog_id' is set
  fail ArgumentError, "Missing the required parameter 'catalog_id' when calling CategoryApi.list_assignments" if catalog_id.nil?
  # resource path
  local_var_path = "/catalogs/{catalogID}/categories/assignments".sub('{format}','json').sub('{' + 'catalogID' + '}', catalog_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'categoryID'] = opts[:'category_id'] if !opts[:'category_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 => 'ListCategoryAssignment')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CategoryApi#list_assignments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_product_assignments(catalog_id, opts = {}) click to toggle source

@param catalog_id ID of the catalog. @param [Hash] opts the optional parameters @option opts [String] :category_id ID of the category. @option opts [String] :product_id ID of the product. @option opts [Integer] :page Page of the category. @option opts [Integer] :page_size Page size of the category. @return [ListCategoryProductAssignment]

# File lib/order_cloud/api/category_api.rb, line 516
def list_product_assignments(catalog_id, opts = {})
  data, _status_code, _headers = list_product_assignments_with_http_info(catalog_id, opts)
  return data
end
list_product_assignments_with_http_info(catalog_id, opts = {}) click to toggle source

@param catalog_id ID of the catalog. @param [Hash] opts the optional parameters @option opts [String] :category_id ID of the category. @option opts [String] :product_id ID of the product. @option opts [Integer] :page Page of the category. @option opts [Integer] :page_size Page size of the category. @return [Array<(ListCategoryProductAssignment, Fixnum, Hash)>] ListCategoryProductAssignment data, response status code and response headers

# File lib/order_cloud/api/category_api.rb, line 530
def list_product_assignments_with_http_info(catalog_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: CategoryApi.list_product_assignments ..."
  end
  # verify the required parameter 'catalog_id' is set
  fail ArgumentError, "Missing the required parameter 'catalog_id' when calling CategoryApi.list_product_assignments" if catalog_id.nil?
  # resource path
  local_var_path = "/catalogs/{catalogID}/categories/productassignments".sub('{format}','json').sub('{' + 'catalogID' + '}', catalog_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'categoryID'] = opts[:'category_id'] if !opts[:'category_id'].nil?
  query_params[:'productID'] = opts[:'product_id'] if !opts[:'product_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 => 'ListCategoryProductAssignment')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CategoryApi#list_product_assignments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_with_http_info(catalog_id, opts = {}) click to toggle source

@param catalog_id ID of the catalog. @param [Hash] opts the optional parameters @option opts [String] :depth Depth of the category. @option opts [String] :search Search of the category. @option opts [Array<String>] :search_on Search on of the category. @option opts [Array<String>] :sort_by Sort by of the category. @option opts [Integer] :page Page of the category. @option opts [Integer] :page_size Page size of the category. @option opts [Hash<String, String>] :filters Filters of the category. @return [Array<(ListCategory, Fixnum, Hash)>] ListCategory data, response status code and response headers

# File lib/order_cloud/api/category_api.rb, line 380
def list_with_http_info(catalog_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: CategoryApi.list ..."
  end
  # verify the required parameter 'catalog_id' is set
  fail ArgumentError, "Missing the required parameter 'catalog_id' when calling CategoryApi.list" if catalog_id.nil?
  # resource path
  local_var_path = "/catalogs/{catalogID}/categories".sub('{format}','json').sub('{' + 'catalogID' + '}', catalog_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].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 => 'ListCategory')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CategoryApi#list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
patch(catalog_id, category_id, category, opts = {}) click to toggle source

@param catalog_id ID of the catalog. @param category_id ID of the category. @param category @param [Hash] opts the optional parameters @return [Category]

# File lib/order_cloud/api/category_api.rb, line 583
def patch(catalog_id, category_id, category, opts = {})
  data, _status_code, _headers = patch_with_http_info(catalog_id, category_id, category, opts)
  return data
end
patch_with_http_info(catalog_id, category_id, category, opts = {}) click to toggle source

@param catalog_id ID of the catalog. @param category_id ID of the category. @param category @param [Hash] opts the optional parameters @return [Array<(Category, Fixnum, Hash)>] Category data, response status code and response headers

# File lib/order_cloud/api/category_api.rb, line 595
def patch_with_http_info(catalog_id, category_id, category, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: CategoryApi.patch ..."
  end
  # verify the required parameter 'catalog_id' is set
  fail ArgumentError, "Missing the required parameter 'catalog_id' when calling CategoryApi.patch" if catalog_id.nil?
  # verify the required parameter 'category_id' is set
  fail ArgumentError, "Missing the required parameter 'category_id' when calling CategoryApi.patch" if category_id.nil?
  # verify the required parameter 'category' is set
  fail ArgumentError, "Missing the required parameter 'category' when calling CategoryApi.patch" if category.nil?
  # resource path
  local_var_path = "/catalogs/{catalogID}/categories/{categoryID}".sub('{format}','json').sub('{' + 'catalogID' + '}', catalog_id.to_s).sub('{' + 'categoryID' + '}', category_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(category)
  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 => 'Category')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CategoryApi#patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
save_assignment(catalog_id, category_assignment, opts = {}) click to toggle source

@param catalog_id ID of the catalog. @param category_assignment @param [Hash] opts the optional parameters @return [nil]

# File lib/order_cloud/api/category_api.rb, line 647
def save_assignment(catalog_id, category_assignment, opts = {})
  save_assignment_with_http_info(catalog_id, category_assignment, opts)
  return nil
end
save_assignment_with_http_info(catalog_id, category_assignment, opts = {}) click to toggle source

@param catalog_id ID of the catalog. @param category_assignment @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers

# File lib/order_cloud/api/category_api.rb, line 658
def save_assignment_with_http_info(catalog_id, category_assignment, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: CategoryApi.save_assignment ..."
  end
  # verify the required parameter 'catalog_id' is set
  fail ArgumentError, "Missing the required parameter 'catalog_id' when calling CategoryApi.save_assignment" if catalog_id.nil?
  # verify the required parameter 'category_assignment' is set
  fail ArgumentError, "Missing the required parameter 'category_assignment' when calling CategoryApi.save_assignment" if category_assignment.nil?
  # resource path
  local_var_path = "/catalogs/{catalogID}/categories/assignments".sub('{format}','json').sub('{' + 'catalogID' + '}', catalog_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(category_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: CategoryApi#save_assignment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
save_product_assignment(catalog_id, product_assignment, opts = {}) click to toggle source

@param catalog_id ID of the catalog. @param product_assignment @param [Hash] opts the optional parameters @return [nil]

# File lib/order_cloud/api/category_api.rb, line 707
def save_product_assignment(catalog_id, product_assignment, opts = {})
  save_product_assignment_with_http_info(catalog_id, product_assignment, opts)
  return nil
end
save_product_assignment_with_http_info(catalog_id, product_assignment, opts = {}) click to toggle source

@param catalog_id ID of the catalog. @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/category_api.rb, line 718
def save_product_assignment_with_http_info(catalog_id, product_assignment, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: CategoryApi.save_product_assignment ..."
  end
  # verify the required parameter 'catalog_id' is set
  fail ArgumentError, "Missing the required parameter 'catalog_id' when calling CategoryApi.save_product_assignment" if catalog_id.nil?
  # verify the required parameter 'product_assignment' is set
  fail ArgumentError, "Missing the required parameter 'product_assignment' when calling CategoryApi.save_product_assignment" if product_assignment.nil?
  # resource path
  local_var_path = "/catalogs/{catalogID}/categories/productassignments".sub('{format}','json').sub('{' + 'catalogID' + '}', catalog_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_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: CategoryApi#save_product_assignment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update(catalog_id, category_id, category, opts = {}) click to toggle source

@param catalog_id ID of the catalog. @param category_id ID of the category. @param category @param [Hash] opts the optional parameters @return [Category]

# File lib/order_cloud/api/category_api.rb, line 768
def update(catalog_id, category_id, category, opts = {})
  data, _status_code, _headers = update_with_http_info(catalog_id, category_id, category, opts)
  return data
end
update_with_http_info(catalog_id, category_id, category, opts = {}) click to toggle source

@param catalog_id ID of the catalog. @param category_id ID of the category. @param category @param [Hash] opts the optional parameters @return [Array<(Category, Fixnum, Hash)>] Category data, response status code and response headers

# File lib/order_cloud/api/category_api.rb, line 780
def update_with_http_info(catalog_id, category_id, category, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: CategoryApi.update ..."
  end
  # verify the required parameter 'catalog_id' is set
  fail ArgumentError, "Missing the required parameter 'catalog_id' when calling CategoryApi.update" if catalog_id.nil?
  # verify the required parameter 'category_id' is set
  fail ArgumentError, "Missing the required parameter 'category_id' when calling CategoryApi.update" if category_id.nil?
  # verify the required parameter 'category' is set
  fail ArgumentError, "Missing the required parameter 'category' when calling CategoryApi.update" if category.nil?
  # resource path
  local_var_path = "/catalogs/{catalogID}/categories/{categoryID}".sub('{format}','json').sub('{' + 'catalogID' + '}', catalog_id.to_s).sub('{' + 'categoryID' + '}', category_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(category)
  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 => 'Category')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CategoryApi#update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end