Class: PlentyClient::Item::Variation::Description

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

Constant Summary collapse

ITEM_VARIATION_DESCRIPTION_BASE_PATH =
'/items/{itemId}/variations/{variationId}'.freeze
LIST_ITEM_VARIATION_DESCRIPTIONS =
'/descriptions'.freeze
GET_ITEM_VARIATIONS_DESCRIPTION =
'/descriptions/{lang}'.freeze
CREATE_ITEM_VARIATIONS_DESCRIPTION =
'/descriptions'.freeze
UPDATE_ITEM_VARIATIONS_DESCRIPTION =
'/descriptions/{lang}'.freeze
DELETE_ITEM_VARIATIONS_DESCRIPTION =
'/descriptions/{lang}'.freeze

Class Method Summary collapse

Methods included from Request

included

Methods included from Endpoint

included

Class Method Details

.create(item_id, variation_id, body = {}) ⇒ Object



30
31
32
33
34
# File 'lib/plenty_client/item/variation/description.rb', line 30

def create(item_id, variation_id, body = {})
  post(build_endpoint("#{ITEM_VARIATION_DESCRIPTION_BASE_PATH}#{CREATE_ITEM_VARIATIONS_DESCRIPTION}",
                      item: item_id,
                      variation: variation_id), body)
end

.destroy(item_id, variation_id, lang) ⇒ Object



43
44
45
46
47
48
# File 'lib/plenty_client/item/variation/description.rb', line 43

def destroy(item_id, variation_id, lang)
  delete(build_endpoint("#{ITEM_VARIATION_DESCRIPTION_BASE_PATH}#{DELETE_ITEM_VARIATIONS_DESCRIPTION}",
                        item: item_id,
                        variation: variation_id,
                        lang: lang))
end

.find(item_id, variation_id, lang, headers = {}) ⇒ Object



23
24
25
26
27
28
# File 'lib/plenty_client/item/variation/description.rb', line 23

def find(item_id, variation_id, lang, headers = {})
  get(build_endpoint("#{ITEM_VARIATION_DESCRIPTION_BASE_PATH}#{GET_ITEM_VARIATIONS_DESCRIPTION}",
                     item: item_id,
                     variation: variation_id,
                     lang: lang), headers, &block)
end

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



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

def list(item_id, variation_id, headers = {}, &block)
  get(build_endpoint("#{ITEM_VARIATION_DESCRIPTION_BASE_PATH}#{LIST_ITEM_VARIATION_DESCRIPTIONS}",
                     item: item_id,
                     variation: variation_id), headers, &block)
end

.update(item_id, variation_id, lang, body = {}) ⇒ Object



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

def update(item_id, variation_id, lang, body = {})
  put(build_endpoint("#{ITEM_VARIATION_DESCRIPTION_BASE_PATH}#{UPDATE_ITEM_VARIATIONS_DESCRIPTION}",
                     item: item_id,
                     variation: variation_id,
                     lang: lang), body)
end