plenty_client 0.0.9 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. checksums.yaml +5 -5
  2. data/lib/plenty_client/account/address.rb +37 -0
  3. data/lib/plenty_client/account/contact/address.rb +8 -6
  4. data/lib/plenty_client/account/contact/bank.rb +7 -5
  5. data/lib/plenty_client/account/contact/type.rb +7 -5
  6. data/lib/plenty_client/account/contact.rb +7 -5
  7. data/lib/plenty_client/account.rb +11 -9
  8. data/lib/plenty_client/accounting.rb +6 -4
  9. data/lib/plenty_client/authentication.rb +7 -5
  10. data/lib/plenty_client/authorization.rb +4 -2
  11. data/lib/plenty_client/basket/item.rb +4 -2
  12. data/lib/plenty_client/basket.rb +3 -1
  13. data/lib/plenty_client/category/branch.rb +4 -2
  14. data/lib/plenty_client/category/template.rb +5 -3
  15. data/lib/plenty_client/category.rb +12 -10
  16. data/lib/plenty_client/comment.rb +8 -6
  17. data/lib/plenty_client/config.rb +6 -0
  18. data/lib/plenty_client/document/category.rb +6 -4
  19. data/lib/plenty_client/document/order.rb +7 -5
  20. data/lib/plenty_client/document.rb +4 -2
  21. data/lib/plenty_client/endpoint.rb +1 -1
  22. data/lib/plenty_client/item/attribute/name.rb +8 -6
  23. data/lib/plenty_client/item/attribute/value.rb +8 -6
  24. data/lib/plenty_client/item/attribute/value_name.rb +8 -6
  25. data/lib/plenty_client/item/attribute.rb +7 -5
  26. data/lib/plenty_client/item/barcode.rb +11 -9
  27. data/lib/plenty_client/item/cross_selling.rb +5 -3
  28. data/lib/plenty_client/item/image/availability.rb +6 -4
  29. data/lib/plenty_client/item/image/name.rb +8 -6
  30. data/lib/plenty_client/item/image.rb +15 -12
  31. data/lib/plenty_client/item/manufacturer/commission.rb +8 -6
  32. data/lib/plenty_client/item/manufacturer.rb +7 -5
  33. data/lib/plenty_client/item/property/market_reference.rb +8 -6
  34. data/lib/plenty_client/item/property/name.rb +8 -6
  35. data/lib/plenty_client/item/property.rb +7 -5
  36. data/lib/plenty_client/item/property_group.rb +7 -5
  37. data/lib/plenty_client/item/property_group_name.rb +8 -6
  38. data/lib/plenty_client/item/sales_price.rb +7 -5
  39. data/lib/plenty_client/item/shipping_profile.rb +5 -3
  40. data/lib/plenty_client/item/unit.rb +7 -5
  41. data/lib/plenty_client/item/unit_name.rb +7 -5
  42. data/lib/plenty_client/item/variation/barcode.rb +3 -1
  43. data/lib/plenty_client/item/variation/bundle.rb +8 -6
  44. data/lib/plenty_client/item/variation/category.rb +14 -6
  45. data/lib/plenty_client/item/variation/client.rb +6 -4
  46. data/lib/plenty_client/item/variation/default_category.rb +7 -5
  47. data/lib/plenty_client/item/variation/description.rb +8 -6
  48. data/lib/plenty_client/item/variation/image.rb +8 -6
  49. data/lib/plenty_client/item/variation/market.rb +6 -4
  50. data/lib/plenty_client/item/variation/market_ident_number.rb +8 -6
  51. data/lib/plenty_client/item/variation/property/text.rb +8 -6
  52. data/lib/plenty_client/item/variation/property.rb +22 -17
  53. data/lib/plenty_client/item/variation/sales_price.rb +15 -19
  54. data/lib/plenty_client/item/variation/sku.rb +8 -6
  55. data/lib/plenty_client/item/variation/stock.rb +9 -7
  56. data/lib/plenty_client/item/variation/supplier.rb +8 -6
  57. data/lib/plenty_client/item/variation/warehouse.rb +8 -6
  58. data/lib/plenty_client/item/variation.rb +8 -6
  59. data/lib/plenty_client/item.rb +11 -4
  60. data/lib/plenty_client/item_set/component.rb +9 -7
  61. data/lib/plenty_client/item_set/config.rb +4 -2
  62. data/lib/plenty_client/item_set.rb +9 -7
  63. data/lib/plenty_client/listing/layout_template.rb +5 -3
  64. data/lib/plenty_client/listing/market/directory.rb +6 -4
  65. data/lib/plenty_client/listing/market/history.rb +7 -5
  66. data/lib/plenty_client/listing/market/info.rb +3 -1
  67. data/lib/plenty_client/listing/market/text.rb +7 -5
  68. data/lib/plenty_client/listing/market.rb +9 -7
  69. data/lib/plenty_client/listing/option_template.rb +7 -5
  70. data/lib/plenty_client/listing/shipping_profile.rb +4 -2
  71. data/lib/plenty_client/listing/stock_dependence_type.rb +4 -2
  72. data/lib/plenty_client/listing/type.rb +4 -2
  73. data/lib/plenty_client/listing.rb +7 -5
  74. data/lib/plenty_client/market/credentials.rb +7 -5
  75. data/lib/plenty_client/market/ebay/authentication.rb +4 -2
  76. data/lib/plenty_client/market/ebay/parts_fitment.rb +8 -6
  77. data/lib/plenty_client/market/ebay/shop_category.rb +3 -1
  78. data/lib/plenty_client/order/contact_wish.rb +4 -2
  79. data/lib/plenty_client/order/coupon_code/contact.rb +3 -1
  80. data/lib/plenty_client/order/coupon_code/validation.rb +3 -1
  81. data/lib/plenty_client/order/coupon_code.rb +3 -1
  82. data/lib/plenty_client/order/currency.rb +6 -4
  83. data/lib/plenty_client/order/date.rb +6 -4
  84. data/lib/plenty_client/order/item/serial_number.rb +4 -2
  85. data/lib/plenty_client/order/item.rb +3 -1
  86. data/lib/plenty_client/order/referrer.rb +4 -2
  87. data/lib/plenty_client/order/shipping/country.rb +3 -1
  88. data/lib/plenty_client/order/shipping/information.rb +12 -17
  89. data/lib/plenty_client/order/shipping/package.rb +9 -7
  90. data/lib/plenty_client/order/shipping/profile.rb +4 -2
  91. data/lib/plenty_client/order/shipping/service_provider.rb +5 -3
  92. data/lib/plenty_client/order/status_history.rb +23 -0
  93. data/lib/plenty_client/order.rb +9 -7
  94. data/lib/plenty_client/order_summary.rb +9 -7
  95. data/lib/plenty_client/payment/contact.rb +4 -2
  96. data/lib/plenty_client/payment/method.rb +10 -8
  97. data/lib/plenty_client/payment/method_name.rb +5 -3
  98. data/lib/plenty_client/payment/order.rb +5 -3
  99. data/lib/plenty_client/payment/property/type/name.rb +7 -5
  100. data/lib/plenty_client/payment/property/type.rb +7 -5
  101. data/lib/plenty_client/payment/property.rb +9 -7
  102. data/lib/plenty_client/payment/status.rb +3 -1
  103. data/lib/plenty_client/payment/transaction.rb +3 -1
  104. data/lib/plenty_client/payment.rb +8 -6
  105. data/lib/plenty_client/request.rb +54 -24
  106. data/lib/plenty_client/sales_price/account.rb +5 -3
  107. data/lib/plenty_client/sales_price/country.rb +5 -3
  108. data/lib/plenty_client/sales_price/currency.rb +5 -3
  109. data/lib/plenty_client/sales_price/customer_class.rb +6 -4
  110. data/lib/plenty_client/sales_price/name.rb +7 -5
  111. data/lib/plenty_client/sales_price/online_store.rb +5 -3
  112. data/lib/plenty_client/sales_price/referrer.rb +5 -3
  113. data/lib/plenty_client/stock.rb +5 -3
  114. data/lib/plenty_client/ticket.rb +6 -4
  115. data/lib/plenty_client/version.rb +3 -1
  116. data/lib/plenty_client/warehouse/management/rack.rb +6 -4
  117. data/lib/plenty_client/warehouse/management/shelf.rb +6 -4
  118. data/lib/plenty_client/warehouse/management/storage_location.rb +6 -4
  119. data/lib/plenty_client/warehouse/management.rb +21 -5
  120. data/lib/plenty_client/warehouse/stock.rb +8 -6
  121. data/lib/plenty_client/warehouse.rb +5 -3
  122. data/lib/plenty_client/webstore.rb +3 -1
  123. data/lib/plenty_client.rb +5 -1
  124. metadata +5 -3
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module PlentyClient
2
4
  module Item
