ConfidentialLedgerClient.GetCurrentLedgerEntry(String, RequestContext) Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
[Protocol Method] Gets the current value available in the ledger.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
public virtual Azure.Response GetCurrentLedgerEntry(string collectionId = default, Azure.RequestContext context = default);
abstract member GetCurrentLedgerEntry : string * Azure.RequestContext -> Azure.Response
override this.GetCurrentLedgerEntry : string * Azure.RequestContext -> Azure.Response
Public Overridable Function GetCurrentLedgerEntry (Optional collectionId As String = Nothing, Optional context As RequestContext = Nothing) As Response
- collectionId
- String
The collection id.
- context
- RequestContext
The request context, which can override default behaviors of the client pipeline on a per-call basis.
The response returned from the service.
Service returned a non-success status code.
This sample shows how to call GetCurrentLedgerEntry and parse the result.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential);
Response response = client.GetCurrentLedgerEntry();
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("contents").ToString());
This sample shows how to call GetCurrentLedgerEntry with all parameters and parse the result.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential);
Response response = client.GetCurrentLedgerEntry(collectionId: "<collectionId>");
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("contents").ToString());
Console.WriteLine(result.GetProperty("collectionId").ToString());
Console.WriteLine(result.GetProperty("transactionId").ToString());
A collection id may optionally be specified.
Below is the JSON schema for the response payload.
Response Body:
Schema for LedgerEntry
:
{
contents: string, # Required. Contents of the ledger entry.
collectionId: string, # Optional.
transactionId: string, # Optional. A unique identifier for the state of the ledger. If returned as part of a LedgerEntry, it indicates the state from which the entry was read.
}
Product | Versions |
---|---|
Azure SDK for .NET | Latest, Preview |
Azure SDK for .NET feedback
Azure SDK for .NET is an open source project. Select a link to provide feedback: