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
assetIdstringThe unique identifier of the asset to retrieve, or null to return all asset identifiers.
cancellationTokenCancellationTokenThe 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
assetIdstringThe unique identifier of the asset for which to retrieve components. Cannot be null or empty.
cancellationTokenCancellationTokenA 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
assetIdstringThe unique identifier of the asset for which to retrieve notes. Cannot be null or empty.
cancellationTokenCancellationTokenA 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
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
IngestAssetAsync(Stream, CancellationToken)
Ingests an asset from the provided request body stream.
Task<IResult> IngestAssetAsync(Stream body, CancellationToken cancellationToken = default)
Parameters
bodyStreamThe request body stream containing the serialized asset payload.
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
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
assetIdstringThe unique identifier of the asset whose components are to be updated. Cannot be null or empty.
bodyStreamA stream containing the component data to update. The stream must be readable and positioned at the start of the data.
cancellationTokenCancellationTokenA 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
assetIdstringThe unique identifier of the asset whose notes are to be updated. Cannot be null or empty.
bodyStreamA 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.
cancellationTokenCancellationTokenA token to monitor for cancellation requests. The default value is None.