ContentSafetyClient.GetTextBlocklistsAsync Method

Definition

Overloads

GetTextBlocklistsAsync(RequestContext)

[Protocol Method] Get All Text Blocklists

GetTextBlocklistsAsync(CancellationToken)

Get All Text Blocklists.

GetTextBlocklistsAsync(RequestContext)

Source:
ContentSafetyClient.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 with required parameters and parse the result.

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

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

Applies to

GetTextBlocklistsAsync(CancellationToken)

Source:
ContentSafetyClient.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.

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

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

Remarks

Get all text blocklists details.

Applies to