Module: PlentyClient::Account

Includes:
Endpoint, Request
Defined in:
lib/plenty_client.rb,
lib/plenty_client/account.rb,
lib/plenty_client/account/address.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 Classes: Address

Constant Summary collapse

LIST_ACCOUNTS =
'/accounts'
FIND_ACCOUNT =
'/accounts/{accountId}'
CREATE_ACCOUNT =
'/accounts'
UPDATE_ACCOUNT =
'/accounts/{accountId}'
DELETE_ACCOUNT =
'/accounts/{accountId}'
LIST_ACCOUNTS_CONTACTS =
'/accounts/{accountId}/contacts'
ACCOUNT_LOGIN =
'/account/login'
ACCOUNT_REFRESH =
'/account/login/refresh'
ACCOUNT_LOGOUT =
'/account/logout'

Class Method Summary collapse

Methods included from Request

included

Methods included from Endpoint

included

Class Method Details

.create(body = {}) ⇒ Object



28
29
30
# File 'lib/plenty_client/account.rb', line 28

def create(body = {})
  post(CREATE_ACCOUNT, body)
end

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



36
37
38
# File 'lib/plenty_client/account.rb', line 36

def destroy(, body = {})
  delete(build_endpoint(DELETE_ACCOUNT, account: ), body)
end

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



24
25
26
# File 'lib/plenty_client/account.rb', line 24

def find(, headers = {}, &block)
  get(build_endpoint(FIND_ACCOUNT, account: ), headers, &block)
end

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



20
21
22
# File 'lib/plenty_client/account.rb', line 20

def list(headers = {}, &block)
  get(build_endpoint(LIST_ACCOUNTS), headers, &block)
end

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



40
41
42
# File 'lib/plenty_client/account.rb', line 40

def list_contacts(, headers = {}, &block)
  get(build_endpoint(LIST_ACCOUNTS_CONTACTS, account: ), headers, &block)
end

.login(body = {}) ⇒ Object



44
45
46
# File 'lib/plenty_client/account.rb', line 44

def (body = {})
  post(ACCOUNT_LOGIN, body)
end

.logout(body = {}) ⇒ Object



52
53
54
# File 'lib/plenty_client/account.rb', line 52

def logout(body = {})
  post(ACCOUNT_LOGOUT, body)
end

.refresh_login(body = {}) ⇒ Object



48
49
50
# File 'lib/plenty_client/account.rb', line 48

def (body = {})
  post(ACCOUNT_REFRESH, body)
end

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



32
33
34
# File 'lib/plenty_client/account.rb', line 32

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