Share via


BlocklistClient.GetTextBlocklists Method

Definition

Overloads

GetTextBlocklists(RequestContext)

[Protocol Method] Get All Text Blocklists

GetTextBlocklists(CancellationToken)

Get All Text Blocklists.

GetTextBlocklists(RequestContext)

Source:
BlocklistClient.cs

[Protocol Method] Get All Text Blocklists

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

Parameters

context
RequestContext

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

Returns

The Pageable<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 GetTextBlocklists and parse the result.

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

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

This sample shows how to call GetTextBlocklists 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);

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

Applies to

GetTextBlocklists(CancellationToken)

Source:
BlocklistClient.cs

Get All Text Blocklists.

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

Parameters

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Examples

This sample shows how to call GetTextBlocklists.

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

foreach (TextBlocklist item in client.GetTextBlocklists())
{
}

This sample shows how to call GetTextBlocklists with all parameters.

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

foreach (TextBlocklist item in client.GetTextBlocklists())
{
}

Remarks

Get all text blocklists details.

Applies to