Table of Contents

Interface IIronLedgerClient

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

Defines the contract for interacting with the IronLedger API client.

public interface IIronLedgerClient

Methods

Create(HttpClient, ILogger?, IIronLedgerSerializer?)

Creates and initializes an instance of the IIronLedgerClient interface.

public static IIronLedgerClient Create(HttpClient httpClient, ILogger? logger = null, IIronLedgerSerializer? serializer = null)

Parameters

httpClient HttpClient

The HttpClient class to use.

logger ILogger

Optional logger instance for logging diagnostic information. If null, a NullLogger will be used.

serializer IIronLedgerSerializer

Optional serializer instance for serializing and deserializing API data. If null, the internal serializer will be used.

Returns

IIronLedgerClient

CreateAssetAsync(AssetId, CancellationToken)

Asynchronously creates a new asset with the specified identifier.

Task<IronLedgerResponse<string>> CreateAssetAsync(AssetId assetId, CancellationToken cancellationToken = default)

Parameters

assetId AssetId

The unique identifier for the asset to be created. Cannot be null.

cancellationToken CancellationToken

A token to monitor for cancellation requests.

Returns

Task<IronLedgerResponse<string>>

A task that represents the asynchronous operation. The task result contains an IronLedgerResponse with the identifier of the newly created asset.

GetAssetAsync(string, CancellationToken)

Asynchronously retrieves the asset record associated with the specified asset identifier.

Task<IronLedgerResponse<AssetRecord>> GetAssetAsync(string assetIdString, CancellationToken cancellationToken = default)

Parameters

assetIdString string

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

cancellationToken CancellationToken

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

Returns

Task<IronLedgerResponse<AssetRecord>>

A task that represents the asynchronous operation. The task result contains an IronLedgerResponse object with the asset record if found; otherwise, the response indicates the error or not found status.

GetAssetAsync(AssetId, CancellationToken)

Retrieves the asset record associated with the specified asset identifier asynchronously.

Task<IronLedgerResponse<AssetRecord>> GetAssetAsync(AssetId assetId, CancellationToken cancellationToken = default)

Parameters

assetId AssetId

The identifier of the asset to retrieve. Must not be null.

cancellationToken CancellationToken

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

Returns

Task<IronLedgerResponse<AssetRecord>>

A task that represents the asynchronous operation. The task result contains an IronLedgerResponse with the asset record if found.

GetAssetIdsAsync(CancellationToken)

Asynchronously retrieves a list of asset identifiers associated with the specified asset.

Task<IronLedgerResponse<List<string>>> GetAssetIdsAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

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

Returns

Task<IronLedgerResponse<List<string>>>

A task that represents the asynchronous operation. The task result contains an IronLedgerResponse with a list of asset IDs. The list will be empty if no assets are found.

GetComponentsAsync(string, CancellationToken)

Asynchronously retrieves the components associated with the specified asset.

Task<IronLedgerResponse<SystemComponentData>> GetComponentsAsync(string assetIdString, CancellationToken cancellationToken = default)

Parameters

assetIdString 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<IronLedgerResponse<SystemComponentData>>

A task that represents the asynchronous operation. The task result contains an IronLedgerResponse with the components returned as SystemComponentData.

GetComponentsAsync(AssetId, CancellationToken)

Asynchronously retrieves the components associated with the specified asset.

Task<IronLedgerResponse<SystemComponentData>> GetComponentsAsync(AssetId assetId, CancellationToken cancellationToken = default)

Parameters

assetId AssetId

The identifier of the asset for which to retrieve components.

cancellationToken CancellationToken

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

Returns

Task<IronLedgerResponse<SystemComponentData>>

A task that represents the asynchronous operation. The task result contains an IronLedgerResponse with the components returned as SystemComponentData.

GetNotesAsync(string, CancellationToken)

Asynchronously retrieves the notes associated with the specified asset.

Task<IronLedgerResponse<string>> GetNotesAsync(string assetIdString, CancellationToken cancellationToken = default)

Parameters

assetIdString 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<IronLedgerResponse<string>>

A task that represents the asynchronous operation. The task result contains an IronLedgerResponse with the notes as a string. If no notes are found, the response may contain an empty string.

GetNotesAsync(AssetId, CancellationToken)

Asynchronously retrieves the notes associated with the specified asset.

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

Parameters

assetId AssetId

The identifier of the asset for which to retrieve notes.

cancellationToken CancellationToken

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

Returns

Task<IronLedgerResponse<string>>

A task that represents the asynchronous operation. The task result contains an IronLedgerResponse with the notes for the specified asset as a string.

GetStatusAsync(CancellationToken)

Retrieves service status from the API.

Task<IronLedgerResponse<string>> GetStatusAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

Task<IronLedgerResponse<string>>

An IronLedgerResponse<T> containing the service status.

SetComponentsAsync(string, SystemComponentData, CancellationToken)

Asynchronously sets the components for the specified asset.

Task<IronLedgerResponse<string>> SetComponentsAsync(string assetIdString, SystemComponentData components, CancellationToken cancellationToken = default)

Parameters

assetIdString string

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

components SystemComponentData

The components to associate with the asset.

cancellationToken CancellationToken

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

Returns

Task<IronLedgerResponse<string>>

A task that represents the asynchronous operation. The task result contains an IronLedgerResponse with the string identifier of the updated asset.

SetComponentsAsync(AssetId, SystemComponentData, CancellationToken)

Asynchronously sets the components for the specified asset.

Task<IronLedgerResponse<string>> SetComponentsAsync(AssetId assetId, SystemComponentData components, CancellationToken cancellationToken = default)

Parameters

assetId AssetId

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

components SystemComponentData

The notes to associate with the asset.

cancellationToken CancellationToken

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

Returns

Task<IronLedgerResponse<string>>

A task that represents the asynchronous operation. The task result contains an IronLedgerResponse with the string identifier of the updated asset.

SetNotesAsync(string, string, CancellationToken)

Asynchronously sets the notes for the specified asset.

Task<IronLedgerResponse<string>> SetNotesAsync(string assetIdString, string notes, CancellationToken cancellationToken = default)

Parameters

assetIdString string

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

notes string

The notes to associate with the asset. May be an empty string to clear existing notes.

cancellationToken CancellationToken

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

Returns

Task<IronLedgerResponse<string>>

A task that represents the asynchronous operation. The task result contains an IronLedgerResponse with the string identifier of the updated asset.

SetNotesAsync(AssetId, string, CancellationToken)

Asynchronously sets the notes for the specified asset.

Task<IronLedgerResponse<string>> SetNotesAsync(AssetId assetId, string notes, CancellationToken cancellationToken = default)

Parameters

assetId AssetId

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

notes string

The notes to associate with the asset. May be an empty string to clear existing notes.

cancellationToken CancellationToken

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

Returns

Task<IronLedgerResponse<string>>

A task that represents the asynchronous operation. The task result contains an IronLedgerResponse with the string identifier of the updated asset.