# `TypeSafeSDK.Prepared`
[🔗](https://github.com/nshkrdotcom/typesafe_sdk/blob/v0.4.0/lib/typesafe_sdk/prepared.ex#L1)

A validated, immutable semantic question contract.

Preparation caches the exact wire fragment, retains finite caller-key metadata,
and computes a versioned semantic fingerprint. Composition functions rebuild
the value through the normal validation path, so ordering and request-relative
invariants are never bypassed.

# `caller_key`

```elixir
@type caller_key() :: atom() | String.t()
```

# `t`

```elixir
@type t() :: %TypeSafeSDK.Prepared{
  count: pos_integer(),
  definitions: map(),
  encoded: struct(),
  fingerprint: String.t(),
  json: binary(),
  keys: %{required(String.t()) =&gt; caller_key()},
  ordered_keys: [caller_key()],
  questions: [{caller_key(), term()}]
}
```

# `delete`

```elixir
@spec delete(t(), caller_key()) :: {:ok, t()} | {:error, TypeSafeSDK.Error.t()}
```

Delete one key and revalidate the resulting Prepared value.

# `fingerprint`

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

Return the versioned deterministic semantic-contract fingerprint.

# `keys`

```elixir
@spec keys(t()) :: [caller_key()]
```

Return caller keys in execution/wire order.

# `merge`

```elixir
@spec merge(t(), t()) :: {:ok, t()} | {:error, TypeSafeSDK.Error.t()}
```

Right-biased merge preserving duplicate positions from the left.

# `new`

```elixir
@spec new(t() | map() | list()) :: {:ok, t()} | {:error, TypeSafeSDK.Error.t()}
```

# `new!`

```elixir
@spec new!(t() | map() | list()) :: t()
```

# `put`

```elixir
@spec put(t(), caller_key(), term()) :: {:ok, t()} | {:error, TypeSafeSDK.Error.t()}
```

Replace a question without moving it, or append a new key.

# `take`

```elixir
@spec take(t(), Enumerable.t()) :: {:ok, t()} | {:error, TypeSafeSDK.Error.t()}
```

Take selected keys while preserving their source execution order.

---

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