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
data/lib/plenty_client/item.rb
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
module PlentyClient
|
2
2
|
module Item
|
3
|
-
|
4
|
-
|
3
|
+
include PlentyClient::Endpoint
|
4
|
+
include PlentyClient::Request
|
5
5
|
|
6
6
|
LIST_ITEMS = '/items'.freeze
|
7
7
|
CREATE_ITEM = '/items'.freeze
|
8
|
+
UPDATE_ITEM = '/items/{itemId}'.freeze
|
8
9
|
GET_ITEM = '/items/{itemId}'.freeze
|
9
10
|
|
10
11
|
class << self
|
@@ -16,6 +17,10 @@ module PlentyClient
|
|
16
17
|
get(build_endpoint(GET_ITEM, item: item_id), headers, &block)
|
17
18
|
end
|
18
19
|
|
20
|
+
def update(item_id, body = {})
|
21
|
+
put(build_endpoint(UPDATE_ITEM, item: item_id), body)
|
22
|
+
end
|
23
|
+
|
19
24
|
def create(body = {})
|
20
25
|
post(CREATE_ITEM, body)
|
21
26
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module PlentyClient
|
2
2
|
module Item
|
3
3
|
module Attribute
|
4
|
-
|
5
|
-
|
4
|
+
include PlentyClient::Endpoint
|
5
|
+
include PlentyClient::Request
|
6
6
|
|
7
7
|
CREATE_ATTRIBUTE = '/items/attributes'.freeze
|
8
8
|
LIST_ATTRIBUTES = '/items/attributes'.freeze
|
@@ -27,7 +27,7 @@ module PlentyClient
|
|
27
27
|
post(build_endpoint(UPDATE_ATTRIBUTE, attribute: attribute_id), headers)
|
28
28
|
end
|
29
29
|
|
30
|
-
def
|
30
|
+
def destroy(attribute_id)
|
31
31
|
delete(build_endpoint(DELETE_attribute, attribute: attribute_id))
|
32
32
|
end
|
33
33
|
end
|
@@ -2,10 +2,10 @@ module PlentyClient
|
|
2
2
|
module Item
|
3
3
|
module Attribute
|
4
4
|
class Name
|
5
|
-
|
6
|
-
|
5
|
+
include PlentyClient::Endpoint
|
6
|
+
include PlentyClient::Request
|
7
7
|
|
8
|
-
ITEM_ATTRIBUTE_PATH
|
8
|
+
ITEM_ATTRIBUTE_PATH = '/items/attributes'.freeze
|
9
9
|
|
10
10
|
CREATE_ITEM_ATTRIBUTES = '/{attributeId}/names'.freeze
|
11
11
|
LIST_ITEM_ATTRIBUTE = '/{attributeId}/names'.freeze
|
@@ -15,35 +15,27 @@ module PlentyClient
|
|
15
15
|
|
16
16
|
class << self
|
17
17
|
def create(attribute_id, headers = {})
|
18
|
-
post(build_endpoint("#{ITEM_ATTRIBUTE_PATH}#{CREATE_ITEM_ATTRIBUTES}"),
|
19
|
-
attribute: attribute_id,
|
20
|
-
headers)
|
18
|
+
post(build_endpoint("#{ITEM_ATTRIBUTE_PATH}#{CREATE_ITEM_ATTRIBUTES}", attribute: attribute_id), headers)
|
21
19
|
end
|
22
20
|
|
23
21
|
def list(attribute_id, headers = {}, &block)
|
24
|
-
get(build_endpoint("#{ITEM_ATTRIBUTE_PATH}#{LIST_ITEM_ATTRIBUTE}"),
|
25
|
-
|
26
|
-
headers, &block)
|
22
|
+
get(build_endpoint("#{ITEM_ATTRIBUTE_PATH}#{LIST_ITEM_ATTRIBUTE}", attribute: attribute_id),
|
23
|
+
headers, &block)
|
27
24
|
end
|
28
25
|
|
29
26
|
def find(attribute_id, lang, headers = {}, &block)
|
30
|
-
get(build_endpoint("#{ITEM_ATTRIBUTE_PATH}#{GET_ITEMS_ATTRIBUTE}",
|
31
|
-
|
32
|
-
lang: lang),
|
33
|
-
headers, &block)
|
27
|
+
get(build_endpoint("#{ITEM_ATTRIBUTE_PATH}#{GET_ITEMS_ATTRIBUTE}", attribute: attribute_id, lang: lang),
|
28
|
+
headers, &block)
|
34
29
|
end
|
35
30
|
|
36
31
|
def update(attribute_id, lang, body = {})
|
37
|
-
put(build_endpoint("#{ITEM_ATTRIBUTE_PATH}#{UPDATE_ITEMS_ATTRIBUTE}",
|
38
|
-
|
39
|
-
lang: lang),
|
40
|
-
body)
|
32
|
+
put(build_endpoint("#{ITEM_ATTRIBUTE_PATH}#{UPDATE_ITEMS_ATTRIBUTE}", attribute: attribute_id, lang: lang),
|
33
|
+
body)
|
41
34
|
end
|
42
35
|
|
43
|
-
def
|
36
|
+
def destroy(attribute_id, lang)
|
44
37
|
delete(build_endpoint("#{ITEM_ATTRIBUTE_PATH}#{DELETE_ITEMS_ATTRIBUTE}",
|
45
|
-
attribute: attribute_id,
|
46
|
-
lang: lang))
|
38
|
+
attribute: attribute_id, lang: lang))
|
47
39
|
end
|
48
40
|
end
|
49
41
|
end
|
@@ -2,10 +2,10 @@ module PlentyClient
|
|
2
2
|
module Item
|
3
3
|
module Attribute
|
4
4
|
class Value
|
5
|
-
|
6
|
-
|
5
|
+
include PlentyClient::Endpoint
|
6
|
+
include PlentyClient::Request
|
7
7
|
|
8
|
-
ITEM_ATTRIBUTE_PATH
|
8
|
+
ITEM_ATTRIBUTE_PATH = '/items/attributes'.freeze
|
9
9
|
|
10
10
|
CREATE_ITEM_ATTRIBUTE_VALUES = '/{attributeId}/values'.freeze
|
11
11
|
LIST_ITEM_ATTRIBUTE_VALUE = '/{attributeId}/values'.freeze
|
@@ -15,35 +15,30 @@ module PlentyClient
|
|
15
15
|
|
16
16
|
class << self
|
17
17
|
def create(attribute_id, body = {})
|
18
|
-
post(build_endpoint("#{ITEM_ATTRIBUTE_PATH}#{CREATE_ITEM_ATTRIBUTE_VALUES}"),
|
19
|
-
|
20
|
-
body)
|
18
|
+
post(build_endpoint("#{ITEM_ATTRIBUTE_PATH}#{CREATE_ITEM_ATTRIBUTE_VALUES}", attribute: attribute_id),
|
19
|
+
body)
|
21
20
|
end
|
22
21
|
|
23
22
|
def list(attribute_id, headers = {}, &block)
|
24
|
-
get(build_endpoint("#{ITEM_ATTRIBUTE_PATH}#{LIST_ITEM_ATTRIBUTE_VALUE}"),
|
25
|
-
|
26
|
-
headers, &block)
|
23
|
+
get(build_endpoint("#{ITEM_ATTRIBUTE_PATH}#{LIST_ITEM_ATTRIBUTE_VALUE}", attribute: attribute_id),
|
24
|
+
headers, &block)
|
27
25
|
end
|
28
26
|
|
29
27
|
def find(attribute_id, value_id, headers = {}, &block)
|
30
28
|
get(build_endpoint("#{ITEM_ATTRIBUTE_PATH}#{GET_ITEMS_ATTRIBUTE_VALUE}",
|
31
|
-
attribute: attribute_id,
|
32
|
-
|
33
|
-
headers, &block)
|
29
|
+
attribute: attribute_id, value: value_id),
|
30
|
+
headers, &block)
|
34
31
|
end
|
35
32
|
|
36
33
|
def update(attribute_id, value_id, body = {}, &block)
|
37
34
|
put(build_endpoint("#{ITEM_ATTRIBUTE_PATH}#{UPDATE_ITEMS_ATTRIBUTE_VALUE}",
|
38
|
-
attribute: attribute_id,
|
39
|
-
|
40
|
-
body, &block)
|
35
|
+
attribute: attribute_id, value: value_id),
|
36
|
+
body, &block)
|
41
37
|
end
|
42
38
|
|
43
|
-
def
|
39
|
+
def destroy(attribute_id, value_id)
|
44
40
|
delete(build_endpoint("#{ITEM_ATTRIBUTE_PATH}#{DELETE_ITEMS_ATTRIBUTE_VALUE}",
|
45
|
-
attribute: attribute_id,
|
46
|
-
value: value_id))
|
41
|
+
attribute: attribute_id, value: value_id))
|
47
42
|
end
|
48
43
|
end
|
49
44
|
end
|
@@ -2,10 +2,10 @@ module PlentyClient
|
|
2
2
|
module Item
|
3
3
|
module Attribute
|
4
4
|
class ValueName
|
5
|
-
|
6
|
-
|
5
|
+
include PlentyClient::Endpoint
|
6
|
+
include PlentyClient::Request
|
7
7
|
|
8
|
-
ITEM_ATTRIBUTE_PATH
|
8
|
+
ITEM_ATTRIBUTE_PATH = '/items/attribute_values'.freeze
|
9
9
|
|
10
10
|
CREATE_ITEM_ATTRIBUTE_VALUES = '/{attributeValueId}/names'.freeze
|
11
11
|
LIST_ITEM_ATTRIBUTE_VALUE = '/{attributeValueId}/names'.freeze
|
@@ -15,32 +15,32 @@ module PlentyClient
|
|
15
15
|
|
16
16
|
class << self
|
17
17
|
def create(attribute_value_id, body = {})
|
18
|
-
post(build_endpoint("#{ITEM_ATTRIBUTE_PATH}#{CREATE_ITEM_ATTRIBUTE_VALUES}"
|
19
|
-
attribute_value: attribute_value_id,
|
20
|
-
|
18
|
+
post(build_endpoint("#{ITEM_ATTRIBUTE_PATH}#{CREATE_ITEM_ATTRIBUTE_VALUES}",
|
19
|
+
attribute_value: attribute_value_id),
|
20
|
+
body)
|
21
21
|
end
|
22
22
|
|
23
23
|
def list(attribute_value_id, headers = {}, &block)
|
24
|
-
get(build_endpoint("#{ITEM_ATTRIBUTE_PATH}#{LIST_ITEM_ATTRIBUTE_VALUE}"
|
25
|
-
|
26
|
-
|
24
|
+
get(build_endpoint("#{ITEM_ATTRIBUTE_PATH}#{LIST_ITEM_ATTRIBUTE_VALUE}",
|
25
|
+
attribute_value: attribute_value_id),
|
26
|
+
headers, &block)
|
27
27
|
end
|
28
28
|
|
29
29
|
def find(attribute_value_id, lang, headers = {}, &block)
|
30
30
|
get(build_endpoint("#{ITEM_ATTRIBUTE_PATH}#{GET_ITEMS_ATTRIBUTE_VALUE}",
|
31
31
|
attribute_value: attribute_value_id,
|
32
32
|
lang: lang),
|
33
|
-
|
33
|
+
headers, &block)
|
34
34
|
end
|
35
35
|
|
36
36
|
def update(attribute_value_id, lang, body = {}, &block)
|
37
37
|
put(build_endpoint("#{ITEM_ATTRIBUTE_PATH}#{UPDATE_ITEMS_ATTRIBUTE_VALUE}",
|
38
38
|
attribute_value: attribute_value_id,
|
39
39
|
lang: lang),
|
40
|
-
|
40
|
+
body, &block)
|
41
41
|
end
|
42
42
|
|
43
|
-
def
|
43
|
+
def destroy(attribute_value_id, _value_id)
|
44
44
|
delete(build_endpoint("#{ITEM_ATTRIBUTE_PATH}#{DELETE_ITEMS_ATTRIBUTE_VALUE}",
|
45
45
|
attribute_value: attribute_value_id,
|
46
46
|
lang: lang))
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module PlentyClient
|
2
2
|
module Item
|
3
3
|
class Barcode
|
4
|
-
|
5
|
-
|
4
|
+
include PlentyClient::Endpoint
|
5
|
+
include PlentyClient::Request
|
6
6
|
|
7
7
|
LIST_ALL_BARCODES = '/items/barcodes'.freeze
|
8
8
|
CREATE_BARCODE = '/items/barcodes'.freeze
|
@@ -39,7 +39,7 @@ module PlentyClient
|
|
39
39
|
post(build_endpoint(UPDATE_BARCODE, barcode: barcode_id), body)
|
40
40
|
end
|
41
41
|
|
42
|
-
def
|
42
|
+
def destroy(barcode_id)
|
43
43
|
delete(build_endpoint(DELETE_BARCODE, barcode: barcode_id))
|
44
44
|
end
|
45
45
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module PlentyClient
|
2
2
|
module Item
|
3
3
|
class CrossSelling
|
4
|
-
|
5
|
-
|
4
|
+
include PlentyClient::Endpoint
|
5
|
+
include PlentyClient::Request
|
6
6
|
|
7
7
|
CREATE_ITEMS_CROSS_SELLING = '/items/{itemId}/item_cross_selling'.freeze
|
8
8
|
GET_ITEMS_CROSS_SELLING = '/items/{itemId}/item_cross_selling'.freeze
|
@@ -17,7 +17,7 @@ module PlentyClient
|
|
17
17
|
get(build_endpoint(GET_ITEMS_CROSS_SELLING, item: item_id), headers, &block)
|
18
18
|
end
|
19
19
|
|
20
|
-
def
|
20
|
+
def destroy(item_id, cross_item_id)
|
21
21
|
delete(build_endpoint(DELETE_ITEMS_CROSS_SELLING, item: item_id, cross_item: cross_item_id))
|
22
22
|
end
|
23
23
|
end
|
@@ -1,9 +1,10 @@
|
|
1
1
|
module PlentyClient
|
2
2
|
module Item
|
3
3
|
module Image
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
include PlentyClient::Endpoint
|
5
|
+
include PlentyClient::Request
|
6
|
+
|
7
|
+
ITEM_IMAGE_BASE_PATH = '/items/{itemId}'.freeze
|
7
8
|
|
8
9
|
LIST_ALL_ITEM_IMAGES = '/images'.freeze
|
9
10
|
CREATE_ITEM_IMAGES = '/images/upload'.freeze
|
@@ -24,7 +25,6 @@ module PlentyClient
|
|
24
25
|
variation: variation_id), headers, &block)
|
25
26
|
end
|
26
27
|
|
27
|
-
|
28
28
|
def find(item_id, image_id, headers = {}, &block)
|
29
29
|
get(build_endpoint("#{ITEM_IMAGE_BASE_PATH}#{GET_ITEM_IMAGES}",
|
30
30
|
property_group: item_id,
|
@@ -34,7 +34,7 @@ module PlentyClient
|
|
34
34
|
def create(headers = {})
|
35
35
|
post(build_endpoint("#{ITEM_IMAGE_BASE_PATH}#{CREATE_ITEM_IMAGES}"), headers)
|
36
36
|
end
|
37
|
-
|
37
|
+
send(:alias_method, :upload, :create)
|
38
38
|
|
39
39
|
def update(item_id, image_id, headers = {})
|
40
40
|
put(build_endpoint("#{ITEM_IMAGE_BASE_PATH}#{UPDATE_ITEM_IMAGES}",
|
@@ -42,7 +42,7 @@ module PlentyClient
|
|
42
42
|
image: image_id), headers)
|
43
43
|
end
|
44
44
|
|
45
|
-
def
|
45
|
+
def destroy(item_id, image_id)
|
46
46
|
delete(build_endpoint("#{ITEM_IMAGE_BASE_PATH}#{DELETE_ITEM_IMAGES}",
|
47
47
|
property_group: item_id,
|
48
48
|
image: image_id))
|
@@ -2,8 +2,9 @@ module PlentyClient
|
|
2
2
|
module Item
|
3
3
|
module Image
|
4
4
|
class Availability
|
5
|
-
|
6
|
-
|
5
|
+
include PlentyClient::Endpoint
|
6
|
+
include PlentyClient::Request
|
7
|
+
|
7
8
|
ITEM_IMAGE_AVAILABILITY_PATH = '/items/{itemId}/images'.freeze
|
8
9
|
|
9
10
|
LIST_ITEM_IMAGE_AVAILABILITY = '/{imageId}/availabilities'.freeze
|
@@ -12,20 +13,19 @@ module PlentyClient
|
|
12
13
|
|
13
14
|
class << self
|
14
15
|
def create(item_id, image_id, headers = {})
|
15
|
-
post(build_endpoint("#{ITEM_IMAGE_AVAILABILITY_PATH}#{CREATE_ITEM_IMAGE_AVAILABILITY}"
|
16
|
+
post(build_endpoint("#{ITEM_IMAGE_AVAILABILITY_PATH}#{CREATE_ITEM_IMAGE_AVAILABILITY}",
|
16
17
|
item: item_id,
|
17
|
-
image: image_id,
|
18
|
-
headers)
|
18
|
+
image: image_id), headers)
|
19
19
|
end
|
20
20
|
|
21
21
|
def list(item_id, image_id, headers = {}, &block)
|
22
|
-
get(build_endpoint("#{ITEM_IMAGE_AVAILABILITY_PATH}#{LIST_ITEM_IMAGE_AVAILABILITY}"
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
get(build_endpoint("#{ITEM_IMAGE_AVAILABILITY_PATH}#{LIST_ITEM_IMAGE_AVAILABILITY}",
|
23
|
+
item: item_id,
|
24
|
+
image: image_id),
|
25
|
+
headers, &block)
|
26
26
|
end
|
27
27
|
|
28
|
-
def
|
28
|
+
def destroy(item_id, image_id)
|
29
29
|
delete(build_endpoint("#{ITEM_IMAGE_AVAILABILITY_PATH}#{DELETE_ITEMS_IMAGE_AVAILABILITY}",
|
30
30
|
item: item_id,
|
31
31
|
image: image_id))
|
@@ -2,10 +2,10 @@ module PlentyClient
|
|
2
2
|
module Item
|
3
3
|
module Image
|
4
4
|
class Name
|
5
|
-
|
6
|
-
|
5
|
+
include PlentyClient::Endpoint
|
6
|
+
include PlentyClient::Request
|
7
7
|
|
8
|
-
ITEM_IMAGE_NAME_PATH
|
8
|
+
ITEM_IMAGE_NAME_PATH = '/items/{itemId}/images'.freeze
|
9
9
|
|
10
10
|
CREATE_ITEM_IMAGE_NAMES = '/{imageId}/names'.freeze
|
11
11
|
LIST_ITEM_IMAGE_NAME = '/{imageId}/names'.freeze
|
@@ -15,40 +15,30 @@ module PlentyClient
|
|
15
15
|
|
16
16
|
class << self
|
17
17
|
def create(item_id, image_id, headers = {})
|
18
|
-
post(build_endpoint("#{ITEM_IMAGE_NAME_PATH}#{CREATE_ITEM_IMAGE_NAMES}"),
|
19
|
-
|
20
|
-
image: image_id,
|
21
|
-
headers)
|
18
|
+
post(build_endpoint("#{ITEM_IMAGE_NAME_PATH}#{CREATE_ITEM_IMAGE_NAMES}", item: item_id, image: image_id),
|
19
|
+
headers)
|
22
20
|
end
|
23
21
|
|
24
22
|
def list(item_id, image_id, headers = {}, &block)
|
25
|
-
get(build_endpoint("#{ITEM_IMAGE_NAME_PATH}#{LIST_ITEM_IMAGE_NAME}"),
|
26
|
-
|
27
|
-
image: image_id,
|
28
|
-
headers, &block)
|
23
|
+
get(build_endpoint("#{ITEM_IMAGE_NAME_PATH}#{LIST_ITEM_IMAGE_NAME}", item: item_id, image: image_id),
|
24
|
+
headers, &block)
|
29
25
|
end
|
30
26
|
|
31
|
-
def find(item_id,
|
27
|
+
def find(item_id, image_id, lang, headers = {}, &block)
|
32
28
|
get(build_endpoint("#{ITEM_IMAGE_NAME_PATH}#{GET_ITEMS_IMAGE_NAME}",
|
33
|
-
item: item_id,
|
34
|
-
|
35
|
-
lang: lang),
|
36
|
-
headers, &block)
|
29
|
+
item: item_id, image: image_id, lang: lang),
|
30
|
+
headers, &block)
|
37
31
|
end
|
38
32
|
|
39
33
|
def update(item_id, image_id, lang, body = {})
|
40
34
|
put(build_endpoint("#{ITEM_IMAGE_NAME_PATH}#{UPDATE_ITEMS_IMAGE_NAME}",
|
41
|
-
item: item_id,
|
42
|
-
|
43
|
-
lang: lang),
|
44
|
-
body)
|
35
|
+
item: item_id, image: image_id, lang: lang),
|
36
|
+
body)
|
45
37
|
end
|
46
38
|
|
47
|
-
def
|
39
|
+
def destroy(item_id, image_id, lang)
|
48
40
|
delete(build_endpoint("#{ITEM_IMAGE_NAME_PATH}#{DELETE_ITEMS_IMAGE_NAME}",
|
49
|
-
item: item_id,
|
50
|
-
image: image_id,
|
51
|
-
lang: lang))
|
41
|
+
item: item_id, image: image_id, lang: lang))
|
52
42
|
end
|
53
43
|
end
|
54
44
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module PlentyClient
|
2
2
|
module Item
|
3
3
|
module Manufacturer
|
4
|
-
|
5
|
-
|
4
|
+
include PlentyClient::Endpoint
|
5
|
+
include PlentyClient::Request
|
6
6
|
|
7
7
|
LIST_ALL_MANUFACTURERS = '/items/manufacturers'.freeze
|
8
8
|
GET_MANUFACTURER = '/items/manufacturers/{manufacturerId}'.freeze
|
@@ -12,7 +12,7 @@ module PlentyClient
|
|
12
12
|
|
13
13
|
class << self
|
14
14
|
def list(headers = {}, &block)
|
15
|
-
get(build_endpoint(
|
15
|
+
get(build_endpoint(LIST_ALL_MANUFACTURERS), headers, &block)
|
16
16
|
end
|
17
17
|
|
18
18
|
def find(manufacturer_id, headers = {}, &block)
|
@@ -27,7 +27,7 @@ module PlentyClient
|
|
27
27
|
put(build_endpoint(UPDATE_MANUFACTURER, manufacturer: manufacturer_id), headers)
|
28
28
|
end
|
29
29
|
|
30
|
-
def
|
30
|
+
def destroy(manufacturer_id)
|
31
31
|
delete(build_endpoint(DELETE_MANUFACTURER, manufacturer: manufacturer_id))
|
32
32
|
end
|
33
33
|
end
|
@@ -2,8 +2,8 @@ module PlentyClient
|
|
2
2
|
module Item
|
3
3
|
module Manufacturer
|
4
4
|
class Commission
|
5
|
-
|
6
|
-
|
5
|
+
include PlentyClient::Endpoint
|
6
|
+
include PlentyClient::Request
|
7
7
|
|
8
8
|
ITEM_MANUFACTURER_COMMISSION = '/items/manufacturers/{manufacturerId}'.freeze
|
9
9
|
|
@@ -40,7 +40,7 @@ module PlentyClient
|
|
40
40
|
body)
|
41
41
|
end
|
42
42
|
|
43
|
-
def
|
43
|
+
def destroy(manufacturer_id, commission_id)
|
44
44
|
delete(build_endpoint("#{ITEM_MANUFACTURER_COMMISSION}#{DELETE_ITEMS_MANUFACTURER_COMMISSION}",
|
45
45
|
manufacturer: manufacturer_id,
|
46
46
|
commission: commission_id))
|