plenty_client 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +23 -0
  3. data/.rspec +2 -0
  4. data/.rubocop.yml +43 -0
  5. data/.travis.yml +5 -0
  6. data/CODE_OF_CONDUCT.md +74 -0
  7. data/Gemfile +4 -0
  8. data/LICENSE.txt +21 -0
  9. data/README.md +154 -0
  10. data/Rakefile +6 -0
  11. data/lib/plenty_client/config.rb +15 -0
  12. data/lib/plenty_client/constants.rb +362 -0
  13. data/lib/plenty_client/endpoint.rb +73 -0
  14. data/lib/plenty_client/item/attribute/name.rb +52 -0
  15. data/lib/plenty_client/item/attribute/value.rb +52 -0
  16. data/lib/plenty_client/item/attribute/value_name.rb +52 -0
  17. data/lib/plenty_client/item/attribute.rb +36 -0
  18. data/lib/plenty_client/item/barcode.rb +56 -0
  19. data/lib/plenty_client/item/cross_selling.rb +26 -0
  20. data/lib/plenty_client/item/image/availability.rb +37 -0
  21. data/lib/plenty_client/item/image/name.rb +57 -0
  22. data/lib/plenty_client/item/image.rb +53 -0
  23. data/lib/plenty_client/item/manufacturer/commission.rb +52 -0
  24. data/lib/plenty_client/item/manufacturer.rb +36 -0
  25. data/lib/plenty_client/item/property/market_reference.rb +52 -0
  26. data/lib/plenty_client/item/property/name.rb +52 -0
  27. data/lib/plenty_client/item/property.rb +36 -0
  28. data/lib/plenty_client/item/property_group.rb +36 -0
  29. data/lib/plenty_client/item/property_group_name.rb +44 -0
  30. data/lib/plenty_client/item/sales_price.rb +37 -0
  31. data/lib/plenty_client/item/shipping_profile.rb +26 -0
  32. data/lib/plenty_client/item/unit.rb +35 -0
  33. data/lib/plenty_client/item/unit_name.rb +38 -0
  34. data/lib/plenty_client/item/variation/barcode.rb +53 -0
  35. data/lib/plenty_client/item/variation/bundle.rb +52 -0
  36. data/lib/plenty_client/item/variation/category.rb +52 -0
  37. data/lib/plenty_client/item/variation/client.rb +37 -0
  38. data/lib/plenty_client/item/variation/default_category.rb +45 -0
  39. data/lib/plenty_client/item/variation/description.rb +53 -0
  40. data/lib/plenty_client/item/variation/image.rb +49 -0
  41. data/lib/plenty_client/item/variation/market.rb +37 -0
  42. data/lib/plenty_client/item/variation/market_ident_number.rb +53 -0
  43. data/lib/plenty_client/item/variation/sales_price.rb +53 -0
  44. data/lib/plenty_client/item/variation/sku.rb +52 -0
  45. data/lib/plenty_client/item/variation/stock.rb +57 -0
  46. data/lib/plenty_client/item/variation/supplier.rb +52 -0
  47. data/lib/plenty_client/item/variation/warehouse.rb +52 -0
  48. data/lib/plenty_client/item/variation.rb +35 -0
  49. data/lib/plenty_client/item/variation_property.rb +36 -0
  50. data/lib/plenty_client/item/variation_property_value.rb +48 -0
  51. data/lib/plenty_client/item.rb +24 -0
  52. data/lib/plenty_client/item_set/component.rb +54 -0
  53. data/lib/plenty_client/item_set/config.rb +20 -0
  54. data/lib/plenty_client/item_set.rb +44 -0
  55. data/lib/plenty_client/order/contact_wish.rb +17 -0
  56. data/lib/plenty_client/order/coupon_code/contact.rb +20 -0
  57. data/lib/plenty_client/order/coupon_code/validation.rb +20 -0
  58. data/lib/plenty_client/order/coupon_code.rb +19 -0
  59. data/lib/plenty_client/order/currency.rb +32 -0
  60. data/lib/plenty_client/order/date.rb +32 -0
  61. data/lib/plenty_client/order/item/date.rb +20 -0
  62. data/lib/plenty_client/order/item/property.rb +20 -0
  63. data/lib/plenty_client/order/item/serial_number.rb +25 -0
  64. data/lib/plenty_client/order/item.rb +18 -0
  65. data/lib/plenty_client/order/property.rb +21 -0
  66. data/lib/plenty_client/order/referrer.rb +22 -0
  67. data/lib/plenty_client/order/shipping/country.rb +18 -0
  68. data/lib/plenty_client/order/shipping/information.rb +45 -0
  69. data/lib/plenty_client/order/shipping/package.rb +54 -0
  70. data/lib/plenty_client/order/shipping/profile.rb +23 -0
  71. data/lib/plenty_client/order/shipping/service_provider.rb +27 -0
  72. data/lib/plenty_client/order/shipping.rb +12 -0
  73. data/lib/plenty_client/order.rb +43 -0
  74. data/lib/plenty_client/request.rb +128 -0
  75. data/lib/plenty_client/sales_price/account.rb +30 -0
  76. data/lib/plenty_client/sales_price/country.rb +26 -0
  77. data/lib/plenty_client/sales_price/currency.rb +26 -0
  78. data/lib/plenty_client/sales_price/customer_class.rb +31 -0
  79. data/lib/plenty_client/sales_price/name.rb +36 -0
  80. data/lib/plenty_client/sales_price/online_store.rb +29 -0
  81. data/lib/plenty_client/sales_price/referrer.rb +25 -0
  82. data/lib/plenty_client/version.rb +3 -0
  83. data/lib/plenty_client.rb +108 -0
  84. data/plenty_client.gemspec +29 -0
  85. metadata +204 -0
