Table of Contents

Interface IIronLedgerService

Namespace
Tudormobile.IronLedgerLib.Services
Assembly
Tudormobile.IronLedgerLib.Services.dll

Defines a contract for Iron Ledger service endpoints. All methods are asynchronous.

public interface IIronLedgerService

Methods

GetAssetAsync(string?, CancellationToken)

Retrieves an asset by its identifier, or all asset identifiers when no ID is provided.

Task<IResult> GetAssetAsync(string? assetId, CancellationToken cancellationToken = default)

Parameters

assetId string

The unique identifier of the asset to retrieve, or null to return all asset identifiers.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

Task<IResult>

An IResult containing the asset, a not-found result, or the list of all asset identifiers.

GetComponentsAsync(string, CancellationToken)

Asynchronously retrieves the components associated with the specified asset.

Task<IResult> GetComponentsAsync(string assetId, CancellationToken cancellationToken = default)

Parameters

assetId string

The unique identifier of the asset for which to retrieve components. Cannot be null or empty.

cancellationToken CancellationToken

A cancellation token that can be used to cancel the asynchronous operation.

Returns

Task<IResult>

A task that represents the asynchronous operation. The task result contains an object representing the outcome of the retrieval, including the components if successful.

GetNotesAsync(string, CancellationToken)

Asynchronously retrieves the notes associated with the specified asset.

Task<IResult> GetNotesAsync(string assetId, CancellationToken cancellationToken = default)

Parameters

assetId string

The unique identifier of the asset for which to retrieve notes. Cannot be null or empty.

cancellationToken CancellationToken

A cancellation token that can be used to cancel the asynchronous operation.

Returns

Task<IResult>

A task that represents the asynchronous operation. The task result contains an object representing the outcome of the notes retrieval operation.

GetStatusAsync(CancellationToken)

Retrieves the service status.

Task<IResult> GetStatusAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

Task<IResult>

An IResult containing the service status.

IngestAssetAsync(Stream, CancellationToken)

Ingests an asset from the provided request body stream.

Task<IResult> IngestAssetAsync(Stream body, CancellationToken cancellationToken = default)

Parameters

body Stream

The request body stream containing the serialized asset payload.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

Task<IResult>

An IResult representing the outcome of the ingest operation.

UpdateComponentsAsync(string, Stream, CancellationToken)

Asynchronously updates the components of the specified asset using the provided data stream.

Task<IResult> UpdateComponentsAsync(string assetId, Stream body, CancellationToken cancellationToken = default)

Parameters

assetId string

The unique identifier of the asset whose components are to be updated. Cannot be null or empty.

body Stream

A stream containing the component data to update. The stream must be readable and positioned at the start of the data.

cancellationToken CancellationToken

A cancellation token that can be used to cancel the asynchronous operation.

Returns

Task<IResult>

A task that represents the asynchronous operation. The task result contains an object indicating the outcome of the update operation.

UpdateNotesAsync(string, Stream, CancellationToken)

Asynchronously updates the notes associated with the specified asset.

Task<IResult> UpdateNotesAsync(string assetId, Stream body, CancellationToken cancellationToken = default)

Parameters

assetId string

The unique identifier of the asset whose notes are to be updated. Cannot be null or empty.

body Stream

A stream containing the new notes content to be applied to the asset. The stream must be readable and positioned at the start of the content.

cancellationToken CancellationToken

A token to monitor for cancellation requests. The default value is None.

Returns

Task<IResult>

A task that represents the asynchronous operation. The task result contains an object indicating the outcome of the update operation.