Module: PlentyClient::Account::Contact

Includes:
Endpoint, Request
Defined in:
lib/plenty_client.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

Classes: Address, Bank, Type

Constant Summary collapse

LIST_A_CONTACTS =
'/accounts/contacts'
FIND_A_CONTACT =
'/accounts/contacts/{contactId}'
CREATE_A_CONTACT =
'/accounts/contacts'
UPDATE_A_CONTACT =
'/accounts/contacts/{contactId}'
DELETE_A_CONTACT =
'/accounts/contacts/{contactId}'

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/account/contact.rb', line 24

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

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



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

def destroy(contact_id, body = {})
  delete(build_endpoint(DELETE_A_CONTACT, contact: contact_id), body)
end

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



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

def find(contact_id, headers = {}, &block)
  get(build_endpoint(FIND_A_CONTACT, contact: contact_id), headers, &block)
end

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



16
17
18
# File 'lib/plenty_client/account/contact.rb', line 16

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

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



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

def update(contact_id, body = {})
  put(build_endpoint(UPDATE_A_CONTACT, contact: contact_id), body)
end