module Mercadolibre::Core::Categories

Public Instance Methods

get_all_categories(site_id, args={}) click to toggle source
# File lib/mercadolibre/core/categories.rb, line 32
def get_all_categories(site_id, args={})
  get_request("/sites/#{site_id}/categories/all", args, { api_response_kind: 'raw' }).body
end
get_category(category_id) click to toggle source
# File lib/mercadolibre/core/categories.rb, line 8
def get_category(category_id)
  get_request("/categories/#{category_id}").body
end
get_category_attributes(category_id) click to toggle source
# File lib/mercadolibre/core/categories.rb, line 12
def get_category_attributes(category_id)
  get_request("/categories/#{category_id}/attributes").body
end
get_category_prediction(site_id, args) click to toggle source
# File lib/mercadolibre/core/categories.rb, line 16
def get_category_prediction(site_id, args)
  get_request("/sites/#{site_id}/category_predictor/predict", args).body
end
get_category_promotion_packs(category_id) click to toggle source
# File lib/mercadolibre/core/categories.rb, line 28
def get_category_promotion_packs(category_id)
  get_request("/categories/#{category_id}/classifieds_promotion_packs").body
end
get_multiple_category_prediction(site_id, categories_data) click to toggle source
# File lib/mercadolibre/core/categories.rb, line 20
def get_multiple_category_prediction(site_id, categories_data)
  payload = categories_data.to_json

  headers = { content_type: :json }

  post_request("/sites/#{site_id}/category_predictor/predict", payload, headers).body
end
get_site_categories(site_id) click to toggle source
# File lib/mercadolibre/core/categories.rb, line 4
def get_site_categories(site_id)
  get_request("/sites/#{site_id}/categories").body
end