Share via


BlocklistClient.GetTextBlocklistsAsync Method

Definition

Overloads

GetTextBlocklistsAsync(RequestContext)

[Protocol Method] Get All Text Blocklists

GetTextBlocklistsAsync(CancellationToken)

Get All Text Blocklists.

GetTextBlocklistsAsync(RequestContext)

Source:
BlocklistClient.cs

[Protocol Method] Get All Text Blocklists

public virtual Azure.AsyncPageable<BinaryData> GetTextBlocklistsAsync (Azure.RequestContext context);
abstract member GetTextBlocklistsAsync : Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
override this.GetTextBlocklistsAsync : Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
Public Overridable Function GetTextBlocklistsAsync (context As RequestContext) As AsyncPageable(Of BinaryData)

Parameters

context
RequestContext

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

Returns

The AsyncPageable<T> from the service containing a list of BinaryData objects. Details of the body schema for each item in the collection are in the Remarks section below.

Exceptions

Service returned a non-success status code.

Examples

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

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

await foreach (BinaryData item in client.GetTextBlocklistsAsync(null))
{
    JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
    Console.WriteLine(result.GetProperty("blocklistName").ToString());
}

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

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

await foreach (BinaryData item in client.GetTextBlocklistsAsync(null))
{
    JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
    Console.WriteLine(result.GetProperty("blocklistName").ToString());
    Console.WriteLine(result.GetProperty("description").ToString());
}

Applies to

GetTextBlocklistsAsync(CancellationToken)

Source:
BlocklistClient.cs

Get All Text Blocklists.

public virtual Azure.AsyncPageable<Azure.AI.ContentSafety.TextBlocklist> GetTextBlocklistsAsync (System.Threading.CancellationToken cancellationToken = default);
abstract member GetTextBlocklistsAsync : System.Threading.CancellationToken -> Azure.AsyncPageable<Azure.AI.ContentSafety.TextBlocklist>
override this.GetTextBlocklistsAsync : System.Threading.CancellationToken -> Azure.AsyncPageable<Azure.AI.ContentSafety.TextBlocklist>
Public Overridable Function GetTextBlocklistsAsync (Optional cancellationToken As CancellationToken = Nothing) As AsyncPageable(Of TextBlocklist)

Parameters

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Examples

This sample shows how to call GetTextBlocklistsAsync.

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

await foreach (TextBlocklist item in client.GetTextBlocklistsAsync())
{
}

This sample shows how to call GetTextBlocklistsAsync with all parameters.

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

await foreach (TextBlocklist item in client.GetTextBlocklistsAsync())
{
}

Remarks

Get all text blocklists details.

Applies to