Twilio.Api.V2010.Usage.TriggerService (twilio_elixir v0.1.1)

Copy Markdown View Source

Webhooks that notify you of usage thresholds

Operations: list, create, fetch, update, delete

Summary

Functions

Create a new UsageTrigger

Operation: DeleteUsageTrigger | Tags: Api20100401Trigger

Fetch and instance of a usage-trigger

Retrieve a list of usage-triggers belonging to the account used to make the request

Stream: Retrieve a list of usage-triggers belonging to the account used to make the request (lazy auto-pagination).

Update an instance of a usage trigger

Functions

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

@spec create(Twilio.Client.t(), map(), keyword()) ::
  {:ok, Twilio.Resources.Api.V2010.Usage.Trigger.t()}
  | {:ok, map(), map()}
  | :ok
  | {:error, Twilio.Error.t()}

Create a new UsageTrigger

Operation: CreateUsageTrigger | Tags: Api20100401Trigger

Required Parameters

ParameterTypeDescription
CallbackUrlstring (uri)The URL we should call using callback_method when the trigger fires.

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

| TriggerValue | string | The usage value at which the trigger should fire. For convenience, you can use an offset value such as +30 to specify a trigger_value that is 30 units more than the current usage value. Be sure to urlencode a + as %2B. |

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

| UsageCategory | string | The usage category that the trigger should watch. Use one of the supported usage categories for this value. |

Optional Parameters

ParameterTypeDescription

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

| CallbackMethod | string (http-method) | The HTTP method we should use to call callback_url. Can be: GET or POST and the default is POST. Values: GET, POST |

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

FriendlyNamestringA descriptive string that you create to describe the resource. It can be up to 64 characters long.
RecurringstringValues: daily, monthly, yearly, alltime
TriggerBystringValues: count, usage, price

delete(client, sid, opts \\ [])

@spec delete(Twilio.Client.t(), String.t(), keyword()) ::
  {:ok, map()} | {:ok, map(), map()} | :ok | {:error, Twilio.Error.t()}

Operation: DeleteUsageTrigger | Tags: Api20100401Trigger

fetch(client, sid, opts \\ [])

@spec fetch(Twilio.Client.t(), String.t(), keyword()) ::
  {:ok, Twilio.Resources.Api.V2010.Usage.Trigger.t()}
  | {:ok, map(), map()}
  | :ok
  | {:error, Twilio.Error.t()}

Fetch and instance of a usage-trigger

Operation: FetchUsageTrigger | Tags: Api20100401Trigger

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

@spec list(Twilio.Client.t(), map(), keyword()) ::
  {:ok, Twilio.Page.t()}
  | {:ok, map(), map()}
  | :ok
  | {:error, Twilio.Error.t()}

Retrieve a list of usage-triggers belonging to the account used to make the request

Operation: ListUsageTrigger | Tags: Api20100401Trigger

Query Parameters

ParameterTypeDescription

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

| Recurring | string | The frequency of recurring UsageTriggers to read. Can be: daily, monthly, or yearly to read recurring UsageTriggers. An empty value or a value of alltime reads non-recurring UsageTriggers. |

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

| TriggerBy | string | The trigger field of the UsageTriggers to read. Can be: count, usage, or price as described in the UsageRecords documentation. |

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

| UsageCategory | string | The usage category of the UsageTriggers to read. Must be a supported usage categories. |

stream(client, params \\ %{}, opts \\ [])

@spec stream(Twilio.Client.t(), map(), keyword()) :: Enumerable.t()

Stream: Retrieve a list of usage-triggers belonging to the account used to make the request (lazy auto-pagination).

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

@spec update(Twilio.Client.t(), String.t(), map(), keyword()) ::
  {:ok, Twilio.Resources.Api.V2010.Usage.Trigger.t()}
  | {:ok, map(), map()}
  | :ok
  | {:error, Twilio.Error.t()}

Update an instance of a usage trigger

Operation: UpdateUsageTrigger | Tags: Api20100401Trigger

Optional Parameters

ParameterTypeDescription

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

CallbackMethodstring (http-method)The HTTP method we should use to call callback_url. Can be: GET or POST and the default is POST. Values: GET, POST
CallbackUrlstring (uri)The URL we should call using callback_method when the trigger fires.

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

| FriendlyName | string | A descriptive string that you create to describe the resource. It can be up to 64 characters long. |