# `AshOnetime.Resource.Info`
[🔗](https://github.com/baselabs/ash_onetime/blob/v1.5.0/lib/ash_onetime/resource/info.ex#L1)

Read-only introspection for the normalized per-action protections a resource declares under
`onetime`.

Each protected action is normalized at compile time into an
`AshOnetime.Resource.Protection` struct carrying its strategy, scope, key, response contract,
and lifecycle configuration. The functions here read that normalized index back without
re-running the DSL.

# `protection`

```elixir
@type protection() :: AshOnetime.Resource.Protection.t()
```

# `protected?`

```elixir
@spec protected?(Ash.Resource.t(), atom()) :: boolean()
```

Returns `true` if `action_name` on `resource` is protected by an `onetime` declaration.

# `protection`

```elixir
@spec protection(Ash.Resource.t(), atom()) :: protection() | nil
```

Returns the protection for `action_name` on `resource`, or `nil` if the action is unprotected.

# `protections`

```elixir
@spec protections(Ash.Resource.t()) :: [protection()]
```

Returns all protections declared on `resource`, in declaration order.

Returns an empty list when the resource declares no `onetime` protections.

# `strategy`

```elixir
@spec strategy(Ash.Resource.t(), atom()) :: :idempotency | :one_time_nonce | nil
```

Returns the keyed-effect strategy for `action_name` (`:idempotency` or `:one_time_nonce`),
or `nil` if the action is unprotected.

---

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