Module: PlentyClient::Account
- Defined in:
- lib/plenty_client.rb,
lib/plenty_client/account.rb,
lib/plenty_client/account/contact.rb,
lib/plenty_client/account/contact/bank.rb,
lib/plenty_client/account/contact/type.rb,
lib/plenty_client/account/contact/address.rb
Defined Under Namespace
Modules: Contact
Constant Summary collapse
- LIST_ACCOUNTS =
'/accounts'.freeze
- FIND_ACCOUNT =
'/accounts/{accountId}'.freeze
- CREATE_ACCOUNT =
'/accounts'.freeze
- UPDATE_ACCOUNT =
'/accounts/{accountId}'.freeze
- DELETE_ACCOUNT =
'/accounts/{accountId}'.freeze
- LIST_ACCOUNTS_CONTACTS =
'/accounts/{accountId}/contacts'.freeze
- ACCOUNT_LOGIN =
'/account/login'.freeze
- ACCOUNT_REFRESH =
'/account/login/refresh'.freeze
- ACCOUNT_LOGOUT =
'/account/logout'.freeze
Class Method Summary collapse
- .create(body = {}) ⇒ Object
- .destroy(account_id, body = {}) ⇒ Object
- .find(account_id, headers = {}, &block) ⇒ Object
- .list(headers = {}, &block) ⇒ Object
- .list_contacts(account_id, headers = {}, &block) ⇒ Object
- .login(body = {}) ⇒ Object
- .logout(body = {}) ⇒ Object
- .refresh_login(body = {}) ⇒ Object
- .update(account_id, body = {}) ⇒ Object
Methods included from Request
Methods included from Endpoint
Class Method Details
.create(body = {}) ⇒ Object
26 27 28 |
# File 'lib/plenty_client/account.rb', line 26 def create(body = {}) post(CREATE_ACCOUNT, body) end |
.destroy(account_id, body = {}) ⇒ Object
34 35 36 |
# File 'lib/plenty_client/account.rb', line 34 def destroy(account_id, body = {}) delete(build_endpoint(DELETE_ACCOUNT, account: account_id), body) end |
.find(account_id, headers = {}, &block) ⇒ Object
22 23 24 |
# File 'lib/plenty_client/account.rb', line 22 def find(account_id, headers = {}, &block) get(build_endpoint(FIND_ACCOUNT, account: account_id), headers, &block) end |
.list(headers = {}, &block) ⇒ Object
18 19 20 |
# File 'lib/plenty_client/account.rb', line 18 def list(headers = {}, &block) get(build_endpoint(LIST_ACCOUNTS), headers, &block) end |
.list_contacts(account_id, headers = {}, &block) ⇒ Object
38 39 40 |
# File 'lib/plenty_client/account.rb', line 38 def list_contacts(account_id, headers = {}, &block) get(build_endpoint(LIST_ACCOUNTS_CONTACTS, account: account_id), headers, &block) end |
.login(body = {}) ⇒ Object
42 43 44 |
# File 'lib/plenty_client/account.rb', line 42 def login(body = {}) post(ACCOUNT_LOGIN, body) end |
.logout(body = {}) ⇒ Object
50 51 52 |
# File 'lib/plenty_client/account.rb', line 50 def logout(body = {}) post(ACCOUNT_LOGOUT, body) end |
.refresh_login(body = {}) ⇒ Object
46 47 48 |
# File 'lib/plenty_client/account.rb', line 46 def refresh_login(body = {}) post(ACCOUNT_REFRESH, body) end |
.update(account_id, body = {}) ⇒ Object
30 31 32 |
# File 'lib/plenty_client/account.rb', line 30 def update(account_id, body = {}) put(build_endpoint(UPDATE_ACCOUNT, account: account_id), body) end |