module BookingSync::API::Client::Accounts
Public Instance Methods
account(account, options = {})
click to toggle source
Get a single account
@param account [BookingSync::API::Resource|Integer] Account or ID
of the account.
@param options [Hash] A customizable set of query options. @option options [Array] fields: List of fields to be fetched. @return [BookingSync::API::Resource]
# File lib/bookingsync/api/client/accounts.rb, line 26 def account(account, options = {}) get("accounts/#{account}", options).pop end
accounts(options = {}, &block)
click to toggle source
List accounts
Returns all the accounts that the user is authenticated with. @param options [Hash] A customizable set of options. @option options [Array] fields: List of fields to be fetched. @return [Array<BookingSync::API::Resource>] Array of accounts.
@example Get the list of accounts for the current account
accounts = @api.accounts accounts.first.email # => "user@example.com"
@see developers.bookingsync.com/reference/endpoints/accounts/#list-accounts
# File lib/bookingsync/api/client/accounts.rb, line 15 def accounts(options = {}, &block) paginate :accounts, options, &block end