OCSF.Category (OCSF v0.1.0)

Copy Markdown View Source

OCSF event categories (top-level grouping).

Maps category names to their OCSF 1.8 numeric identifiers. Categories are the broadest classification of events and group related event classes together.

See the OCSF category_uid definition.

Values

NameID
:"Identity & Access Management"3
:"Application Activity"6

See OCSF.Class for the event classes within each category.

Summary

Functions

Return values formatted for Ecto.Enum.

Return the name atom for the given numeric identifier.

Return the numeric identifier for the given name atom.

Return true if the given name or identifier is valid.

Return all values as a keyword list.

Functions

ecto_values()

@spec ecto_values() :: keyword()

Return values formatted for Ecto.Enum.

Examples

iex> OCSF.Category.ecto_values()
[{:"Identity & Access Management", 3}, {:"Application Activity", 6}]

name(uid)

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

Return the name atom for the given numeric identifier.

Examples

iex> OCSF.Category.name(3)
:"Identity & Access Management"

iex> OCSF.Category.name(42)
nil

uid(name)

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

Return the numeric identifier for the given name atom.

Examples

iex> OCSF.Category.uid(:"Identity & Access Management")
3

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

valid?(name)

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

Return true if the given name or identifier is valid.

Examples

iex> OCSF.Category.valid?(:"Identity & Access Management")
true

iex> OCSF.Category.valid?(3)
true

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

values()

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

Return all values as a keyword list.

Examples

iex> OCSF.Category.values()
[{:"Identity & Access Management", 3}, {:"Application Activity", 6}]