Module: PlentyClient::Category
- Includes:
- Endpoint, Request
- Defined in:
- lib/plenty_client.rb,
lib/plenty_client/category.rb,
lib/plenty_client/category/branch.rb,
lib/plenty_client/category/template.rb
Defined Under Namespace
Classes: Branch, Template
Constant Summary
collapse
- FIND_CATEGORY =
'/categories/{catId}'.freeze
- LIST_CATEGORIES =
'/categories'.freeze
- CREATE_CATEGORY =
'/categories'.freeze
- UPDATE_CATEGORY =
'/categories/{catId}'.freeze
- UPDATE_CATEGORIES =
'/categories'.freeze
- DELETE_CATEGORY =
'/categories/{catId}'.freeze
- DELETE_CATEGORY_DETAILS =
'/categories/{catId}/details'.freeze
- DELETE_CATEGORY_CLIENTS =
'/categories/{catId}/clients'.freeze
Class Method Summary
collapse
Methods included from Request
included
Methods included from Endpoint
included
Class Method Details
.create(body = {}) ⇒ Object
24
25
26
|
# File 'lib/plenty_client/category.rb', line 24
def create(body = {})
post(CREATE_CATEGORY, body)
end
|
.destroy(cat_id, body = {}) ⇒ Object
36
37
38
|
# File 'lib/plenty_client/category.rb', line 36
def destroy(cat_id, body = {})
delete(build_endpoint(DELETE_CATEGORY, cat: cat_id), body)
end
|
.destroy_clients(cat_id, body = {}) ⇒ Object
44
45
46
|
# File 'lib/plenty_client/category.rb', line 44
def destroy_clients(cat_id, body = {})
delete(build_endpoint(DELETE_CATEGORY_CLIENTS, cat: cat_id), body)
end
|
.destroy_details(cat_id, body = {}) ⇒ Object
40
41
42
|
# File 'lib/plenty_client/category.rb', line 40
def destroy_details(cat_id, body = {})
delete(build_endpoint(DELETE_CATEGORY_DETAILS, cat: cat_id), body)
end
|
.find(cat_id = nil, headers = {}, &block) ⇒ Object
20
21
22
|
# File 'lib/plenty_client/category.rb', line 20
def find(cat_id = nil, = {}, &block)
get(build_endpoint(FIND_CATEGORY, cat: cat_id), , &block)
end
|
.list(headers = {}, &block) ⇒ Object
16
17
18
|
# File 'lib/plenty_client/category.rb', line 16
def list( = {}, &block)
get(build_endpoint(LIST_CATEGORIES), , &block)
end
|
.update(cat_id, body = {}) ⇒ Object
28
29
30
|
# File 'lib/plenty_client/category.rb', line 28
def update(cat_id, body = {})
post(build_endpoint(UPDATE_CATEGORY, cat: cat_id), body)
end
|
.update_all(body = {}) ⇒ Object
32
33
34
|
# File 'lib/plenty_client/category.rb', line 32
def update_all(body = {})
post(build_endpoint(UPDATE_CATEGORIES), body)
end
|