Class: PlentyClient::Item::Property::MarketReference

Inherits:
Object
  • Object
show all
Includes:
Endpoint, Request
Defined in:
lib/plenty_client/item/property/market_reference.rb

Constant Summary collapse

ITEM_PROPERTY_MARKET_REFERENCE_PATH =
'/items/properties'
CREATE_ITEM_PROPERTY_MARKET_REFERENCE =
'/{propertyId}/market_references'
LIST_ITEM_PROPERTY_MARKET_REFERENCE =
'/{propertyId}/market_references'
GET_ITEMS_PROPERTY_MARKET_REFERENCE =
'/{propertyId}/market_references/{marketId}'
UPDATE_ITEMS_PROPERTY_MARKET_REFERENCE =
'/{propertyId}/market_references/{marketId}'
DELETE_ITEMS_PROPERTY_MARKET_REFERENCE =
'/{propertyId}/market_references/{marketId}'

Class Method Summary collapse

Methods included from Request

included

Methods included from Endpoint

included

Class Method Details

.create(property_id, headers = {}) ⇒ Object



19
20
21
22
23
# File 'lib/plenty_client/item/property/market_reference.rb', line 19

def create(property_id, headers = {})
  post(build_endpoint("#{ITEM_PROPERTY_MARKET_REFERENCE_PATH}#{CREATE_ITEM_PROPERTY_MARKET_REFERENCE}",
                      property: property_id),
       headers)
end

.destroy(property_id, market_id) ⇒ Object



45
46
47
48
49
# File 'lib/plenty_client/item/property/market_reference.rb', line 45

def destroy(property_id, market_id)
  delete(build_endpoint("#{ITEM_PROPERTY_MARKET_REFERENCE_PATH}#{DELETE_ITEMS_PROPERTY_MARKET_REFERENCE}",
                        property: property_id,
                        market: market_id))
end

.find(property_id, market_id, headers = {}, &block) ⇒ Object



31
32
33
34
35
36
# File 'lib/plenty_client/item/property/market_reference.rb', line 31

def find(property_id, market_id, headers = {}, &block)
  get(build_endpoint("#{ITEM_PROPERTY_MARKET_REFERENCE_PATH}#{GET_ITEMS_PROPERTY_MARKET_REFERENCE}",
                     property: property_id,
                     market: market_id),
      headers, &block)
end

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



25
26
27
28
29
# File 'lib/plenty_client/item/property/market_reference.rb', line 25

def list(property_id, headers = {}, &block)
  get(build_endpoint("#{ITEM_PROPERTY_MARKET_REFERENCE_PATH}#{LIST_ITEM_PROPERTY_MARKET_REFERENCE}",
                     property: property_id),
      headers, &block)
end

.update(property_id, market_id, body = {}) ⇒ Object



38
39
40
41
42
43
# File 'lib/plenty_client/item/property/market_reference.rb', line 38

def update(property_id, market_id, body = {})
  put(build_endpoint("#{ITEM_PROPERTY_MARKET_REFERENCE_PATH}#{UPDATE_ITEMS_PROPERTY_MARKET_REFERENCE}",
                     property: property_id,
                     market: market_id),
      body)
end