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

The normalized, per-action keyed-effect declaration produced by an `onetime` `protect` block.

One `Protection` exists per protected action, carrying its strategy (`:idempotency` or
`:one_time_nonce`), identity scope, key source, fingerprint, response contract, retention,
replay window, external-effect module, store-failure policy, and limits. The struct is the
return type of `AshOnetime.Resource.Info.protection/2` and `protections/1`; read its fields
directly for introspection.

# `t`

```elixir
@type t() :: %AshOnetime.Resource.Protection{
  __spark_metadata__: Spark.Dsl.Entity.spark_meta(),
  action: atom(),
  commit: :with_action | :independent,
  external_effect: module() | nil,
  external_lock_timeout_ms: pos_integer() | nil,
  fingerprint: Keyword.t() | nil,
  key: [AshOnetime.KeySource.source()],
  limits: Keyword.t(),
  on_definite_store_failure: :fail_closed | :execute_untracked,
  response: AshOnetime.Resource.Response.t() | nil,
  retention: non_neg_integer() | nil,
  scope: [AshOnetime.Scope.component()],
  strategy: :idempotency | :one_time_nonce,
  window: Keyword.t() | nil
}
```

---

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