Share via


CodeTransparencyClient.GetCodeTransparencyConfigAsync Method

Definition

Overloads

GetCodeTransparencyConfigAsync(RequestContext)

[Protocol Method] Get CodeTransparency configuration information.

GetCodeTransparencyConfigAsync(CancellationToken)

Get CodeTransparency configuration information.

GetCodeTransparencyConfigAsync(RequestContext)

Source:
CodeTransparencyClient.cs

[Protocol Method] Get CodeTransparency configuration information.

public virtual System.Threading.Tasks.Task<Azure.Response> GetCodeTransparencyConfigAsync (Azure.RequestContext context);
abstract member GetCodeTransparencyConfigAsync : Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetCodeTransparencyConfigAsync : Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetCodeTransparencyConfigAsync (context As RequestContext) As Task(Of Response)

Parameters

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

Service returned a non-success status code.

Examples

This sample shows how to call GetCodeTransparencyConfigAsync 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.GetCodeTransparencyConfigAsync(null);

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

This sample shows how to call GetCodeTransparencyConfigAsync 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.GetCodeTransparencyConfigAsync(null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("policy").GetProperty("accepted_algorithms")[0].ToString());
Console.WriteLine(result.GetProperty("policy").GetProperty("accepted_did_issuers")[0].ToString());
Console.WriteLine(result.GetProperty("authentication").GetProperty("allow_unauthenticated").ToString());
Console.WriteLine(result.GetProperty("authentication").GetProperty("jwt").GetProperty("required_claims").GetProperty("<key>").ToString());
Console.WriteLine(result.GetProperty("service_identifier").ToString());

Applies to

GetCodeTransparencyConfigAsync(CancellationToken)

Source:
CodeTransparencyClient.cs

Get CodeTransparency configuration information.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Security.CodeTransparency.CodeTransparencyConfiguration>> GetCodeTransparencyConfigAsync (System.Threading.CancellationToken cancellationToken = default);
abstract member GetCodeTransparencyConfigAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Security.CodeTransparency.CodeTransparencyConfiguration>>
override this.GetCodeTransparencyConfigAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Security.CodeTransparency.CodeTransparencyConfiguration>>
Public Overridable Function GetCodeTransparencyConfigAsync (Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of CodeTransparencyConfiguration))

Parameters

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Examples

This sample shows how to call GetCodeTransparencyConfigAsync.

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

Response<CodeTransparencyConfiguration> response = await client.GetCodeTransparencyConfigAsync();

This sample shows how to call GetCodeTransparencyConfigAsync with all parameters.

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

Response<CodeTransparencyConfiguration> response = await client.GetCodeTransparencyConfigAsync();

Applies to