Interface ICommit
This interface holds information about a commit and provides access to committed artifacts.
Namespace: Unity.Cloud.Storage
Syntax
public interface ICommit
Properties
Comment
Gets the comment added when the dataset version was committed.
Declaration
string Comment { get; }
Property Value
Type | Description |
---|---|
String |
CommittedOn
Gets the UTC date and time when the dataset version was committed.
Declaration
DateTime CommittedOn { get; }
Property Value
Type | Description |
---|---|
DateTime |
VersionNumber
Gets the incremental number of the dataset version. The bigger the number, the later the version.
Declaration
int VersionNumber { get; }
Property Value
Type | Description |
---|---|
Int32 |
Methods
GetArtifactsCountAsync(CancellationToken)
Asynchronously requests the amount of committed artifacts in the dataset version.
Declaration
Task<int> GetArtifactsCountAsync(CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | An optional cancellation token. |
Returns
Type | Description |
---|---|
Task<Int32> |
Exceptions
Type | Condition |
---|---|
HttpRequestException | Thrown when the request fails to complete. See the returned StatusCode for more details. |
ListArtifactsAsync(Range, CancellationToken)
Requests an asynchronous list of IArtifact from the dataset version.
Declaration
IAsyncEnumerable<IArtifact> ListArtifactsAsync(Range range, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
Range | range | A range of artifacts to request. For example, Range.All returns all artifacts in the version while Range(0,10) returns the first 10 that exist. |
CancellationToken | cancellationToken | An optional cancellation token. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<IArtifact> | Returns an asynchronous collection of IArtifact. |
Remarks
If the requested range cannot be served due to the existing amount of items, the results will be clamped. For example, if the dataset version contains 5 artifacts then Range(0,10) will return only 5 existing items and Range(10, 100) will return an empty collection.
Exceptions
Type | Condition |
---|---|
HttpRequestException | Thrown when the request fails to complete. See the returned StatusCode for more details. |