ContentSafetyClient.GetTextBlocklistItemsAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
GetTextBlocklistItemsAsync(String, Nullable<Int32>, Nullable<Int32>, Nullable<Int32>, RequestContext) |
[Protocol Method] Get All BlockItems By blocklistName
|
GetTextBlocklistItemsAsync(String, Nullable<Int32>, Nullable<Int32>, Nullable<Int32>, CancellationToken) |
Get All BlockItems By blocklistName. |
GetTextBlocklistItemsAsync(String, Nullable<Int32>, Nullable<Int32>, Nullable<Int32>, RequestContext)
- Source:
- ContentSafetyClient.cs
[Protocol Method] Get All BlockItems By blocklistName
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
- Please try the simpler GetTextBlocklistItemsAsync(String, Nullable<Int32>, Nullable<Int32>, Nullable<Int32>, CancellationToken) convenience overload with strongly typed models first.
public virtual Azure.AsyncPageable<BinaryData> GetTextBlocklistItemsAsync (string blocklistName, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context);
abstract member GetTextBlocklistItemsAsync : string * Nullable<int> * Nullable<int> * Nullable<int> * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
override this.GetTextBlocklistItemsAsync : string * Nullable<int> * Nullable<int> * Nullable<int> * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
Public Overridable Function GetTextBlocklistItemsAsync (blocklistName As String, maxCount As Nullable(Of Integer), skip As Nullable(Of Integer), maxpagesize As Nullable(Of Integer), context As RequestContext) As AsyncPageable(Of BinaryData)
Parameters
- blocklistName
- String
Text blocklist name.
- 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
blocklistName
is null.
blocklistName
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 GetTextBlocklistItemsAsync 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.GetTextBlocklistItemsAsync("<blocklistName>", 1234, 1234, 1234, new RequestContext()))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("blockItemId").ToString());
Console.WriteLine(result.GetProperty("description").ToString());
Console.WriteLine(result.GetProperty("text").ToString());
}
Applies to
GetTextBlocklistItemsAsync(String, Nullable<Int32>, Nullable<Int32>, Nullable<Int32>, CancellationToken)
- Source:
- ContentSafetyClient.cs
Get All BlockItems By blocklistName.
public virtual Azure.AsyncPageable<Azure.AI.ContentSafety.TextBlockItem> GetTextBlocklistItemsAsync (string blocklistName, int? maxCount = default, int? skip = default, int? maxpagesize = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetTextBlocklistItemsAsync : string * Nullable<int> * Nullable<int> * Nullable<int> * System.Threading.CancellationToken -> Azure.AsyncPageable<Azure.AI.ContentSafety.TextBlockItem>
override this.GetTextBlocklistItemsAsync : string * Nullable<int> * Nullable<int> * Nullable<int> * System.Threading.CancellationToken -> Azure.AsyncPageable<Azure.AI.ContentSafety.TextBlockItem>
Public Overridable Function GetTextBlocklistItemsAsync (blocklistName 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 AsyncPageable(Of TextBlockItem)
Parameters
- blocklistName
- String
Text blocklist name.
- cancellationToken
- CancellationToken
The cancellation token to use.
Returns
Exceptions
blocklistName
is null.
blocklistName
is an empty string, and was expected to be non-empty.
Examples
This sample shows how to call GetTextBlocklistItemsAsync with required parameters.
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.GetTextBlocklistItemsAsync("<blocklistName>", 1234, 1234, 1234))
{
}
Remarks
Get all blockItems in a text blocklist.
Applies to
Azure SDK for .NET