plenty_client 0.0.9 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/plenty_client/account/address.rb +37 -0
- data/lib/plenty_client/account/contact/address.rb +8 -6
- data/lib/plenty_client/account/contact/bank.rb +7 -5
- data/lib/plenty_client/account/contact/type.rb +7 -5
- data/lib/plenty_client/account/contact.rb +7 -5
- data/lib/plenty_client/account.rb +11 -9
- data/lib/plenty_client/accounting.rb +6 -4
- data/lib/plenty_client/authentication.rb +7 -5
- data/lib/plenty_client/authorization.rb +4 -2
- data/lib/plenty_client/basket/item.rb +4 -2
- data/lib/plenty_client/basket.rb +3 -1
- data/lib/plenty_client/category/branch.rb +4 -2
- data/lib/plenty_client/category/template.rb +5 -3
- data/lib/plenty_client/category.rb +12 -10
- data/lib/plenty_client/comment.rb +8 -6
- data/lib/plenty_client/config.rb +6 -0
- data/lib/plenty_client/document/category.rb +6 -4
- data/lib/plenty_client/document/order.rb +7 -5
- data/lib/plenty_client/document.rb +4 -2
- data/lib/plenty_client/endpoint.rb +1 -1
- data/lib/plenty_client/item/attribute/name.rb +8 -6
- data/lib/plenty_client/item/attribute/value.rb +8 -6
- data/lib/plenty_client/item/attribute/value_name.rb +8 -6
- data/lib/plenty_client/item/attribute.rb +7 -5
- data/lib/plenty_client/item/barcode.rb +11 -9
- data/lib/plenty_client/item/cross_selling.rb +5 -3
- data/lib/plenty_client/item/image/availability.rb +6 -4
- data/lib/plenty_client/item/image/name.rb +8 -6
- data/lib/plenty_client/item/image.rb +15 -12
- data/lib/plenty_client/item/manufacturer/commission.rb +8 -6
- data/lib/plenty_client/item/manufacturer.rb +7 -5
- data/lib/plenty_client/item/property/market_reference.rb +8 -6
- data/lib/plenty_client/item/property/name.rb +8 -6
- data/lib/plenty_client/item/property.rb +7 -5
- data/lib/plenty_client/item/property_group.rb +7 -5
- data/lib/plenty_client/item/property_group_name.rb +8 -6
- data/lib/plenty_client/item/sales_price.rb +7 -5
- data/lib/plenty_client/item/shipping_profile.rb +5 -3
- data/lib/plenty_client/item/unit.rb +7 -5
- data/lib/plenty_client/item/unit_name.rb +7 -5
- data/lib/plenty_client/item/variation/barcode.rb +3 -1
- data/lib/plenty_client/item/variation/bundle.rb +8 -6
- data/lib/plenty_client/item/variation/category.rb +14 -6
- data/lib/plenty_client/item/variation/client.rb +6 -4
- data/lib/plenty_client/item/variation/default_category.rb +7 -5
- data/lib/plenty_client/item/variation/description.rb +8 -6
- data/lib/plenty_client/item/variation/image.rb +8 -6
- data/lib/plenty_client/item/variation/market.rb +6 -4
- data/lib/plenty_client/item/variation/market_ident_number.rb +8 -6
- data/lib/plenty_client/item/variation/property/text.rb +8 -6
- data/lib/plenty_client/item/variation/property.rb +22 -17
- data/lib/plenty_client/item/variation/sales_price.rb +15 -19
- data/lib/plenty_client/item/variation/sku.rb +8 -6
- data/lib/plenty_client/item/variation/stock.rb +9 -7
- data/lib/plenty_client/item/variation/supplier.rb +8 -6
- data/lib/plenty_client/item/variation/warehouse.rb +8 -6
- data/lib/plenty_client/item/variation.rb +8 -6
- data/lib/plenty_client/item.rb +11 -4
- data/lib/plenty_client/item_set/component.rb +9 -7
- data/lib/plenty_client/item_set/config.rb +4 -2
- data/lib/plenty_client/item_set.rb +9 -7
- data/lib/plenty_client/listing/layout_template.rb +5 -3
- data/lib/plenty_client/listing/market/directory.rb +6 -4
- data/lib/plenty_client/listing/market/history.rb +7 -5
- data/lib/plenty_client/listing/market/info.rb +3 -1
- data/lib/plenty_client/listing/market/text.rb +7 -5
- data/lib/plenty_client/listing/market.rb +9 -7
- data/lib/plenty_client/listing/option_template.rb +7 -5
- data/lib/plenty_client/listing/shipping_profile.rb +4 -2
- data/lib/plenty_client/listing/stock_dependence_type.rb +4 -2
- data/lib/plenty_client/listing/type.rb +4 -2
- data/lib/plenty_client/listing.rb +7 -5
- data/lib/plenty_client/market/credentials.rb +7 -5
- data/lib/plenty_client/market/ebay/authentication.rb +4 -2
- data/lib/plenty_client/market/ebay/parts_fitment.rb +8 -6
- data/lib/plenty_client/market/ebay/shop_category.rb +3 -1
- data/lib/plenty_client/order/contact_wish.rb +4 -2
- data/lib/plenty_client/order/coupon_code/contact.rb +3 -1
- data/lib/plenty_client/order/coupon_code/validation.rb +3 -1
- data/lib/plenty_client/order/coupon_code.rb +3 -1
- data/lib/plenty_client/order/currency.rb +6 -4
- data/lib/plenty_client/order/date.rb +6 -4
- data/lib/plenty_client/order/item/serial_number.rb +4 -2
- data/lib/plenty_client/order/item.rb +3 -1
- data/lib/plenty_client/order/referrer.rb +4 -2
- data/lib/plenty_client/order/shipping/country.rb +3 -1
- data/lib/plenty_client/order/shipping/information.rb +12 -17
- data/lib/plenty_client/order/shipping/package.rb +9 -7
- data/lib/plenty_client/order/shipping/profile.rb +4 -2
- data/lib/plenty_client/order/shipping/service_provider.rb +5 -3
- data/lib/plenty_client/order/status_history.rb +23 -0
- data/lib/plenty_client/order.rb +9 -7
- data/lib/plenty_client/order_summary.rb +9 -7
- data/lib/plenty_client/payment/contact.rb +4 -2
- data/lib/plenty_client/payment/method.rb +10 -8
- data/lib/plenty_client/payment/method_name.rb +5 -3
- data/lib/plenty_client/payment/order.rb +5 -3
- data/lib/plenty_client/payment/property/type/name.rb +7 -5
- data/lib/plenty_client/payment/property/type.rb +7 -5
- data/lib/plenty_client/payment/property.rb +9 -7
- data/lib/plenty_client/payment/status.rb +3 -1
- data/lib/plenty_client/payment/transaction.rb +3 -1
- data/lib/plenty_client/payment.rb +8 -6
- data/lib/plenty_client/request.rb +54 -24
- data/lib/plenty_client/sales_price/account.rb +5 -3
- data/lib/plenty_client/sales_price/country.rb +5 -3
- data/lib/plenty_client/sales_price/currency.rb +5 -3
- data/lib/plenty_client/sales_price/customer_class.rb +6 -4
- data/lib/plenty_client/sales_price/name.rb +7 -5
- data/lib/plenty_client/sales_price/online_store.rb +5 -3
- data/lib/plenty_client/sales_price/referrer.rb +5 -3
- data/lib/plenty_client/stock.rb +5 -3
- data/lib/plenty_client/ticket.rb +6 -4
- data/lib/plenty_client/version.rb +3 -1
- data/lib/plenty_client/warehouse/management/rack.rb +6 -4
- data/lib/plenty_client/warehouse/management/shelf.rb +6 -4
- data/lib/plenty_client/warehouse/management/storage_location.rb +6 -4
- data/lib/plenty_client/warehouse/management.rb +21 -5
- data/lib/plenty_client/warehouse/stock.rb +8 -6
- data/lib/plenty_client/warehouse.rb +5 -3
- data/lib/plenty_client/webstore.rb +3 -1
- data/lib/plenty_client.rb +5 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: b6ff37ac81ad08b66efcf7d3bf22de8bd7c044f63e9075049cfa12e48e79e67d
|
4
|
+
data.tar.gz: 32bcc7518200db454ff6723807e4f895669a6a96bbc3855376a90b2af23aa965
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a544191236f9de2a8ea7b57e50015e73ade83a0fde9225844a71308439151ffb9121dd1681fbe8fe4616f130c008f3e10057bcd2f3e348cf0c823bb6167a6297
|
7
|
+
data.tar.gz: 1b02c33c9ca78d69435186cccf3851c4e2cc02d75cd9d66a83c6a6d9685d0b68e85afbcf516e26b9f7a217a061daf24e63fa25840365f16a281414159316a583
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module PlentyClient
|
4
|
+
module Account
|
5
|
+
class Address
|
6
|
+
include PlentyClient::Endpoint
|
7
|
+
include PlentyClient::Request
|
8
|
+
|
9
|
+
ACCOUNT_ADDRESS_BASE_PATH = '/accounts/addresses'
|
10
|
+
SINGLE_ADDRESS_SUFFIX = '/{addressId}'
|
11
|
+
|
12
|
+
class << self
|
13
|
+
def find(address_id, headers = {})
|
14
|
+
get(url(address_id), headers)
|
15
|
+
end
|
16
|
+
|
17
|
+
def create(headers = {})
|
18
|
+
post(build_endpoint(ACCOUNT_ADDRESS_BASE_PATH), headers)
|
19
|
+
end
|
20
|
+
|
21
|
+
def update(address_id, headers = {})
|
22
|
+
put(url(address_id), headers)
|
23
|
+
end
|
24
|
+
|
25
|
+
def destroy(address_id, headers = {})
|
26
|
+
delete(url(address_id), headers)
|
27
|
+
end
|
28
|
+
|
29
|
+
private
|
30
|
+
|
31
|
+
def url(address_id)
|
32
|
+
build_endpoint(ACCOUNT_ADDRESS_BASE_PATH + SINGLE_ADDRESS_SUFFIX, address: address_id)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module PlentyClient
|
2
4
|
module Account
|
3
5
|
module Contact
|
@@ -5,13 +7,13 @@ module PlentyClient
|
|
5
7
|
include PlentyClient::Endpoint
|
6
8
|
include PlentyClient::Request
|
7
9
|
|
8
|
-
CONTACT_ADDRESS_BASE_PATH = '/accounts/contacts/{contactId}'
|
10
|
+
CONTACT_ADDRESS_BASE_PATH = '/accounts/contacts/{contactId}'
|
9
11
|
|
10
|
-
LIST_A_CONTACT_ADDRESSES = '/addresses/{addressTypeId}'
|
11
|
-
CREATE_A_CONTACT_ADDRESS = '/addresses'
|
12
|
-
UPDATE_A_CONTACT_ADDRESS = '/addresses/{addressId}'
|
13
|
-
DELETE_A_CONTACT_ADDRESS = '/addresses/{addressId}'
|
14
|
-
SET_PRIMARY_CONTACT_ADDRESS = '/addresses/{addressId}/types/{addressTypeId}/primary'
|
12
|
+
LIST_A_CONTACT_ADDRESSES = '/addresses/{addressTypeId}'
|
13
|
+
CREATE_A_CONTACT_ADDRESS = '/addresses'
|
14
|
+
UPDATE_A_CONTACT_ADDRESS = '/addresses/{addressId}'
|
15
|
+
DELETE_A_CONTACT_ADDRESS = '/addresses/{addressId}'
|
16
|
+
SET_PRIMARY_CONTACT_ADDRESS = '/addresses/{addressId}/types/{addressTypeId}/primary'
|
15
17
|
|
16
18
|
class << self
|
17
19
|
def list(contact_id, address_type = '', headers = {}, &block)
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module PlentyClient
|
2
4
|
module Account
|
3
5
|
module Contact
|
@@ -5,11 +7,11 @@ module PlentyClient
|
|
5
7
|
include PlentyClient::Endpoint
|
6
8
|
include PlentyClient::Request
|
7
9
|
|
8
|
-
LIST_A_CONTACT_PAYMENTS = '/accounts/contacts/{contactId}/banks'
|
9
|
-
FIND_A_CONTACT_PAYMENT = '/accounts/contacts/banks/{contactBankId}'
|
10
|
-
CREATE_A_CONTACT_PAYMENT = '/accounts/contacts/banks'
|
11
|
-
UPDATE_A_CONTACT_PAYMENT = '/accounts/contacts/banks/{contactBankId}'
|
12
|
-
DELETE_A_CONTACT_PAYMENT = '/accounts/contacts/banks/{contactBankId}'
|
10
|
+
LIST_A_CONTACT_PAYMENTS = '/accounts/contacts/{contactId}/banks'
|
11
|
+
FIND_A_CONTACT_PAYMENT = '/accounts/contacts/banks/{contactBankId}'
|
12
|
+
CREATE_A_CONTACT_PAYMENT = '/accounts/contacts/banks'
|
13
|
+
UPDATE_A_CONTACT_PAYMENT = '/accounts/contacts/banks/{contactBankId}'
|
14
|
+
DELETE_A_CONTACT_PAYMENT = '/accounts/contacts/banks/{contactBankId}'
|
13
15
|
|
14
16
|
class << self
|
15
17
|
def list(contact_id, headers = {}, &block)
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module PlentyClient
|
2
4
|
module Account
|
3
5
|
module Contact
|
@@ -5,11 +7,11 @@ module PlentyClient
|
|
5
7
|
include PlentyClient::Endpoint
|
6
8
|
include PlentyClient::Request
|
7
9
|
|
8
|
-
LIST_A_CONTACT_TYPES = '/accounts/contacts/types'
|
9
|
-
FIND_A_CONTACT_TYPE = '/accounts/contacts/types/{typeId}'
|
10
|
-
CREATE_A_CONTACT_TYPE = '/accounts/contacts/types'
|
11
|
-
UPDATE_A_CONTACT_TYPE = '/accounts/contacts/types/{typeId}'
|
12
|
-
DELETE_A_CONTACT_TYPE = '/accounts/contacts/types/{typeId}'
|
10
|
+
LIST_A_CONTACT_TYPES = '/accounts/contacts/types'
|
11
|
+
FIND_A_CONTACT_TYPE = '/accounts/contacts/types/{typeId}'
|
12
|
+
CREATE_A_CONTACT_TYPE = '/accounts/contacts/types'
|
13
|
+
UPDATE_A_CONTACT_TYPE = '/accounts/contacts/types/{typeId}'
|
14
|
+
DELETE_A_CONTACT_TYPE = '/accounts/contacts/types/{typeId}'
|
13
15
|
|
14
16
|
class << self
|
15
17
|
def list(headers = {}, &block)
|
@@ -1,14 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module PlentyClient
|
2
4
|
module Account
|
3
5
|
module Contact
|
4
6
|
include PlentyClient::Endpoint
|
5
7
|
include PlentyClient::Request
|
6
8
|
|
7
|
-
LIST_A_CONTACTS = '/accounts/contacts'
|
8
|
-
FIND_A_CONTACT = '/accounts/contacts/{contactId}'
|
9
|
-
CREATE_A_CONTACT = '/accounts/contacts'
|
10
|
-
UPDATE_A_CONTACT = '/accounts/contacts/{contactId}'
|
11
|
-
DELETE_A_CONTACT = '/accounts/contacts/{contactId}'
|
9
|
+
LIST_A_CONTACTS = '/accounts/contacts'
|
10
|
+
FIND_A_CONTACT = '/accounts/contacts/{contactId}'
|
11
|
+
CREATE_A_CONTACT = '/accounts/contacts'
|
12
|
+
UPDATE_A_CONTACT = '/accounts/contacts/{contactId}'
|
13
|
+
DELETE_A_CONTACT = '/accounts/contacts/{contactId}'
|
12
14
|
|
13
15
|
class << self
|
14
16
|
def list(headers = {}, &block)
|
@@ -1,18 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module PlentyClient
|
2
4
|
module Account
|
3
5
|
include PlentyClient::Endpoint
|
4
6
|
include PlentyClient::Request
|
5
7
|
|
6
|
-
LIST_ACCOUNTS = '/accounts'
|
7
|
-
FIND_ACCOUNT = '/accounts/{accountId}'
|
8
|
-
CREATE_ACCOUNT = '/accounts'
|
9
|
-
UPDATE_ACCOUNT = '/accounts/{accountId}'
|
10
|
-
DELETE_ACCOUNT = '/accounts/{accountId}'
|
11
|
-
LIST_ACCOUNTS_CONTACTS = '/accounts/{accountId}/contacts'
|
8
|
+
LIST_ACCOUNTS = '/accounts'
|
9
|
+
FIND_ACCOUNT = '/accounts/{accountId}'
|
10
|
+
CREATE_ACCOUNT = '/accounts'
|
11
|
+
UPDATE_ACCOUNT = '/accounts/{accountId}'
|
12
|
+
DELETE_ACCOUNT = '/accounts/{accountId}'
|
13
|
+
LIST_ACCOUNTS_CONTACTS = '/accounts/{accountId}/contacts'
|
12
14
|
|
13
|
-
ACCOUNT_LOGIN = '/account/login'
|
14
|
-
ACCOUNT_REFRESH = '/account/login/refresh'
|
15
|
-
ACCOUNT_LOGOUT = '/account/logout'
|
15
|
+
ACCOUNT_LOGIN = '/account/login'
|
16
|
+
ACCOUNT_REFRESH = '/account/login/refresh'
|
17
|
+
ACCOUNT_LOGOUT = '/account/logout'
|
16
18
|
|
17
19
|
class << self
|
18
20
|
def list(headers = {}, &block)
|
@@ -1,12 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module PlentyClient
|
2
4
|
module Accounting
|
3
5
|
include PlentyClient::Endpoint
|
4
6
|
include PlentyClient::Request
|
5
7
|
|
6
|
-
LIST_VAT_OF_LOCATION = '/vat/locations/{locationId}'
|
7
|
-
LIST_VAT_OF_COUNTRY = '/vat/locations/{locationId}/countries/{countryId}'
|
8
|
-
LIST_VAT_CONFIGURATIONS = '/vat'
|
9
|
-
LIST_VAT_STANDARD = '/vat/standard'
|
8
|
+
LIST_VAT_OF_LOCATION = '/vat/locations/{locationId}'
|
9
|
+
LIST_VAT_OF_COUNTRY = '/vat/locations/{locationId}/countries/{countryId}'
|
10
|
+
LIST_VAT_CONFIGURATIONS = '/vat'
|
11
|
+
LIST_VAT_STANDARD = '/vat/standard'
|
10
12
|
|
11
13
|
class << self
|
12
14
|
def list(headers = {}, &block)
|
@@ -1,13 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module PlentyClient
|
2
4
|
module Authentication
|
3
5
|
include PlentyClient::Endpoint
|
4
6
|
include PlentyClient::Request
|
5
7
|
|
6
|
-
AUTH_LOGIN = '/login'
|
7
|
-
AUTH_REFRESH = '/login/refresh'
|
8
|
-
AUTH_TOKEN = '/oauth/access_token'
|
9
|
-
AUTH_LOGOUT = '/logout'
|
10
|
-
AUTH_CLIENT = '/client-login'
|
8
|
+
AUTH_LOGIN = '/login'
|
9
|
+
AUTH_REFRESH = '/login/refresh'
|
10
|
+
AUTH_TOKEN = '/oauth/access_token'
|
11
|
+
AUTH_LOGOUT = '/logout'
|
12
|
+
AUTH_CLIENT = '/client-login'
|
11
13
|
|
12
14
|
class << self
|
13
15
|
def access_token(headers = {}, &block)
|
@@ -1,10 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module PlentyClient
|
2
4
|
module Authorization
|
3
5
|
include PlentyClient::Endpoint
|
4
6
|
include PlentyClient::Request
|
5
7
|
|
6
|
-
AUTH_USER = '/authorized_user'
|
7
|
-
AUTH_USER_WITH_UI_CONFIG = '/user/authorized_user_with_ui_config'
|
8
|
+
AUTH_USER = '/authorized_user'
|
9
|
+
AUTH_USER_WITH_UI_CONFIG = '/user/authorized_user_with_ui_config'
|
8
10
|
|
9
11
|
class << self
|
10
12
|
def list(headers = {}, &block)
|
@@ -1,11 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module PlentyClient
|
2
4
|
module Basket
|
3
5
|
class Item
|
4
6
|
include PlentyClient::Endpoint
|
5
7
|
include PlentyClient::Request
|
6
8
|
|
7
|
-
CREATE_BASKET_ITEM = '/basket/items'
|
8
|
-
LIST_BASKET_ITEMS = '/basket/items'
|
9
|
+
CREATE_BASKET_ITEM = '/basket/items'
|
10
|
+
LIST_BASKET_ITEMS = '/basket/items'
|
9
11
|
|
10
12
|
class << self
|
11
13
|
def list(headers = {}, &block)
|
data/lib/plenty_client/basket.rb
CHANGED
@@ -1,11 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module PlentyClient
|
2
4
|
module Category
|
3
5
|
class Branch
|
4
6
|
include PlentyClient::Endpoint
|
5
7
|
include PlentyClient::Request
|
6
8
|
|
7
|
-
FIND_CATEGORY_BRANCH = '/category_branches/{catId}'
|
8
|
-
LIST_CATEGORY_BRANCH = '/category_branches'
|
9
|
+
FIND_CATEGORY_BRANCH = '/category_branches/{catId}'
|
10
|
+
LIST_CATEGORY_BRANCH = '/category_branches'
|
9
11
|
|
10
12
|
class << self
|
11
13
|
def list(headers = {}, &block)
|
@@ -1,12 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module PlentyClient
|
2
4
|
module Category
|
3
5
|
class Template
|
4
6
|
include PlentyClient::Endpoint
|
5
7
|
include PlentyClient::Request
|
6
8
|
|
7
|
-
FIND_CATEGORY_TEMPLATE = '/categories/{catId}/templates'
|
8
|
-
UPDATE_CATEGORY_TEMPLATE = '/categories/{catId}/templates'
|
9
|
-
DELETE_CATEGORY_TEMPLATE = '/categories/{catId}/templates'
|
9
|
+
FIND_CATEGORY_TEMPLATE = '/categories/{catId}/templates'
|
10
|
+
UPDATE_CATEGORY_TEMPLATE = '/categories/{catId}/templates'
|
11
|
+
DELETE_CATEGORY_TEMPLATE = '/categories/{catId}/templates'
|
10
12
|
|
11
13
|
class << self
|
12
14
|
def list(cat_id, headers = {}, &block)
|
@@ -1,16 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module PlentyClient
|
2
4
|
module Category
|
3
5
|
include PlentyClient::Endpoint
|
4
6
|
include PlentyClient::Request
|
5
7
|
|
6
|
-
FIND_CATEGORY = '/categories/{catId}'
|
7
|
-
LIST_CATEGORIES = '/categories'
|
8
|
-
CREATE_CATEGORY = '/categories'
|
9
|
-
UPDATE_CATEGORY = '/categories/{catId}'
|
10
|
-
UPDATE_CATEGORIES = '/categories'
|
11
|
-
DELETE_CATEGORY = '/categories/{catId}'
|
12
|
-
DELETE_CATEGORY_DETAILS = '/categories/{catId}/details'
|
13
|
-
DELETE_CATEGORY_CLIENTS = '/categories/{catId}/clients'
|
8
|
+
FIND_CATEGORY = '/categories/{catId}'
|
9
|
+
LIST_CATEGORIES = '/categories'
|
10
|
+
CREATE_CATEGORY = '/categories'
|
11
|
+
UPDATE_CATEGORY = '/categories/{catId}'
|
12
|
+
UPDATE_CATEGORIES = '/categories'
|
13
|
+
DELETE_CATEGORY = '/categories/{catId}'
|
14
|
+
DELETE_CATEGORY_DETAILS = '/categories/{catId}/details'
|
15
|
+
DELETE_CATEGORY_CLIENTS = '/categories/{catId}/clients'
|
14
16
|
|
15
17
|
class << self
|
16
18
|
def list(headers = {}, &block)
|
@@ -26,11 +28,11 @@ module PlentyClient
|
|
26
28
|
end
|
27
29
|
|
28
30
|
def update(cat_id, body = {})
|
29
|
-
|
31
|
+
put(build_endpoint(UPDATE_CATEGORY, cat: cat_id), body)
|
30
32
|
end
|
31
33
|
|
32
34
|
def update_all(body = {})
|
33
|
-
|
35
|
+
put(build_endpoint(UPDATE_CATEGORIES), body)
|
34
36
|
end
|
35
37
|
|
36
38
|
def destroy(cat_id, body = {})
|
@@ -1,12 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module PlentyClient
|
2
4
|
module Comment
|
3
5
|
include PlentyClient::Endpoint
|
4
6
|
include PlentyClient::Request
|
5
7
|
|
6
|
-
FIND_COMMENT = '/comments/{commentId}'
|
7
|
-
LIST_COMMENTS = '/comments/{referenceType}/{referenceValue}'
|
8
|
-
CREATE_COMMENT = '/comments'
|
9
|
-
DELETE_COMMENT = '/comments/{commentId}'
|
8
|
+
FIND_COMMENT = '/comments/{commentId}'
|
9
|
+
LIST_COMMENTS = '/comments/{referenceType}/{referenceValue}'
|
10
|
+
CREATE_COMMENT = '/comments'
|
11
|
+
DELETE_COMMENT = '/comments/{commentId}'
|
10
12
|
|
11
13
|
class << self
|
12
14
|
def list(reference_type, reference_value, headers = {}, &block)
|
@@ -20,11 +22,11 @@ module PlentyClient
|
|
20
22
|
end
|
21
23
|
|
22
24
|
def create(body = {})
|
23
|
-
post(
|
25
|
+
post(CREATE_COMMENT, body)
|
24
26
|
end
|
25
27
|
|
26
28
|
def destroy(cat_id, body = {})
|
27
|
-
delete(build_endpoint(
|
29
|
+
delete(build_endpoint(DELETE_COMMENT, comment: cat_id), body)
|
28
30
|
end
|
29
31
|
end
|
30
32
|
end
|
data/lib/plenty_client/config.rb
CHANGED
@@ -7,9 +7,11 @@ module PlentyClient
|
|
7
7
|
|
8
8
|
# When expiry_date is less than this many seconds from now, it should renew API keys
|
9
9
|
LOGIN_RENEW_BUFFER = 60
|
10
|
+
ATTEMPT_COUNT = 3
|
10
11
|
|
11
12
|
class << self
|
12
13
|
attr_accessor :site_url, :api_user, :api_password, :access_token, :refresh_token, :log, :expiry_date, :plenty_id
|
14
|
+
attr_writer :attempt_count
|
13
15
|
|
14
16
|
def validate_credentials
|
15
17
|
raise NoCredentials if site_url.nil? || api_user.nil? || api_password.nil?
|
@@ -19,6 +21,10 @@ module PlentyClient
|
|
19
21
|
!access_token.nil? && !refresh_token.nil?
|
20
22
|
end
|
21
23
|
|
24
|
+
def attempt_count
|
25
|
+
@attempt_count || ATTEMPT_COUNT
|
26
|
+
end
|
27
|
+
|
22
28
|
def tokens_valid?
|
23
29
|
tokens_present? &&
|
24
30
|
expiry_date.instance_of?(Time) &&
|
@@ -1,13 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module PlentyClient
|
2
4
|
module Document
|
3
5
|
class Category
|
4
6
|
include PlentyClient::Endpoint
|
5
7
|
include PlentyClient::Request
|
6
8
|
|
7
|
-
DOWNLOAD_CATEGORY_DOCUMENT = '/categories/{categoryId}/documents/downloads'
|
8
|
-
LIST_CATEGORY_DOCUMENTS = '/categories/{categoryId}/documents/'
|
9
|
-
UPLOAD_CATEGORY_DOCUMENT = '/categories/{categoryId}/documents'
|
10
|
-
DELTE_CATEGORY_DOCUMENTS = '/categories/{categoryId}/documents/{documentId}'
|
9
|
+
DOWNLOAD_CATEGORY_DOCUMENT = '/categories/{categoryId}/documents/downloads'
|
10
|
+
LIST_CATEGORY_DOCUMENTS = '/categories/{categoryId}/documents/'
|
11
|
+
UPLOAD_CATEGORY_DOCUMENT = '/categories/{categoryId}/documents'
|
12
|
+
DELTE_CATEGORY_DOCUMENTS = '/categories/{categoryId}/documents/{documentId}'
|
11
13
|
|
12
14
|
class << self
|
13
15
|
def download(category_id, headers = {}, &block)
|
@@ -1,14 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module PlentyClient
|
2
4
|
module Document
|
3
5
|
class Order
|
4
6
|
include PlentyClient::Endpoint
|
5
7
|
include PlentyClient::Request
|
6
8
|
|
7
|
-
DOWNLOAD_ORDERS_DOCUMENTS = '/orders/{orderId}/documents/downloads/{type}'
|
8
|
-
DOWNLOAD_ORDER_DOCUMENTS_BY_TYPE = '/orders/documents/downloads/{type}'
|
9
|
-
LIST_ORDER_DOCUMENTS = '/orders/{orderId}/documents/{type}'
|
10
|
-
LIST_ORDER_DOCUMENTS_BY_TYPE = '/orders/documents/{type}'
|
11
|
-
UPLOAD_ORDER_DOCUMENT = '/orders/{orderId}/documents/{type}'
|
9
|
+
DOWNLOAD_ORDERS_DOCUMENTS = '/orders/{orderId}/documents/downloads/{type}'
|
10
|
+
DOWNLOAD_ORDER_DOCUMENTS_BY_TYPE = '/orders/documents/downloads/{type}'
|
11
|
+
LIST_ORDER_DOCUMENTS = '/orders/{orderId}/documents/{type}'
|
12
|
+
LIST_ORDER_DOCUMENTS_BY_TYPE = '/orders/documents/{type}'
|
13
|
+
UPLOAD_ORDER_DOCUMENT = '/orders/{orderId}/documents/{type}'
|
12
14
|
|
13
15
|
class << self
|
14
16
|
def download(order_id, type_string, headers = {}, &block)
|
@@ -1,13 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module PlentyClient
|
2
4
|
module Document
|
3
5
|
include PlentyClient::Endpoint
|
4
6
|
include PlentyClient::Request
|
5
7
|
|
6
|
-
DOWNLOAD_DOCUMENT = '/documents/{documentId}'
|
8
|
+
DOWNLOAD_DOCUMENT = '/documents/{documentId}'
|
7
9
|
|
8
10
|
class << self
|
9
11
|
def download(document_id, headers = {}, &block)
|
10
|
-
get(build_endpoint(
|
12
|
+
get(build_endpoint(DOWNLOAD_DOCUMENT, document: document_id), headers, &block)
|
11
13
|
end
|
12
14
|
end
|
13
15
|
end
|
@@ -52,7 +52,7 @@ module PlentyClient
|
|
52
52
|
order_item: /\{orderItemId\}/,
|
53
53
|
order_summary: /\{orderSummaryId\}/,
|
54
54
|
payment: /\{paymentId\}/,
|
55
|
-
payment_method: /\{
|
55
|
+
payment_method: /\{paymentMethodId\}/,
|
56
56
|
parent_referrer: /\{parentReferrerId\}/,
|
57
57
|
plenty: /\{plentyId\}/,
|
58
58
|
plugin_key: /\{pluginKey\}/,
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module PlentyClient
|
2
4
|
module Item
|
3
5
|
module Attribute
|
@@ -5,13 +7,13 @@ module PlentyClient
|
|
5
7
|
include PlentyClient::Endpoint
|
6
8
|
include PlentyClient::Request
|
7
9
|
|
8
|
-
ITEM_ATTRIBUTE_PATH = '/items/attributes'
|
10
|
+
ITEM_ATTRIBUTE_PATH = '/items/attributes'
|
9
11
|
|
10
|
-
CREATE_ITEM_ATTRIBUTES = '/{attributeId}/names'
|
11
|
-
LIST_ITEM_ATTRIBUTE = '/{attributeId}/names'
|
12
|
-
GET_ITEMS_ATTRIBUTE = '/{attributeId}/names/{lang}'
|
13
|
-
UPDATE_ITEMS_ATTRIBUTE = '/{attributeId}/names/{lang}'
|
14
|
-
DELETE_ITEMS_ATTRIBUTE = '/{attributeId}/names/{lang}'
|
12
|
+
CREATE_ITEM_ATTRIBUTES = '/{attributeId}/names'
|
13
|
+
LIST_ITEM_ATTRIBUTE = '/{attributeId}/names'
|
14
|
+
GET_ITEMS_ATTRIBUTE = '/{attributeId}/names/{lang}'
|
15
|
+
UPDATE_ITEMS_ATTRIBUTE = '/{attributeId}/names/{lang}'
|
16
|
+
DELETE_ITEMS_ATTRIBUTE = '/{attributeId}/names/{lang}'
|
15
17
|
|
16
18
|
class << self
|
17
19
|
def create(attribute_id, headers = {})
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module PlentyClient
|
2
4
|
module Item
|
3
5
|
module Attribute
|
@@ -5,13 +7,13 @@ module PlentyClient
|
|
5
7
|
include PlentyClient::Endpoint
|
6
8
|
include PlentyClient::Request
|
7
9
|
|
8
|
-
ITEM_ATTRIBUTE_PATH = '/items/attributes'
|
10
|
+
ITEM_ATTRIBUTE_PATH = '/items/attributes'
|
9
11
|
|
10
|
-
CREATE_ITEM_ATTRIBUTE_VALUES = '/{attributeId}/values'
|
11
|
-
LIST_ITEM_ATTRIBUTE_VALUE = '/{attributeId}/values'
|
12
|
-
GET_ITEMS_ATTRIBUTE_VALUE = '/{attributeId}/values/{valueId}'
|
13
|
-
UPDATE_ITEMS_ATTRIBUTE_VALUE = '/{attributeId}/values/{valueId}'
|
14
|
-
DELETE_ITEMS_ATTRIBUTE_VALUE = '/{attributeId}/values/{valueId}'
|
12
|
+
CREATE_ITEM_ATTRIBUTE_VALUES = '/{attributeId}/values'
|
13
|
+
LIST_ITEM_ATTRIBUTE_VALUE = '/{attributeId}/values'
|
14
|
+
GET_ITEMS_ATTRIBUTE_VALUE = '/{attributeId}/values/{valueId}'
|
15
|
+
UPDATE_ITEMS_ATTRIBUTE_VALUE = '/{attributeId}/values/{valueId}'
|
16
|
+
DELETE_ITEMS_ATTRIBUTE_VALUE = '/{attributeId}/values/{valueId}'
|
15
17
|
|
16
18
|
class << self
|
17
19
|
def create(attribute_id, body = {})
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module PlentyClient
|
2
4
|
module Item
|
3
5
|
module Attribute
|
@@ -5,13 +7,13 @@ module PlentyClient
|
|
5
7
|
include PlentyClient::Endpoint
|
6
8
|
include PlentyClient::Request
|
7
9
|
|
8
|
-
ITEM_ATTRIBUTE_PATH = '/items/attribute_values'
|
10
|
+
ITEM_ATTRIBUTE_PATH = '/items/attribute_values'
|
9
11
|
|
10
|
-
CREATE_ITEM_ATTRIBUTE_VALUES = '/{attributeValueId}/names'
|
11
|
-
LIST_ITEM_ATTRIBUTE_VALUE = '/{attributeValueId}/names'
|
12
|
-
GET_ITEMS_ATTRIBUTE_VALUE = '/{attributeValueId}/names/{lang}'
|
13
|
-
UPDATE_ITEMS_ATTRIBUTE_VALUE = '/{attributeValueId}/names/{lang}'
|
14
|
-
DELETE_ITEMS_ATTRIBUTE_VALUE = '/{attributeValueId}/names/{lang}'
|
12
|
+
CREATE_ITEM_ATTRIBUTE_VALUES = '/{attributeValueId}/names'
|
13
|
+
LIST_ITEM_ATTRIBUTE_VALUE = '/{attributeValueId}/names'
|
14
|
+
GET_ITEMS_ATTRIBUTE_VALUE = '/{attributeValueId}/names/{lang}'
|
15
|
+
UPDATE_ITEMS_ATTRIBUTE_VALUE = '/{attributeValueId}/names/{lang}'
|
16
|
+
DELETE_ITEMS_ATTRIBUTE_VALUE = '/{attributeValueId}/names/{lang}'
|
15
17
|
|
16
18
|
class << self
|
17
19
|
def create(attribute_value_id, body = {})
|
@@ -1,14 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module PlentyClient
|
2
4
|
module Item
|
3
5
|
module Attribute
|
4
6
|
include PlentyClient::Endpoint
|
5
7
|
include PlentyClient::Request
|
6
8
|
|
7
|
-
CREATE_ATTRIBUTE = '/items/attributes'
|
8
|
-
LIST_ATTRIBUTES = '/items/attributes'
|
9
|
-
GET_ATTRIBUTE = '/items/attributes/{attributeId}'
|
10
|
-
UPDATE_ATTRIBUTE = '/items/attributes/{attributeId}'
|
11
|
-
DELETE_ATTRIBUTE = '/items/attributes/{attributeId}'
|
9
|
+
CREATE_ATTRIBUTE = '/items/attributes'
|
10
|
+
LIST_ATTRIBUTES = '/items/attributes'
|
11
|
+
GET_ATTRIBUTE = '/items/attributes/{attributeId}'
|
12
|
+
UPDATE_ATTRIBUTE = '/items/attributes/{attributeId}'
|
13
|
+
DELETE_ATTRIBUTE = '/items/attributes/{attributeId}'
|
12
14
|
|
13
15
|
class << self
|
14
16
|
def list(headers = {}, &block)
|
@@ -1,18 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module PlentyClient
|
2
4
|
module Item
|
3
5
|
class Barcode
|
4
6
|
include PlentyClient::Endpoint
|
5
7
|
include PlentyClient::Request
|
6
8
|
|
7
|
-
LIST_ALL_BARCODES = '/items/barcodes'
|
8
|
-
CREATE_BARCODE = '/items/barcodes'
|
9
|
-
GET_BARCODE = '/items/barcodes/{barcodeId}'
|
10
|
-
UPDATE_BARCODE = '/items/barcodes/{barcodeId}'
|
11
|
-
DELETE_BARCODE = '/items/barcodes/{barcodeId}'
|
12
|
-
DEACTIVATE_REFERRER = '/items/barcodes/{barcodeId}/referrer/{referrerId}'
|
13
|
-
ACTIVATE_RERERRER = '/items/barcodes/{barcodeId}/referrer'
|
14
|
-
LIST_BARCODES_BY_TYPE = '/items/barcodes/type/{type}'
|
15
|
-
LIST_BARCODES_BY_REFERRER = '/items/barcodes/referrer/{referrerId}'
|
9
|
+
LIST_ALL_BARCODES = '/items/barcodes'
|
10
|
+
CREATE_BARCODE = '/items/barcodes'
|
11
|
+
GET_BARCODE = '/items/barcodes/{barcodeId}'
|
12
|
+
UPDATE_BARCODE = '/items/barcodes/{barcodeId}'
|
13
|
+
DELETE_BARCODE = '/items/barcodes/{barcodeId}'
|
14
|
+
DEACTIVATE_REFERRER = '/items/barcodes/{barcodeId}/referrer/{referrerId}'
|
15
|
+
ACTIVATE_RERERRER = '/items/barcodes/{barcodeId}/referrer'
|
16
|
+
LIST_BARCODES_BY_TYPE = '/items/barcodes/type/{type}'
|
17
|
+
LIST_BARCODES_BY_REFERRER = '/items/barcodes/referrer/{referrerId}'
|
16
18
|
|
17
19
|
class << self
|
18
20
|
def list(headers = {}, &block)
|
@@ -1,12 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module PlentyClient
|
2
4
|
module Item
|
3
5
|
class CrossSelling
|
4
6
|
include PlentyClient::Endpoint
|
5
7
|
include PlentyClient::Request
|
6
8
|
|
7
|
-
CREATE_ITEMS_CROSS_SELLING = '/items/{itemId}/item_cross_selling'
|
8
|
-
GET_ITEMS_CROSS_SELLING = '/items/{itemId}/item_cross_selling'
|
9
|
-
DELETE_ITEMS_CROSS_SELLING = '/items/{itemId}/item_cross_selling/{crossItemId}'
|
9
|
+
CREATE_ITEMS_CROSS_SELLING = '/items/{itemId}/item_cross_selling'
|
10
|
+
GET_ITEMS_CROSS_SELLING = '/items/{itemId}/item_cross_selling'
|
11
|
+
DELETE_ITEMS_CROSS_SELLING = '/items/{itemId}/item_cross_selling/{crossItemId}'
|
10
12
|
|
11
13
|
class << self
|
12
14
|
def create(item_id, headers = {})
|