3
5
  module Variation
@@ -5,38 +7,41 @@ module PlentyClient
5
7
  include PlentyClient::Endpoint
6
8
  include PlentyClient::Request
7
9
 
8
- VARIATION_PROPERTY_BASE_PATH = '/items/{itemId}/variations/{variationId}'.freeze
9
-
10
- LIST_ALL_VARIATION_PROPERTIES = '/variation_properties'.freeze
11
- GET_VARIATION_PROPERTY = '/variation_properties/{propertyId}'.freeze
12
- CREATE_VARIATION_PROPERTY = '/variation_properties'.freeze
13
- UPDATE_VARIATION_PROPERTY = '/variation_properties/{propertyId}'.freeze
14
- DELETE_VARIATION_PROPERTY = '/variation_properties/{propertyId}'.freeze
10
+ BASE_PATH = '/items/{itemId}/variations/{variationId}/variation_properties'
11
+ SINGULAR_PATH = BASE_PATH + '/{propertyId}'
12
+ BULK_PATH = '/items/variations/variation_properties'
15
13
 
16
14
  class << self
17
15
  def list(item_id, variation_id, headers = {}, &block)
18
- get(build_endpoint("#{VARIATION_PROPERTY_BASE_PATH}#{LIST_ALL_VARIATION_PROPERTIES}",
19
- item: item_id, variation: variation_id), headers, &block)
16
+ get(build_endpoint(BASE_PATH, item: item_id, variation: variation_id), headers, &block)
20
17
  end
21
18
 
22
19
  def find(item_id, variation_id, property_id, headers = {}, &block)
23
- get(build_endpoint("#{VARIATION_PROPERTY_BASE_PATH}#{GET_VARIATION_PROPERTY}",
24
- item: item_id, variation: variation_id, property: property_id), headers, &block)
20
+ get(build_endpoint(SINGULAR_PATH, item: item_id, variation: variation_id, property: property_id), headers, &block)
25
21
  end
26
22
 
27
23
  def create(item_id, variation_id, headers = {})
