# `OCSF.Status`
[🔗](https://github.com/docjerem/ocsf/blob/v0.1.0/lib/ocsf/status.ex#L1)

OCSF event status.

Maps event outcome status names to their OCSF 1.8 numeric identifiers.
Used by event builders to resolve the `:status` keyword into the
`status_id` field.

See the OCSF
[status_id](https://schema.ocsf.io/1.8.0/data_types/integer?caption=status_id)
definition.

## Values

| Name       | ID |
|------------|----|
| `:Unknown` | 0  |
| `:Success` | 1  |
| `:Failure` | 2  |
| `:Other`   | 99 |

See `OCSF.StatusDetail` for well-known `status_detail` string constants
and `OCSF.Severity` for severity levels.

# `ecto_values`

```elixir
@spec ecto_values() :: keyword()
```

Return values formatted for `Ecto.Enum`.

## Examples

    iex> OCSF.Status.ecto_values()
    [Unknown: 0, Success: 1, Failure: 2, Other: 99]

# `name`

```elixir
@spec name(integer()) :: atom() | nil
```

Return the name atom for the given numeric identifier.

## Examples

    iex> OCSF.Status.name(1)
    :Success

    iex> OCSF.Status.name(42)
    nil

# `uid`

```elixir
@spec uid(atom()) :: integer() | nil
```

Return the numeric identifier for the given name atom.

## Examples

    iex> OCSF.Status.uid(:Success)
    1

    iex> OCSF.Status.uid(:NonExistent)
    nil

# `valid?`

```elixir
@spec valid?(atom() | integer()) :: boolean()
```

Return true if the given name or identifier is valid.

## Examples

    iex> OCSF.Status.valid?(:Success)
    true

    iex> OCSF.Status.valid?(1)
    true

    iex> OCSF.Status.valid?(:NonExistent)
    false

# `values`

```elixir
@spec values() :: [{atom(), integer()}]
```

Return all values as a keyword list.

## Examples

    iex> OCSF.Status.values()
    [Unknown: 0, Success: 1, Failure: 2, Other: 99]

---

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