Share via


CodeTransparencyClient.GetEntryAsync Method

Definition

Overloads

GetEntryAsync(String, Nullable<Boolean>, CancellationToken)

Get Entry with or without receipt embedded in its unprotected header.

GetEntryAsync(String, Nullable<Boolean>, RequestContext)

[Protocol Method] Get Entry with or without receipt embedded in its unprotected header

GetEntryAsync(String, Nullable<Boolean>, CancellationToken)

Source:
CodeTransparencyClient.cs

Get Entry with or without receipt embedded in its unprotected header.

public virtual System.Threading.Tasks.Task<Azure.Response<BinaryData>> GetEntryAsync (string entryId, bool? embedReceipt = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetEntryAsync : string * Nullable<bool> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<BinaryData>>
override this.GetEntryAsync : string * Nullable<bool> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<BinaryData>>
Public Overridable Function GetEntryAsync (entryId As String, Optional embedReceipt As Nullable(Of Boolean) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of BinaryData))

Parameters

entryId
String

ID of the entry to retrieve.

embedReceipt
Nullable<Boolean>

Embed a receipt as part of the response.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

entryId is null.

entryId is an empty string, and was expected to be non-empty.

Examples

This sample shows how to call GetEntryAsync.

Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
CodeTransparencyClient client = new CodeTransparencyClient(endpoint, credential);

Response<BinaryData> response = await client.GetEntryAsync("<entryId>");

This sample shows how to call GetEntryAsync with all parameters.

Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
CodeTransparencyClient client = new CodeTransparencyClient(endpoint, credential);

Response<BinaryData> response = await client.GetEntryAsync("<entryId>", embedReceipt: true);

Applies to

GetEntryAsync(String, Nullable<Boolean>, RequestContext)

Source:
CodeTransparencyClient.cs

[Protocol Method] Get Entry with or without receipt embedded in its unprotected header

public virtual System.Threading.Tasks.Task<Azure.Response> GetEntryAsync (string entryId, bool? embedReceipt, Azure.RequestContext context);
abstract member GetEntryAsync : string * Nullable<bool> * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetEntryAsync : string * Nullable<bool> * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetEntryAsync (entryId As String, embedReceipt As Nullable(Of Boolean), context As RequestContext) As Task(Of Response)

Parameters

entryId
String

ID of the entry to retrieve.

embedReceipt
Nullable<Boolean>

Embed a receipt as part of the response.

context
RequestContext

The request context, which can override default behaviors of the client pipeline on a per-call basis.

Returns

The response returned from the service.

Exceptions

entryId is null.

entryId is an empty string, and was expected to be non-empty.

Service returned a non-success status code.

Examples

This sample shows how to call GetEntryAsync and parse the result.

Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
CodeTransparencyClient client = new CodeTransparencyClient(endpoint, credential);

Response response = await client.GetEntryAsync("<entryId>", null, null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());

This sample shows how to call GetEntryAsync with all parameters and parse the result.

Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
CodeTransparencyClient client = new CodeTransparencyClient(endpoint, credential);

Response response = await client.GetEntryAsync("<entryId>", true, null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());

Applies to