Class: PlentyClient::Item::Variation::Bundle

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

Constant Summary collapse

ITEM_VARIATION_BUNDLE_PATH =
'/items/{itemId}/variations/{variationId}'.freeze
LIST_ITEM_VARIATIONS_BUNDLE =
'/variation_bundles'.freeze
GET_ITEM_VARIATIONS_BUNDLE =
'/variation_bundles/{bundleId}'.freeze
CREATE_ITEM_VARIATIONS_BUNDLE =
'/variation_bundles'.freeze
UPDATE_ITEM_VARIATIONS_BUNDLE =
'/variation_bundles/{bundleId}'.freeze
DELETE_ITEM_VARIATIONS_BUNDLE =
'/variation_bundles/{bundleId}'.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/bundle.rb', line 30

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

.destroy(item_id, variation_id, bundle_id) ⇒ Object



42
43
44
45
# File 'lib/plenty_client/item/variation/bundle.rb', line 42

def destroy(item_id, variation_id, bundle_id)
  delete(build_endpoint("#{ITEM_VARIATION_BUNDLE_PATH}#{DELETE_ITEM_VARIATIONS_BUNDLE}",
                        item: item_id, variation: variation_id, bundle: bundle_id))
end

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



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

def find(item_id, variation_id, bundle_id, headers = {}, &block)
  get(build_endpoint("#{ITEM_VARIATION_BUNDLE_PATH}#{GET_ITEM_VARIATIONS_BUNDLE}",
                     item: item_id, variation: variation_id, bundle: bundle_id),
      headers, &block)
end

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



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

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

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



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

def update(item_id, variation_id, bundle_id, body = {})
  put(build_endpoint("#{ITEM_VARIATION_BUNDLE_PATH}#{UPDATE_ITEM_VARIATIONS_BUNDLE}",
                     item: item_id, variation: variation_id, bundle: bundle_id),
      body)
end