Class MassiveEnumValues
- Namespace
- MassiveDotNet
- Assembly
- MassiveDotNet.dll
Converts SDK enums to the literal strings the Massive platform API expects on the wire.
public static class MassiveEnumValues
- Inheritance
-
MassiveEnumValues
- Inherited Members
Remarks
These are plain switch expressions rather than reflection-driven conversion so that the SDK stays fully Native AOT compatible.
Methods
ToWireValue(AggregateTimespan)
Returns the wire representation of an AggregateTimespan.
public static string ToWireValue(this AggregateTimespan value)
Parameters
valueAggregateTimespanThe value to convert.
Returns
- string
The literal accepted by the API, for example
"minute".
Exceptions
- ArgumentOutOfRangeException
The value is not a defined enum member.
ToWireValue(ContractType)
Returns the wire representation of a ContractType.
public static string ToWireValue(this ContractType value)
Parameters
valueContractTypeThe value to convert.
Returns
- string
Either
"call"or"put", the query value the contracts route takes.
Exceptions
- ArgumentOutOfRangeException
The value is not a defined enum member.
ToWireValue(MarketType)
Returns the wire representation of a MarketType.
public static string ToWireValue(this MarketType value)
Parameters
valueMarketTypeThe value to convert.
Returns
- string
The literal accepted by the API, for example
"stocks".
Exceptions
- ArgumentOutOfRangeException
The value is not a defined enum member.
ToWireValue(SeriesType)
Returns the wire representation of a SeriesType.
public static string ToWireValue(this SeriesType value)
Parameters
valueSeriesTypeThe value to convert.
Returns
- string
The literal accepted by the API, for example
"close".
Exceptions
- ArgumentOutOfRangeException
The value is not a defined enum member.
ToWireValue(SnapshotDirection)
Returns the wire representation of a SnapshotDirection.
public static string ToWireValue(this SnapshotDirection value)
Parameters
valueSnapshotDirectionThe value to convert.
Returns
- string
Either
"gainers"or"losers", the path segment the snapshot route takes.
Exceptions
- ArgumentOutOfRangeException
The value is not a defined enum member.
ToWireValue(SortOrder)
Returns the wire representation of a SortOrder.
public static string ToWireValue(this SortOrder value)
Parameters
valueSortOrderThe value to convert.
Returns
- string
Either
"asc"or"desc".
Exceptions
- ArgumentOutOfRangeException
The value is not a defined enum member.
ToWireValue(Instant)
Returns the wire representation of an instant, as Unix milliseconds.
public static string ToWireValue(this Instant value)
Parameters
valueInstantThe instant to convert.
Returns
- string
Milliseconds since the Unix epoch.
ToWireValue(LocalDate)
Returns the wire representation of a calendar date.
public static string ToWireValue(this LocalDate value)
Parameters
valueLocalDateThe date to convert.
Returns
- string
The date in ISO
YYYY-MM-DDform.
ToWireValueNanoseconds(Instant)
Returns the wire representation of an instant, as Unix nanoseconds.
public static string ToWireValueNanoseconds(this Instant value)
Parameters
valueInstantThe instant to convert.
Returns
- string
Nanoseconds since the Unix epoch, used by the tick-level endpoints.