plenty_client 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/README.md +9 -36
- data/Rakefile +3 -3
- data/lib/plenty_client.rb +8 -5
- data/lib/plenty_client/accounting.rb +2 -2
- data/lib/plenty_client/authentication.rb +2 -2
- data/lib/plenty_client/authorization.rb +2 -2
- data/lib/plenty_client/basket.rb +2 -2
- data/lib/plenty_client/basket/item.rb +2 -2
- data/lib/plenty_client/category.rb +6 -7
- data/lib/plenty_client/category/branch.rb +2 -2
- data/lib/plenty_client/category/template.rb +3 -3
- data/lib/plenty_client/comment.rb +3 -3
- data/lib/plenty_client/config.rb +3 -1
- data/lib/plenty_client/endpoint.rb +74 -68
- data/lib/plenty_client/item.rb +7 -2
- data/lib/plenty_client/item/attribute.rb +3 -3
- data/lib/plenty_client/item/attribute/name.rb +12 -20
- data/lib/plenty_client/item/attribute/value.rb +13 -18
- data/lib/plenty_client/item/attribute/value_name.rb +12 -12
- data/lib/plenty_client/item/barcode.rb +3 -3
- data/lib/plenty_client/item/cross_selling.rb +3 -3
- data/lib/plenty_client/item/image.rb +6 -6
- data/lib/plenty_client/item/image/availability.rb +10 -10
- data/lib/plenty_client/item/image/name.rb +14 -24
- data/lib/plenty_client/item/manufacturer.rb +4 -4
- data/lib/plenty_client/item/manufacturer/commission.rb +3 -3
- data/lib/plenty_client/item/property.rb +3 -3
- data/lib/plenty_client/item/property/market_reference.rb +11 -11
- data/lib/plenty_client/item/property/name.rb +12 -17
- data/lib/plenty_client/item/property_group.rb +3 -3
- data/lib/plenty_client/item/property_group_name.rb +8 -10
- data/lib/plenty_client/item/sales_price.rb +3 -4
- data/lib/plenty_client/item/shipping_profile.rb +6 -6
- data/lib/plenty_client/item/unit.rb +3 -4
- data/lib/plenty_client/item/unit_name.rb +12 -11
- data/lib/plenty_client/item/variation.rb +10 -4
- data/lib/plenty_client/item/variation/barcode.rb +3 -3
- data/lib/plenty_client/item/variation/bundle.rb +14 -16
- data/lib/plenty_client/item/variation/category.rb +8 -10
- data/lib/plenty_client/item/variation/client.rb +3 -3
- data/lib/plenty_client/item/variation/default_category.rb +3 -3
- data/lib/plenty_client/item/variation/description.rb +3 -3
- data/lib/plenty_client/item/variation/image.rb +5 -4
- data/lib/plenty_client/item/variation/market.rb +3 -3
- data/lib/plenty_client/item/variation/market_ident_number.rb +3 -3
- data/lib/plenty_client/item/variation/sales_price.rb +13 -17
- data/lib/plenty_client/item/variation/sku.rb +12 -15
- data/lib/plenty_client/item/variation/stock.rb +3 -3
- data/lib/plenty_client/item/variation/supplier.rb +12 -15
- data/lib/plenty_client/item/variation/warehouse.rb +6 -5
- data/lib/plenty_client/item/variation_property.rb +3 -3
- data/lib/plenty_client/item/variation_property_value.rb +10 -14
- data/lib/plenty_client/item_set.rb +4 -4
- data/lib/plenty_client/item_set/component.rb +15 -22
- data/lib/plenty_client/item_set/config.rb +3 -2
- data/lib/plenty_client/order.rb +5 -4
- data/lib/plenty_client/order/contact_wish.rb +2 -3
- data/lib/plenty_client/order/coupon_code.rb +5 -7
- data/lib/plenty_client/order/coupon_code/contact.rb +4 -6
- data/lib/plenty_client/order/coupon_code/validation.rb +4 -6
- data/lib/plenty_client/order/currency.rb +2 -3
- data/lib/plenty_client/order/date.rb +3 -4
- data/lib/plenty_client/order/item.rb +3 -3
- data/lib/plenty_client/order/item/date.rb +2 -2
- data/lib/plenty_client/order/item/property.rb +2 -2
- data/lib/plenty_client/order/item/serial_number.rb +3 -3
- data/lib/plenty_client/order/property.rb +2 -3
- data/lib/plenty_client/order/referrer.rb +2 -3
- data/lib/plenty_client/order/shipping.rb +2 -3
- data/lib/plenty_client/order/shipping/country.rb +2 -2
- data/lib/plenty_client/order/shipping/information.rb +3 -3
- data/lib/plenty_client/order/shipping/package.rb +4 -4
- data/lib/plenty_client/order/shipping/profile.rb +2 -2
- data/lib/plenty_client/order/shipping/service_provider.rb +2 -2
- data/lib/plenty_client/request.rb +121 -98
- data/lib/plenty_client/sales_price/account.rb +2 -3
- data/lib/plenty_client/sales_price/country.rb +2 -2
- data/lib/plenty_client/sales_price/currency.rb +2 -2
- data/lib/plenty_client/sales_price/customer_class.rb +2 -2
- data/lib/plenty_client/sales_price/name.rb +4 -4
- data/lib/plenty_client/sales_price/online_store.rb +2 -3
- data/lib/plenty_client/sales_price/referrer.rb +3 -2
- data/lib/plenty_client/version.rb +1 -1
- metadata +2 -2
@@ -1,8 +1,8 @@
|
|
1
1
|
module PlentyClient
|
2
2
|
module Item
|
3
3
|
module Property
|
4
|
-
|
5
|
-
|
4
|
+
include PlentyClient::Endpoint
|
5
|
+
include PlentyClient::Request
|
6
6
|
|
7
7
|
LIST_ALL_PROPERTIES = '/items/properties'.freeze
|
8
8
|
GET_PROPERTY = '/items/properties/{propertyId}'.freeze
|
@@ -27,7 +27,7 @@ module PlentyClient
|
|
27
27
|
put(build_endpoint(UPDATE_PROPERTY, property: property_id), headers)
|
28
28
|
end
|
29
29
|
|
30
|
-
def
|
30
|
+
def destroy(property_id)
|
31
31
|
delete(build_endpoint(DELETE_PROPERTY, property: property_id))
|
32
32
|
end
|
33
33
|
end
|
@@ -2,8 +2,8 @@ module PlentyClient
|
|
2
2
|
module Item
|
3
3
|
module Property
|
4
4
|
class MarketReference
|
5
|
-
|
6
|
-
|
5
|
+
include PlentyClient::Endpoint
|
6
|
+
include PlentyClient::Request
|
7
7
|
|
8
8
|
ITEM_PROPERTY_MARKET_REFERENCE_PATH = '/items/properties'.freeze
|
9
9
|
|
@@ -15,32 +15,32 @@ module PlentyClient
|
|
15
15
|
|
16
16
|
class << self
|
17
17
|
def create(property_id, headers = {})
|
18
|
-
post(build_endpoint("#{ITEM_PROPERTY_MARKET_REFERENCE_PATH}#{CREATE_ITEM_PROPERTY_MARKET_REFERENCE}"
|
19
|
-
property: property_id,
|
20
|
-
|
18
|
+
post(build_endpoint("#{ITEM_PROPERTY_MARKET_REFERENCE_PATH}#{CREATE_ITEM_PROPERTY_MARKET_REFERENCE}",
|
19
|
+
property: property_id),
|
20
|
+
headers)
|
21
21
|
end
|
22
22
|
|
23
23
|
def list(property_id, headers = {}, &block)
|
24
|
-
get(build_endpoint("#{ITEM_PROPERTY_MARKET_REFERENCE_PATH}#{LIST_ITEM_PROPERTY_MARKET_REFERENCE}"
|
25
|
-
|
26
|
-
|
24
|
+
get(build_endpoint("#{ITEM_PROPERTY_MARKET_REFERENCE_PATH}#{LIST_ITEM_PROPERTY_MARKET_REFERENCE}",
|
25
|
+
property: property_id),
|
26
|
+
headers, &block)
|
27
27
|
end
|
28
28
|
|
29
29
|
def find(property_id, market_id, headers = {}, &block)
|
30
30
|
get(build_endpoint("#{ITEM_PROPERTY_MARKET_REFERENCE_PATH}#{GET_ITEMS_PROPERTY_MARKET_REFERENCE}",
|
31
31
|
property: property_id,
|
32
32
|
market: market_id),
|
33
|
-
|
33
|
+
headers, &block)
|
34
34
|
end
|
35
35
|
|
36
36
|
def update(property_id, market_id, body = {})
|
37
37
|
put(build_endpoint("#{ITEM_PROPERTY_MARKET_REFERENCE_PATH}#{UPDATE_ITEMS_PROPERTY_MARKET_REFERENCE}",
|
38
38
|
property: property_id,
|
39
39
|
market: market_id),
|
40
|
-
|
40
|
+
body)
|
41
41
|
end
|
42
42
|
|
43
|
-
def
|
43
|
+
def destroy(property_id, market_id)
|
44
44
|
delete(build_endpoint("#{ITEM_PROPERTY_MARKET_REFERENCE_PATH}#{DELETE_ITEMS_PROPERTY_MARKET_REFERENCE}",
|
45
45
|
property: property_id,
|
46
46
|
market: market_id))
|
@@ -2,8 +2,8 @@ module PlentyClient
|
|
2
2
|
module Item
|
3
3
|
module Property
|
4
4
|
class Name
|
5
|
-
|
6
|
-
|
5
|
+
include PlentyClient::Endpoint
|
6
|
+
include PlentyClient::Request
|
7
7
|
|
8
8
|
ITEM_PROPERTY_PATH = '/items/properties'.freeze
|
9
9
|
|
@@ -15,35 +15,30 @@ module PlentyClient
|
|
15
15
|
|
16
16
|
class << self
|
17
17
|
def create(property_id, headers = {})
|
18
|
-
post(build_endpoint("#{ITEM_PROPERTY_PATH}#{CREATE_ITEM_PROPERTIES}"),
|
19
|
-
|
20
|
-
headers)
|
18
|
+
post(build_endpoint("#{ITEM_PROPERTY_PATH}#{CREATE_ITEM_PROPERTIES}", property: property_id),
|
19
|
+
headers)
|
21
20
|
end
|
22
21
|
|
23
22
|
def list(property_id, headers = {}, &block)
|
24
|
-
get(build_endpoint("#{ITEM_PROPERTY_PATH}#{LIST_ITEM_PROPERTY}"),
|
25
|
-
|
26
|
-
headers, &block)
|
23
|
+
get(build_endpoint("#{ITEM_PROPERTY_PATH}#{LIST_ITEM_PROPERTY}", property: property_id),
|
24
|
+
headers, &block)
|
27
25
|
end
|
28
26
|
|
29
27
|
def find(property_id, lang, headers = {}, &block)
|
30
28
|
get(build_endpoint("#{ITEM_PROPERTY_PATH}#{GET_ITEMS_PROPERTY}",
|
31
|
-
property: property_id,
|
32
|
-
|
33
|
-
headers, &block)
|
29
|
+
property: property_id, lang: lang),
|
30
|
+
headers, &block)
|
34
31
|
end
|
35
32
|
|
36
33
|
def update(property_id, lang, body = {})
|
37
34
|
put(build_endpoint("#{ITEM_PROPERTY_PATH}#{UPDATE_ITEMS_PROPERTY}",
|
38
|
-
property: property_id,
|
39
|
-
|
40
|
-
body)
|
35
|
+
property: property_id, lang: lang),
|
36
|
+
body)
|
41
37
|
end
|
42
38
|
|
43
|
-
def
|
39
|
+
def destroy(property_id, lang)
|
44
40
|
delete(build_endpoint("#{ITEM_PROPERTY_PATH}#{DELETE_ITEMS_PROPERTY}",
|
45
|
-
property: property_id,
|
46
|
-
lang: lang))
|
41
|
+
property: property_id, lang: lang))
|
47
42
|
end
|
48
43
|
end
|
49
44
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module PlentyClient
|
2
2
|
module Item
|
3
3
|
class PropertyGroup
|
4
|
-
|
5
|
-
|
4
|
+
include PlentyClient::Endpoint
|
5
|
+
include PlentyClient::Request
|
6
6
|
|
7
7
|
LIST_ALL_PROPERTY_GROUPS = '/items/property_groups'.freeze
|
8
8
|
GET_PROPERTY_GROUP = '/items/property_groups/{propertyGroupId}'.freeze
|
@@ -27,7 +27,7 @@ module PlentyClient
|
|
27
27
|
put(build_endpoint(UPDATE_PROPERTY_GROUP, property_group: property_group_id), body)
|
28
28
|
end
|
29
29
|
|
30
|
-
def
|
30
|
+
def destroy(property_group_id)
|
31
31
|
delete(build_endpoint(DELETE_PROPERTY_GROUP, property_group: property_group_id))
|
32
32
|
end
|
33
33
|
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
module PlentyClient
|
2
2
|
module Item
|
3
3
|
class PropertyGroupName
|
4
|
-
|
5
|
-
|
4
|
+
include PlentyClient::Endpoint
|
5
|
+
include PlentyClient::Request
|
6
6
|
|
7
|
-
PROPERTY_GROUP_BASE_PATH = 'items/property_groups/{propertyGroupId}'
|
7
|
+
PROPERTY_GROUP_BASE_PATH = 'items/property_groups/{propertyGroupId}'.freeze
|
8
8
|
|
9
9
|
LIST_ALL_PROPERTY_GROUP_NAMES = '/names'.freeze
|
10
10
|
GET_PROPERTY_GROUP_NAMES = '/names/{lang}'.freeze
|
@@ -19,8 +19,8 @@ module PlentyClient
|
|
19
19
|
|
20
20
|
def find(property_group_id, lang, headers = {}, &block)
|
21
21
|
get(build_endpoint("#{PROPERTY_GROUP_BASE_PATH}#{GET_PROPERTY_GROUP_NAMES}",
|
22
|
-
property_group: property_group_id,
|
23
|
-
|
22
|
+
property_group: property_group_id, lang: lang),
|
23
|
+
headers, &block)
|
24
24
|
end
|
25
25
|
|
26
26
|
def create(headers = {})
|
@@ -29,14 +29,12 @@ module PlentyClient
|
|
29
29
|
|
30
30
|
def update(property_group_id, lang, headers = {})
|
31
31
|
put(build_endpoint("#{PROPERTY_GROUP_BASE_PATH}#{UPDATE_PROPERTY_GROUP_NAMES}",
|
32
|
-
property_group: property_group_id,
|
33
|
-
lang: lang), headers)
|
32
|
+
property_group: property_group_id, lang: lang), headers)
|
34
33
|
end
|
35
34
|
|
36
|
-
def
|
35
|
+
def destroy(property_group_id, lang)
|
37
36
|
delete(build_endpoint("#{PROPERTY_GROUP_BASE_PATH}#{DELETE_PROPERTY_GROUP_NAMES}",
|
38
|
-
property_group: property_group_id,
|
39
|
-
lang: lang))
|
37
|
+
property_group: property_group_id, lang: lang))
|
40
38
|
end
|
41
39
|
end
|
42
40
|
end
|
@@ -1,9 +1,8 @@
|
|
1
1
|
module PlentyClient
|
2
2
|
module Item
|
3
3
|
class SalesPrice
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
include PlentyClient::Endpoint
|
5
|
+
include PlentyClient::Request
|
7
6
|
|
8
7
|
LIST_ALL_SALES_PRICES = '/items/sales_prices'.freeze
|
9
8
|
GET_SALES_PRICE = '/items/sales_prices/{salesPriceId}'.freeze
|
@@ -28,7 +27,7 @@ module PlentyClient
|
|
28
27
|
put(build_endpoint(UPDATE_SALES_PRICE, sales_price: sales_price_id), headers)
|
29
28
|
end
|
30
29
|
|
31
|
-
def
|
30
|
+
def destroy(sales_price_id)
|
32
31
|
delete(build_endpoint(DELETE_SALES_PRICE, sales_price: sales_price_id))
|
33
32
|
end
|
34
33
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module PlentyClient
|
2
2
|
module Item
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
class ShippingProfile
|
4
|
+
include PlentyClient::Endpoint
|
5
|
+
include PlentyClient::Request
|
6
6
|
|
7
7
|
GET_ITEMS_SHIPPING_PROFILE = '/items/{itemId}/item_shipping_profiles'.freeze
|
8
8
|
CREATE_ITEMS_SHIPPING_PROFILE = '/items/{itemId}/item_shipping_profiles'.freeze
|
@@ -14,11 +14,11 @@ module PlentyClient
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def create(item_id, headers = {})
|
17
|
-
post(build_endpoint(
|
17
|
+
post(build_endpoint(CREATE_ITEMS_SHIPPING_PROFILE, item: item_id), headers)
|
18
18
|
end
|
19
19
|
|
20
|
-
def
|
21
|
-
delete(build_endpoint(
|
20
|
+
def destroy(item_id, profile_id)
|
21
|
+
delete(build_endpoint(DELETE_ITEMS_SHIPPING_PROFILE, item: item_id, profile: profile_id))
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
@@ -1,9 +1,8 @@
|
|
1
1
|
module PlentyClient
|
2
2
|
module Item
|
3
3
|
class Unit
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
include PlentyClient::Endpoint
|
5
|
+
include PlentyClient::Request
|
7
6
|
|
8
7
|
CREATE_ITEMS_UNITS = '/items/{itemId}/units'.freeze
|
9
8
|
GET_ITEMS_UNIT = '/items/{itemId}/units'.freeze
|
@@ -26,7 +25,7 @@ module PlentyClient
|
|
26
25
|
put(build_endpoint(GET_ITEMS_UNIT, unit: unit_id), headers, &block)
|
27
26
|
end
|
28
27
|
|
29
|
-
def
|
28
|
+
def destroy(unit_id)
|
30
29
|
delete(build_endpoint(DELETE_ITEMS_UNIT, unit: unit_id))
|
31
30
|
end
|
32
31
|
end
|
@@ -1,10 +1,11 @@
|
|
1
|
+
# TODO: Fix class, PlentyMarkets changed syntax
|
1
2
|
module PlentyClient
|
2
3
|
module Item
|
3
4
|
class UnitName
|
4
|
-
|
5
|
-
|
5
|
+
include PlentyClient::Endpoint
|
6
|
+
include PlentyClient::Request
|
6
7
|
|
7
|
-
ITEM_UNIT_PATH
|
8
|
+
ITEM_UNIT_PATH = '/items/{itemId}/units'.freeze
|
8
9
|
|
9
10
|
ITEM_UNITS = '/names'.freeze
|
10
11
|
LIST_ITEM_UNIT = '/names'.freeze
|
@@ -14,23 +15,23 @@ module PlentyClient
|
|
14
15
|
|
15
16
|
class << self
|
16
17
|
def create(item_id, headers = {})
|
17
|
-
post(build_endpoint(CREATE_ITEMS_UNITS), headers)
|
18
|
+
post(build_endpoint(CREATE_ITEMS_UNITS, item: item_id), headers)
|
18
19
|
end
|
19
20
|
|
20
21
|
def list(item_id, headers = {}, &block)
|
21
|
-
get(build_endpoint(LIST_ITEM_UNIT), headers, &block)
|
22
|
+
get(build_endpoint(LIST_ITEM_UNIT, item: item_id), headers, &block)
|
22
23
|
end
|
23
24
|
|
24
|
-
def find(unit_id, lang, headers = {}, &block)
|
25
|
-
get(build_endpoint(GET_ITEMS_UNIT, unit: unit_id, lang: lang), headers, &block)
|
25
|
+
def find(item_id, unit_id, lang, headers = {}, &block)
|
26
|
+
get(build_endpoint(GET_ITEMS_UNIT, item: item_id, unit: unit_id, lang: lang), headers, &block)
|
26
27
|
end
|
27
28
|
|
28
|
-
def update(unit_id, lang, headers = {}, &block)
|
29
|
-
put(build_endpoint(UPDATE_ITEMS_UNIT, unit: unit_id, lang: lang), headers, &block)
|
29
|
+
def update(item_id, unit_id, lang, headers = {}, &block)
|
30
|
+
put(build_endpoint(UPDATE_ITEMS_UNIT, item: item_id, unit: unit_id, lang: lang), headers, &block)
|
30
31
|
end
|
31
32
|
|
32
|
-
def
|
33
|
-
delete(build_endpoint(DELETE_ITEMS_UNIT, unit: unit_id, lang: lang))
|
33
|
+
def destroy(item_id, unit_id, lang)
|
34
|
+
delete(build_endpoint(DELETE_ITEMS_UNIT, item: item_id, unit: unit_id, lang: lang))
|
34
35
|
end
|
35
36
|
end
|
36
37
|
end
|
@@ -1,13 +1,15 @@
|
|
1
1
|
module PlentyClient
|
2
2
|
module Item
|
3
3
|
module Variation
|
4
|
-
|
5
|
-
|
4
|
+
include PlentyClient::Endpoint
|
5
|
+
include PlentyClient::Request
|
6
|
+
|
6
7
|
ALL_VARIATIONS = '/items/variations'.freeze
|
7
8
|
DELETE_ITEMS_VARIATION = '/items/{itemId}/variations/{variationId}'.freeze
|
8
9
|
GET_ITEMS_VARIATION = '/items/{itemId}/variations/{variationId}'.freeze
|
9
10
|
GET_ITEMS_VARIATIONS = '/items/{itemId}/variations'.freeze
|
10
11
|
POST_ITEMS_VARIATION = '/items/{itemId}/variations'.freeze
|
12
|
+
UPDATE_ITEMS_VARIATION = '/items/{itemId}/variations/{variationId}'.freeze
|
11
13
|
|
12
14
|
class << self
|
13
15
|
def all(headers = {}, &block)
|
@@ -22,11 +24,15 @@ module PlentyClient
|
|
22
24
|
get(build_endpoint(GET_ITEMS_VARIATIONS, item: item_id), headers, &block)
|
23
25
|
end
|
24
26
|
|
25
|
-
def
|
27
|
+
def create(item_id, body = {})
|
26
28
|
post(build_endpoint(POST_ITEMS_VARIATION, item: item_id), body)
|
27
29
|
end
|
28
30
|
|
29
|
-
def
|
31
|
+
def update(item_id, variation_id, body = {})
|
32
|
+
put(build_endpoint(UPDATE_ITEMS_VARIATION, item: item_id, variation: variation_id), body)
|
33
|
+
end
|
34
|
+
|
35
|
+
def destroy(item_id, variation_id)
|
30
36
|
delete(build_endpoint(DELETE_ITEMS_VARIATION, item: item_id, variation: variation_id))
|
31
37
|
end
|
32
38
|
end
|
@@ -2,8 +2,8 @@ module PlentyClient
|
|
2
2
|
module Item
|
3
3
|
module Variation
|
4
4
|
class Barcode
|
5
|
-
|
6
|
-
|
5
|
+
include PlentyClient::Endpoint
|
6
|
+
include PlentyClient::Request
|
7
7
|
|
8
8
|
ITEM_VARIATION_BARCODE_PATH = '/items/{itemId}/variations/{variationId}'.freeze
|
9
9
|
|
@@ -40,7 +40,7 @@ module PlentyClient
|
|
40
40
|
barcode: barcode_id), body)
|
41
41
|
end
|
42
42
|
|
43
|
-
def
|
43
|
+
def destroy(item_id, variation_id, barcode_id)
|
44
44
|
delete(build_endpoint("#{ITEM_VARIATION_BARCODE_PATH}#{DELETE_ITEM_VARIATIONS_BARCODE}",
|
45
45
|
item: item_id,
|
46
46
|
variation: variation_id,
|
@@ -1,9 +1,10 @@
|
|
1
|
+
# TODO: Fix class, PlentyMarkets changed syntax
|
1
2
|
module PlentyClient
|
2
3
|
module Item
|
3
4
|
module Variation
|
4
5
|
class Bundle
|
5
|
-
|
6
|
-
|
6
|
+
include PlentyClient::Endpoint
|
7
|
+
include PlentyClient::Request
|
7
8
|
|
8
9
|
ITEM_VARIATION_BUNDLE_PATH = '/items/{itemId}/variations/{variationId}'.freeze
|
9
10
|
|
@@ -16,34 +17,31 @@ module PlentyClient
|
|
16
17
|
class << self
|
17
18
|
def list(item_id, variation_id, headers = {}, &block)
|
18
19
|
get(build_endpoint("#{ITEM_VARIATION_BUNDLE_PATH}#{LIST_ITEM_VARIATIONS_BUNDLE}",
|
19
|
-
item: item_id,
|
20
|
-
|
20
|
+
item: item_id, variation: variation_id),
|
21
|
+
headers, &block)
|
21
22
|
end
|
22
23
|
|
23
24
|
def find(item_id, variation_id, bundle_id, headers = {}, &block)
|
24
25
|
get(build_endpoint("#{ITEM_VARIATION_BUNDLE_PATH}#{GET_ITEM_VARIATIONS_BUNDLE}",
|
25
|
-
item: item_id,
|
26
|
-
|
27
|
-
bundle: bundle_id), headers, &block)
|
26
|
+
item: item_id, variation: variation_id, bundle: bundle_id),
|
27
|
+
headers, &block)
|
28
28
|
end
|
29
29
|
|
30
30
|
def create(item_id, variation_id, body = {})
|
31
31
|
post(build_endpoint("#{ITEM_VARIATION_BUNDLE_PATH}#{CREATE_ITEM_VARIATIONS_BUNDLE}",
|
32
|
-
item: item_id,
|
33
|
-
|
32
|
+
item: item_id, variation: variation_id),
|
33
|
+
body)
|
34
34
|
end
|
35
35
|
|
36
36
|
def update(item_id, variation_id, bundle_id, body = {})
|
37
|
-
put(build_endpoint("#{ITEM_VARIATION_BUNDLE_PATH}#{
|
38
|
-
|
39
|
-
|
37
|
+
put(build_endpoint("#{ITEM_VARIATION_BUNDLE_PATH}#{UPDATE_ITEM_VARIATIONS_BUNDLE}",
|
38
|
+
item: item_id, variation: variation_id, bundle: bundle_id),
|
39
|
+
body)
|
40
40
|
end
|
41
41
|
|
42
|
-
def
|
42
|
+
def destroy(item_id, variation_id, bundle_id)
|
43
43
|
delete(build_endpoint("#{ITEM_VARIATION_BUNDLE_PATH}#{DELETE_ITEM_VARIATIONS_BUNDLE}",
|
44
|
-
item: item_id,
|
45
|
-
variation: variation_id,
|
46
|
-
bundle: bundle_id))
|
44
|
+
item: item_id, variation: variation_id, bundle: bundle_id))
|
47
45
|
end
|
48
46
|
end
|
49
47
|
end
|
@@ -2,8 +2,8 @@ module PlentyClient
|
|
2
2
|
module Item
|
3
3
|
module Variation
|
4
4
|
class Category
|
5
|
-
|
6
|
-
|
5
|
+
include PlentyClient::Endpoint
|
6
|
+
include PlentyClient::Request
|
7
7
|
|
8
8
|
ITEM_VARIATION_CATEGORY_PATH = '/items/{itemId}/variations/{variationId}'.freeze
|
9
9
|
|
@@ -24,7 +24,7 @@ module PlentyClient
|
|
24
24
|
get(build_endpoint("#{ITEM_VARIATION_CATEGORY_PATH}#{GET_ITEM_VARIATIONS_CATEGORY}",
|
25
25
|
item: item_id,
|
26
26
|
variation: variation_id,
|
27
|
-
|
27
|
+
cat: category_id), headers, &block)
|
28
28
|
end
|
29
29
|
|
30
30
|
def create(item_id, variation_id, body = {})
|
@@ -34,16 +34,14 @@ module PlentyClient
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def update(item_id, variation_id, category_id, body = {})
|
37
|
-
put(build_endpoint("#{ITEM_VARIATION_CATEGORY_PATH}#{
|
38
|
-
|
39
|
-
|
37
|
+
put(build_endpoint("#{ITEM_VARIATION_CATEGORY_PATH}#{UPDATE_ITEM_VARIATIONS_CATEGORY}",
|
38
|
+
item: item_id, variation: variation_id, cat: category_id),
|
39
|
+
body)
|
40
40
|
end
|
41
41
|
|
42
|
-
def
|
42
|
+
def destroy(item_id, variation_id, category_id)
|
43
43
|
delete(build_endpoint("#{ITEM_VARIATION_CATEGORY_PATH}#{DELETE_ITEM_VARIATIONS_CATEGORY}",
|
44
|
-
item: item_id,
|
45
|
-
variation: variation_id,
|
46
|
-
category: category_id))
|
44
|
+
item: item_id, variation: variation_id, cat: category_id))
|
47
45
|
end
|
48
46
|
end
|
49
47
|
end
|