Table of Contents

Struct EventCategory

Namespace
DatabentoDotNet.Reference
Assembly
DatabentoDotNet.Reference.dll

The category a corporate-action event falls into.

[JsonConverter(typeof(ReferenceCodeJsonConverter<EventCategory>))]
public readonly record struct EventCategory : IReferenceCode<EventCategory>, IEquatable<EventCategory>
Implements
Inherited Members

Remarks

An open set: a code this library does not know is carried, not lost. Upstream ends this enum in an Unknown(String) variant (enums.rs:2221) so a code Databento adds next month round-trips untouched, and a C# enum cannot hold a payload. See IReferenceCode<TSelf> for the shape this takes instead and why.

corporate_actions.list_enums has no group for this type, so corporate_actions.list_events is its only authority — and the two agree exactly, upstream included.

Other is a value the server sends and is not the same thing as an unrecognised code. A code the server adds later is carried intact and reports IsKnown false; other is known and means other.

Constructors

EventCategory(string)

Wraps a wire code, known or not. Prefer a named member such as Distribution where one exists, and From(string?) where the value came from the server.

public EventCategory(string code)

Parameters

code string

The wire code.

Exceptions

ArgumentException

code is null or empty. A blank code is the absence of a value, which is default.

Properties

Code

The wire code, or null when this names no value.

public string? Code { get; }

Property Value

string

Distribution

distribution (distribution).

public static EventCategory Distribution { get; }

Property Value

EventCategory

DistributionDebit

distribution_debit (distribution_debit).

public static EventCategory DistributionDebit { get; }

Property Value

EventCategory

HasValue

true when this names a code — known or not.

public bool HasValue { get; }

Property Value

bool

IsKnown

true when Code is one of KnownCodes.

public bool IsKnown { get; }

Property Value

bool

Remarks

false is not an error. It means the server sent something newer than the table this library shipped with, and the code is still in Code to be read, logged, or sent back in a filter.

KnownCodes

Every code the reference API reported for this type when the fixture was captured — 8 of them.

public static IReadOnlySet<string> KnownCodes { get; }

Property Value

IReadOnlySet<string>

LegalAction

legal_action (legal_action).

public static EventCategory LegalAction { get; }

Property Value

EventCategory

Other

other (other).

public static EventCategory Other { get; }

Property Value

EventCategory

Proposals

proposals (proposals).

public static EventCategory Proposals { get; }

Property Value

EventCategory

Reorganisation

reorganisation (reorganisation).

public static EventCategory Reorganisation { get; }

Property Value

EventCategory

StaticReference

static_reference (static_reference).

public static EventCategory StaticReference { get; }

Property Value

EventCategory

TaxRelated

tax_related (tax_related).

public static EventCategory TaxRelated { get; }

Property Value

EventCategory

Methods

From(string?)

Reads a wire code, mapping null and the empty string to default — the absence of a value.

public static EventCategory From(string? code)

Parameters

code string

The wire code, or null.

Returns

EventCategory

The value.

ToString()

The wire code, or the empty string when this names no value.

public override string ToString()

Returns

string

The wire code.