Module: PlentyClient::Stock

Includes:
Endpoint, Request
Defined in:
lib/plenty_client/stock.rb

Constant Summary collapse

LIST_STOCK =
'/stockmanagement/stock'.freeze
LIST_STOCK_BY_TYPE =
'/stockmanagement/stock/types/{type}'.freeze
REDISTRIBUTE_STOCK =
'/stockmanagement/stock/redistribute'.freeze

Class Method Summary collapse

Methods included from Request

included

Methods included from Endpoint

included

Class Method Details

.list(headers = {}, &block) ⇒ Object



11
12
13
# File 'lib/plenty_client/stock.rb', line 11

def list(headers = {}, &block)
  get(build_endpoint(LIST_STOCK), headers, &block)
end

.list_by_type(type_string, headers = {}, &block) ⇒ Object



15
16
17
# File 'lib/plenty_client/stock.rb', line 15

def list_by_type(type_string, headers = {}, &block)
  get(build_endpoint(LIST_STOCK_BY_TYPE, type_string: type_string), headers, &block)
end

.redistribute(body = {}) ⇒ Object



19
20
21
# File 'lib/plenty_client/stock.rb', line 19

def redistribute(body = {})
  put(build_endpoint(REDISTRIBUTE_STOCK), body)
end