Table of Contents

Class BatchWireStrings

Namespace
DatabentoDotNet.Historical
Assembly
DatabentoDotNet.Historical.dll

Wire-string conversions for the three enums the batch.* endpoints carry.

public static class BatchWireStrings
Inheritance
BatchWireStrings
Inherited Members

Remarks

Shaped like MetadataWireStrings and holding to the same contract, which is WireStrings': ToWireString throws ArgumentOutOfRangeException for a value outside the defined set, and every TryParse answers false without throwing. One method per enum rather than an overload set, so the ordinary out var call form stays unambiguous.

Upstream establishes each spelling by hand in an as_str / FromStr pair with no serde attribute anywhere — batch.rs:632-680 for SplitDuration, :683-720 for Delivery, :722-760 for JobState — so these tables are the only written record of them in this codebase.

TryParseJobState(string?, out JobState) knows three spellings upstream's FromStr does not. See JobState for what the API answered when #39 asked, and for why the missing ones are a defect rather than a difference of taste.

Methods

ToWireString(Delivery)

Returns the wire string for value.

public static string ToWireString(this Delivery value)

Parameters

value Delivery

Returns

string

Exceptions

ArgumentOutOfRangeException

value is not a defined Delivery.

ToWireString(JobState)

Returns the wire string for value.

public static string ToWireString(this JobState value)

Parameters

value JobState

Returns

string

Exceptions

ArgumentOutOfRangeException

value is not a defined JobState.

ToWireString(SplitDuration)

Returns the wire string for value.

public static string ToWireString(this SplitDuration value)

Parameters

value SplitDuration

Returns

string

Remarks

None renders as none, which is what a request carries. A response spells the same thing as JSON null; see TryParseSplitDuration(string?, out SplitDuration).

Exceptions

ArgumentOutOfRangeException

value is not a defined SplitDuration.

TryParseDelivery(string?, out Delivery)

Parses a Delivery wire string.

public static bool TryParseDelivery(string? value, out Delivery result)

Parameters

value string
result Delivery

Returns

bool

true if value named a defined mechanism.

TryParseJobState(string?, out JobState)

Parses a JobState wire string.

public static bool TryParseJobState(string? value, out JobState result)

Parameters

value string
result JobState

Returns

bool

true if value named a defined state.

TryParseSplitDuration(string?, out SplitDuration)

Parses a SplitDuration wire string.

public static bool TryParseSplitDuration(string? value, out SplitDuration result)

Parameters

value string
result SplitDuration

Returns

bool

true if value named a defined duration.

Remarks

A null value is not handled here, and that is deliberate: this method answers false for it like any other unrecognised spelling. The API's null-means-None rule belongs to the JSON layer, where a JSON null token is distinguishable from the four-character string "null" — see Json.SplitDurationJsonConverter. Folding it in here would make TryParseSplitDuration("null", out _) succeed, which no wire value ever should.