CodeTransparencyClient.GetParametersAsync Method
Definition
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.
Overloads
GetParametersAsync(CancellationToken) |
Get service parameters. |
GetParametersAsync(RequestContext) |
[Protocol Method] Get service parameters
|
GetParametersAsync(CancellationToken)
- Source:
- CodeTransparencyClient.cs
Get service parameters.
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Security.CodeTransparency.ParametersResult>> GetParametersAsync (System.Threading.CancellationToken cancellationToken = default);
abstract member GetParametersAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Security.CodeTransparency.ParametersResult>>
override this.GetParametersAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Security.CodeTransparency.ParametersResult>>
Public Overridable Function GetParametersAsync (Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of ParametersResult))
Parameters
- cancellationToken
- CancellationToken
The cancellation token to use.
Returns
Examples
This sample shows how to call GetParametersAsync.
Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
CodeTransparencyClient client = new CodeTransparencyClient(endpoint, credential);
Response<ParametersResult> response = await client.GetParametersAsync();
This sample shows how to call GetParametersAsync with all parameters.
Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
CodeTransparencyClient client = new CodeTransparencyClient(endpoint, credential);
Response<ParametersResult> response = await client.GetParametersAsync();
Applies to
GetParametersAsync(RequestContext)
- Source:
- CodeTransparencyClient.cs
[Protocol Method] Get service parameters
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
- Please try the simpler GetParametersAsync(CancellationToken) convenience overload with strongly typed models first.
public virtual System.Threading.Tasks.Task<Azure.Response> GetParametersAsync (Azure.RequestContext context);
abstract member GetParametersAsync : Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetParametersAsync : Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetParametersAsync (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 GetParametersAsync 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.GetParametersAsync(null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("serviceCertificate").ToString());
Console.WriteLine(result.GetProperty("serviceId").ToString());
Console.WriteLine(result.GetProperty("signatureAlgorithm").ToString());
Console.WriteLine(result.GetProperty("treeAlgorithm").ToString());
This sample shows how to call GetParametersAsync 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.GetParametersAsync(null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("serviceCertificate").ToString());
Console.WriteLine(result.GetProperty("serviceId").ToString());
Console.WriteLine(result.GetProperty("signatureAlgorithm").ToString());
Console.WriteLine(result.GetProperty("treeAlgorithm").ToString());
Applies to
Azure SDK for .NET