# `Spectre.GAM.Mandate`
[🔗](https://github.com/elchemista/spectre/blob/0.4.0/lib/spectre/gam/mandate.ex#L1)

Portable, decidable boundary of delegated authority.

A mandate states who may propose, which executors and executor contracts may
carry an admitted Act, what may be touched, and for which closed purpose,
Evidence, time, resource, delegation and revocation constraints. Possessing a
mandate reference is not an execution capability.

# `delegation_policy`

```elixir
@type delegation_policy() :: %{required(String.t()) =&gt; boolean() | non_neg_integer()}
```

# `revocation_mode`

```elixir
@type revocation_mode() :: :cascade | :retained_controller
```

# `revocation_policy`

```elixir
@type revocation_policy() :: %{
  required(String.t()) =&gt; revocation_mode() | [String.t()]
}
```

# `t`

```elixir
@type t() :: %Spectre.GAM.Mandate{
  accountable_ref: String.t(),
  ceiling: Spectre.GAM.Row.t(),
  classes: [String.t()],
  conditions: [Spectre.GAM.Condition.t()],
  delegation: delegation_policy(),
  disclosable_labels: [Spectre.GAM.Label.t()],
  executor_contract_refs: [String.t()],
  executor_refs: [String.t()],
  expires_at: integer(),
  grantor_ref: String.t(),
  holder_ref: String.t(),
  meters: %{optional(String.t()) =&gt; non_neg_integer()},
  not_before: integer(),
  parent_ref: String.t() | nil,
  purpose_params: map(),
  purpose_ref: String.t(),
  ref: String.t(),
  revision: pos_integer(),
  revocation: revocation_policy(),
  schema_version: 1,
  scope_refs: [String.t()],
  source_ref: String.t(),
  subject_refs: [String.t()],
  target_refs: [String.t()]
}
```

# `canonical`

```elixir
@spec canonical(t()) :: map()
```

Returns the plain, string-keyed ledger representation.

# `content_ref`

```elixir
@spec content_ref(t()) :: String.t()
```

Returns the content-derived reference, independent of an assigned `ref`.

# `digest`

```elixir
@spec digest(t()) :: String.t()
```

Returns the stable digest of the complete mandate.

# `from_canonical`

```elixir
@spec from_canonical(map()) :: {:ok, t()} | {:error, term()}
```

Restores a mandate from its canonical map.

# `from_issue_draft`

```elixir
@spec from_issue_draft(map(), String.t()) :: {:ok, t()} | {:error, term()}
```

Materializes an exact canonical issue draft under the Act that authorized it.

# `issue_draft`

```elixir
@spec issue_draft(map() | keyword() | t()) :: {:ok, map()} | {:error, term()}
```

Builds the canonical, validated body frozen by a mandate-issuance Candidate.

# `new`

```elixir
@spec new(map() | keyword() | t()) :: {:ok, t()} | {:error, term()}
```

Builds and validates a mandate.

# `root?`

```elixir
@spec root?(t()) :: boolean()
```

Returns whether the mandate has no parent mandate.

---

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