28
- post(build_endpoint("#{VARIATION_PROPERTY_BASE_PATH}#{CREATE_VARIATION_PROPERTY}",
29
- item: item_id, variation: variation_id), headers)
24
+ post(build_endpoint(BASE_PATH, item: item_id, variation: variation_id), headers)
30
25
  end
31
26
 
32
27
  def update(item_id, variation_id, property_id, headers = {})
33
- put(build_endpoint("#{VARIATION_PROPERTY_BASE_PATH}#{UPDATE_VARIATION_PROPERTY}",
34
- item: item_id, variation: variation_id, property: property_id), headers)
28
+ put(build_endpoint(SINGULAR_PATH, item: item_id, variation: variation_id, property: property_id), headers)
35
29
  end
36
30
 
37
31
  def destroy(item_id, variation_id, property_id)
38
- delete(build_endpoint("#{VARIATION_PROPERTY_BASE_PATH}#{DELETE_VARIATION_PROPERTY}",
39
- item: item_id, variation: variation_id, property: property_id))
32
+ delete(build_endpoint(SINGULAR_PATH, item: item_id, variation: variation_id, property: property_id))
33
+ end
34
+
35
+ def bulk_create(body = {})
36
+ post(BULK_PATH, body)
37
+ end
38
+
39
+ def bulk_update(body = {})
40
+ put(BULK_PATH, body)
41
+ end
42
+
43
+ def destroy_all(item_id, variation_id)
44
+ delete(build_endpoint(BASE_PATH, item: item_id, variation: variation_id))
40
45
  end
41
46
  end
42
47
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module PlentyClient
2
4
  module Item
3
5
  module Variation
@@ -5,42 +7,36 @@ module PlentyClient
5
7
  include PlentyClient::Endpoint
6
8
  include PlentyClient::Request
7
9
 
8
- ITEM_VARIATION_SALES_PRICES_PATH = '/items/{itemId}/variations/{variationId}'.freeze
9
-
10
- LIST_ITEM_VARIATIONS_SALES_PRICES = '/variation_sales_prices'.freeze
11
- GET_ITEM_VARIATIONS_SALES_PRICES = '/variation_sales_prices/{priceId}'.freeze
12
- CREATE_ITEM_VARIATIONS_SALES_PRICES = '/variation_sales_prices'.freeze
13
- UPDATE_ITEM_VARIATIONS_SALES_PRICES = '/variation_sales_prices/{priceId}'.freeze
14
- DELETE_ITEM_VARIATIONS_SALES_PRICES = '/variation_sales_prices/{priceId}'.freeze
10
+ BASE_PATH = '/items/{itemId}/variations/{variationId}'
11
+ PLURAL_PATH = BASE_PATH + '/variation_sales_prices'
12
+ SINGULAR_PATH = PLURAL_PATH + '/{priceId}'
13
+ BULK_PATH = '/items/variations/variation_sales_prices'
15
14
 
16
15
  class << self
17
16
  def list(item_id, variation_id, headers = {}, &block)
