View Source ExTwilio.Account (ExTwilio v0.10.0)

Represents an Account or Subaccount resource.

Examples

An ExTwilio.Account can represent either an Account or a SubAccount. To see all accounts and subaccounts that your auth_token has access to, run:

ExTwilio.Account.all

If you want to find a SubAccount, use find/1.

ExTwilio.Account.find("sid")

If you want to see items associated with a SubAccount, you can do so by passing in an account: option in all other ExTwilio resources. For example:

ExTwilio.Call.stream(account: "subaccount_sid")

Summary

Functions

Children represent path segments that come after the current resource. For example, in the path /v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Users/Active "Active" is a child. Children may or may not have a key in the next segment.

Permanently close an Account by updating its status to "closed". This cannot be undone, so use it carefully!

Parents represent path segments that precede the current resource. For example, in the path /v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Users "Services" is a parent. Parents will always have a key in the next segment. If your parent is under a submodule of ExTwilio, specify your parent using the ExTwilio.Parent struct.

Reactivate a suspended Account by updating its status to "active".

Underscored and lowercased collection name for a given resource. Delegates the real work to ExTwilio.UrlGenerator.resource_collection_name/1 by default.

CamelCase resource name as it would be used in Twilio's API. Delegates the real work to ExTwilio.UrlGenerator.resource_name/1 by default.

Suspend an Account by updating its status to "suspended".

Functions

@spec all(list()) :: [map()]
@spec children() :: list()

Children represent path segments that come after the current resource. For example, in the path /v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Users/Active "Active" is a child. Children may or may not have a key in the next segment.

Override this method in your resource to specify children in the order that they will appear in the path.

Permanently close an Account by updating its status to "closed". This cannot be undone, so use it carefully!

Examples

{:ok, account} = ExTwilio.Account.find("<sid>")
ExTwilio.Account.close(account)
Link to this function

create(data, options \\ [])

View Source
@spec do_new(
  %ExTwilio.Account{
    auth_token: term(),
    date_created: term(),
    date_updated: term(),
    friendly_name: term(),
    owner_account_sid: term(),
    sid: term(),
    status: term(),
    subresource_uris: term(),
    type: term(),
    uri: term()
  },
  list()
) :: %ExTwilio.Account{
  auth_token: term(),
  date_created: term(),
  date_updated: term(),
  friendly_name: term(),
  owner_account_sid: term(),
  sid: term(),
  status: term(),
  subresource_uris: term(),
  type: term(),
  uri: term()
}
Link to this function

find(sid, options \\ [])

View Source
@spec find(String.t() | nil, list()) :: ExTwilio.Parser.parsed_list_response()
@spec new() :: %ExTwilio.Account{
  auth_token: term(),
  date_created: term(),
  date_updated: term(),
  friendly_name: term(),
  owner_account_sid: term(),
  sid: term(),
  status: term(),
  subresource_uris: term(),
  type: term(),
  uri: term()
}
@spec new(list()) :: %ExTwilio.Account{
  auth_token: term(),
  date_created: term(),
  date_updated: term(),
  friendly_name: term(),
  owner_account_sid: term(),
  sid: term(),
  status: term(),
  subresource_uris: term(),
  type: term(),
  uri: term()
}
@spec parents() :: list()

Parents represent path segments that precede the current resource. For example, in the path /v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Users "Services" is a parent. Parents will always have a key in the next segment. If your parent is under a submodule of ExTwilio, specify your parent using the ExTwilio.Parent struct.

Override this method in your resource to specify parents in the order that they will appear in the path.

@spec reactivate(map() | String.t()) ::
  ExTwilio.Parser.success() | ExTwilio.Parser.error()

Reactivate a suspended Account by updating its status to "active".

Examples

{:ok, account} = ExTwilio.Account.find("<sid>")
ExTwilio.Account.reactivate(account)
Link to this function

resource_collection_name()

View Source

Underscored and lowercased collection name for a given resource. Delegates the real work to ExTwilio.UrlGenerator.resource_collection_name/1 by default.

Override in your module after use ExTwilio.Resource if you need something different.

CamelCase resource name as it would be used in Twilio's API. Delegates the real work to ExTwilio.UrlGenerator.resource_name/1 by default.

Override in your module after use ExTwilio.Resource if you need something different.

Suspend an Account by updating its status to "suspended".

Examples

{:ok, account} = ExTwilio.Account.find("<sid>")
ExTwilio.Account.suspend(account)
Link to this function

update(sid, data, options \\ [])

View Source