@@ -0,0 +1,26 @@
1
+ module PlentyClient
2
+ module Item
3
+ class CrossSelling
4
+ extend PlentyClient::Endpoint
5
+ extend PlentyClient::Request
6
+
7
+ CREATE_ITEMS_CROSS_SELLING = '/items/{itemId}/item_cross_selling'.freeze
8
+ GET_ITEMS_CROSS_SELLING = '/items/{itemId}/item_cross_selling'.freeze
9
+ DELETE_ITEMS_CROSS_SELLING = '/items/{itemId}/item_cross_selling/{crossItemId}'.freeze
10
+
11
+ class << self
12
+ def create(item_id, headers = {})
13
+ post(build_endpoint(CREATE_ITEMS_CROSS_SELLING, item: item_id), headers)
14
+ end
15
+
16
+ def list(item_id, headers = {}, &block)
17
+ get(build_endpoint(GET_ITEMS_CROSS_SELLING, item: item_id), headers, &block)
18
+ end
19
+
20
+ def delete(item_id, cross_item_id)
21
+ delete(build_endpoint(DELETE_ITEMS_CROSS_SELLING, item: item_id, cross_item: cross_item_id))
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,37 @@
1
+ module PlentyClient
2
+ module Item
3
+ module Image
4
+ class Availability
5
+ extend PlentyClient::Endpoint
6
+ extend PlentyClient::Request
7
+ ITEM_IMAGE_AVAILABILITY_PATH = '/items/{itemId}/images'.freeze
8
+
9
+ LIST_ITEM_IMAGE_AVAILABILITY = '/{imageId}/availabilities'.freeze
10
+ CREATE_ITEM_IMAGE_AVAILABILITY = '/{imageId}/availabilities'.freeze
11
+ DELETE_ITEMS_IMAGE_AVAILABILITY = '/{imageId}/availabilities'.freeze
12
+
13
+ class << self
14
+ def create(item_id, image_id, headers = {})
15
+ post(build_endpoint("#{ITEM_IMAGE_AVAILABILITY_PATH}#{CREATE_ITEM_IMAGE_AVAILABILITY}"),
16
+ item: item_id,
17
+ image: image_id,
18
+ headers)
19
+ end
20
+
21
+ def list(item_id, image_id, headers = {}, &block)
22
+ get(build_endpoint("#{ITEM_IMAGE_AVAILABILITY_PATH}#{LIST_ITEM_IMAGE_AVAILABILITY}"),
23
+ item: item_id,
24
+ image: image_id,
25
+ headers, &block)
26
+ end
27
+
28
+ def delete(item_id, image_id)
29
+ delete(build_endpoint("#{ITEM_IMAGE_AVAILABILITY_PATH}#{DELETE_ITEMS_IMAGE_AVAILABILITY}",
30
+ item: item_id,
31
+ image: image_id))
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,57 @@
1
+ module PlentyClient
2
+ module Item
3
+ module Image
4
+ class Name
5
+ extend PlentyClient::Endpoint
6
+ extend PlentyClient::Request
7
+
8
+ ITEM_IMAGE_NAME_PATH = '/items/{itemId}/images'.freeze
9
+
10
+ CREATE_ITEM_IMAGE_NAMES = '/{imageId}/names'.freeze
11
+ LIST_ITEM_IMAGE_NAME = '/{imageId}/names'.freeze
12
+ GET_ITEMS_IMAGE_NAME = '/{imageId}/names/{lang}'.freeze
13
+ UPDATE_ITEMS_IMAGE_NAME = '/{imageId}/names/{lang}'.freeze
14
+ DELETE_ITEMS_IMAGE_NAME = '/{imageId}/names/{lang}'.freeze
15
+
16
+ class << self
17
+ def create(item_id, image_id, headers = {})
18
+ post(build_endpoint("#{ITEM_IMAGE_NAME_PATH}#{CREATE_ITEM_IMAGE_NAMES}"),
19
+ item: item_id,
20
+ image: image_id,
21
+ headers)
22
+ end
23
+
24
+ def list(item_id, image_id, headers = {}, &block)
25
+ get(build_endpoint("#{ITEM_IMAGE_NAME_PATH}#{LIST_ITEM_IMAGE_NAME}"),
26
+ item: item_id,
27
+ image: image_id,
28
+ headers, &block)
29
+ end
30
+
31
+ def find(item_id, image_id, lang, headers = {}, &block)
32
+ get(build_endpoint("#{ITEM_IMAGE_NAME_PATH}#{GET_ITEMS_IMAGE_NAME}",
33
+ item: item_id,
34
+ image: image_id,
35
+ lang: lang),
36
+ headers, &block)
37
+ end
38
+
39
+ def update(item_id, image_id, lang, body = {})
40
+ put(build_endpoint("#{ITEM_IMAGE_NAME_PATH}#{UPDATE_ITEMS_IMAGE_NAME}",
41
+ item: item_id,
42
+ image: image_id,
43
+ lang: lang),
44
+ body)
45
+ end
46
+
47
+ def delete(item_id, image_id, lang)
48
+ delete(build_endpoint("#{ITEM_IMAGE_NAME_PATH}#{DELETE_ITEMS_IMAGE_NAME}",
49
+ item: item_id,
50
+ image: image_id,
51
+ lang: lang))
52
+ end
53
+ end
54
+ end
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,53 @@
1
+ module PlentyClient
2
+ module Item
3
+ module Image
4
+ extend PlentyClient::Endpoint
5
+ extend PlentyClient::Request
6
+ ITEM_IMAGE_BASE_PATH = '/items/{itemId}'.freeze
7
+
8
+ LIST_ALL_ITEM_IMAGES = '/images'.freeze
9
+ CREATE_ITEM_IMAGES = '/images/upload'.freeze
10
+ GET_ITEM_IMAGES = '/images/{imageId}'.freeze
11
+ UPDATE_ITEM_IMAGES = '/images/{imageId}'.freeze
12
+ DELETE_ITEM_IMAGES = '/images/{imageId}'.freeze
13
+ LIST_ITEM_VARIATION_IMAGE = '/variations/{variationId}/images'.freeze
14
+
15
+ class << self
16
+ def list(item_id, headers = {}, &block)
17
+ get(build_endpoint("#{ITEM_IMAGE_BASE_PATH}#{LIST_ALL_ITEM_IMAGES}",
18
+ item: item_id), headers, &block)
19
+ end
20
+
21
+ def list_variation_images(item_id, variation_id, headers = {}, &block)
22
+ get(build_endpoint("#{ITEM_IMAGE_BASE_PATH}#{LIST_ITEM_VARIATION_IMAGE}",
23
+ item: item_id,
24
+ variation: variation_id), headers, &block)
25
+ end
26
+
27
+
28
+ def find(item_id, image_id, headers = {}, &block)
29
+ get(build_endpoint("#{ITEM_IMAGE_BASE_PATH}#{GET_ITEM_IMAGES}",
30
+ property_group: item_id,
31
+ image: image_id), headers, &block)
32
+ end
33
+
34
+ def create(headers = {})
35
+ post(build_endpoint("#{ITEM_IMAGE_BASE_PATH}#{CREATE_ITEM_IMAGES}"), headers)
36
+ end
37
+ self.send(:alias_method, :upload, :create)
38
+
39
+ def update(item_id, image_id, headers = {})
40
+ put(build_endpoint("#{ITEM_IMAGE_BASE_PATH}#{UPDATE_ITEM_IMAGES}",
41
+ property_group: item_id,
42
+ image: image_id), headers)
43
+ end
44
+
45
+ def delete(item_id, image_id)
46
+ delete(build_endpoint("#{ITEM_IMAGE_BASE_PATH}#{DELETE_ITEM_IMAGES}",
47
+ property_group: item_id,
48
+ image: image_id))
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,52 @@
1
+ module PlentyClient
2
+ module Item
3
+ module Manufacturer
4
+ class Commission
5
+ extend PlentyClient::Endpoint
6
+ extend PlentyClient::Request
7
+
8
+ ITEM_MANUFACTURER_COMMISSION = '/items/manufacturers/{manufacturerId}'.freeze
9
+
10
+ LIST_ITEM_MANUFACTURER_COMMISSION = '/commissions'.freeze
11
+ GET_ITEMS_MANUFACTURER_COMMISSION = '/commissions/{commissionId}'.freeze
12
+ CREATE_ITEM_MANUFACTURER_COMMISSION = '/commissions'.freeze
13
+ UPDATE_ITEMS_MANUFACTURER_COMMISSION = '/commissions/{commissionId}'.freeze
14
+ DELETE_ITEMS_MANUFACTURER_COMMISSION = '/commissions/{commissionId}'.freeze
15
+
16
+ class << self
17
+ def list(manufacturer_id, headers = {}, &block)
18
+ get(build_endpoint("#{ITEM_MANUFACTURER_COMMISSION}#{LIST_ITEM_MANUFACTURER_COMMISSION}",
19
+ manufacturer: manufacturer_id),
20
+ headers, &block)
21
+ end
22
+
23
+ def find(manufacturer_id, commission_id, headers = {}, &block)
24
+ get(build_endpoint("#{ITEM_MANUFACTURER_COMMISSION}#{GET_ITEMS_MANUFACTURER_COMMISSION}",
25
+ manufacturer: manufacturer_id,
26
+ commission: commission_id),
27
+ headers, &block)
28
+ end
29
+
30
+ def create(manufacturer_id, headers = {})
31
+ post(build_endpoint("#{ITEM_MANUFACTURER_COMMISSION}#{CREATE_ITEM_MANUFACTURER_COMMISSION}",
32
+ manufacturer: manufacturer_id),
33
+ headers)
34
+ end
35
+
36
+ def update(manufacturer_id, commission_id, body = {})
37
+ put(build_endpoint("#{ITEM_MANUFACTURER_COMMISSION}#{UPDATE_ITEMS_MANUFACTURER_COMMISSION}",
38
+ manufacturer: manufacturer_id,
39
+ commission: commission_id),
40
+ body)
41
+ end
42
+
43
+ def delete(manufacturer_id, commission_id)
44
+ delete(build_endpoint("#{ITEM_MANUFACTURER_COMMISSION}#{DELETE_ITEMS_MANUFACTURER_COMMISSION}",
45
+ manufacturer: manufacturer_id,
46
+ commission: commission_id))
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,36 @@
1
+ module PlentyClient
2
+ module Item
3
+ module Manufacturer
4
+ extend PlentyClient::Endpoint
5
+ extend PlentyClient::Request
6
+
7
+ LIST_ALL_MANUFACTURERS = '/items/manufacturers'.freeze
8
+ GET_MANUFACTURER = '/items/manufacturers/{manufacturerId}'.freeze
9
+ CREATE_MANUFACTURER = '/items/manufacturers'.freeze
10
+ UPDATE_MANUFACTURER = '/items/manufacturers/{manufacturerId}'.freeze
11
+ DELETE_MANUFACTURER = '/items/manufacturers/{manufacturerId}'.freeze
12
+
13
+ class << self
14
+ def list(headers = {}, &block)
15
+ get(build_endpoint(LIST_ALL_MANUFACTURER), headers, &block)
16
+ end
17
+
18
+ def find(manufacturer_id, headers = {}, &block)
19
+ get(build_endpoint(GET_MANUFACTURER, manufacturer: manufacturer_id), headers, &block)
20
+ end
21
+
22
+ def create(headers = {})
23
+ post(build_endpoint(CREATE_MANUFACTURER), headers)
24
+ end
25
+
26
+ def update(manufacturer_id, headers = {})
27
+ put(build_endpoint(UPDATE_MANUFACTURER, manufacturer: manufacturer_id), headers)
28
+ end
29
+
30
+ def delete(manufacturer_id)
31
+ delete(build_endpoint(DELETE_MANUFACTURER, manufacturer: manufacturer_id))
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,52 @@
1
+ module PlentyClient
2
+ module Item
3
+ module Property
4
+ class MarketReference
5
+ extend PlentyClient::Endpoint
6
+ extend PlentyClient::Request
7
+
8
+ ITEM_PROPERTY_MARKET_REFERENCE_PATH = '/items/properties'.freeze
9
+
10
+ CREATE_ITEM_PROPERTY_MARKET_REFERENCE = '/{propertyId}/market_references'.freeze
11
+ LIST_ITEM_PROPERTY_MARKET_REFERENCE = '/{propertyId}/market_references'.freeze
12
+ GET_ITEMS_PROPERTY_MARKET_REFERENCE = '/{propertyId}/market_references/{marketId}'.freeze
13
+ UPDATE_ITEMS_PROPERTY_MARKET_REFERENCE = '/{propertyId}/market_references/{marketId}'.freeze
14
+ DELETE_ITEMS_PROPERTY_MARKET_REFERENCE = '/{propertyId}/market_references/{marketId}'.freeze
15
+
16
+ class << self
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
+ headers)
21
+ end
22
+
23
+ def list(property_id, headers = {}, &block)
24
+ get(build_endpoint("#{ITEM_PROPERTY_MARKET_REFERENCE_PATH}#{LIST_ITEM_PROPERTY_MARKET_REFERENCE}"),
25
+ property: property_id,
26
+ headers, &block)
27
+ end
28
+
29
+ def find(property_id, market_id, headers = {}, &block)
30
+ get(build_endpoint("#{ITEM_PROPERTY_MARKET_REFERENCE_PATH}#{GET_ITEMS_PROPERTY_MARKET_REFERENCE}",
31
+ property: property_id,
32
+ market: market_id),
33
+ headers, &block)
34
+ end
35
+
36
+ def update(property_id, market_id, body = {})
37
+ put(build_endpoint("#{ITEM_PROPERTY_MARKET_REFERENCE_PATH}#{UPDATE_ITEMS_PROPERTY_MARKET_REFERENCE}",
38
+ property: property_id,
39
+ market: market_id),
40
+ body)
41
+ end
42
+
43
+ def delete(property_id, market_id)
44
+ delete(build_endpoint("#{ITEM_PROPERTY_MARKET_REFERENCE_PATH}#{DELETE_ITEMS_PROPERTY_MARKET_REFERENCE}",
45
+ property: property_id,
46
+ market: market_id))
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,52 @@
1
+ module PlentyClient
2
+ module Item
3
+ module Property
4
+ class Name
5
+ extend PlentyClient::Endpoint
6
+ extend PlentyClient::Request
7
+
8
+ ITEM_PROPERTY_PATH = '/items/properties'.freeze
9
+
10
+ CREATE_ITEM_PROPERTIES = '/{propertyId}/names'.freeze
11
+ LIST_ITEM_PROPERTY = '/{propertyId}/names'.freeze
12
+ GET_ITEMS_PROPERTY = '/{propertyId}/names/{lang}'.freeze
13
+ UPDATE_ITEMS_PROPERTY = '/{propertyId}/names/{lang}'.freeze
14
+ DELETE_ITEMS_PROPERTY = '/{propertyId}/names/{lang}'.freeze
15
+
16
+ class << self
17
+ def create(property_id, headers = {})
18
+ post(build_endpoint("#{ITEM_PROPERTY_PATH}#{CREATE_ITEM_PROPERTIES}"),
19
+ property: property_id,
20
+ headers)
21
+ end
22
+
23
+ def list(property_id, headers = {}, &block)
24
+ get(build_endpoint("#{ITEM_PROPERTY_PATH}#{LIST_ITEM_PROPERTY}"),
25
+ property: property_id,
26
+ headers, &block)
27
+ end
28
+
29
+ def find(property_id, lang, headers = {}, &block)
30
+ get(build_endpoint("#{ITEM_PROPERTY_PATH}#{GET_ITEMS_PROPERTY}",
31
+ property: property_id,
32
+ lang: lang),
33
+ headers, &block)
34
+ end
35
+
36
+ def update(property_id, lang, body = {})
37
+ put(build_endpoint("#{ITEM_PROPERTY_PATH}#{UPDATE_ITEMS_PROPERTY}",
38
+ property: property_id,
39
+ lang: lang),
40
+ body)
41
+ end
42
+
43
+ def delete(property_id, lang)
44
+ delete(build_endpoint("#{ITEM_PROPERTY_PATH}#{DELETE_ITEMS_PROPERTY}",
45
+ property: property_id,
46
+ lang: lang))
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,36 @@
1
+ module PlentyClient
2
+ module Item
3
+ module Property
4
+ extend PlentyClient::Endpoint
5
+ extend PlentyClient::Request
6
+
7
+ LIST_ALL_PROPERTIES = '/items/properties'.freeze
8
+ GET_PROPERTY = '/items/properties/{propertyId}'.freeze
9
+ CREATE_PROPERTY = '/items/properties'.freeze
10
+ UPDATE_PROPERTY = '/items/properties/{propertyId}'.freeze
11
+ DELETE_PROPERTY = '/items/properties/{propertyId}'.freeze
12
+
13
+ class << self
14
+ def list(headers = {}, &block)
15
+ get(build_endpoint(LIST_ALL_PROPERTIES), headers, &block)
16
+ end
17
+
18
+ def find(property_id, headers = {}, &block)
19
+ get(build_endpoint(GET_PROPERTY, property: property_id), headers, &block)
20
+ end
21
+
22
+ def create(headers = {})
23
+ post(build_endpoint(CREATE_PROPERTY), headers)
24
+ end
25
+
26
+ def update(property_id, headers = {})
27
+ put(build_endpoint(UPDATE_PROPERTY, property: property_id), headers)
28
+ end
29
+
30
+ def delete(property_id)
31
+ delete(build_endpoint(DELETE_PROPERTY, property: property_id))
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,36 @@
1
+ module PlentyClient
2
+ module Item
3
+ class PropertyGroup
4
+ extend PlentyClient::Endpoint
5
+ extend PlentyClient::Request
6
+
7
+ LIST_ALL_PROPERTY_GROUPS = '/items/property_groups'.freeze
8
+ GET_PROPERTY_GROUP = '/items/property_groups/{propertyGroupId}'.freeze
9
+ CREATE_PROPERTY_GROUP = '/items/property_groups'.freeze
10
+ UPDATE_PROPERTY_GROUP = '/items/property_groups/{propertyGroupId}'.freeze
11
+ DELETE_PROPERTY_GROUP = '/items/property_groups/{propertyGroupId}'.freeze
12
+
13
+ class << self
14
+ def list(headers = {}, &block)
15
+ get(build_endpoint(LIST_ALL_PROPERTY_GROUPS), headers, &block)
16
+ end
17
+
18
+ def find(property_group_id, headers = {}, &block)
19
+ get(build_endpoint(GET_PROPERTY_GROUP, property_group: property_group_id), headers, &block)
20
+ end
21
+
22
+ def create(body = {})
23
+ post(build_endpoint(CREATE_PROPERTY_GROUP), body)
24
+ end
25
+
26
+ def update(property_group_id, body = {})
27
+ put(build_endpoint(UPDATE_PROPERTY_GROUP, property_group: property_group_id), body)
28
+ end
29
+
30
+ def delete(property_group_id)
31
+ delete(build_endpoint(DELETE_PROPERTY_GROUP, property_group: property_group_id))
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,44 @@
1
+ module PlentyClient
2
+ module Item
3
+ class PropertyGroupName
4
+ extend PlentyClient::Endpoint
5
+ extend PlentyClient::Request
6
+
7
+ PROPERTY_GROUP_BASE_PATH = 'items/property_groups/{propertyGroupId}'
8
+
9
+ LIST_ALL_PROPERTY_GROUP_NAMES = '/names'.freeze
10
+ GET_PROPERTY_GROUP_NAMES = '/names/{lang}'.freeze
11
+ CREATE_PROPERTY_GROUP_NAMES = '/names'.freeze
12
+ UPDATE_PROPERTY_GROUP_NAMES = '/names/{lang}'.freeze
13
+ DELETE_PROPERTY_GROUP_NAMES = '/names/{lang}'.freeze
14
+
15
+ class << self
16
+ def list(headers = {}, &block)
17
+ get(build_endpoint("#{PROPERTY_GROUP_BASE_PATH}#{LIST_ALL_PROPERTY_GROUP_NAMES}"), headers, &block)
18
+ end
19
+
20
+ def find(property_group_id, lang, headers = {}, &block)
21
+ get(build_endpoint("#{PROPERTY_GROUP_BASE_PATH}#{GET_PROPERTY_GROUP_NAMES}",
22
+ property_group: property_group_id,
23
+ lang: lang), headers, &block)
24
+ end
25
+
26
+ def create(headers = {})
27
+ post(build_endpoint("#{PROPERTY_GROUP_BASE_PATH}#{CREATE_PROPERTY_GROUP_NAMES}"), headers)
28
+ end
29
+
30
+ def update(property_group_id, lang, headers = {})
31
+ put(build_endpoint("#{PROPERTY_GROUP_BASE_PATH}#{UPDATE_PROPERTY_GROUP_NAMES}",
32
+ property_group: property_group_id,
33
+ lang: lang), headers)
34
+ end
35
+
36
+ def delete(property_group_id, lang)
37
+ delete(build_endpoint("#{PROPERTY_GROUP_BASE_PATH}#{DELETE_PROPERTY_GROUP_NAMES}",
38
+ property_group: property_group_id,
39
+ lang: lang))
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,37 @@
1
+ module PlentyClient
2
+ module Item
3
+ class SalesPrice
4
+ extend PlentyClient::Endpoint
5
+ extend PlentyClient::Request
6
+
7
+
8
+ LIST_ALL_SALES_PRICES = '/items/sales_prices'.freeze
9
+ GET_SALES_PRICE = '/items/sales_prices/{salesPriceId}'.freeze
10
+ CREATE_SALES_PRICE = '/items/sales_prices'.freeze
11
+ UPDATE_SALES_PRICE = '/items/sales_prices/{salesPriceId}'.freeze
12
+ DELETE_SALES_PRICE = '/items/sales_prices/{salesPriceId}'.freeze
13
+
14
+ class << self
15
+ def list(headers = {}, &block)
16
+ get(build_endpoint(LIST_ALL_SALES_PRICES), headers, &block)
17
+ end
18
+
19
+ def find(sales_price_id, headers = {}, &block)
20
+ get(build_endpoint(GET_SALES_PRICE, sales_price: sales_price_id), headers, &block)
21
+ end
22
+
23
+ def create(headers = {})
24
+ post(build_endpoint(CREATE_SALES_PRICE), headers)
25
+ end
26
+
27
+ def update(sales_price_id, headers = {})
28
+ put(build_endpoint(UPDATE_SALES_PRICE, sales_price: sales_price_id), headers)
29
+ end
30
+
31
+ def delete(sales_price_id)
32
+ delete(build_endpoint(DELETE_SALES_PRICE, sales_price: sales_price_id))
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,26 @@
1
+ module PlentyClient
2
+ module Item
3
+ module ShippingProfile
4
+ extend PlentyClient::Endpoint
5
+ extend PlentyClient::Request
6
+
7
+ GET_ITEMS_SHIPPING_PROFILE = '/items/{itemId}/item_shipping_profiles'.freeze
8
+ CREATE_ITEMS_SHIPPING_PROFILE = '/items/{itemId}/item_shipping_profiles'.freeze
9
+ DELETE_ITEMS_SHIPPING_PROFILE = '/items/{itemId}/item_shipping_profiles/{shippingProfileId}'.freeze
10
+
11
+ class << self
12
+ def list(item_id, headers = {}, &block)
13
+ get(build_endpoint(GET_ITEMS_SHIPPING_PROFILE, item: item_id), headers, &block)
14
+ end
15
+
16
+ def create(item_id, headers = {})
17
+ post(build_endpoint(CREATE_ITEMS_CROSS_SELLING, item: item_id), headers)
18
+ end
19
+
20
+ def delete(item_id, cross_item_id)
21
+ delete(build_endpoint(DELETE_ITEMS_CROSS_SELLING, item: item_id, cross_item: cross_item_id))
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,35 @@
1
+ module PlentyClient
2
+ module Item
3
+ class Unit
4
+ extend PlentyClient::Endpoint
5
+ extend PlentyClient::Request
6
+
7
+
8
+ CREATE_ITEMS_UNITS = '/items/{itemId}/units'.freeze
9
+ GET_ITEMS_UNIT = '/items/{itemId}/units'.freeze
10
+ DELETE_ITEMS_UNIT = '/items/{itemId}/units/{unitId}'.freeze
11
+
12
+ class << self
13
+ def create(headers = {})
14
+ post(build_endpoint(CREATE_ITEMS_UNITS), headers)
15
+ end
16
+
17
+ def list(headers = {}, &block)
18
+ get(build_endpoint(GET_ITEMS_UNIT), headers, &block)
19
+ end
20
+
21
+ def find(unit_id, headers = {}, &block)
22
+ get(build_endpoint(GET_ITEMS_UNIT, unit: unit_id), headers, &block)
23
+ end
24
+
25
+ def update(unit_id, headers = {}, &block)
26
+ put(build_endpoint(GET_ITEMS_UNIT, unit: unit_id), headers, &block)
27
+ end
28
+
29
+ def delete(unit_id)
30
+ delete(build_endpoint(DELETE_ITEMS_UNIT, unit: unit_id))
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,38 @@
1
+ module PlentyClient
2
+ module Item
3
+ class UnitName
4
+ extend PlentyClient::Endpoint
5
+ extend PlentyClient::Request
6
+
7
+ ITEM_UNIT_PATH = '/items/{itemId}/units'.freeze
8
+
9
+ ITEM_UNITS = '/names'.freeze
10
+ LIST_ITEM_UNIT = '/names'.freeze
11
+ GET_ITEMS_UNIT = '/names/{lang}'.freeze
12
+ UPDATE_ITEMS_UNIT = '/names/{lang}'.freeze
13
+ DELETE_ITEMS_UNIT = '/names/{lang}'.freeze
14
+
15
+ class << self
16
+ def create(item_id, headers = {})
17
+ post(build_endpoint(CREATE_ITEMS_UNITS), headers)
18
+ end
19
+
20
+ def list(item_id, headers = {}, &block)
21
+ get(build_endpoint(LIST_ITEM_UNIT), headers, &block)
22
+ end
23
+
24
+ def find(unit_id, lang, headers = {}, &block)
25
+ get(build_endpoint(GET_ITEMS_UNIT, unit: unit_id, lang: lang), headers, &block)
26
+ end
27
+
28
+ def update(unit_id, lang, headers = {}, &block)
29
+ put(build_endpoint(UPDATE_ITEMS_UNIT, unit: unit_id, lang: lang), headers, &block)
30
+ end
31
+
32
+ def delete(unit_id, lang)
33
+ delete(build_endpoint(DELETE_ITEMS_UNIT, unit: unit_id, lang: lang))
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end