StellaOps.Workflow.Contracts.Durability
Durable execution contracts of the workflow engine: the durable start and activity contracts, RFC 8785 canonical JSON with its SHA-256 digest, a strict JSON reader, bounded scalar types and a frozen JSON schema set. Install Installing Stella Ops packagesWorkflow downloads and signaturesnet10.01.0.1-20261118T121708Zdotnet add package StellaOps.
Namespaces
namespace StellaOps.Workflow.Contracts.Durability.Activities
| Type | Kind | Description |
|---|---|---|
WorkflowActivityCancelActiveAttemptV1 | record | The attempt a cancel stops. |
WorkflowActivityCancelContinuationLineageV1 | record | The continuation a cancel revokes. |
WorkflowActivityCancelV1 | record | Sent on the cancel lane when an operator or a deadline stops a step whose attempt may still run. |
WorkflowActivityCompletionContinuationV1 | record | A continuation the handler reports, for the next attempt to resume. |
WorkflowActivityCompletionV1 | record | The handler’s answer on the completion lane, bound to the exact request it answers. |
WorkflowActivityFailureV1 | record | Why an activity attempt failed. |
WorkflowActivityOutcome | enum | The outcome of an activity attempt. |
WorkflowActivityRequestContinuationV1 | record | The continuation a retry resumes: the prior attempt’s completion and its continuation. |
WorkflowActivityRequestV1 | record | The request an external activity handler receives on its execute lane: the attempt identity the engine fences on, the registered operation, the deadline and the input payload. |
record WorkflowActivityCancelActiveAttemptV1
public sealed record WorkflowActivityCancelActiveAttemptV1 : IContractValidatable
The attempt a cancel stops.
Members
| Member | Kind | Summary |
|---|---|---|
WorkflowActivityCancelActiveAttemptV1( | constructor | Creates an instance of Workflow. |
AttemptId | property | The attempt. |
DispatchId | property | The dispatch. |
RequestSha256 | property | The SHA-256 of the request. |
Validate( | method | Checks the fields. |
constructor WorkflowActivityCancelActiveAttemptV1() #
WorkflowActivityCancelActiveAttemptV1() #public WorkflowActivityCancelActiveAttemptV1()
Creates an instance of Workflow.
property AttemptId #
AttemptId #public required string AttemptId { get; init; }
The attempt.
property DispatchId #
DispatchId #public required string DispatchId { get; init; }
The dispatch.
property RequestSha256 #
RequestSha256 #public required Sha256Hex RequestSha256 { get; init; }
The SHA-256 of the request.
method Validate() #
Validate() #public void Validate()
Checks the fields.
Exceptions
ContractValidationException: A field breaks its rule.
record WorkflowActivityCancelContinuationLineageV1
public sealed record WorkflowActivityCancelContinuationLineageV1 : IContractValidatable
The continuation a cancel revokes.
Members
| Member | Kind | Summary |
|---|---|---|
WorkflowActivityCancelContinuationLineageV1( | constructor | Creates an instance of Workflow. |
ContinuationRef | property | The provider’s continuation reference. |
ContinuationSha256 | property | The SHA-256 of the continuation. |
Generation | property | The continuation generation. |
LineageId | property | The lineage. |
SourceAttemptId | property | The attempt that left the continuation. |
SourceCompletionEventId | property | The completion that carried it. |
Validate( | method | Checks the fields. |
constructor WorkflowActivityCancelContinuationLineageV1() #
WorkflowActivityCancelContinuationLineageV1() #public WorkflowActivityCancelContinuationLineageV1()
Creates an instance of Workflow.
property ContinuationRef #
ContinuationRef #public required string ContinuationRef { get; init; }
The provider’s continuation reference.
property ContinuationSha256 #
ContinuationSha256 #public required Sha256Hex ContinuationSha256 { get; init; }
The SHA-256 of the continuation.
property Generation #
Generation #public required long Generation { get; init; }
The continuation generation.
property LineageId #
LineageId #public required string LineageId { get; init; }
The lineage.
property SourceAttemptId #
SourceAttemptId #public required string SourceAttemptId { get; init; }
The attempt that left the continuation.
property SourceCompletionEventId #
SourceCompletionEventId #public required string SourceCompletionEventId { get; init; }
The completion that carried it.
method Validate() #
Validate() #public void Validate()
Checks the fields.
Exceptions
ContractValidationException: A field breaks its rule.
record WorkflowActivityCancelV1
public sealed record WorkflowActivityCancelV1 : IContractValidatable
Sent on the cancel lane when an operator or a deadline stops a step whose attempt may still run.
Members
| Member | Kind | Summary |
|---|---|---|
WorkflowActivityCancelV1( | constructor | Creates an instance of Workflow. |
ActiveAttempt | property | The attempt to stop, when one may still run. |
CancelFenceVersion | property | The cancel fence of the request. |
CancelId | property | The cancel request. |
CanceledAt | property | When the step was canceled. |
ContinuationLineage | property | The continuation to revoke, when there is one. |
ContractVersion | property | The contract version: 1. |
DeadlineAt | property | The deadline that stopped the step, for a deadline cancel. |
EventId | property | The event identifier. |
ReasonCode | property | Why. |
ScopeExecutionId | property | The scope. |
StepExecutionId | property | The step execution. |
WorkflowExecutionId | property | The execution (workflow instance). |
Validate( | method | Checks the fields. |
constructor WorkflowActivityCancelV1() #
WorkflowActivityCancelV1() #public WorkflowActivityCancelV1()
Creates an instance of Workflow.
property ActiveAttempt #
ActiveAttempt #public required WorkflowActivityCancelActiveAttemptV1? ActiveAttempt { get; init; }
The attempt to stop, when one may still run.
property CancelFenceVersion #
CancelFenceVersion #public required long CancelFenceVersion { get; init; }
The cancel fence of the request.
property CancelId #
CancelId #public required string CancelId { get; init; }
The cancel request.
property CanceledAt #
CanceledAt #public required Rfc3339MillisecondInstant CanceledAt { get; init; }
When the step was canceled.
property ContinuationLineage #
ContinuationLineage #public required WorkflowActivityCancelContinuationLineageV1? ContinuationLineage { get; init; }
The continuation to revoke, when there is one.
property ContractVersion #
ContractVersion #public required int ContractVersion { get; init; }
The contract version: 1.
property DeadlineAt #
DeadlineAt #public required Rfc3339MillisecondInstant? DeadlineAt { get; init; }
The deadline that stopped the step, for a deadline cancel.
property EventId #
EventId #public required string EventId { get; init; }
The event identifier.
property ReasonCode #
ReasonCode #public required string ReasonCode { get; init; }
Why.
property ScopeExecutionId #
ScopeExecutionId #public required string ScopeExecutionId { get; init; }
The scope.
property StepExecutionId #
StepExecutionId #public required string StepExecutionId { get; init; }
The step execution.
property WorkflowExecutionId #
WorkflowExecutionId #public required string WorkflowExecutionId { get; init; }
The execution (workflow instance).
method Validate() #
Validate() #public void Validate()
Checks the fields.
Exceptions
ContractValidationException: A field breaks its rule.
record WorkflowActivityCompletionContinuationV1
public sealed record WorkflowActivityCompletionContinuationV1 : IContractValidatable
A continuation the handler reports, for the next attempt to resume.
Members
| Member | Kind | Summary |
|---|---|---|
WorkflowActivityCompletionContinuationV1( | constructor | Creates an instance of Workflow. |
ContinuationRef | property | The provider’s continuation reference. |
ContinuationSha256 | property | The SHA-256 of the continuation. |
Generation | property | The continuation generation. |
Validate( | method | Checks the fields. |
constructor WorkflowActivityCompletionContinuationV1() #
WorkflowActivityCompletionContinuationV1() #public WorkflowActivityCompletionContinuationV1()
Creates an instance of Workflow.
property ContinuationRef #
ContinuationRef #public required string ContinuationRef { get; init; }
The provider’s continuation reference.
property ContinuationSha256 #
ContinuationSha256 #public required Sha256Hex ContinuationSha256 { get; init; }
The SHA-256 of the continuation.
property Generation #
Generation #public required long Generation { get; init; }
The continuation generation.
method Validate() #
Validate() #public void Validate()
Checks the fields.
Exceptions
ContractValidationException: A field breaks its rule.
record WorkflowActivityCompletionV1
public sealed record WorkflowActivityCompletionV1 : IContractValidatable
The handler’s answer on the completion lane, bound to the exact request it answers.
Members
| Member | Kind | Summary |
|---|---|---|
WorkflowActivityCompletionV1( | constructor | Creates an instance of Workflow. |
AttemptId | property | The attempt. |
CompletedAt | property | When the attempt completed. |
Continuation | property | A continuation for the next attempt to resume. |
ContractVersion | property | The contract version: 1. |
DispatchId | property | The dispatch. |
EventId | property | The event identifier. |
Failure | property | Why it failed, for a failure. |
OperationCode | property | The operation of the activity. |
Outcome | property | The outcome. |
RequestSha256 | property | The SHA-256 of the request it answers. |
Result | property | The result payload, for a success. |
ScopeExecutionId | property | The scope. |
StepExecutionId | property | The step execution. |
WorkflowExecutionId | property | The execution (workflow instance). |
Validate( | method | Checks the fields. |
ValidateAgainst( | method | Checks that the completion answers the request. |
constructor WorkflowActivityCompletionV1() #
WorkflowActivityCompletionV1() #public WorkflowActivityCompletionV1()
Creates an instance of Workflow.
property AttemptId #
AttemptId #public required string AttemptId { get; init; }
The attempt.
property CompletedAt #
CompletedAt #public required Rfc3339MillisecondInstant CompletedAt { get; init; }
When the attempt completed.
property Continuation #
Continuation #public required WorkflowActivityCompletionContinuationV1? Continuation { get; init; }
A continuation for the next attempt to resume.
property ContractVersion #
ContractVersion #public required int ContractVersion { get; init; }
The contract version: 1.
property DispatchId #
DispatchId #public required string DispatchId { get; init; }
The dispatch.
property EventId #
EventId #public required string EventId { get; init; }
The event identifier.
property Failure #
Failure #public required WorkflowActivityFailureV1? Failure { get; init; }
Why it failed, for a failure.
property OperationCode #
OperationCode #public required string OperationCode { get; init; }
The operation of the activity.
property Outcome #
Outcome #public required WorkflowActivityOutcome Outcome { get; init; }
The outcome.
property RequestSha256 #
RequestSha256 #public required Sha256Hex RequestSha256 { get; init; }
The SHA-256 of the request it answers.
property Result #
Result #public required JsonPayloadDescriptorV1? Result { get; init; }
The result payload, for a success.
property ScopeExecutionId #
ScopeExecutionId #public required string ScopeExecutionId { get; init; }
The scope.
property StepExecutionId #
StepExecutionId #public required string StepExecutionId { get; init; }
The step execution.
property WorkflowExecutionId #
WorkflowExecutionId #public required string WorkflowExecutionId { get; init; }
The execution (workflow instance).
method Validate() #
Validate() #public void Validate()
Checks the fields.
Exceptions
ContractValidationException: A field breaks its rule.
method ValidateAgainst(WorkflowActivityRequestV1) #
ValidateAgainst(WorkflowActivityRequestV1) #public void ValidateAgainst(WorkflowActivityRequestV1 request)
Checks that the completion answers the request.
Parameters
request: The request.
Exceptions
ContractValidationException: It does not answer the request.
record WorkflowActivityFailureV1
public sealed record WorkflowActivityFailureV1 : IContractValidatable
Why an activity attempt failed.
Members
| Member | Kind | Summary |
|---|---|---|
WorkflowActivityFailureV1( | constructor | Creates an instance of Workflow. |
Category | property | The failure category, which the retry policy matches. |
Code | property | The failure code. |
RetryAfter | property | When the provider asks the retry to wait until. |
Validate( | method | Checks the fields. |
constructor WorkflowActivityFailureV1() #
WorkflowActivityFailureV1() #public WorkflowActivityFailureV1()
Creates an instance of Workflow.
property Category #
Category #public required string Category { get; init; }
The failure category, which the retry policy matches.
property Code #
Code #public required string Code { get; init; }
The failure code.
property RetryAfter #
RetryAfter #public required Rfc3339MillisecondInstant? RetryAfter { get; init; }
When the provider asks the retry to wait until.
method Validate() #
Validate() #public void Validate()
Checks the fields.
Exceptions
ContractValidationException: A field breaks its rule.
enum WorkflowActivityOutcome
public enum WorkflowActivityOutcome
The outcome of an activity attempt.
| Value | Description |
|---|---|
SUCCEEDED = 0 | Succeeded. |
RETRYABLE = 1 | Failed; a retry may succeed. |
PERMANENT_ | Failed; a retry would fail too. |
CANCELED = 3 | Canceled. |
DEADLINE_ | Ran past its deadline. |
record WorkflowActivityRequestContinuationV1
public sealed record WorkflowActivityRequestContinuationV1 : IContractValidatable
The continuation a retry resumes: the prior attempt’s completion and its continuation.
Members
| Member | Kind | Summary |
|---|---|---|
WorkflowActivityRequestContinuationV1( | constructor | Creates an instance of Workflow. |
ContinuationRef | property | The provider’s continuation reference. |
ContinuationSha256 | property | The SHA-256 of the continuation. |
Generation | property | The continuation generation. |
PriorAttemptId | property | The prior attempt. |
PriorCompletionEventId | property | The prior completion. |
Validate( | method | Checks the fields. |
constructor WorkflowActivityRequestContinuationV1() #
WorkflowActivityRequestContinuationV1() #public WorkflowActivityRequestContinuationV1()
Creates an instance of Workflow.
property ContinuationRef #
ContinuationRef #public required string ContinuationRef { get; init; }
The provider’s continuation reference.
property ContinuationSha256 #
ContinuationSha256 #public required Sha256Hex ContinuationSha256 { get; init; }
The SHA-256 of the continuation.
property Generation #
Generation #public required long Generation { get; init; }
The continuation generation.
property PriorAttemptId #
PriorAttemptId #public required string PriorAttemptId { get; init; }
The prior attempt.
property PriorCompletionEventId #
PriorCompletionEventId #public required string PriorCompletionEventId { get; init; }
The prior completion.
method Validate() #
Validate() #public void Validate()
Checks the fields.
Exceptions
ContractValidationException: A field breaks its rule.
record WorkflowActivityRequestV1
public sealed record WorkflowActivityRequestV1 : IContractValidatable
The request an external activity handler receives on its execute lane: the attempt identity the engine fences on, the registered operation, the deadline and the input payload. A retry that resumes a pending external operation carries the continuation the prior attempt reported.
Members
| Member | Kind | Summary |
|---|---|---|
WorkflowActivityRequestV1( | constructor | Creates an instance of Workflow. |
AttemptId | property | The attempt. |
Continuation | property | The continuation a retry resumes, when it resumes one. |
ContractVersion | property | The contract version: 1. |
DeadlineAt | property | The deadline of the attempt. |
DispatchId | property | The dispatch. |
Input | property | The input payload. |
OperationCode | property | The operation of the activity. |
OperationVersion | property | The operation version. |
ScopeExecutionId | property | The scope. |
StepExecutionId | property | The step execution. |
WorkflowExecutionId | property | The execution (workflow instance). |
ComputeSha256( | method | The SHA-256 of the request’s canonical JSON. |
Validate( | method | Checks the fields. |
ValidateContinuationOf( | method | Checks that the request resumes the continuation of a prior completion. |
constructor WorkflowActivityRequestV1() #
WorkflowActivityRequestV1() #public WorkflowActivityRequestV1()
Creates an instance of Workflow.
property AttemptId #
AttemptId #public required string AttemptId { get; init; }
The attempt.
property Continuation #
Continuation #public required WorkflowActivityRequestContinuationV1? Continuation { get; init; }
The continuation a retry resumes, when it resumes one.
property ContractVersion #
ContractVersion #public required int ContractVersion { get; init; }
The contract version: 1.
property DeadlineAt #
DeadlineAt #public required Rfc3339MillisecondInstant DeadlineAt { get; init; }
The deadline of the attempt.
property DispatchId #
DispatchId #public required string DispatchId { get; init; }
The dispatch.
property Input #
Input #public required JsonPayloadDescriptorV1 Input { get; init; }
The input payload.
property OperationCode #
OperationCode #public required string OperationCode { get; init; }
The operation of the activity.
property OperationVersion #
OperationVersion #public required string OperationVersion { get; init; }
The operation version.
property ScopeExecutionId #
ScopeExecutionId #public required string ScopeExecutionId { get; init; }
The scope.
property StepExecutionId #
StepExecutionId #public required string StepExecutionId { get; init; }
The step execution.
property WorkflowExecutionId #
WorkflowExecutionId #public required string WorkflowExecutionId { get; init; }
The execution (workflow instance).
method ComputeSha256() #
ComputeSha256() #public Sha256Hex ComputeSha256()
The SHA-256 of the request’s canonical JSON.
Returns
The SHA-256.
method Validate() #
Validate() #public void Validate()
Checks the fields.
Exceptions
ContractValidationException: A field breaks its rule.
method ValidateContinuationOf(WorkflowActivityCompletionV1) #
ValidateContinuationOf(WorkflowActivityCompletionV1) #public void ValidateContinuationOf(WorkflowActivityCompletionV1 priorCompletion)
Checks that the request resumes the continuation of a prior completion.
Parameters
priorCompletion: The prior completion.
Exceptions
ContractValidationException: It does not.
namespace StellaOps.Workflow.Contracts.Durability.CanonicalJson
| Type | Kind | Description |
|---|---|---|
CanonicalJsonErrorCodes | class | The error codes of the strict JSON reader and the canonicalizer. |
CanonicalJsonException | class | Raised when JSON breaks the strict reading or canonicalization rules; its message carries only the code, the pointer and the limit. |
CanonicalJsonResult | class | Canonical JSON bytes with their root kind and SHA-256. |
StrictJsonReadResult | record | What the strict reader saw. |
StrictJsonReader | class | Reads JSON strictly: UTF-8 without a byte order mark, no duplicate property, strings that decode as Unicode, I-JSON numbers and the reader limits. |
StrictJsonReaderOptions | record | Limits of the strict JSON reader that reads canonical durable JSON; every limit must be positive. |
WorkflowJcsV1 | class | The Workflow JSON canonicalization: strict reading, then RFC 8785 (JCS). |
class CanonicalJsonErrorCodes
public static class CanonicalJsonErrorCodes
The error codes of the strict JSON reader and the canonicalizer.
Members
| Member | Kind | Summary |
|---|---|---|
BomNotAllowed | constant | The JSON starts with a byte order mark. |
CanonicalizationFailed | constant | The canonicalization failed. |
DuplicateProperty | constant | An object has the same property twice. |
InvalidUnicode | constant | A string does not decode as Unicode, such as one with an unpaired surrogate. |
InvalidUtf8 | constant | The bytes are not valid UTF-8. |
LimitExceeded | constant | A reader limit is exceeded. |
NumberNotIJson | constant | A number is outside the I-JSON range (RFC 7493). |
PayloadHashMismatch | constant | The canonical SHA-256 differs from the expected one. |
PayloadLengthMismatch | constant | The canonical length differs from the expected one. |
SyntaxInvalid | constant | The JSON syntax is not valid. |
constant BomNotAllowed #
BomNotAllowed #public const string BomNotAllowed = "JSON_BOM_NOT_ALLOWED"
The JSON starts with a byte order mark.
constant CanonicalizationFailed #
CanonicalizationFailed #public const string CanonicalizationFailed = "JSON_CANONICALIZATION_FAILED"
The canonicalization failed.
constant DuplicateProperty #
DuplicateProperty #public const string DuplicateProperty = "JSON_DUPLICATE_PROPERTY"
An object has the same property twice.
constant InvalidUnicode #
InvalidUnicode #public const string InvalidUnicode = "JSON_INVALID_UNICODE"
A string does not decode as Unicode, such as one with an unpaired surrogate.
constant InvalidUtf8 #
InvalidUtf8 #public const string InvalidUtf8 = "JSON_INVALID_UTF8"
The bytes are not valid UTF-8.
constant LimitExceeded #
LimitExceeded #public const string LimitExceeded = "JSON_LIMIT_EXCEEDED"
A reader limit is exceeded.
constant NumberNotIJson #
NumberNotIJson #public const string NumberNotIJson = "JSON_NUMBER_NOT_IJSON"
A number is outside the I-JSON range (RFC 7493).
constant PayloadHashMismatch #
PayloadHashMismatch #public const string PayloadHashMismatch = "PAYLOAD_HASH_MISMATCH"
The canonical SHA-256 differs from the expected one.
constant PayloadLengthMismatch #
PayloadLengthMismatch #public const string PayloadLengthMismatch = "PAYLOAD_LENGTH_MISMATCH"
The canonical length differs from the expected one.
constant SyntaxInvalid #
SyntaxInvalid #public const string SyntaxInvalid = "JSON_SYNTAX_INVALID"
The JSON syntax is not valid.
class CanonicalJsonException
public sealed class CanonicalJsonException : Exception
Raised when JSON breaks the strict reading or canonicalization rules; its message carries only the code, the pointer and the limit.
Members
| Member | Kind | Summary |
|---|---|---|
CanonicalJsonException( | constructor | Creates the exception. |
Code | property | The error code. |
JsonPointer | property | The JSON pointer of the value. |
LimitName | property | The limit exceeded, when one was. |
constructor CanonicalJsonException(string, string, string, Exception) #
CanonicalJsonException(string, string, string, Exception) #public CanonicalJsonException(string code, string jsonPointer, string? limitName = null, Exception? innerException = null)
Creates the exception.
Parameters
code: The error code; seeCanonicalJsonErrorCodes.jsonPointer: The JSON pointer of the value.limitName: The limit exceeded, when one was.innerException: The cause.
property Code #
Code #public string Code { get; }
The error code.
property JsonPointer #
JsonPointer #public string JsonPointer { get; }
The JSON pointer of the value.
property LimitName #
LimitName #public string? LimitName { get; }
The limit exceeded, when one was.
class CanonicalJsonResult
public sealed class CanonicalJsonResult
Canonical JSON bytes with their root kind and SHA-256.
Members
| Member | Kind | Summary |
|---|---|---|
ByteLength | property | The byte length. |
Bytes | property | The canonical UTF-8 bytes. |
RootKind | property | The kind of the root value. |
Sha256 | property | The SHA-256 of the bytes. |
GetUtf8String( | method | Returns the canonical JSON as text. |
Verify( | method | Checks the length and the SHA-256 against expected values. |
property ByteLength #
ByteLength #public int ByteLength { get; }
The byte length.
property Bytes #
Bytes #public ReadOnlyMemory<byte> Bytes { get; }
The canonical UTF-8 bytes.
property RootKind #
RootKind #public JsonValueKind RootKind { get; }
The kind of the root value.
property Sha256 #
Sha256 #public Sha256Hex Sha256 { get; }
The SHA-256 of the bytes.
method GetUtf8String() #
GetUtf8String() #public string GetUtf8String()
Returns the canonical JSON as text.
Returns
The text.
method Verify(int, Sha256Hex) #
Verify(int, Sha256Hex) #public void Verify(int expectedByteLength, Sha256Hex expectedSha256)
Checks the length and the SHA-256 against expected values.
Parameters
expectedByteLength: The expected length.expectedSha256: The expected SHA-256.
Exceptions
CanonicalJsonException: The length or the hash differs.
record StrictJsonReadResult
public sealed record StrictJsonReadResult
What the strict reader saw.
Parameters
RootKind: The kind of the root value.ObjectPropertyCount: The properties of all objects.ArrayElementCount: The elements of all arrays.MaximumDepth: The deepest nesting.
Members
| Member | Kind | Summary |
|---|---|---|
StrictJsonReadResult( | constructor | What the strict reader saw. |
ArrayElementCount | property | The elements of all arrays. |
MaximumDepth | property | The deepest nesting. |
ObjectPropertyCount | property | The properties of all objects. |
RootKind | property | The kind of the root value. |
constructor StrictJsonReadResult(JsonValueKind, int, int, int) #
StrictJsonReadResult(JsonValueKind, int, int, int) #public StrictJsonReadResult(JsonValueKind RootKind, int ObjectPropertyCount, int ArrayElementCount, int MaximumDepth)
What the strict reader saw.
Parameters
RootKind: The kind of the root value.ObjectPropertyCount: The properties of all objects.ArrayElementCount: The elements of all arrays.MaximumDepth: The deepest nesting.
property ArrayElementCount #
ArrayElementCount #public int ArrayElementCount { get; init; }
The elements of all arrays.
property MaximumDepth #
MaximumDepth #public int MaximumDepth { get; init; }
The deepest nesting.
property ObjectPropertyCount #
ObjectPropertyCount #public int ObjectPropertyCount { get; init; }
The properties of all objects.
property RootKind #
RootKind #public JsonValueKind RootKind { get; init; }
The kind of the root value.
class StrictJsonReader
public static class StrictJsonReader
Reads JSON strictly: UTF-8 without a byte order mark, no duplicate property, strings that decode as Unicode, I-JSON numbers and the reader limits.
Members
| Member | Kind | Summary |
|---|---|---|
Validate( | method | Checks JSON against the strict rules. |
method Validate(ReadOnlySpan<byte>, StrictJsonReaderOptions) #
Validate(ReadOnlySpan<byte>, StrictJsonReaderOptions) #public static StrictJsonReadResult Validate(ReadOnlySpan<byte> utf8Json, StrictJsonReaderOptions? options = null)
Checks JSON against the strict rules.
Parameters
utf8Json: The UTF-8 JSON.options: The reader limits; the defaults when not set.
Returns
What the reader saw.
Exceptions
CanonicalJsonException: The JSON breaks a rule.
record StrictJsonReaderOptions
public sealed record StrictJsonReaderOptions
Limits of the strict JSON reader that reads canonical durable JSON; every limit must be positive.
Members
| Member | Kind | Summary |
|---|---|---|
StrictJsonReaderOptions( | constructor | Creates an instance of Strict. |
DefaultArtifactBytes | constant | The default input limit for an artifact: 16 MiB. |
DefaultInlineBytes | constant | The input limit for an inline value: 256 KiB. |
MaxArrayElements | property | The most elements in one array. |
MaxDepth | property | The deepest nesting of objects and arrays. |
MaxInputBytes | property | The largest input, in bytes. |
MaxObjectProperties | property | The most properties in one object. |
MaxStringUtf8Bytes | property | The longest string, in UTF-8 bytes. |
constructor StrictJsonReaderOptions() #
StrictJsonReaderOptions() #public StrictJsonReaderOptions()
Creates an instance of Strict.
constant DefaultArtifactBytes #
DefaultArtifactBytes #public const int DefaultArtifactBytes = 16777216
The default input limit for an artifact: 16 MiB.
constant DefaultInlineBytes #
DefaultInlineBytes #public const int DefaultInlineBytes = 262144
The input limit for an inline value: 256 KiB.
property MaxArrayElements #
MaxArrayElements #public int MaxArrayElements { get; init; }
The most elements in one array. The default is 250000.
property MaxDepth #
MaxDepth #public int MaxDepth { get; init; }
The deepest nesting of objects and arrays. The default is 64.
property MaxInputBytes #
MaxInputBytes #public int MaxInputBytes { get; init; }
The largest input, in bytes. The default is StrictJsonReaderOptions..
property MaxObjectProperties #
MaxObjectProperties #public int MaxObjectProperties { get; init; }
The most properties in one object. The default is 100000.
property MaxStringUtf8Bytes #
MaxStringUtf8Bytes #public int MaxStringUtf8Bytes { get; init; }
The longest string, in UTF-8 bytes. The default is 1 MiB.
class WorkflowJcsV1
public static class WorkflowJcsV1
The Workflow JSON canonicalization: strict reading, then RFC 8785 (JCS).
Members
| Member | Kind | Summary |
|---|---|---|
Name | constant | The name of the canonicalization. |
Canonicalize( | method | Reads JSON strictly and canonicalizes it. |
constant Name #
Name #public const string Name = "STELLAOPS-JCS-1"
The name of the canonicalization.
method Canonicalize(ReadOnlySpan<byte>, StrictJsonReaderOptions) #
Canonicalize(ReadOnlySpan<byte>, StrictJsonReaderOptions) #public static CanonicalJsonResult Canonicalize(ReadOnlySpan<byte> utf8Json, StrictJsonReaderOptions? options = null)
Reads JSON strictly and canonicalizes it.
Parameters
utf8Json: The UTF-8 JSON.options: The reader limits; the defaults when not set.
Returns
The canonical bytes and their SHA-256.
Exceptions
CanonicalJsonException: The JSON breaks a rule.
namespace StellaOps.Workflow.Contracts.Durability.Execution
| Type | Kind | Description |
|---|---|---|
StartWorkflowDisposition | enum | The decision on a durable start request. |
StartWorkflowExecutionResultV1 | record | The decision on a durable start request. |
StartWorkflowExecutionV1 | record | A durable start request: the execution to create, its definition, business reference, caller idempotency, association and input. |
WorkflowPrestartTerminalAckV1 | record | The acknowledgement of a prestart terminal command. |
WorkflowPrestartTerminalCommandV1 | record | A terminal command, such as a cancel, for a start that may not have arrived yet; it fences the start. |
enum StartWorkflowDisposition
public enum StartWorkflowDisposition
The decision on a durable start request.
record StartWorkflowExecutionResultV1
public sealed record StartWorkflowExecutionResultV1 : IContractValidatable
The decision on a durable start request.
Members
| Member | Kind | Summary |
|---|---|---|
StartWorkflowExecutionResultV1( | constructor | Creates an instance of Start. |
AssociationGeneration | property | The generation of the association. |
AssociationId | property | The association. |
AssociationSha256 | property | The SHA-256 of the association. |
ContractVersion | property | The contract version: 1. |
DecidedAt | property | When the decision was taken. |
Disposition | property | The decision. |
EventId | property | The event identifier. |
ExecutionVersion | property | The execution version the start created. |
FirstEventSequence | property | The sequence of the first history event. |
RootScopeExecutionId | property | The root scope. |
SafeCode | property | The safe refusal code, when refused. |
StartRequestId | property | The start request. |
StartRequestSha256 | property | The SHA-256 of the start request. |
WorkflowExecutionId | property | The execution (workflow instance). |
Validate( | method | Checks the fields. |
ValidateAgainst( | method | Checks that the result answers the request: the same start request, execution and association. |
constructor StartWorkflowExecutionResultV1() #
StartWorkflowExecutionResultV1() #public StartWorkflowExecutionResultV1()
Creates an instance of Start.
property AssociationGeneration #
AssociationGeneration #public required long AssociationGeneration { get; init; }
The generation of the association.
property AssociationId #
AssociationId #public required string AssociationId { get; init; }
The association.
property AssociationSha256 #
AssociationSha256 #public required Sha256Hex AssociationSha256 { get; init; }
The SHA-256 of the association.
property ContractVersion #
ContractVersion #public required int ContractVersion { get; init; }
The contract version: 1.
property DecidedAt #
DecidedAt #public required Rfc3339MillisecondInstant DecidedAt { get; init; }
When the decision was taken.
property Disposition #
Disposition #public required StartWorkflowDisposition Disposition { get; init; }
The decision.
property EventId #
EventId #public required string EventId { get; init; }
The event identifier.
property ExecutionVersion #
ExecutionVersion #public required long? ExecutionVersion { get; init; }
The execution version the start created.
property FirstEventSequence #
FirstEventSequence #public required long? FirstEventSequence { get; init; }
The sequence of the first history event.
property RootScopeExecutionId #
RootScopeExecutionId #public required string RootScopeExecutionId { get; init; }
The root scope.
property SafeCode #
SafeCode #public required string? SafeCode { get; init; }
The safe refusal code, when refused.
property StartRequestId #
StartRequestId #public required string StartRequestId { get; init; }
The start request.
property StartRequestSha256 #
StartRequestSha256 #public required Sha256Hex StartRequestSha256 { get; init; }
The SHA-256 of the start request.
property WorkflowExecutionId #
WorkflowExecutionId #public required string WorkflowExecutionId { get; init; }
The execution (workflow instance).
method Validate() #
Validate() #public void Validate()
Checks the fields.
Exceptions
ContractValidationException: A field breaks its rule.
method ValidateAgainst(StartWorkflowExecutionV1) #
ValidateAgainst(StartWorkflowExecutionV1) #public void ValidateAgainst(StartWorkflowExecutionV1 request)
Checks that the result answers the request: the same start request, execution and association.
Parameters
request: The request.
Exceptions
ContractValidationException: The result does not answer the request.
record StartWorkflowExecutionV1
public sealed record StartWorkflowExecutionV1 : IContractValidatable
A durable start request: the execution to create, its definition, business reference, caller idempotency, association and input.
Members
| Member | Kind | Summary |
|---|---|---|
StartWorkflowExecutionV1( | constructor | Creates an instance of Start. |
AssociationGeneration | property | The generation of the association. |
AssociationId | property | The association. |
AssociationSha256 | property | The SHA-256 of the association. |
BusinessReferenceSha256 | property | The SHA-256 of the business reference. |
CallerIdempotencySha256 | property | The SHA-256 of the caller’s idempotency key. |
ContractVersion | property | The contract version: 1. |
DefinitionCode | property | The workflow definition. |
DefinitionSha256 | property | The SHA-256 of the definition. |
DefinitionVersion | property | The definition version. |
Input | property | The input payload. |
PredecessorExecutionId | property | The execution this one continues, when it continues one. |
RequestedAt | property | When the start was requested. |
RootScopeExecutionId | property | The root scope. |
StartRequestId | property | The start request. |
WorkflowExecutionId | property | The execution (workflow instance). |
ComputeSha256( | method | The SHA-256 of the request’s canonical JSON. |
Validate( | method | Checks the fields. |
constructor StartWorkflowExecutionV1() #
StartWorkflowExecutionV1() #public StartWorkflowExecutionV1()
Creates an instance of Start.
property AssociationGeneration #
AssociationGeneration #public required long AssociationGeneration { get; init; }
The generation of the association.
property AssociationId #
AssociationId #public required string AssociationId { get; init; }
The association.
property AssociationSha256 #
AssociationSha256 #public required Sha256Hex AssociationSha256 { get; init; }
The SHA-256 of the association.
property BusinessReferenceSha256 #
BusinessReferenceSha256 #public required Sha256Hex BusinessReferenceSha256 { get; init; }
The SHA-256 of the business reference.
property CallerIdempotencySha256 #
CallerIdempotencySha256 #public required Sha256Hex CallerIdempotencySha256 { get; init; }
The SHA-256 of the caller’s idempotency key.
property ContractVersion #
ContractVersion #public required int ContractVersion { get; init; }
The contract version: 1.
property DefinitionCode #
DefinitionCode #public required string DefinitionCode { get; init; }
The workflow definition.
property DefinitionSha256 #
DefinitionSha256 #public required Sha256Hex DefinitionSha256 { get; init; }
The SHA-256 of the definition.
property DefinitionVersion #
DefinitionVersion #public required string DefinitionVersion { get; init; }
The definition version.
property Input #
Input #public required JsonPayloadDescriptorV1 Input { get; init; }
The input payload.
property PredecessorExecutionId #
PredecessorExecutionId #public required string? PredecessorExecutionId { get; init; }
The execution this one continues, when it continues one.
property RequestedAt #
RequestedAt #public required Rfc3339MillisecondInstant RequestedAt { get; init; }
When the start was requested.
property RootScopeExecutionId #
RootScopeExecutionId #public required string RootScopeExecutionId { get; init; }
The root scope.
property StartRequestId #
StartRequestId #public required string StartRequestId { get; init; }
The start request.
property WorkflowExecutionId #
WorkflowExecutionId #public required string WorkflowExecutionId { get; init; }
The execution (workflow instance).
method ComputeSha256() #
ComputeSha256() #public Sha256Hex ComputeSha256()
The SHA-256 of the request’s canonical JSON.
Returns
The SHA-256.
method Validate() #
Validate() #public void Validate()
Checks the fields.
Exceptions
ContractValidationException: A field breaks its rule.
record WorkflowPrestartTerminalAckV1
public sealed record WorkflowPrestartTerminalAckV1 : IContractValidatable
The acknowledgement of a prestart terminal command.
Members
| Member | Kind | Summary |
|---|---|---|
WorkflowPrestartTerminalAckV1( | constructor | Creates an instance of Workflow. |
AssociationGeneration | property | The generation of the association. |
AssociationId | property | The association. |
AssociationSha256 | property | The SHA-256 of the association. |
CleanupDisposition | property | How the cleanup was handled. |
CommandEventId | property | The command. |
CommandSha256 | property | The SHA-256 of the command. |
ContractVersion | property | The contract version: 1. |
Disposition | property | How the command was handled. |
EventId | property | The event identifier. |
LatchDisposition | property | How the terminal latch was handled. |
OccurredAt | property | When it happened. |
RootOutcome | property | The outcome of the root execution, when it exists. |
SafeCode | property | The safe refusal code, when refused. |
ScopeExecutionId | property | The root scope. |
StartRequestId | property | The start request. |
StartRequestSha256 | property | The SHA-256 of the start request. |
TerminalFenceId | property | The terminal fence. |
TerminalFenceSha256 | property | The SHA-256 of the fence. |
TerminalFenceVersion | property | The fence version. |
TerminalMode | property | The terminal mode: BUSINESS_CANCELED or EXTERNALLY_FINALIZED. |
WorkflowExecutionId | property | The execution (workflow instance). |
Validate( | method | Checks the fields. |
ValidateAgainst( | method | Checks that the acknowledgement answers the command. |
constructor WorkflowPrestartTerminalAckV1() #
WorkflowPrestartTerminalAckV1() #public WorkflowPrestartTerminalAckV1()
Creates an instance of Workflow.
property AssociationGeneration #
AssociationGeneration #public required long AssociationGeneration { get; init; }
The generation of the association.
property AssociationId #
AssociationId #public required string AssociationId { get; init; }
The association.
property AssociationSha256 #
AssociationSha256 #public required Sha256Hex AssociationSha256 { get; init; }
The SHA-256 of the association.
property CleanupDisposition #
CleanupDisposition #public required string CleanupDisposition { get; init; }
How the cleanup was handled.
property CommandEventId #
CommandEventId #public required string CommandEventId { get; init; }
The command.
property CommandSha256 #
CommandSha256 #public required Sha256Hex CommandSha256 { get; init; }
The SHA-256 of the command.
property ContractVersion #
ContractVersion #public required int ContractVersion { get; init; }
The contract version: 1.
property Disposition #
Disposition #public required string Disposition { get; init; }
How the command was handled.
property EventId #
EventId #public required string EventId { get; init; }
The event identifier.
property LatchDisposition #
LatchDisposition #public required string LatchDisposition { get; init; }
How the terminal latch was handled.
property OccurredAt #
OccurredAt #public required Rfc3339MillisecondInstant OccurredAt { get; init; }
When it happened.
property RootOutcome #
RootOutcome #public required string? RootOutcome { get; init; }
The outcome of the root execution, when it exists.
property SafeCode #
SafeCode #public required string? SafeCode { get; init; }
The safe refusal code, when refused.
property ScopeExecutionId #
ScopeExecutionId #public required string ScopeExecutionId { get; init; }
The root scope.
property StartRequestId #
StartRequestId #public required string StartRequestId { get; init; }
The start request.
property StartRequestSha256 #
StartRequestSha256 #public required Sha256Hex StartRequestSha256 { get; init; }
The SHA-256 of the start request.
property TerminalFenceId #
TerminalFenceId #public required string TerminalFenceId { get; init; }
The terminal fence.
property TerminalFenceSha256 #
TerminalFenceSha256 #public required Sha256Hex TerminalFenceSha256 { get; init; }
The SHA-256 of the fence.
property TerminalFenceVersion #
TerminalFenceVersion #public required long TerminalFenceVersion { get; init; }
The fence version.
property TerminalMode #
TerminalMode #public required string TerminalMode { get; init; }
The terminal mode: BUSINESS_CANCELED or EXTERNALLY_FINALIZED.
property WorkflowExecutionId #
WorkflowExecutionId #public required string WorkflowExecutionId { get; init; }
The execution (workflow instance).
method Validate() #
Validate() #public void Validate()
Checks the fields.
Exceptions
ContractValidationException: A field breaks its rule.
method ValidateAgainst(WorkflowPrestartTerminalCommandV1) #
ValidateAgainst(WorkflowPrestartTerminalCommandV1) #public void ValidateAgainst(WorkflowPrestartTerminalCommandV1 command)
Checks that the acknowledgement answers the command.
Parameters
command: The command.
Exceptions
ContractValidationException: It does not answer the command.
record WorkflowPrestartTerminalCommandV1
public sealed record WorkflowPrestartTerminalCommandV1 : IContractValidatable
A terminal command, such as a cancel, for a start that may not have arrived yet; it fences the start.
Members
| Member | Kind | Summary |
|---|---|---|
WorkflowPrestartTerminalCommandV1( | constructor | Creates an instance of Workflow. |
AssociationGeneration | property | The generation of the association. |
AssociationId | property | The association. |
AssociationSha256 | property | The SHA-256 of the association. |
ContractVersion | property | The contract version: 1. |
EventId | property | The event identifier. |
OccurredAt | property | When it happened. |
ScopeExecutionId | property | The root scope. |
StartRequestId | property | The start request. |
StartRequestSha256 | property | The SHA-256 of the start request. |
TerminalFenceId | property | The terminal fence. |
TerminalFenceSha256 | property | The SHA-256 of the fence. |
TerminalFenceVersion | property | The fence version. |
TerminalMode | property | The terminal mode: BUSINESS_CANCELED or EXTERNALLY_FINALIZED. |
WorkflowExecutionId | property | The execution (workflow instance). |
Validate( | method | Checks the fields. |
constructor WorkflowPrestartTerminalCommandV1() #
WorkflowPrestartTerminalCommandV1() #public WorkflowPrestartTerminalCommandV1()
Creates an instance of Workflow.
property AssociationGeneration #
AssociationGeneration #public required long AssociationGeneration { get; init; }
The generation of the association.
property AssociationId #
AssociationId #public required string AssociationId { get; init; }
The association.
property AssociationSha256 #
AssociationSha256 #public required Sha256Hex AssociationSha256 { get; init; }
The SHA-256 of the association.
property ContractVersion #
ContractVersion #public required int ContractVersion { get; init; }
The contract version: 1.
property EventId #
EventId #public required string EventId { get; init; }
The event identifier.
property OccurredAt #
OccurredAt #public required Rfc3339MillisecondInstant OccurredAt { get; init; }
When it happened.
property ScopeExecutionId #
ScopeExecutionId #public required string ScopeExecutionId { get; init; }
The root scope.
property StartRequestId #
StartRequestId #public required string StartRequestId { get; init; }
The start request.
property StartRequestSha256 #
StartRequestSha256 #public required Sha256Hex StartRequestSha256 { get; init; }
The SHA-256 of the start request.
property TerminalFenceId #
TerminalFenceId #public required string TerminalFenceId { get; init; }
The terminal fence.
property TerminalFenceSha256 #
TerminalFenceSha256 #public required Sha256Hex TerminalFenceSha256 { get; init; }
The SHA-256 of the fence.
property TerminalFenceVersion #
TerminalFenceVersion #public required long TerminalFenceVersion { get; init; }
The fence version.
property TerminalMode #
TerminalMode #public required string TerminalMode { get; init; }
The terminal mode: BUSINESS_CANCELED or EXTERNALLY_FINALIZED.
property WorkflowExecutionId #
WorkflowExecutionId #public required string WorkflowExecutionId { get; init; }
The execution (workflow instance).
method Validate() #
Validate() #public void Validate()
Checks the fields.
Exceptions
ContractValidationException: A field breaks its rule.
namespace StellaOps.Workflow.Contracts.Durability.Payloads
| Type | Kind | Description |
|---|---|---|
DataSensitivity | enum | The sensitivity of a payload. |
JsonArtifactContentReferenceV1 | class | The artifact content reference of payloads. |
JsonPayloadDescriptorV1 | record | A JSON payload, inline or in an artifact store, with its schema, canonical hash, length and sensitivity. |
JsonPayloadTransport | enum | Where a payload’s JSON travels. |
enum DataSensitivity
public enum DataSensitivity
The sensitivity of a payload.
| Value | Description |
|---|---|
PUBLIC = 0 | Public. |
INTERNAL = 1 | Internal. |
CONFIDENTIAL = 2 | Confidential. |
RESTRICTED = 3 | Restricted. |
class JsonArtifactContentReferenceV1
public static class JsonArtifactContentReferenceV1
The artifact content reference of payloads.
Members
| Member | Kind | Summary |
|---|---|---|
DescriptorPropertyName | constant | The property name of the artifact content reference: stella. |
constant DescriptorPropertyName #
DescriptorPropertyName #public const string DescriptorPropertyName = "stellaOpsArtifactContentV1"
The property name of the artifact content reference: stella.
record JsonPayloadDescriptorV1
public sealed record JsonPayloadDescriptorV1 : IContractValidatable
A JSON payload, inline or in an artifact store, with its schema, canonical hash, length and sensitivity.
Members
| Member | Kind | Summary |
|---|---|---|
JsonPayloadDescriptorV1( | constructor | Creates an instance of Json. |
ArtifactRef | property | The artifact reference, for an artifact payload: printable ASCII, at most 512 characters. |
ByteLength | property | The length of the canonical JSON. |
Canonicalization | property | The canonicalization: WorkflowJcsV1.. |
Compression | property | The compression: NONE. |
DescriptorVersion | property | The descriptor version: 1. |
InlineJson | property | The JSON, for an inline payload. |
MediaType | property | The media type: application/json. |
SchemaId | property | The schema of the JSON. |
SchemaVersion | property | The schema version, from 1. |
Sensitivity | property | The sensitivity. |
Sha256 | property | The SHA-256 of the canonical JSON. |
Transport | property | Whether the JSON is inline or in an artifact. |
Validate( | method | Checks the fields. |
constructor JsonPayloadDescriptorV1() #
JsonPayloadDescriptorV1() #public JsonPayloadDescriptorV1()
Creates an instance of Json.
property ArtifactRef #
ArtifactRef #public string? ArtifactRef { get; init; }
The artifact reference, for an artifact payload: printable ASCII, at most 512 characters.
property ByteLength #
ByteLength #public required long ByteLength { get; init; }
The length of the canonical JSON.
property Canonicalization #
Canonicalization #public required string Canonicalization { get; init; }
The canonicalization: WorkflowJcsV1..
property Compression #
Compression #public required string Compression { get; init; }
The compression: NONE.
property DescriptorVersion #
DescriptorVersion #public required int DescriptorVersion { get; init; }
The descriptor version: 1.
property InlineJson #
InlineJson #public JsonElement InlineJson { get; init; }
The JSON, for an inline payload.
property MediaType #
MediaType #public required string MediaType { get; init; }
The media type: application/json.
property SchemaId #
SchemaId #public required string SchemaId { get; init; }
The schema of the JSON.
property SchemaVersion #
SchemaVersion #public required int SchemaVersion { get; init; }
The schema version, from 1.
property Sensitivity #
Sensitivity #public required DataSensitivity Sensitivity { get; init; }
The sensitivity.
property Sha256 #
Sha256 #public required Sha256Hex Sha256 { get; init; }
The SHA-256 of the canonical JSON.
property Transport #
Transport #public required JsonPayloadTransport Transport { get; init; }
Whether the JSON is inline or in an artifact.
method Validate() #
Validate() #public void Validate()
Checks the fields.
Exceptions
ContractValidationException: A field breaks its rule.
enum JsonPayloadTransport
public enum JsonPayloadTransport
Where a payload’s JSON travels.
| Value | Description |
|---|---|
INLINE = 0 | The JSON is in the descriptor. |
ARTIFACT = 1 | The JSON is in an artifact store. |
namespace StellaOps.Workflow.Contracts.Durability.Scalars
| Type | Kind | Description |
|---|---|---|
ConfidenceBasisPoints | struct | A confidence in basis points: 0 to 10000 (100%). |
ConfidenceBasisPointsJsonConverter | class | Reads and writes a confidence as a JSON number. |
DecimalString | struct | An exact decimal in canonical text: an optional minus, no leading zeros, and a fraction without trailing zeros; no negative zero. |
DecimalStringJsonConverter | class | Reads and writes a decimal string as a JSON string. |
GregorianDate | struct | A Gregorian date as YYYY-MM-DD text. |
GregorianDateJsonConverter | class | Reads and writes a date as a JSON string. |
Iso4217Code | struct | An ISO 4217 currency code: three uppercase ASCII letters. |
Iso4217CodeJsonConverter | class | Reads and writes a currency code as a JSON string. |
NormalizedCoordinate | struct | A coordinate normalized to the range 0 to 1000000. |
NormalizedCoordinateJsonConverter | class | Reads and writes a normalized coordinate as a JSON number. |
Rfc3339MillisecondInstant | struct | A UTC instant as RFC 3339 text with exactly millisecond precision. |
Rfc3339MillisecondInstantJsonConverter | class | Reads and writes an instant as a JSON string. |
Sha256Hex | struct | A SHA-256 digest as 64 lowercase hexadecimal characters. |
Sha256HexJsonConverter | class | Reads and writes a digest as a JSON string. |
struct ConfidenceBasisPoints
public readonly struct ConfidenceBasisPoints : IEquatable<ConfidenceBasisPoints>
A confidence in basis points: 0 to 10000 (100%).
Members
| Member | Kind | Summary |
|---|---|---|
ConfidenceBasisPoints( | constructor | Creates a confidence. |
Value | property | The basis points. |
ToString( | method | Returns the basis points as invariant text. |
constructor ConfidenceBasisPoints(int) #
ConfidenceBasisPoints(int) #public ConfidenceBasisPoints(int value)
Creates a confidence.
Parameters
value: The basis points.
Exceptions
Argument: The value is outside 0 to 10000.Out Of Range Exception
property Value #
Value #public int Value { get; }
The basis points.
method ToString() #
ToString() #public override string ToString()
Returns the basis points as invariant text.
Returns
The text.
class ConfidenceBasisPointsJsonConverter
public sealed class ConfidenceBasisPointsJsonConverter : JsonConverter<ConfidenceBasisPoints>
Reads and writes a confidence as a JSON number.
Members
| Member | Kind | Summary |
|---|---|---|
ConfidenceBasisPointsJsonConverter( | constructor | Creates an instance of Confidence. |
Read( | method | Reads the confidence from a JSON number. |
Write( | method | Writes the confidence as a JSON number. |
constructor ConfidenceBasisPointsJsonConverter() #
ConfidenceBasisPointsJsonConverter() #public ConfidenceBasisPointsJsonConverter()
Creates an instance of Confidence.
method Read(ref Utf8JsonReader, Type, JsonSerializerOptions) #
Read(ref Utf8JsonReader, Type, JsonSerializerOptions) #public override ConfidenceBasisPoints Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Reads the confidence from a JSON number.
Parameters
reader: The reader.typeToConvert: The type to convert.options: The serializer options.
Returns
The value.
method Write(Utf8JsonWriter, ConfidenceBasisPoints, JsonSerializerOptions) #
Write(Utf8JsonWriter, ConfidenceBasisPoints, JsonSerializerOptions) #public override void Write(Utf8JsonWriter writer, ConfidenceBasisPoints value, JsonSerializerOptions options)
Writes the confidence as a JSON number.
Parameters
writer: The writer.value: The value.options: The serializer options.
struct DecimalString
public readonly struct DecimalString : IEquatable<DecimalString>
An exact decimal in canonical text: an optional minus, no leading zeros, and a fraction without trailing zeros; no negative zero.
Members
| Member | Kind | Summary |
|---|---|---|
DecimalValue | property | The value. |
Scale | property | The digits after the decimal point. |
Value | property | The canonical text. |
EnsureMaximumScale( | method | Checks the scale. |
Parse( | method | Parses canonical text with at most 28 decimals. |
Parse( | method | Parses canonical text with at most maximumScale decimals. |
ParseMoney( | method | Parses an amount of money: at most 4 decimals. |
ParseQuantity( | method | Parses a quantity: at most 6 decimals. |
ParseRate( | method | Parses a rate: at most 8 decimals. |
ToString( | method | Returns the canonical text. |
property DecimalValue #
DecimalValue #public decimal DecimalValue { get; }
The value.
property Scale #
Scale #public int Scale { get; }
The digits after the decimal point.
property Value #
Value #public string Value { get; }
The canonical text.
method EnsureMaximumScale(int) #
EnsureMaximumScale(int) #public DecimalString EnsureMaximumScale(int maximumScale)
Checks the scale.
Parameters
maximumScale: The most decimals allowed.
Returns
The same value.
Exceptions
FormatException: The value has more decimals.
method Parse(string) #
Parse(string) #public static DecimalString Parse(string value)
Parses canonical text with at most 28 decimals.
Parameters
value: The text.
Returns
The decimal string.
Exceptions
FormatException: The text is not valid.
method Parse(string, int) #
Parse(string, int) #public static DecimalString Parse(string value, int maximumScale)
Parses canonical text with at most maximumScale decimals.
Parameters
value: The text.maximumScale: The most decimals allowed, from 0 to 28.
Returns
The decimal string.
Exceptions
FormatException: The text is not valid.Argument:Out Of Range Exception maximumScaleis outside 0 to 28.
method ParseMoney(string) #
ParseMoney(string) #public static DecimalString ParseMoney(string value)
Parses an amount of money: at most 4 decimals.
Parameters
value: The text.
Returns
The decimal string.
Exceptions
FormatException: The text is not valid.
method ParseQuantity(string) #
ParseQuantity(string) #public static DecimalString ParseQuantity(string value)
Parses a quantity: at most 6 decimals.
Parameters
value: The text.
Returns
The decimal string.
Exceptions
FormatException: The text is not valid.
method ParseRate(string) #
ParseRate(string) #public static DecimalString ParseRate(string value)
Parses a rate: at most 8 decimals.
Parameters
value: The text.
Returns
The decimal string.
Exceptions
FormatException: The text is not valid.
method ToString() #
ToString() #public override string ToString()
Returns the canonical text.
Returns
The text.
class DecimalStringJsonConverter
public sealed class DecimalStringJsonConverter : JsonConverter<DecimalString>
Reads and writes a decimal string as a JSON string.
Members
| Member | Kind | Summary |
|---|---|---|
DecimalStringJsonConverter( | constructor | Creates an instance of Decimal. |
Read( | method | Reads the decimal string from a JSON string. |
Write( | method | Writes the decimal string as a JSON string. |
constructor DecimalStringJsonConverter() #
DecimalStringJsonConverter() #public DecimalStringJsonConverter()
Creates an instance of Decimal.
method Read(ref Utf8JsonReader, Type, JsonSerializerOptions) #
Read(ref Utf8JsonReader, Type, JsonSerializerOptions) #public override DecimalString Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Reads the decimal string from a JSON string.
Parameters
reader: The reader.typeToConvert: The type to convert.options: The serializer options.
Returns
The value.
method Write(Utf8JsonWriter, DecimalString, JsonSerializerOptions) #
Write(Utf8JsonWriter, DecimalString, JsonSerializerOptions) #public override void Write(Utf8JsonWriter writer, DecimalString value, JsonSerializerOptions options)
Writes the decimal string as a JSON string.
Parameters
writer: The writer.value: The value.options: The serializer options.
struct GregorianDate
public readonly struct GregorianDate : IEquatable<GregorianDate>
A Gregorian date as YYYY-MM-DD text.
Members
| Member | Kind | Summary |
|---|---|---|
Date | property | The date. |
Value | property | The text. |
Parse( | method | Parses YYYY-MM-DD text. |
ToString( | method | Returns the canonical text. |
property Date #
Date #public DateOnly Date { get; }
The date.
property Value #
Value #public string Value { get; }
The text.
method Parse(string) #
Parse(string) #public static GregorianDate Parse(string value)
Parses YYYY-MM-DD text.
Parameters
value: The text.
Returns
The date.
Exceptions
FormatException: The text is not valid.
method ToString() #
ToString() #public override string ToString()
Returns the canonical text.
Returns
The text.
class GregorianDateJsonConverter
public sealed class GregorianDateJsonConverter : JsonConverter<GregorianDate>
Reads and writes a date as a JSON string.
Members
| Member | Kind | Summary |
|---|---|---|
GregorianDateJsonConverter( | constructor | Creates an instance of Gregorian. |
Read( | method | Reads the date from a JSON string. |
Write( | method | Writes the date as a JSON string. |
constructor GregorianDateJsonConverter() #
GregorianDateJsonConverter() #public GregorianDateJsonConverter()
Creates an instance of Gregorian.
method Read(ref Utf8JsonReader, Type, JsonSerializerOptions) #
Read(ref Utf8JsonReader, Type, JsonSerializerOptions) #public override GregorianDate Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Reads the date from a JSON string.
Parameters
reader: The reader.typeToConvert: The type to convert.options: The serializer options.
Returns
The value.
method Write(Utf8JsonWriter, GregorianDate, JsonSerializerOptions) #
Write(Utf8JsonWriter, GregorianDate, JsonSerializerOptions) #public override void Write(Utf8JsonWriter writer, GregorianDate value, JsonSerializerOptions options)
Writes the date as a JSON string.
Parameters
writer: The writer.value: The value.options: The serializer options.
struct Iso4217Code
public readonly struct Iso4217Code : IEquatable<Iso4217Code>
An ISO 4217 currency code: three uppercase ASCII letters.
Members
| Member | Kind | Summary |
|---|---|---|
Iso4217Code( | constructor | Creates a currency code. |
Value | property | The code. |
Parse( | method | Parses a currency code. |
ToString( | method | Returns the canonical text. |
constructor Iso4217Code(string) #
Iso4217Code(string) #public Iso4217Code(string value)
Creates a currency code.
Parameters
value: The code.
Exceptions
FormatException: The text is not valid.
property Value #
Value #public string Value { get; }
The code.
method Parse(string) #
Parse(string) #public static Iso4217Code Parse(string value)
Parses a currency code.
Parameters
value: The text.
Returns
The code.
Exceptions
FormatException: The text is not valid.
method ToString() #
ToString() #public override string ToString()
Returns the canonical text.
Returns
The text.
class Iso4217CodeJsonConverter
public sealed class Iso4217CodeJsonConverter : JsonConverter<Iso4217Code>
Reads and writes a currency code as a JSON string.
Members
| Member | Kind | Summary |
|---|---|---|
Iso4217CodeJsonConverter( | constructor | Creates an instance of Iso4217. |
Read( | method | Reads the currency code from a JSON string. |
Write( | method | Writes the currency code as a JSON string. |
constructor Iso4217CodeJsonConverter() #
Iso4217CodeJsonConverter() #public Iso4217CodeJsonConverter()
Creates an instance of Iso4217.
method Read(ref Utf8JsonReader, Type, JsonSerializerOptions) #
Read(ref Utf8JsonReader, Type, JsonSerializerOptions) #public override Iso4217Code Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Reads the currency code from a JSON string.
Parameters
reader: The reader.typeToConvert: The type to convert.options: The serializer options.
Returns
The value.
method Write(Utf8JsonWriter, Iso4217Code, JsonSerializerOptions) #
Write(Utf8JsonWriter, Iso4217Code, JsonSerializerOptions) #public override void Write(Utf8JsonWriter writer, Iso4217Code value, JsonSerializerOptions options)
Writes the currency code as a JSON string.
Parameters
writer: The writer.value: The value.options: The serializer options.
struct NormalizedCoordinate
public readonly struct NormalizedCoordinate : IEquatable<NormalizedCoordinate>
A coordinate normalized to the range 0 to 1000000.
Members
| Member | Kind | Summary |
|---|---|---|
NormalizedCoordinate( | constructor | Creates a coordinate. |
Value | property | The coordinate. |
ToString( | method | Returns the coordinate as invariant text. |
constructor NormalizedCoordinate(int) #
NormalizedCoordinate(int) #public NormalizedCoordinate(int value)
Creates a coordinate.
Parameters
value: The coordinate.
Exceptions
Argument: The value is outside 0 to 1000000.Out Of Range Exception
property Value #
Value #public int Value { get; }
The coordinate.
method ToString() #
ToString() #public override string ToString()
Returns the coordinate as invariant text.
Returns
The text.
class NormalizedCoordinateJsonConverter
public sealed class NormalizedCoordinateJsonConverter : JsonConverter<NormalizedCoordinate>
Reads and writes a normalized coordinate as a JSON number.
Members
| Member | Kind | Summary |
|---|---|---|
NormalizedCoordinateJsonConverter( | constructor | Creates an instance of Normalized. |
Read( | method | Reads the coordinate from a JSON number. |
Write( | method | Writes the coordinate as a JSON number. |
constructor NormalizedCoordinateJsonConverter() #
NormalizedCoordinateJsonConverter() #public NormalizedCoordinateJsonConverter()
Creates an instance of Normalized.
method Read(ref Utf8JsonReader, Type, JsonSerializerOptions) #
Read(ref Utf8JsonReader, Type, JsonSerializerOptions) #public override NormalizedCoordinate Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Reads the coordinate from a JSON number.
Parameters
reader: The reader.typeToConvert: The type to convert.options: The serializer options.
Returns
The value.
method Write(Utf8JsonWriter, NormalizedCoordinate, JsonSerializerOptions) #
Write(Utf8JsonWriter, NormalizedCoordinate, JsonSerializerOptions) #public override void Write(Utf8JsonWriter writer, NormalizedCoordinate value, JsonSerializerOptions options)
Writes the coordinate as a JSON number.
Parameters
writer: The writer.value: The value.options: The serializer options.
struct Rfc3339MillisecondInstant
public readonly struct Rfc3339MillisecondInstant : IEquatable<Rfc3339MillisecondInstant>
A UTC instant as RFC 3339 text with exactly millisecond precision.
Members
| Member | Kind | Summary |
|---|---|---|
Format | constant | The text format: yyyy-MM-dd. |
Instant | property | The instant. |
Value | property | The text. |
FromDateTimeOffset( | method | Converts an instant with exact millisecond precision to UTC text. |
Parse( | method | Parses the text format. |
ToString( | method | Returns the canonical text. |
constant Format #
Format #public const string Format = "yyyy-MM-dd'T'HH:mm:ss.fff'Z'"
The text format: yyyy-MM-dd.
property Instant #
Instant #public DateTimeOffset Instant { get; }
The instant.
property Value #
Value #public string Value { get; }
The text.
method FromDateTimeOffset(DateTimeOffset) #
FromDateTimeOffset(DateTimeOffset) #public static Rfc3339MillisecondInstant FromDateTimeOffset(DateTimeOffset value)
Converts an instant with exact millisecond precision to UTC text.
Parameters
value: The instant.
Returns
The instant.
Exceptions
ArgumentException: The instant has sub-millisecond precision.
method Parse(string) #
Parse(string) #public static Rfc3339MillisecondInstant Parse(string value)
Parses the text format.
Parameters
value: The text.
Returns
The instant.
Exceptions
FormatException: The text is not valid.
method ToString() #
ToString() #public override string ToString()
Returns the canonical text.
Returns
The text.
class Rfc3339MillisecondInstantJsonConverter
public sealed class Rfc3339MillisecondInstantJsonConverter : JsonConverter<Rfc3339MillisecondInstant>
Reads and writes an instant as a JSON string.
Members
| Member | Kind | Summary |
|---|---|---|
Rfc3339MillisecondInstantJsonConverter( | constructor | Creates an instance of Rfc3339. |
Read( | method | Reads the instant from a JSON string. |
Write( | method | Writes the instant as a JSON string. |
constructor Rfc3339MillisecondInstantJsonConverter() #
Rfc3339MillisecondInstantJsonConverter() #public Rfc3339MillisecondInstantJsonConverter()
Creates an instance of Rfc3339.
method Read(ref Utf8JsonReader, Type, JsonSerializerOptions) #
Read(ref Utf8JsonReader, Type, JsonSerializerOptions) #public override Rfc3339MillisecondInstant Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Reads the instant from a JSON string.
Parameters
reader: The reader.typeToConvert: The type to convert.options: The serializer options.
Returns
The value.
method Write(Utf8JsonWriter, Rfc3339MillisecondInstant, JsonSerializerOptions) #
Write(Utf8JsonWriter, Rfc3339MillisecondInstant, JsonSerializerOptions) #public override void Write(Utf8JsonWriter writer, Rfc3339MillisecondInstant value, JsonSerializerOptions options)
Writes the instant as a JSON string.
Parameters
writer: The writer.value: The value.options: The serializer options.
struct Sha256Hex
public readonly struct Sha256Hex : IEquatable<Sha256Hex>
A SHA-256 digest as 64 lowercase hexadecimal characters.
Members
| Member | Kind | Summary |
|---|---|---|
Sha256Hex( | constructor | Creates a digest. |
Value | property | The hexadecimal text. |
FixedTimeEquals( | method | Compares two digests in constant time. |
FromBytes( | method | Creates a digest from its 32 bytes. |
Parse( | method | Parses a digest. |
ToString( | method | Returns the canonical text. |
TryParse( | method | Parses a digest. |
constructor Sha256Hex(string) #
Sha256Hex(string) #public Sha256Hex(string value)
Creates a digest.
Parameters
value: The hexadecimal text.
Exceptions
FormatException: The text is not valid.
property Value #
Value #public string Value { get; }
The hexadecimal text.
method FixedTimeEquals(Sha256Hex) #
FixedTimeEquals(Sha256Hex) #public bool FixedTimeEquals(Sha256Hex other)
Compares two digests in constant time.
Parameters
other: The other digest.
Returns
Whether they are equal; false when either is empty.
method FromBytes(ReadOnlySpan<byte>) #
FromBytes(ReadOnlySpan<byte>) #public static Sha256Hex FromBytes(ReadOnlySpan<byte> bytes)
Creates a digest from its 32 bytes.
Parameters
bytes: The bytes.
Returns
The digest.
Exceptions
ArgumentException: There are not exactly 32 bytes.
method Parse(string) #
Parse(string) #public static Sha256Hex Parse(string value)
Parses a digest.
Parameters
value: The text.
Returns
The digest.
Exceptions
FormatException: The text is not valid.
method ToString() #
ToString() #public override string ToString()
Returns the canonical text.
Returns
The text.
method TryParse(string, out Sha256Hex) #
TryParse(string, out Sha256Hex) #public static bool TryParse(string? value, out Sha256Hex result)
Parses a digest.
Parameters
value: The text.result: The digest, when valid.
Returns
Whether it is valid.
class Sha256HexJsonConverter
public sealed class Sha256HexJsonConverter : JsonConverter<Sha256Hex>
Reads and writes a digest as a JSON string.
Members
| Member | Kind | Summary |
|---|---|---|
Sha256HexJsonConverter( | constructor | Creates an instance of Sha256. |
Read( | method | Reads the digest from a JSON string. |
Write( | method | Writes the digest as a JSON string. |
constructor Sha256HexJsonConverter() #
Sha256HexJsonConverter() #public Sha256HexJsonConverter()
Creates an instance of Sha256.
method Read(ref Utf8JsonReader, Type, JsonSerializerOptions) #
Read(ref Utf8JsonReader, Type, JsonSerializerOptions) #public override Sha256Hex Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Reads the digest from a JSON string.
Parameters
reader: The reader.typeToConvert: The type to convert.options: The serializer options.
Returns
The value.
method Write(Utf8JsonWriter, Sha256Hex, JsonSerializerOptions) #
Write(Utf8JsonWriter, Sha256Hex, JsonSerializerOptions) #public override void Write(Utf8JsonWriter writer, Sha256Hex value, JsonSerializerOptions options)
Writes the digest as a JSON string.
Parameters
writer: The writer.value: The value.options: The serializer options.
namespace StellaOps.Workflow.Contracts.Durability.Schemas
| Type | Kind | Description |
|---|---|---|
ContractSchemaValidationException | class | Raised when a value does not match a frozen schema. |
FrozenContractSchemaSet | class | Immutable in-assembly copy of the frozen v1 contract schemas. |
FrozenSchemaDescriptor | record | A frozen schema. |
class ContractSchemaValidationException
public sealed class ContractSchemaValidationException : Exception
Raised when a value does not match a frozen schema.
Parameters
schemaReference: The schema reference.instanceLocation: Where in the value.message: What does not match.
Members
| Member | Kind | Summary |
|---|---|---|
ContractSchemaValidationException( | constructor | Raised when a value does not match a frozen schema. |
InstanceLocation | property | Where in the value. |
SchemaReference | property | The schema reference. |
constructor ContractSchemaValidationException(string, string, string) #
ContractSchemaValidationException(string, string, string) #public ContractSchemaValidationException(string schemaReference, string instanceLocation, string message)
Raised when a value does not match a frozen schema.
Parameters
schemaReference: The schema reference.instanceLocation: Where in the value.message: What does not match.
property InstanceLocation #
InstanceLocation #public string InstanceLocation { get; }
Where in the value.
property SchemaReference #
SchemaReference #public string SchemaReference { get; }
The schema reference.
class FrozenContractSchemaSet
public sealed class FrozenContractSchemaSet
Immutable in-assembly copy of the frozen v1 contract schemas. Every evaluation uses a self-contained compound schema document, so resolution never uses the network or JsonSchema.Net’s process-global schema registry.
Members
| Member | Kind | Summary |
|---|---|---|
SchemaIds | property | The schema ids. |
V1 | property | The frozen v1 schemas. |
GetDescriptor( | method | Returns the descriptor of a schema. |
IsValid( | method | Whether a value matches a schema. |
Validate( | method | Checks a value against a schema. |
property SchemaIds #
SchemaIds #public IReadOnlyCollection<string> SchemaIds { get; }
The schema ids.
property V1 #
V1 #public static FrozenContractSchemaSet V1 { get; }
The frozen v1 schemas.
method GetDescriptor(string) #
GetDescriptor(string) #public FrozenSchemaDescriptor GetDescriptor(string schemaId)
Returns the descriptor of a schema.
Parameters
schemaId: The schema id.
Returns
The descriptor.
Exceptions
Argument: The schema is not in the set.Out Of Range Exception
method IsValid(JsonElement, string) #
IsValid(JsonElement, string) #public bool IsValid(JsonElement instance, string schemaReference)
Whether a value matches a schema.
Parameters
instance: The value.schemaReference: The schema reference.
Returns
Whether it matches.
method Validate(JsonElement, string) #
Validate(JsonElement, string) #public void Validate(JsonElement instance, string schemaReference)
Checks a value against a schema.
Parameters
instance: The value.schemaReference: The schema reference.
Exceptions
ContractSchemaValidationException: The value does not match.
record FrozenSchemaDescriptor
public sealed record FrozenSchemaDescriptor
A frozen schema.
Parameters
SchemaId: The schema id.Sha256: The SHA-256 of its canonical JSON.CanonicalByteLength: The length of its canonical JSON.
Members
| Member | Kind | Summary |
|---|---|---|
FrozenSchemaDescriptor( | constructor | A frozen schema. |
CanonicalByteLength | property | The length of its canonical JSON. |
SchemaId | property | The schema id. |
Sha256 | property | The SHA-256 of its canonical JSON. |
constructor FrozenSchemaDescriptor(string, Sha256Hex, int) #
FrozenSchemaDescriptor(string, Sha256Hex, int) #public FrozenSchemaDescriptor(string SchemaId, Sha256Hex Sha256, int CanonicalByteLength)
A frozen schema.
Parameters
SchemaId: The schema id.Sha256: The SHA-256 of its canonical JSON.CanonicalByteLength: The length of its canonical JSON.
property CanonicalByteLength #
CanonicalByteLength #public int CanonicalByteLength { get; init; }
The length of its canonical JSON.
property SchemaId #
SchemaId #public string SchemaId { get; init; }
The schema id.
property Sha256 #
Sha256 #public Sha256Hex Sha256 { get; init; }
The SHA-256 of its canonical JSON.
namespace StellaOps.Workflow.Contracts.Durability.Serialization
| Type | Kind | Description |
|---|---|---|
ContractJsonCodec | class | Reads and writes the durable contracts as canonical JSON. |
DecodedContract< | record | A decoded contract with its canonical JSON. |
class ContractJsonCodec
public static class ContractJsonCodec
Reads and writes the durable contracts as canonical JSON.
Members
| Member | Kind | Summary |
|---|---|---|
ComputeSha256< | method | The SHA-256 of a contract’s canonical JSON. |
ComputeValueSha256< | method | The SHA-256 of any value’s canonical JSON. |
CreateIsolatedSerializerOptions( | method | A copy of the contract serializer options. |
Decode< | method | Reads a contract strictly and canonically, then checks its fields. |
DecodeUnchecked< | method | Reads a contract strictly and canonically, without checking its fields. |
DecodeWithSchema< | method | Reads a contract strictly and canonically and checks it against a frozen schema. |
Encode< | method | Checks a contract’s fields and writes it as canonical JSON. |
EncodeValue< | method | Writes any value as canonical JSON. |
method ComputeSha256<T>(T) #
ComputeSha256<T>(T) #public static Sha256Hex ComputeSha256<T>(T value) where T : IContractValidatable
The SHA-256 of a contract’s canonical JSON.
Type parameters
T: The contract type.
Parameters
value: The contract.
Returns
The SHA-256.
method ComputeValueSha256<T>(T) #
ComputeValueSha256<T>(T) #public static Sha256Hex ComputeValueSha256<T>(T value)
The SHA-256 of any value’s canonical JSON.
Type parameters
T: The value type.
Parameters
value: The value.
Returns
The SHA-256.
method CreateIsolatedSerializerOptions() #
CreateIsolatedSerializerOptions() #public static JsonSerializerOptions CreateIsolatedSerializerOptions()
A copy of the contract serializer options.
Returns
The options.
method Decode<T>(ReadOnlySpan<byte>, StrictJsonReaderOptions) #
Decode<T>(ReadOnlySpan<byte>, StrictJsonReaderOptions) #public static DecodedContract<T> Decode<T>(ReadOnlySpan<byte> utf8Json, StrictJsonReaderOptions? readerOptions = null) where T : IContractValidatable
Reads a contract strictly and canonically, then checks its fields.
Type parameters
T: The contract type.
Parameters
utf8Json: The UTF-8 JSON.readerOptions: The reader limits; the defaults when not set.
Returns
The contract and its canonical JSON.
method DecodeUnchecked<T>(ReadOnlySpan<byte>, StrictJsonReaderOptions) #
DecodeUnchecked<T>(ReadOnlySpan<byte>, StrictJsonReaderOptions) #public static DecodedContract<T> DecodeUnchecked<T>(ReadOnlySpan<byte> utf8Json, StrictJsonReaderOptions? readerOptions = null) where T : IContractValidatable
Reads a contract strictly and canonically, without checking its fields.
Type parameters
T: The contract type.
Parameters
utf8Json: The UTF-8 JSON.readerOptions: The reader limits; the defaults when not set.
Returns
The contract and its canonical JSON.
method DecodeWithSchema<T>(ReadOnlySpan<byte>, string, StrictJsonReaderOptions) #
DecodeWithSchema<T>(ReadOnlySpan<byte>, string, StrictJsonReaderOptions) #public static DecodedContract<T> DecodeWithSchema<T>(ReadOnlySpan<byte> utf8Json, string schemaReference, StrictJsonReaderOptions? readerOptions = null) where T : IContractValidatable
Reads a contract strictly and canonically and checks it against a frozen schema.
Type parameters
T: The contract type.
Parameters
utf8Json: The UTF-8 JSON.schemaReference: The schema reference.readerOptions: The reader limits; the defaults when not set.
Returns
The contract and its canonical JSON.
method Encode<T>(T) #
Encode<T>(T) #public static CanonicalJsonResult Encode<T>(T value) where T : IContractValidatable
Checks a contract’s fields and writes it as canonical JSON.
Type parameters
T: The contract type.
Parameters
value: The contract.
Returns
The canonical JSON.
method EncodeValue<T>(T) #
EncodeValue<T>(T) #public static CanonicalJsonResult EncodeValue<T>(T value)
Writes any value as canonical JSON.
Type parameters
T: The value type.
Parameters
value: The value.
Returns
The canonical JSON.
record DecodedContract<T>
public sealed record DecodedContract<T>
A decoded contract with its canonical JSON.
Type parameters
T: The contract type.
Parameters
Value: The contract.CanonicalJson: Its canonical JSON.
Members
| Member | Kind | Summary |
|---|---|---|
DecodedContract( | constructor | A decoded contract with its canonical JSON. |
CanonicalJson | property | Its canonical JSON. |
Value | property | The contract. |
constructor DecodedContract(T, CanonicalJsonResult) #
DecodedContract(T, CanonicalJsonResult) #public DecodedContract(T Value, CanonicalJsonResult CanonicalJson)
A decoded contract with its canonical JSON.
Type parameters
T: The contract type.
Parameters
Value: The contract.CanonicalJson: Its canonical JSON.
property CanonicalJson #
CanonicalJson #public CanonicalJsonResult CanonicalJson { get; init; }
Its canonical JSON.
property Value #
Value #public T Value { get; init; }
The contract.
namespace StellaOps.Workflow.Contracts.Durability.Validation
| Type | Kind | Description |
|---|---|---|
ContractValidation | class | The field rules of the durable contracts. |
ContractValidationException | class | Raised when a durable contract field breaks its rule. |
IContractValidatable | interface | A durable contract that checks its own fields. |
class ContractValidation
public static class ContractValidation
The field rules of the durable contracts.
Members
| Member | Kind | Summary |
|---|---|---|
MaximumSafeInteger | constant | The largest integer a JSON number carries exactly: 2^53 - 1. |
Require( | method | Raises a validation error when a condition fails. |
RequireCallerNamespace( | method | Requires a caller namespace: 3 to 128 lowercase letters, digits, _, . or -, starting with a letter (CONTRACT_). |
RequireCode( | method | Requires a code: 1 to 128 uppercase letters, digits, _, . or -, starting with a letter (CONTRACT_). |
RequireContractVersion( | method | Requires contract version 1 (CONTRACT_). |
RequireExecutionId( | method | Requires an execution id: 8 to 128 letters, digits, ., _, : or -, starting with a letter or digit (CONTRACT_). |
RequireOpaqueAscii( | method | Requires printable ASCII without spaces, 1 to maximumLength characters (CONTRACT_). |
RequireSafeNonNegative( | method | Requires an integer from 0 to ContractValidation.(CONTRACT_). |
RequireSafePositive( | method | Requires an integer from 1 to ContractValidation.(CONTRACT_). |
RequireSchemaId( | method | Requires a schema id: 3 to 200 characters, path segments of lowercase letters, digits, ., _ or - (PAYLOAD_). |
RequireVersion( | method | Requires a version text: 1 to 100 letters, digits, ., _, + or -, starting with a letter or digit (CONTRACT_). |
constant MaximumSafeInteger #
MaximumSafeInteger #public const long MaximumSafeInteger = 9007199254740991
The largest integer a JSON number carries exactly: 2^53 - 1.
method Require(bool, string, string) #
Require(bool, string, string) #public static void Require(bool condition, string code, string pointer)
Raises a validation error when a condition fails.
Parameters
condition: The condition.code: The error code.pointer: The JSON pointer of the value, for the error.
Exceptions
ContractValidationException: The value is not valid.
method RequireCallerNamespace(string, string) #
RequireCallerNamespace(string, string) #public static void RequireCallerNamespace(string value, string pointer)
Requires a caller namespace: 3 to 128 lowercase letters, digits, _, . or -, starting with a letter (CONTRACT_).
Parameters
value: The value.pointer: The JSON pointer of the value, for the error.
Exceptions
ContractValidationException: The value is not valid.
method RequireCode(string, string) #
RequireCode(string, string) #public static void RequireCode(string value, string pointer)
Requires a code: 1 to 128 uppercase letters, digits, _, . or -, starting with a letter (CONTRACT_).
Parameters
value: The value.pointer: The JSON pointer of the value, for the error.
Exceptions
ContractValidationException: The value is not valid.
method RequireContractVersion(int, string) #
RequireContractVersion(int, string) #public static void RequireContractVersion(int value, string pointer = "/contractVersion")
Requires contract version 1 (CONTRACT_).
Parameters
value: The value.pointer: The JSON pointer of the value, for the error.
Exceptions
ContractValidationException: The value is not valid.
method RequireExecutionId(string, string) #
RequireExecutionId(string, string) #public static void RequireExecutionId(string value, string pointer)
Requires an execution id: 8 to 128 letters, digits, ., _, : or -, starting with a letter or digit (CONTRACT_).
Parameters
value: The value.pointer: The JSON pointer of the value, for the error.
Exceptions
ContractValidationException: The value is not valid.
method RequireOpaqueAscii(string, int, string) #
RequireOpaqueAscii(string, int, string) #public static void RequireOpaqueAscii(string value, int maximumLength, string pointer)
Requires printable ASCII without spaces, 1 to maximumLength characters (CONTRACT_).
Parameters
value: The value.maximumLength: The longest length.pointer: The JSON pointer of the value, for the error.
Exceptions
ContractValidationException: The value is not valid.
method RequireSafeNonNegative(long, string) #
RequireSafeNonNegative(long, string) #public static void RequireSafeNonNegative(long value, string pointer)
Requires an integer from 0 to ContractValidation.(CONTRACT_).
Parameters
value: The value.pointer: The JSON pointer of the value, for the error.
Exceptions
ContractValidationException: The value is not valid.
method RequireSafePositive(long, string) #
RequireSafePositive(long, string) #public static void RequireSafePositive(long value, string pointer)
Requires an integer from 1 to ContractValidation.(CONTRACT_).
Parameters
value: The value.pointer: The JSON pointer of the value, for the error.
Exceptions
ContractValidationException: The value is not valid.
method RequireSchemaId(string, string) #
RequireSchemaId(string, string) #public static void RequireSchemaId(string value, string pointer)
Requires a schema id: 3 to 200 characters, path segments of lowercase letters, digits, ., _ or - (PAYLOAD_).
Parameters
value: The value.pointer: The JSON pointer of the value, for the error.
Exceptions
ContractValidationException: The value is not valid.
method RequireVersion(string, string) #
RequireVersion(string, string) #public static void RequireVersion(string value, string pointer)
Requires a version text: 1 to 100 letters, digits, ., _, + or -, starting with a letter or digit (CONTRACT_).
Parameters
value: The value.pointer: The JSON pointer of the value, for the error.
Exceptions
ContractValidationException: The value is not valid.
class ContractValidationException
public sealed class ContractValidationException : Exception
Raised when a durable contract field breaks its rule.
Members
| Member | Kind | Summary |
|---|---|---|
ContractValidationException( | constructor | Creates the exception. |
Code | property | The error code. |
JsonPointer | property | The JSON pointer of the field. |
constructor ContractValidationException(string, string) #
ContractValidationException(string, string) #public ContractValidationException(string code, string jsonPointer)
Creates the exception.
Parameters
code: The error code.jsonPointer: The JSON pointer of the field.
property Code #
Code #public string Code { get; }
The error code.
property JsonPointer #
JsonPointer #public string JsonPointer { get; }
The JSON pointer of the field.
interface IContractValidatable
public interface IContractValidatable
A durable contract that checks its own fields.
Members
| Member | Kind | Summary |
|---|---|---|
Validate( | method | Checks the fields. |
method Validate() #
Validate() #