ContentSafetyClient.GetTextBlocklists Method

Definition

Overloads

GetTextBlocklists(RequestContext)

[Protocol Method] Get All Text Blocklists

GetTextBlocklists(CancellationToken)

Get All Text Blocklists.

GetTextBlocklists(RequestContext)

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

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

Applies to

GetTextBlocklists(CancellationToken)

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

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

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

Remarks

Get all text blocklists details.

Applies to