Module: Laposta::Client::Accounts

Included in:
Laposta::Client
Defined in:
lib/laposta/client/accounts.rb

Instance Method Summary collapse

Instance Method Details

#accounts(params = {}) ⇒ Object



4
5
6
# File 'lib/laposta/client/accounts.rb', line 4

def accounts(params = {})
  list("account", params)
end

#create_account!(params = {}) ⇒ Object

Allowed attributes: Name Type Description


hostname string The hostname for this account, for in the url hostname.email-provider.com company object (mandatory) company string (mandatory) The name of the organization of this account company string Extra line for the name of the organization of this account user object (mandatory) user string (mandatory) Email address of the user associated with this account user string The sex of the user associated with this account (male or female) user string The first name of the user associated with this account user string The last name of the user associated with this account




30
31
32
33
34
35
# File 'lib/laposta/client/accounts.rb', line 30

def create_account!(params = {})
  cleaned = params.permit(:hostname,
                          { company: [:name1, :name2] },
                          { user: [:email, :sex, :name1, :name2] })
  create("account", cleaned)
end

#get_account(account_id) ⇒ Object

Parameters Name Type Description


account_id string (mandatory) The ID of the account




13
14
15
# File 'lib/laposta/client/accounts.rb', line 13

def ()
  get("account/#{}")
end