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'.freeze
CREATE_ITEM_PROPERTY_MARKET_REFERENCE =
'/{propertyId}/market_references'.freeze
LIST_ITEM_PROPERTY_MARKET_REFERENCE =
'/{propertyId}/market_references'.freeze
GET_ITEMS_PROPERTY_MARKET_REFERENCE =
'/{propertyId}/market_references/{marketId}'.freeze
UPDATE_ITEMS_PROPERTY_MARKET_REFERENCE =
'/{propertyId}/market_references/{marketId}'.freeze
DELETE_ITEMS_PROPERTY_MARKET_REFERENCE =
'/{propertyId}/market_references/{marketId}'.freeze

Class Method Summary collapse

Methods included from Request

included

Methods included from Endpoint

included

Class Method Details

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



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

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



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

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



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

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



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

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



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

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