Share via


BlocklistClient.GetTextBlocklistItems Method

Definition

Overloads

GetTextBlocklistItems(String, Nullable<Int32>, Nullable<Int32>, Nullable<Int32>, RequestContext)

[Protocol Method] Get All BlocklistItems By blocklistName

GetTextBlocklistItems(String, Nullable<Int32>, Nullable<Int32>, Nullable<Int32>, CancellationToken)

Get All BlocklistItems By blocklistName.

GetTextBlocklistItems(String, Nullable<Int32>, Nullable<Int32>, Nullable<Int32>, RequestContext)

Source:
BlocklistClient.cs

[Protocol Method] Get All BlocklistItems By blocklistName

public virtual Azure.Pageable<BinaryData> GetTextBlocklistItems (string name, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context);
abstract member GetTextBlocklistItems : string * Nullable<int> * Nullable<int> * Nullable<int> * Azure.RequestContext -> Azure.Pageable<BinaryData>
override this.GetTextBlocklistItems : string * Nullable<int> * Nullable<int> * Nullable<int> * Azure.RequestContext -> Azure.Pageable<BinaryData>
Public Overridable Function GetTextBlocklistItems (name As String, maxCount As Nullable(Of Integer), skip As Nullable(Of Integer), maxpagesize As Nullable(Of Integer), context As RequestContext) As Pageable(Of BinaryData)

Parameters

name
String

Text blocklist name.

maxCount
Nullable<Int32>

The number of result items to return.

skip
Nullable<Int32>

The number of result items to skip.

maxpagesize
Nullable<Int32>

The maximum number of result items per page.

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

name is null.

name is an empty string, and was expected to be non-empty.

Service returned a non-success status code.

Examples

This sample shows how to call GetTextBlocklistItems 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.GetTextBlocklistItems("<Name>", null, null, null, null))
{
    JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
    Console.WriteLine(result.GetProperty("blocklistItemId").ToString());
    Console.WriteLine(result.GetProperty("text").ToString());
}

This sample shows how to call GetTextBlocklistItems 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.GetTextBlocklistItems("<Name>", 1234, 1234, 1234, null))
{
    JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
    Console.WriteLine(result.GetProperty("blocklistItemId").ToString());
    Console.WriteLine(result.GetProperty("description").ToString());
    Console.WriteLine(result.GetProperty("text").ToString());
}

Applies to

GetTextBlocklistItems(String, Nullable<Int32>, Nullable<Int32>, Nullable<Int32>, CancellationToken)

Source:
BlocklistClient.cs

Get All BlocklistItems By blocklistName.

public virtual Azure.Pageable<Azure.AI.ContentSafety.TextBlocklistItem> GetTextBlocklistItems (string name, int? maxCount = default, int? skip = default, int? maxpagesize = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetTextBlocklistItems : string * Nullable<int> * Nullable<int> * Nullable<int> * System.Threading.CancellationToken -> Azure.Pageable<Azure.AI.ContentSafety.TextBlocklistItem>
override this.GetTextBlocklistItems : string * Nullable<int> * Nullable<int> * Nullable<int> * System.Threading.CancellationToken -> Azure.Pageable<Azure.AI.ContentSafety.TextBlocklistItem>
Public Overridable Function GetTextBlocklistItems (name As String, Optional maxCount As Nullable(Of Integer) = Nothing, Optional skip As Nullable(Of Integer) = Nothing, Optional maxpagesize As Nullable(Of Integer) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Pageable(Of TextBlocklistItem)

Parameters

name
String

Text blocklist name.

maxCount
Nullable<Int32>

The number of result items to return.

skip
Nullable<Int32>

The number of result items to skip.

maxpagesize
Nullable<Int32>

The maximum number of result items per page.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

name is null.

name is an empty string, and was expected to be non-empty.

Examples

This sample shows how to call GetTextBlocklistItems.

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

foreach (TextBlocklistItem item in client.GetTextBlocklistItems("<Name>"))
{
}

This sample shows how to call GetTextBlocklistItems with all parameters.

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

foreach (TextBlocklistItem item in client.GetTextBlocklistItems("<Name>", maxCount: 1234, skip: 1234, maxpagesize: 1234))
{
}

Remarks

Get all blocklistItems in a text blocklist.

Applies to