Twilio.Accounts (twilio v0.2.0)

Copy Markdown

API calls: create, list, retrieve, update.

Summary

Functions

Create a new Twilio Subaccount from the account making the request

Like create/2, but returns the result or raises Infusion.Runtime.Error.

Retrieves a collection of Accounts belonging to the account used to make the request

Like list/2, but returns the result or raises Infusion.Runtime.Error.

Like list/2, but returns every item, from every page: a lazy stream of Twilio.Schemas.Account.t() that fetches pages as it is read.

Fetch the account specified by the provided Account Sid

Like retrieve/2, but returns the result or raises Infusion.Runtime.Error.

Modify the properties of a given Account

Functions

create(params \\ %{}, opts \\ [])

@spec create(map() | keyword(), keyword()) ::
  {:ok, Twilio.Schemas.Account.t()} | {:error, Infusion.Runtime.Error.t()}

Create a new Twilio Subaccount from the account making the request

POST /2010-04-01/Accounts.json

Parameters

  • friendly_name - A human readable description of the account to create, defaults to SubAccount Created at {YYYY-MM-DD HH:MM meridian}

create!(params \\ %{}, opts \\ [])

@spec create!(map() | keyword(), keyword()) :: Twilio.Schemas.Account.t()

Like create/2, but returns the result or raises Infusion.Runtime.Error.

list(params \\ %{}, opts \\ [])

@spec list(map() | keyword(), keyword()) ::
  {:ok, Twilio.Schemas.AccountsListResponse.t()}
  | {:error, Infusion.Runtime.Error.t()}

Retrieves a collection of Accounts belonging to the account used to make the request

GET /2010-04-01/Accounts.json

Parameters

  • friendly_name - Only return the Account resources with friendly names that exactly match this name.
  • status - Only return Account resources with the given status. Can be closed, suspended or active.
  • page_size - How many resources to return in each list page. The default is 50, and the maximum is 1000.
  • page - The page index. This value is simply for client state.
  • page_token - The page token. This is provided by the API.

To read every item across all pages, use list_all.

list!(params \\ %{}, opts \\ [])

Like list/2, but returns the result or raises Infusion.Runtime.Error.

list_all(params \\ %{}, opts \\ [])

@spec list_all(map() | keyword(), keyword()) ::
  {:ok, Enumerable.t()} | {:error, Infusion.Runtime.Error.t()}

Like list/2, but returns every item, from every page: a lazy stream of Twilio.Schemas.Account.t() that fetches pages as it is read.

The first page is fetched right away, so its errors are returned; a later page that fails raises Infusion.Runtime.Error. Stopping early (Enum.take/2) fetches no more pages.

list_all!(params \\ %{}, opts \\ [])

@spec list_all!(map() | keyword(), keyword()) :: Enumerable.t()

Like list_all/2, but returns the stream or raises Infusion.Runtime.Error.

retrieve(sid, opts \\ [])

@spec retrieve(String.t(), keyword()) ::
  {:ok, Twilio.Schemas.Account.t()} | {:error, Infusion.Runtime.Error.t()}

Fetch the account specified by the provided Account Sid

GET /2010-04-01/Accounts/{Sid}.json

Path parameters

  • sid (required) - The Account Sid that uniquely identifies the account to fetch

retrieve!(sid, opts \\ [])

@spec retrieve!(String.t(), keyword()) :: Twilio.Schemas.Account.t()

Like retrieve/2, but returns the result or raises Infusion.Runtime.Error.

update(sid, params \\ %{}, opts \\ [])

@spec update(String.t(), map() | keyword(), keyword()) ::
  {:ok, Twilio.Schemas.Account.t()} | {:error, Infusion.Runtime.Error.t()}

Modify the properties of a given Account

POST /2010-04-01/Accounts/{Sid}.json

Path parameters

  • sid (required) - The Account Sid that uniquely identifies the account to update

Parameters

  • friendly_name - Update the human-readable description of this Account
  • status

update!(sid, params \\ %{}, opts \\ [])

@spec update!(String.t(), map() | keyword(), keyword()) :: Twilio.Schemas.Account.t()

Like update/3, but returns the result or raises Infusion.Runtime.Error.