Module: PlentyClient::Listing

Includes:
Endpoint, Request
Defined in:
lib/plenty_client.rb,
lib/plenty_client/listing.rb,
lib/plenty_client/listing/type.rb,
lib/plenty_client/listing/market.rb,
lib/plenty_client/listing/market/info.rb,
lib/plenty_client/listing/market/text.rb,
lib/plenty_client/listing/market/history.rb,
lib/plenty_client/listing/layout_template.rb,
lib/plenty_client/listing/option_template.rb,
lib/plenty_client/listing/market/directory.rb,
lib/plenty_client/listing/shipping_profile.rb,
lib/plenty_client/listing/stock_dependence_type.rb

Defined Under Namespace

Modules: Market Classes: LayoutTemplate, OptionTemplate, ShippingProfile, StockDependenceType, Type

Constant Summary collapse

FIND_LISTING =
'/listings/{listingId}'.freeze
LIST_LISTINGS =
'/listings'.freeze
CREATE_LISTING =
'/listings'.freeze
UPDATE_LISTING =
'/listings/{listingId}'.freeze
DELETE_LISTING =
'/listings/{listingId}'.freeze

Class Method Summary collapse

Methods included from Request

included

Methods included from Endpoint

included

Class Method Details

.create(body = {}) ⇒ Object



21
22
23
# File 'lib/plenty_client/listing.rb', line 21

def create(body = {})
  post(CREATE_LISTING, body)
end

.destroy(listing_id, body = {}) ⇒ Object



29
30
31
# File 'lib/plenty_client/listing.rb', line 29

def destroy(listing_id, body = {})
  delete(build_endpoint(DELETE_LISTING, listing: listing_id), body)
end

.find(listing_id = nil, headers = {}, &block) ⇒ Object



17
18
19
# File 'lib/plenty_client/listing.rb', line 17

def find(listing_id = nil, headers = {}, &block)
  get(build_endpoint(FIND_LISTING, listing: listing_id), headers, &block)
end

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



13
14
15
# File 'lib/plenty_client/listing.rb', line 13

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

.update(listing_id, body = {}) ⇒ Object



25
26
27
# File 'lib/plenty_client/listing.rb', line 25

def update(listing_id, body = {})
  post(build_endpoint(UPDATE_LISTING, listing: listing_id), body)
end