Module: PlentyClient::Account

Includes:
Endpoint, Request
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

Methods included from Request

included

Methods included from Endpoint

included

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(, body = {})
  delete(build_endpoint(DELETE_ACCOUNT, account: ), body)
end

.find(account_id, headers = {}, &block) ⇒ Object



22
23
24
# File 'lib/plenty_client/account.rb', line 22

def find(, headers = {}, &block)
  get(build_endpoint(FIND_ACCOUNT, account: ), 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(, headers = {}, &block)
  get(build_endpoint(LIST_ACCOUNTS_CONTACTS, account: ), headers, &block)
end

.login(body = {}) ⇒ Object



42
43
44
# File 'lib/plenty_client/account.rb', line 42

def (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 (body = {})
  post(ACCOUNT_REFRESH, body)
end

.update(account_id, body = {}) ⇒ Object



30
31
32
# File 'lib/plenty_client/account.rb', line 30

def update(, body = {})
  put(build_endpoint(UPDATE_ACCOUNT, account: ), body)
end