Share via


ContentSafetyClient.RemoveBlockItemsAsync Method

Definition

Overloads

RemoveBlockItemsAsync(String, RemoveBlockItemsOptions, CancellationToken)

Remove BlockItems From Text Blocklist.

RemoveBlockItemsAsync(String, RequestContent, RequestContext)

[Protocol Method] Remove BlockItems From Text Blocklist

RemoveBlockItemsAsync(String, RemoveBlockItemsOptions, CancellationToken)

Source:
ContentSafetyClient.cs

Remove BlockItems From Text Blocklist.

public virtual System.Threading.Tasks.Task<Azure.Response> RemoveBlockItemsAsync (string blocklistName, Azure.AI.ContentSafety.RemoveBlockItemsOptions removeBlockItemsOptions, System.Threading.CancellationToken cancellationToken = default);
abstract member RemoveBlockItemsAsync : string * Azure.AI.ContentSafety.RemoveBlockItemsOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response>
override this.RemoveBlockItemsAsync : string * Azure.AI.ContentSafety.RemoveBlockItemsOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function RemoveBlockItemsAsync (blocklistName As String, removeBlockItemsOptions As RemoveBlockItemsOptions, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response)

Parameters

blocklistName
String

Text blocklist name.

removeBlockItemsOptions
RemoveBlockItemsOptions

The request of removing blockItems from text blocklist.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

blocklistName or removeBlockItemsOptions is null.

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

Examples

This sample shows how to call RemoveBlockItemsAsync with required parameters.

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

var removeBlockItemsOptions = new RemoveBlockItemsOptions(new string[] 
{
    "<null>"
});
var result = await client.RemoveBlockItemsAsync("<blocklistName>", removeBlockItemsOptions);

Remarks

Remove blockItems from a text blocklist. You can remove at most 100 BlockItems in one request.

Applies to

RemoveBlockItemsAsync(String, RequestContent, RequestContext)

Source:
ContentSafetyClient.cs

[Protocol Method] Remove BlockItems From Text Blocklist

public virtual System.Threading.Tasks.Task<Azure.Response> RemoveBlockItemsAsync (string blocklistName, Azure.Core.RequestContent content, Azure.RequestContext context = default);
abstract member RemoveBlockItemsAsync : string * Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.RemoveBlockItemsAsync : string * Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function RemoveBlockItemsAsync (blocklistName As String, content As RequestContent, Optional context As RequestContext = Nothing) As Task(Of Response)

Parameters

blocklistName
String

Text blocklist name.

content
RequestContent

The content to send as the body of the request.

context
RequestContext

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

Returns

The response returned from the service.

Exceptions

blocklistName or content 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 RemoveBlockItemsAsync with required parameters and request content.

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

var data = new {
    blockItemIds = new[] {
        "<String>"
    },
};

Response response = await client.RemoveBlockItemsAsync("<blocklistName>", RequestContent.Create(data), new RequestContext());
Console.WriteLine(response.Status);

Applies to