# `Twilio.Usage.Records.ThisMonth`

API calls: `list`.

# `list`

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

`GET /2010-04-01/Accounts/{AccountSid}/Usage/Records/ThisMonth.json`

`{AccountSid}` in the path is the `:account_sid` setting; pass `account_sid: "..."` as an option to use another.

## Parameters

  * `category` - The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved.
  * `start_date` - Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date.
  * `end_date` - Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date.
  * `include_subaccounts` - Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account.
  * `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!`

```elixir
@spec list!(map() | keyword(), keyword()) ::
  Twilio.Schemas.UsageRecordsThisMonthListResponse.t()
```

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

# `list_all`

```elixir
@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.UsageRecordThisMonth.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!`

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

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

---

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