Struct Frequency
- Namespace
- DatabentoDotNet.Reference
- Assembly
- DatabentoDotNet.Reference.dll
How often a distribution recurs.
[JsonConverter(typeof(ReferenceCodeJsonConverter<Frequency>))]
public readonly record struct Frequency : IReferenceCode<Frequency>, IEquatable<Frequency>
- 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:2799) 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.
The members come from the FREQ group of the vendored corporate_actions.list_enums response, which is the oracle rather than a count typed into an issue.
The one type here whose members are named after their descriptions rather than their codes, because upstream names them that way. Upstream falls back to the code where the description is more than one word, which is why Intonmat and Itm — which share the description "Interest on Maturity" — keep their codes. BiWeekly and Fortnightly are the two the live dictionary has and upstream does not; both names fall out of that same rule.
Constructors
Frequency(string)
Wraps a wire code, known or not. Prefer a named member such as Annual where one exists, and From(string?) where the value came from the server.
public Frequency(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
Annual
Annual (ANL).
public static Frequency Annual { get; }
Property Value
BiMonthly
BiMonthly (BIM).
public static Frequency BiMonthly { get; }
Property Value
BiWeekly
BiWeekly (BIW).
public static Frequency BiWeekly { get; }
Property Value
Code
The wire code, or null when this names no value.
public string? Code { get; }
Property Value
Daily
Daily (DLY).
public static Frequency Daily { get; }
Property Value
Final
Final (FNL).
public static Frequency Final { get; }
Property Value
Fortnightly
Fortnightly (FRT).
public static Frequency Fortnightly { get; }
Property Value
HasValue
true when this names a code — known or not.
public bool HasValue { get; }
Property Value
Interim
Interim (INT).
public static Frequency Interim { get; }
Property Value
Intonmat
Interest on Maturity (INTONMAT).
public static Frequency Intonmat { get; }
Property Value
Irregular
Irregular (IRG).
public static Frequency Irregular { 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.
Itm
Interest on Maturity (ITM).
public static Frequency Itm { get; }
Property Value
KnownCodes
Every code the reference API reported for this type when the fixture was captured — 16 of them.
public static IReadOnlySet<string> KnownCodes { get; }
Property Value
Monthly
Monthly (MNT).
public static Frequency Monthly { get; }
Property Value
Quarterly
Quarterly (QTR).
public static Frequency Quarterly { get; }
Property Value
SemiAnnual
Semi-Annual (SMA).
public static Frequency SemiAnnual { get; }
Property Value
Trimesterly
Trimesterly (TRM).
public static Frequency Trimesterly { get; }
Property Value
Unspecified
Unspecified (UN).
public static Frequency Unspecified { get; }
Property Value
Weekly
Weekly (WKL).
public static Frequency Weekly { get; }
Property Value
Methods
From(string?)
public static Frequency From(string? code)
Parameters
Returns
- Frequency
The value.
ToString()
The wire code, or the empty string when this names no value.
public override string ToString()
Returns
- string
The wire code.