# `Ankusa.SDK.ClaimRef`
[🔗](https://github.com/jamescarr/ankusa/blob/sdk-elixir-v0.6.0/packages/sdk-elixir/lib/ankusa/sdk/claim_ref.ex#L1)

A parsed claim-check ref: `urn:ankusa:claim:v1:<tenant>:<claim_id>` or the
signed, expiring `urn:ankusa:claim:v2:<tenant>:<claim_id>:<exp_unix>:<signature>`,
the string a queue message carries in its `"claim"` field once its body
outgrows the sink's `inline_max_bytes` (see `Ankusa.SDK.Message`).

The claim id is a Crockford base32 ULID: 26 characters, no `I`, `L`, `O` or
`U`, and a first character in `0`..`7` so the timestamp stays in range.
`exp_unix` is a decimal of 1-12 digits with no leading zero and `signature`
43 unpadded base64url characters. The gateway checks the signature and the
expiry; the SDK only carries them in the path.

# `t`

```elixir
@type t() :: %Ankusa.SDK.ClaimRef{
  claim_id: String.t(),
  path: String.t(),
  tenant_id: String.t()
}
```

# `parse`

```elixir
@spec parse(term()) :: {:ok, t()} | {:error, Ankusa.SDK.InvalidClaimRefError.t()}
```

Parse a ref, or return an `Ankusa.SDK.InvalidClaimRefError`.

The gateway path a ref maps to is `/v1/claims/<tenant>/<claim_id>`, with
`?exp=<exp_unix>&sig=<signature>` for a v2 ref.

---

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