# `ExFattureincloud.OAuth.Token`
[🔗](https://github.com/elchemista/ex_fattureincloud/blob/v0.1.0/lib/ex_fattureincloud/oauth.ex#L1)

OAuth credentials. Inspection hides access/refresh tokens. Times are Unix seconds.

# `t`

```elixir
@type t() :: %ExFattureincloud.OAuth.Token{
  access_token: String.t(),
  expires_at: integer(),
  expires_in: pos_integer() | nil,
  refresh_token: String.t() | nil,
  token_type: String.t() | nil
}
```

OAuth credentials. `expires_at` is a Unix timestamp and `expires_in` is a
lifetime, both in seconds. Restored tokens can omit `expires_in` and
`token_type`.

# `expired?`

```elixir
@spec expired?(t(), non_neg_integer()) :: boolean()
```

True if the token expires within the given safety margin (default 60 seconds).

---

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