Class: PlentyClient::Item::Variation::Sku

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

Constant Summary collapse

ITEM_VARIATION_SKU_PATH =
'/items/{itemId}/variations/{variationId}'
LIST_ITEM_VARIATIONS_SKU =
'/variation_skus'
GET_ITEM_VARIATIONS_SKU =
'/variation_skus/{skuId}'
CREATE_ITEM_VARIATIONS_SKU =
'/variation_skus'
UPDATE_ITEM_VARIATIONS_SKU =
'/variation_skus/{skuId}'
DELETE_ITEM_VARIATIONS_SKU =
'/variation_skus/{skuId}'

Class Method Summary collapse

Methods included from Request

included

Methods included from Endpoint

included

Class Method Details

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



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

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

.destroy(item_id, variation_id, sku_id) ⇒ Object



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

def destroy(item_id, variation_id, sku_id)
  delete(build_endpoint("#{ITEM_VARIATION_SKU_PATH}#{DELETE_ITEM_VARIATIONS_SKU}",
                        item: item_id, variation: variation_id, sku: sku_id))
end

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



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

def find(item_id, variation_id, sku_id, headers = {}, &block)
  get(build_endpoint("#{ITEM_VARIATION_SKU_PATH}#{GET_ITEM_VARIATIONS_SKU}",
                     item: item_id, variation: variation_id, sku: sku_id),
      headers, &block)
end

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



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

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

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



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

def update(item_id, variation_id, sku_id, body = {})
  put(build_endpoint("#{ITEM_VARIATION_SKU_PATH}#{CREATE_ITEM_VARIATIONS_SKU}",
                     item: item_id, variation: variation_id, sku: sku_id),
      body)
end