Zum Hauptinhalt springen

CkOperationHandle<TResult>

Namespace: Meshmakers.Octo.Sdk.ServiceClient.AssetRepositoryServices.Tenants.Methods

The handle of an accepted call of an asynchronous CK method with a declared result of type TResult, see CkOperationHandle.

public sealed class CkOperationHandle<TResult> : CkOperationHandle

Type Parameters​

TResult
The C# type of the declared result

Inheritance Object → CkOperationHandle → CkOperationHandle<TResult>

Properties​

OperationId​

The opaque id of the operation, unique in the tenant. Keep it to read the operation again later (e.g. after a restart of the client); new CkOperationHandle(operationId) recreates the handle.

public string OperationId { get; }

Property Value​

String

MethodId​

The qualified id of the method that started the operation, e.g. System.Bot/TenantRepository.Dump-1; null for a handle created from an id only.

public string MethodId { get; }

Property Value​

String

InvocationId​

The invocation id of the call that started the operation (correlation with the handler log).

public string InvocationId { get; }

Property Value​

String

AcceptedAtUtc​

The time (UTC) the operation was accepted.

public Nullable<DateTime> AcceptedAtUtc { get; }

Property Value​

Nullable<DateTime>

RetryAfterSeconds​

The suggested delay before the first status check, in seconds; CkOperationsClient waits at least this long between two reads.

public Nullable<int> RetryAfterSeconds { get; }

Property Value​

Nullable<Int32>

ExpiresAtUtc​

The time (UTC) after which the platform may forget the operation; null while it is open.

public Nullable<DateTime> ExpiresAtUtc { get; }

Property Value​

Nullable<DateTime>

DeclaredErrorCodes​

The error codes the method declares in its CK model. A failed operation with one of these codes is returned as CkMethodResult.Error by CkOperationsClient.WaitForOperationAsync(CkOperationHandle, IProgress<CkOperation>, CkOperationWaitOptions, CancellationToken); every other code is thrown as CkMethodCallException.

public IReadOnlyCollection<string> DeclaredErrorCodes { get; }

Property Value​

IReadOnlyCollection<String>

Constructors​

CkOperationHandle(String, String, String, Nullable<DateTime>, Nullable<Int32>, Nullable<DateTime>, IReadOnlyCollection<String>, JsonSerializerOptions)​

Creates a handle.

public CkOperationHandle(string operationId, string methodId, string invocationId, Nullable<DateTime> acceptedAtUtc, Nullable<int> retryAfterSeconds, Nullable<DateTime> expiresAtUtc, IReadOnlyCollection<string> declaredErrorCodes, JsonSerializerOptions resultOptions)

Parameters​

operationId String
The opaque id of the operation

methodId String
The qualified id of the method that started it; null when unknown

invocationId String
The invocation id of the call that started it; null when unknown

acceptedAtUtc Nullable<DateTime>
The time (UTC) the operation was accepted

retryAfterSeconds Nullable<Int32>
The suggested delay before the first status check, in seconds

expiresAtUtc Nullable<DateTime>
The time (UTC) after which the operation may be forgotten; null while it is open

declaredErrorCodes IReadOnlyCollection<String>
The error codes the method declares

resultOptions JsonSerializerOptions
The JSON options the result is read with; null for CkOperationResultJson.DefaultOptions

Methods​

ReadResult(CkOperation)​

Reads the result of a succeeded operation as TResult.

public TResult ReadResult(CkOperation operation)

Parameters​

operation CkOperation
The succeeded operation

Returns​

TResult
The typed result; default when the operation has no result