18
- get(build_endpoint("#{ITEM_VARIATION_SALES_PRICES_PATH}#{LIST_ITEM_VARIATIONS_SALES_PRICES}",
19
- item: item_id, variation: variation_id),
17
+ get(build_endpoint(PLURAL_PATH, item: item_id, variation: variation_id),
20
18
  headers, &block)
21
19
  end
22
20
 
23
21
  def find(item_id, variation_id, price_id, headers = {}, &block)
24
- get(build_endpoint("#{ITEM_VARIATION_SALES_PRICES_PATH}#{GET_ITEM_VARIATIONS_SALES_PRICES}",
25
- item: item_id, variation: variation_id, price: price_id),
22
+ get(build_endpoint(SINGULAR_PATH, item: item_id, variation: variation_id, price: price_id),
26
23
  headers, &block)
27
24
  end
28
25
 
29
26
  def create(item_id, variation_id, body = {})
30
- post(build_endpoint("#{ITEM_VARIATION_SALES_PRICES_PATH}#{CREATE_ITEM_VARIATIONS_SALES_PRICES}",
31
- item: item_id, variation: variation_id),
32
- body)
27
+ post(build_endpoint(PLURAL_PATH, item: item_id, variation: variation_id), body)
33
28
  end
34
29
 
35
30
  def update(item_id, variation_id, price_id, body = {})
36
- put(build_endpoint("#{ITEM_VARIATION_SALES_PRICES_PATH}#{UPDATE_ITEM_VARIATIONS_SALES_PRICES}",
37
- item: item_id, variation: variation_id, price: price_id),
38
- body)
31
+ put(build_endpoint(SINGULAR_PATH, item: item_id, variation: variation_id, price: price_id), body)
39
32
  end
40
33
 
41
34
  def destroy(item_id, variation_id, price_id)
42
- delete(build_endpoint("#{ITEM_VARIATION_SALES_PRICES_PATH}#{DELETE_ITEM_VARIATIONS_SALES_PRICES}",
43
- item: item_id, variation: variation_id, price: price_id))
35
+ delete(build_endpoint(SINGULAR_PATH, item: item_id, variation: variation_id, price: price_id))
36
+ end
37
+
38
+ def bulk_update(body = {})
39
+ put(BULK_PATH, body)
44
40
  end
45
41
  end
46
42
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module PlentyClient
2
4
  module Item
3
5
  module Variation
@@ -5,13 +7,13 @@ module PlentyClient
5
7
  include PlentyClient::Endpoint
6
8
  include PlentyClient::Request
7
9
 
8
- ITEM_VARIATION_SKU_PATH = '/items/{itemId}/variations/{variationId}'.freeze
10
+ ITEM_VARIATION_SKU_PATH = '/items/{itemId}/variations/{variationId}'
9
11
 
10
- LIST_ITEM_VARIATIONS_SKU = '/variation_skus'.freeze
11
- GET_ITEM_VARIATIONS_SKU = '/variation_skus/{skuId}'.freeze
12
- CREATE_ITEM_VARIATIONS_SKU = '/variation_skus'.freeze
13
- UPDATE_ITEM_VARIATIONS_SKU = '/variation_skus/{skuId}'.freeze
14
- DELETE_ITEM_VARIATIONS_SKU = '/variation_skus/{skuId}'.freeze
12
+ LIST_ITEM_VARIATIONS_SKU = '/variation_skus'
13
+ GET_ITEM_VARIATIONS_SKU = '/variation_skus/{skuId}'
14
+ CREATE_ITEM_VARIATIONS_SKU = '/variation_skus'
15
+ UPDATE_ITEM_VARIATIONS_SKU = '/variation_skus/{skuId}'
16
+ DELETE_ITEM_VARIATIONS_SKU = '/variation_skus/{skuId}'
15
17
 
16
18
  class << self
17
19
  def list(item_id, variation_id, headers = {}, &block)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module PlentyClient
2
4
  module Item
3
5
  module Variation
@@ -5,14 +7,14 @@ module PlentyClient
5
7
  include PlentyClient::Endpoint
6
8
  include PlentyClient::Request
7
9
 
8
- ITEM_VARIATION_STOCK_PATH = '/items/{itemId}/variations/{variationId}'.freeze
10
+ ITEM_VARIATION_STOCK_PATH = '/items/{itemId}/variations/{variationId}'
9
11
 
10
- LIST_ITEM_VARIATIONS_STOCK = '/stock'.freeze
11
- LIST_ITEM_VARIATIONS_STOCK_STORAGE_LOCATIONS = '/stock/storageLocations'.freeze
12
- LIST_ITEM_VARIATIONS_STOCK_MOVEMENTS = '/stock/movements'.freeze
13
- UPDATE_ITEM_VARIATIONS_STOCK_INCOMING_ITEMS = '/stock/bookIncomingItems'.freeze
14
- UPDATE_ITEM_VARIATIONS_STOCK_CORRECTION = '/stock/correction'.freeze
15
- UPDATE_ITEM_VARIATIONS_STOCK_REDISTRIBUTE = '/stock/redistribute'.freeze
12
+ LIST_ITEM_VARIATIONS_STOCK = '/stock'
13
+ LIST_ITEM_VARIATIONS_STOCK_STORAGE_LOCATIONS = '/stock/storageLocations'
14
+ LIST_ITEM_VARIATIONS_STOCK_MOVEMENTS = '/stock/movements'
15
+ UPDATE_ITEM_VARIATIONS_STOCK_INCOMING_ITEMS = '/stock/bookIncomingItems'
16
+ UPDATE_ITEM_VARIATIONS_STOCK_CORRECTION = '/stock/correction'
17
+ UPDATE_ITEM_VARIATIONS_STOCK_REDISTRIBUTE = '/stock/redistribute'
16
18
 
17
19
  class << self
18
20
  def list(item_id, variation_id, headers = {}, &block)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module PlentyClient
2
4
  module Item
3
5
  module Variation
@@ -5,13 +7,13 @@ module PlentyClient
5
7
  include PlentyClient::Endpoint
6
8
  include PlentyClient::Request
7
9
 
8
- ITEM_VARIATION_SUPPLIER_PATH = '/items/{itemId}/variations/{variationId}'.freeze
10
+ ITEM_VARIATION_SUPPLIER_PATH = '/items/{itemId}/variations/{variationId}'
9
11
 
10
- LIST_ITEM_VARIATIONS_SUPPLIER = '/variation_suppliers'.freeze
11
- GET_ITEM_VARIATIONS_SUPPLIER = '/variation_suppliers/{variationSupplierId}'.freeze
12
- CREATE_ITEM_VARIATIONS_SUPPLIER = '/variation_suppliers'.freeze
13
- UPDATE_ITEM_VARIATIONS_SUPPLIER = '/variation_suppliers/{variationSupplierId}'.freeze
14
- DELETE_ITEM_VARIATIONS_SUPPLIER = '/variation_suppliers/{variationSupplierId}'.freeze
12
+ LIST_ITEM_VARIATIONS_SUPPLIER = '/variation_suppliers'
13
+ GET_ITEM_VARIATIONS_SUPPLIER = '/variation_suppliers/{variationSupplierId}'
14
+ CREATE_ITEM_VARIATIONS_SUPPLIER = '/variation_suppliers'
15
+ UPDATE_ITEM_VARIATIONS_SUPPLIER = '/variation_suppliers/{variationSupplierId}'
16
+ DELETE_ITEM_VARIATIONS_SUPPLIER = '/variation_suppliers/{variationSupplierId}'
15
17
 
16
18
  class << self
17
19
  def list(item_id, variation_id, headers = {}, &block)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module PlentyClient
2
4
  module Item
3
5
  module Variation
@@ -5,13 +7,13 @@ module PlentyClient
5
7
  include PlentyClient::Endpoint
6
8
  include PlentyClient::Request
7
9
 
8
- ITEM_VARIATION_WAREHOUSE_PATH = '/items/{itemId}/variations/{variationId}'.freeze
10
+ ITEM_VARIATION_WAREHOUSE_PATH = '/items/{itemId}/variations/{variationId}'
9
11
 
10
- LIST_ITEM_VARIATIONS_WAREHOUSE = '/variation_warehouses'.freeze
11
- GET_ITEM_VARIATIONS_WAREHOUSE = '/variation_warehouses/{warehouseId}'.freeze
12
- CREATE_ITEM_VARIATIONS_WAREHOUSE = '/variation_warehouses'.freeze
13
- UPDATE_ITEM_VARIATIONS_WAREHOUSE = '/variation_warehouses/{warehouseId}'.freeze
14
- DELETE_ITEM_VARIATIONS_WAREHOUSE = '/variation_warehouses/{warehouseId}'.freeze
12
+ LIST_ITEM_VARIATIONS_WAREHOUSE = '/variation_warehouses'
13
+ GET_ITEM_VARIATIONS_WAREHOUSE = '/variation_warehouses/{warehouseId}'
14
+ CREATE_ITEM_VARIATIONS_WAREHOUSE = '/variation_warehouses'
15
+ UPDATE_ITEM_VARIATIONS_WAREHOUSE = '/variation_warehouses/{warehouseId}'
16
+ DELETE_ITEM_VARIATIONS_WAREHOUSE = '/variation_warehouses/{warehouseId}'
15
17
 
16
18
  class << self
17
19
  def list(item_id, variation_id, headers = {}, &block)
@@ -1,15 +1,17 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module PlentyClient
2
4
  module Item
3
5
  module Variation
4
6
  include PlentyClient::Endpoint
5
7
  include PlentyClient::Request
6
8
 
7
- ALL_VARIATIONS = '/items/variations'.freeze
8
- DELETE_ITEMS_VARIATION = '/items/{itemId}/variations/{variationId}'.freeze
9
- GET_ITEMS_VARIATION = '/items/{itemId}/variations/{variationId}'.freeze
10
- GET_ITEMS_VARIATIONS = '/items/{itemId}/variations'.freeze
11
- POST_ITEMS_VARIATION = '/items/{itemId}/variations'.freeze
12
- UPDATE_ITEMS_VARIATION = '/items/{itemId}/variations/{variationId}'.freeze
9
+ ALL_VARIATIONS = '/items/variations'
10
+ DELETE_ITEMS_VARIATION = '/items/{itemId}/variations/{variationId}'
11
+ GET_ITEMS_VARIATION = '/items/{itemId}/variations/{variationId}'
12
+ GET_ITEMS_VARIATIONS = '/items/{itemId}/variations'
13
+ POST_ITEMS_VARIATION = '/items/{itemId}/variations'
14
+ UPDATE_ITEMS_VARIATION = '/items/{itemId}/variations/{variationId}'
13
15
 
14
16
  class << self
15
17
  def all(headers = {}, &block)
@@ -1,12 +1,15 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module PlentyClient
2
4
  module Item
3
5
  include PlentyClient::Endpoint
4
6
  include PlentyClient::Request
5
7
 
6
- LIST_ITEMS = '/items'.freeze
7
- CREATE_ITEM = '/items'.freeze
8
- UPDATE_ITEM = '/items/{itemId}'.freeze
9
- GET_ITEM = '/items/{itemId}'.freeze
8
+ LIST_ITEMS = '/items'
9
+ CREATE_ITEM = '/items'
10
+ UPDATE_ITEM = '/items/{itemId}'
11
+ GET_ITEM = '/items/{itemId}'
12
+ DELETE_ITEM = '/items/{itemId}'
10
13
 
11
14
  class << self
12
15
  def list(headers = {}, &block)
@@ -24,6 +27,10 @@ module PlentyClient
24
27
  def create(body = {})
25
28
  post(CREATE_ITEM, body)
26
29
  end
30
+
31
+ def destroy(item_id, body = {})
32
+ delete(build_endpoint(DELETE_ITEM, item: item_id), body)
33
+ end
27
34
  end
28
35
  end
29
36
  end
@@ -1,16 +1,18 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module PlentyClient
2
4
  module ItemSet
3
5
  class Component
4
6
  include PlentyClient::Endpoint
5
7
  include PlentyClient::Request
6
8
 
7
- LIST_ITEM_SET_COMPONENT = '/item_sets/{itemSetId}/components/{componentId}'.freeze
8
- LIST_ITEM_SETS_COMPONENT = '/item_sets/{itemSetId}/components'.freeze
9
- CREATE_ITEM_SET_COMPONENTS = '/item_sets/{itemSetId}/components'.freeze
10
- UPDATE_ITEM_SET_COMPONENT = '/item_sets/{itemSetId}/components/{componentId}'.freeze
11
- UPDATE_ITEM_SETS_COMPONENTS = '/item_sets/{itemSetId}/components'.freeze
12
- DELETE_ITEM_SET_COMPONENT = '/item_sets/{itemSetId}/components/{componentId}'.freeze
13
- DELETE_ITEM_SETS_COMPONENTS = '/item_sets/{itemSetId}/components'.freeze
9
+ LIST_ITEM_SET_COMPONENT = '/item_sets/{itemSetId}/components/{componentId}'
10
+ LIST_ITEM_SETS_COMPONENT = '/item_sets/{itemSetId}/components'
11
+ CREATE_ITEM_SET_COMPONENTS = '/item_sets/{itemSetId}/components'
12
+ UPDATE_ITEM_SET_COMPONENT = '/item_sets/{itemSetId}/components/{componentId}'
13
+ UPDATE_ITEM_SETS_COMPONENTS = '/item_sets/{itemSetId}/components'
14
+ DELETE_ITEM_SET_COMPONENT = '/item_sets/{itemSetId}/components/{componentId}'
15
+ DELETE_ITEM_SETS_COMPONENTS = '/item_sets/{itemSetId}/components'
14
16
 
15
17
  class << self
16
18
  def list_item_set_component(item_set_id, component_id, headers = {}, &block)
@@ -1,11 +1,13 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module PlentyClient
2
4
  module ItemSet
3
5
  class Config
4
6
  include PlentyClient::Endpoint
5
7
  include PlentyClient::Request
6
8
 
7
- FIND_ITEM_SET_CONFIGS = '/item_sets/{itemSetId}/config'.freeze
8
- UPDATE_ITEM_SET_CONFIGS = '/item_sets/{itemSetId}/config'.freeze
9
+ FIND_ITEM_SET_CONFIGS = '/item_sets/{itemSetId}/config'
10
+ UPDATE_ITEM_SET_CONFIGS = '/item_sets/{itemSetId}/config'
9
11
 
10
12
  class << self
11
13
  def find(item_set_id, headers = {}, &block)
@@ -1,15 +1,17 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module PlentyClient
2
4
  module ItemSet
3
5
  include PlentyClient::Endpoint
4
6
  include PlentyClient::Request
5
7
 
6
- LIST_ITEM_SETS = '/item_sets'.freeze
7
- GET_ITEM_SET = '/item_sets/{itemSetId}'.freeze
8
- CREATE_ITEM_SETS = '/item_sets'.freeze
9
- UPDATE_ITEM_SET = '/item_sets/{itemSetId}'.freeze
10
- UPDATE_ITEM_SETS = '/item_sets'.freeze
11
- DELETE_ITEM_SET = '/item_sets/{itemSetId}'.freeze
12
- DELETE_ITEM_SETS = '/item_sets'.freeze
8
+ LIST_ITEM_SETS = '/item_sets'
9
+ GET_ITEM_SET = '/item_sets/{itemSetId}'
10
+ CREATE_ITEM_SETS = '/item_sets'
11
+ UPDATE_ITEM_SET = '/item_sets/{itemSetId}'
12
+ UPDATE_ITEM_SETS = '/item_sets'
13
+ DELETE_ITEM_SET = '/item_sets/{itemSetId}'
14
+ DELETE_ITEM_SETS = '/item_sets'
13
15
 
14
16
  class << self
15
17
  def list(headers = {}, &block)
@@ -1,12 +1,14 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module PlentyClient
2
4
  module Listing
3
5
  class LayoutTemplate
4
6
  include PlentyClient::Endpoint
5
7
  include PlentyClient::Request
6
8
 
7
- FIND_LISTINGS_LAYOUT_TEMPLATE = '/listings/layout_templates/{layoutTemplateId}'.freeze
8
- CREATE_LISTINGS_LAYOUT_TEMPLATE = '/listings/layout_templates'.freeze
9
- DELTE_LISTINGS_LAYOUT_TEMPLATE = '/listings/layout_templates/{layoutTemplateId}'.freeze
9
+ FIND_LISTINGS_LAYOUT_TEMPLATE = '/listings/layout_templates/{layoutTemplateId}'
10
+ CREATE_LISTINGS_LAYOUT_TEMPLATE = '/listings/layout_templates'
11
+ DELTE_LISTINGS_LAYOUT_TEMPLATE = '/listings/layout_templates/{layoutTemplateId}'
10
12
 
11
13
  class << self
12
14
  def find(layout_template_id, headers = {}, &block)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module PlentyClient
2
4
  module Listing
3
5
  module Market
@@ -5,10 +7,10 @@ module PlentyClient
5
7
  include PlentyClient::Endpoint
6
8
  include PlentyClient::Request
7
9
 
8
- FIND_LISTING_MARKET = '/listings/markets/directories/{directoryId}'.freeze
9
- CREATE_LISTING_MARKET = '/listings/markets/directories'.freeze
10
- UPDATE_LISTING_MARKET = '/listings/markets/directories/{directoryId}'.freeze
11
- DELETE_LISTING_MARKET = '/listings/markets/directories/{directoryId}'.freeze
10
+ FIND_LISTING_MARKET = '/listings/markets/directories/{directoryId}'
11
+ CREATE_LISTING_MARKET = '/listings/markets/directories'
12
+ UPDATE_LISTING_MARKET = '/listings/markets/directories/{directoryId}'
13
+ DELETE_LISTING_MARKET = '/listings/markets/directories/{directoryId}'
12
14
 
13
15
  class << self
14
16
  def find(directory_id, headers = {}, &block)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module PlentyClient
2
4
  module Listing
3
5
  module Market
@@ -5,11 +7,11 @@ module PlentyClient
5
7
  include PlentyClient::Endpoint
6
8
  include PlentyClient::Request
7
9
 
8
- FIND_LISTING_MARKET_HISTORY = '/listings/markets/histories/{marketListingHistoryId}'.freeze
9
- LIST_LISTING_MARKET_HISTORIES = '/listings/markets/histories'.freeze
10
- END_LISTING_MARKET_HISTORY = '/listings/markets/histories/end/{marketListingHistoryId}'.freeze
11
- RELIST_LISTING_MARKET_HISTORY = '/listings/markets/histories/relist/{marketListingHistoryId}'.freeze
12
- UPDATE_LISTING_MARKET_HISTORY = '/listings/markets/histories/update/{marketListingHistoryId}'.freeze
10
+ FIND_LISTING_MARKET_HISTORY = '/listings/markets/histories/{marketListingHistoryId}'
11
+ LIST_LISTING_MARKET_HISTORIES = '/listings/markets/histories'
12
+ END_LISTING_MARKET_HISTORY = '/listings/markets/histories/end/{marketListingHistoryId}'
13
+ RELIST_LISTING_MARKET_HISTORY = '/listings/markets/histories/relist/{marketListingHistoryId}'
14
+ UPDATE_LISTING_MARKET_HISTORY = '/listings/markets/histories/update/{marketListingHistoryId}'
13
15
 
14
16
  class << self
15
17
  def find(market_listing_history_id, headers = {}, &block)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module PlentyClient
2
4
  module Listing
3
5
  module Market
@@ -5,7 +7,7 @@ module PlentyClient
5
7
  include PlentyClient::Endpoint
6
8
  include PlentyClient::Request
7
9
 
8
- LIST_LISTINGS_MARKET_INFO = '/listings/markets/info'.freeze
10
+ LIST_LISTINGS_MARKET_INFO = '/listings/markets/info'
9
11
 
10
12
  class << self
11
13
  def list(headers = {}, &block)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module PlentyClient
2
4
  module Listing
3
5
  module Market
@@ -5,11 +7,11 @@ module PlentyClient
5
7
  include PlentyClient::Endpoint
6
8
  include PlentyClient::Request
7
9
 
8
- FIND_LISTING_MARKET_TEXT = '/listings/markets/texts/{marketTextId}'.freeze
9
- LIST_LISTING_MARKET_TEXTS = '/listings/markets/texts'.freeze
10
- CREATE_LISTING_MARKET_TEXT = '/listings/markets/texts'.freeze
11
- UPDATE_LISTING_MARKET_TEXT = '/listings/markets/texts/{marketTextId}'.freeze
12
- DELETE_LISTING_MARKET_TEXT = '/listings/markets/texts/{marketTextId}'.freeze
10
+ FIND_LISTING_MARKET_TEXT = '/listings/markets/texts/{marketTextId}'
11
+ LIST_LISTING_MARKET_TEXTS = '/listings/markets/texts'
12
+ CREATE_LISTING_MARKET_TEXT = '/listings/markets/texts'
13
+ UPDATE_LISTING_MARKET_TEXT = '/listings/markets/texts/{marketTextId}'
14
+ DELETE_LISTING_MARKET_TEXT = '/listings/markets/texts/{marketTextId}'
13
15
 
14
16
  class << self
15
17
  def find(market_text_id, headers = {}, &block)
@@ -1,16 +1,18 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module PlentyClient
2
4
  module Listing
3
5
  module Market
4
6
  include PlentyClient::Endpoint
5
7
  include PlentyClient::Request
6
8
 
7
- FIND_LISTING_MARKET = '/listings/markets/{marketListingId}'.freeze
8
- LIST_LISTING_MARKETS = '/listings/markets'.freeze
9
- CREATE_LISTING_MARKET = '/listings/markets'.freeze
10
- UPDATE_LISTING_MARKET = '/listings/markets/{marketListingId}'.freeze
11
- DELETE_LISTING_MARKET = '/listings/markets/{marketListingId}'.freeze
12
- START_LISTING_MARKET = '/listings/markets/start/{marketListingId}'.freeze
13
- VERIFY_LISTING_MARKET = '/listings/markets/verify/{marketListingId}'.freeze
9
+ FIND_LISTING_MARKET = '/listings/markets/{marketListingId}'
10
+ LIST_LISTING_MARKETS = '/listings/markets'
11
+ CREATE_LISTING_MARKET = '/listings/markets'
12
+ UPDATE_LISTING_MARKET = '/listings/markets/{marketListingId}'
13
+ DELETE_LISTING_MARKET = '/listings/markets/{marketListingId}'
14
+ START_LISTING_MARKET = '/listings/markets/start/{marketListingId}'
15
+ VERIFY_LISTING_MARKET = '/listings/markets/verify/{marketListingId}'
14
16
 
15
17
  class << self
16
18
  def find(market_listing_id, headers = {}, &block)
@@ -1,14 +1,16 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module PlentyClient
2
4
  module Listing
3
5
  class OptionTemplate
4
6
  include PlentyClient::Endpoint
5
7
  include PlentyClient::Request
6
8
 
7
- PREVIEW_LISTINGS_OPTION_TEMPLATE = '/listings/option_templates/preview'.freeze
8
- FIND_LISTINGS_OPTION_TEMPLATE = '/listings/option_templates/{optionTemplateId}'.freeze
9
- CREATE_LISTINGS_OPTION_TEMPLATE = '/listings/option_templates'.freeze
10
- UPDATE_LISTINGS_OPTION_TEMPLATE = '/listings/option_templates/{optionTemplateId}'.freeze
11
- DELTE_LISTINGS_OPTION_TEMPLATE = '/listings/option_templates/{optionTemplateId}'.freeze
9
+ PREVIEW_LISTINGS_OPTION_TEMPLATE = '/listings/option_templates/preview'
10
+ FIND_LISTINGS_OPTION_TEMPLATE = '/listings/option_templates/{optionTemplateId}'
11
+ CREATE_LISTINGS_OPTION_TEMPLATE = '/listings/option_templates'
12
+ UPDATE_LISTINGS_OPTION_TEMPLATE = '/listings/option_templates/{optionTemplateId}'
13
+ DELTE_LISTINGS_OPTION_TEMPLATE = '/listings/option_templates/{optionTemplateId}'
12
14
 
13
15
  class << self
14
16
  def preview(headers = {}, &block)
@@ -1,11 +1,13 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module PlentyClient
2
4
  module Listing
3
5
  class ShippingProfile
4
6
  include PlentyClient::Endpoint
5
7
  include PlentyClient::Request
6
8
 
7
- FIND_LISTINGS_SHIPPING_PROFILE = '/listings/shipping_profiles/{shippingProfileId}'.freeze
8
- LIST_LISTINGS_SHIPPING_PROFILES = '/listings/shipping_profiles'.freeze
9
+ FIND_LISTINGS_SHIPPING_PROFILE = '/listings/shipping_profiles/{shippingProfileId}'
10
+ LIST_LISTINGS_SHIPPING_PROFILES = '/listings/shipping_profiles'
9
11
 
10
12
  class << self
11
13
  def find(shipping_profile_id, headers = {}, &block)
@@ -1,11 +1,13 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module PlentyClient
2
4
  module Listing
3
5
  class StockDependenceType
4
6
  include PlentyClient::Endpoint
5
7
  include PlentyClient::Request
6
8
 
7
- FIND_LISTINGS_STOCK_DEPENCENCE_TYPE = '/listings/types/{typeId}'.freeze
8
- LIST_LISTINGS_STOCK_DEPENCENCE_TYPES = '/listings/types'.freeze
9
+ FIND_LISTINGS_STOCK_DEPENCENCE_TYPE = '/listings/types/{typeId}'
10
+ LIST_LISTINGS_STOCK_DEPENCENCE_TYPES = '/listings/types'
9
11
 
10
12
  class << self
11
13
  def find(type_id, headers = {}, &block)
@@ -1,11 +1,13 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module PlentyClient
2
4
  module Listing
3
5
  class Type
4
6
  include PlentyClient::Endpoint
5
7
  include PlentyClient::Request
6
8
 
7
- FIND_LISTINGS_TYPE = '/listings/types/{typeId}'.freeze
8
- LIST_LISTINGS_TYPES = '/listings/types'.freeze
9
+ FIND_LISTINGS_TYPE = '/listings/types/{typeId}'
10
+ LIST_LISTINGS_TYPES = '/listings/types'
9
11
 
10
12
  class << self
11
13
  def find(type_id, headers = {}, &block)
@@ -1,13 +1,15 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module PlentyClient
2
4
  module Listing
3
5
  include PlentyClient::Endpoint
4
6
  include PlentyClient::Request
5
7
 
6
- FIND_LISTING = '/listings/{listingId}'.freeze
7
- LIST_LISTINGS = '/listings'.freeze
8
- CREATE_LISTING = '/listings'.freeze
9
- UPDATE_LISTING = '/listings/{listingId}'.freeze
10
- DELETE_LISTING = '/listings/{listingId}'.freeze
8
+ FIND_LISTING = '/listings/{listingId}'
9
+ LIST_LISTINGS = '/listings'
10
+ CREATE_LISTING = '/listings'
11
+ UPDATE_LISTING = '/listings/{listingId}'
12
+ DELETE_LISTING = '/listings/{listingId}'
11
13
 
12
14
  class << self
13
15
  def list(headers = {}, &block)
@@ -1,14 +1,16 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module PlentyClient
2
4
  module Market
3
5
  module Credentials
4
6
  include PlentyClient::Endpoint
5
7
  include PlentyClient::Request
6
8
 
7
- LIST_MARKET_CREDENTIALS = '/markets/credentials'.freeze
8
- FIND_MARKET_CREDENTIALS = '/markets/credentials/{credentialsId}'.freeze
9
- CREATE_MARKET_CREDENTIALS = '/markets/credentials'.freeze
10
- UPDATE_MARKET_CREDENTIALS = '/markets/credentials/{credentialsId}'.freeze
11
- DELETE_MARKET_CREDENTIALS = '/markets/credentials/{credentialsId}'.freeze
9
+ LIST_MARKET_CREDENTIALS = '/markets/credentials'
10
+ FIND_MARKET_CREDENTIALS = '/markets/credentials/{credentialsId}'
11
+ CREATE_MARKET_CREDENTIALS = '/markets/credentials'
12
+ UPDATE_MARKET_CREDENTIALS = '/markets/credentials/{credentialsId}'
13
+ DELETE_MARKET_CREDENTIALS = '/markets/credentials/{credentialsId}'
12
14
 
13
15
  class << self
14
16
  def list(headers = {}, &block)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module PlentyClient
2
4
  module Market
3
5
  module Ebay
@@ -5,8 +7,8 @@ module PlentyClient
5
7
  include PlentyClient::Endpoint
6
8
  include PlentyClient::Request
7
9
 
8
- FIND_MARKET_EBAY_AUTH_URL = '/markets/ebay/auth/login'.freeze
9
- REFRESH_MARKET_EBAY_AUTH_TOKEN = '/markets/ebay/auth/refresh-token'.freeze
10
+ FIND_MARKET_EBAY_AUTH_URL = '/markets/ebay/auth/login'
11
+ REFRESH_MARKET_EBAY_AUTH_TOKEN = '/markets/ebay/auth/refresh-token'
10
12
 
11
13
  class << self
12
14
  def find_login_url(headers = {}, &block)