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
codestringThe wire code.
Exceptions
- ArgumentException
codeis 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
Distribution
distribution (distribution).
public static EventCategory Distribution { get; }
Property Value
DistributionDebit
distribution_debit (distribution_debit).
public static EventCategory DistributionDebit { get; }
Property Value
HasValue
true when this names a code — known or not.
public bool HasValue { get; }
Property Value
IsKnown
true when Code is one of KnownCodes.
public bool IsKnown { get; }
Property Value
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
LegalAction
legal_action (legal_action).
public static EventCategory LegalAction { get; }
Property Value
Other
other (other).
public static EventCategory Other { get; }
Property Value
Proposals
proposals (proposals).
public static EventCategory Proposals { get; }
Property Value
Reorganisation
reorganisation (reorganisation).
public static EventCategory Reorganisation { get; }
Property Value
StaticReference
static_reference (static_reference).
public static EventCategory StaticReference { get; }
Property Value
TaxRelated
tax_related (tax_related).
public static EventCategory TaxRelated { get; }
Property Value
Methods
From(string?)
public static EventCategory From(string? code)
Parameters
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.