# `Twilio.Api.V2010.Usage.TriggerService`
[🔗](https://github.com/jeffhuen/twilio_elixir/blob/main/lib/twilio/api/v2010/usage/trigger_service.ex#L2)

Webhooks that notify you of usage thresholds

Operations: `list`, `create`, `fetch`, `update`, `delete`

# `create`

```elixir
@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

| Parameter | Type | Description |
|-----------|------|-------------|
| `CallbackUrl` | string (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](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) for this value. |
## Optional Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
# 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
| `FriendlyName` | string | A descriptive string that you create to describe the resource. It can be up to 64 characters long. |
| `Recurring` | string |  Values: `daily`, `monthly`, `yearly`, `alltime` |
| `TriggerBy` | string |  Values: `count`, `usage`, `price` |

# `delete`

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

Operation: `DeleteUsageTrigger` | Tags: Api20100401Trigger

# `fetch`

```elixir
@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`

```elixir
@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

| Parameter | Type | Description |
|-----------|------|-------------|
# 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](https://www.twilio.com/docs/usage/api/usage-record#usage-count-price). |
# 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](https://www.twilio.com/docs/usage/api/usage-record#usage-categories). |

# `stream`

```elixir
@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`

```elixir
@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

| Parameter | Type | Description |
|-----------|------|-------------|
# 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` |
| `CallbackUrl` | string (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. |

---

*Consult [api-reference.md](api-reference.md) for complete listing*
