BlocklistClient.RemoveBlocklistItemsAsync 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
RemoveBlocklistItemsAsync(String, RemoveTextBlocklistItemsOptions, CancellationToken) |
Remove BlocklistItems From Text Blocklist. |
RemoveBlocklistItemsAsync(String, RequestContent, RequestContext) |
[Protocol Method] Remove BlocklistItems From Text Blocklist
|
RemoveBlocklistItemsAsync(String, RemoveTextBlocklistItemsOptions, CancellationToken)
- Source:
- BlocklistClient.cs
Remove BlocklistItems From Text Blocklist.
public virtual System.Threading.Tasks.Task<Azure.Response> RemoveBlocklistItemsAsync (string name, Azure.AI.ContentSafety.RemoveTextBlocklistItemsOptions options, System.Threading.CancellationToken cancellationToken = default);
abstract member RemoveBlocklistItemsAsync : string * Azure.AI.ContentSafety.RemoveTextBlocklistItemsOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response>
override this.RemoveBlocklistItemsAsync : string * Azure.AI.ContentSafety.RemoveTextBlocklistItemsOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function RemoveBlocklistItemsAsync (name As String, options As RemoveTextBlocklistItemsOptions, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response)
Parameters
- name
- String
Text blocklist name.
- options
- RemoveTextBlocklistItemsOptions
Options for removing blocklist items.
- cancellationToken
- CancellationToken
The cancellation token to use.
Returns
Exceptions
name
or options
is null.
name
is an empty string, and was expected to be non-empty.
Examples
This sample shows how to call RemoveBlocklistItemsAsync.
Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
BlocklistClient client = new BlocklistClient(endpoint, credential);
RemoveTextBlocklistItemsOptions options = new RemoveTextBlocklistItemsOptions(new string[] { "<blocklistItemIds>" });
Response response = await client.RemoveBlocklistItemsAsync("<Name>", options);
This sample shows how to call RemoveBlocklistItemsAsync with all parameters.
Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
BlocklistClient client = new BlocklistClient(endpoint, credential);
RemoveTextBlocklistItemsOptions options = new RemoveTextBlocklistItemsOptions(new string[] { "<blocklistItemIds>" });
Response response = await client.RemoveBlocklistItemsAsync("<Name>", options);
Remarks
Remove blocklistItems from a text blocklist. You can remove at most 100 BlocklistItems in one request.
Applies to
RemoveBlocklistItemsAsync(String, RequestContent, RequestContext)
- Source:
- BlocklistClient.cs
[Protocol Method] Remove BlocklistItems From Text Blocklist
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
- Please try the simpler RemoveBlocklistItemsAsync(String, RemoveTextBlocklistItemsOptions, CancellationToken) convenience overload with strongly typed models first.
public virtual System.Threading.Tasks.Task<Azure.Response> RemoveBlocklistItemsAsync (string name, Azure.Core.RequestContent content, Azure.RequestContext context = default);
abstract member RemoveBlocklistItemsAsync : string * Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.RemoveBlocklistItemsAsync : string * Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function RemoveBlocklistItemsAsync (name As String, content As RequestContent, Optional context As RequestContext = Nothing) As Task(Of Response)
Parameters
- name
- 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
name
or content
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 RemoveBlocklistItemsAsync.
Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
BlocklistClient client = new BlocklistClient(endpoint, credential);
using RequestContent content = RequestContent.Create(new
{
blocklistItemIds = new object[]
{
"<blocklistItemIds>"
},
});
Response response = await client.RemoveBlocklistItemsAsync("<Name>", content);
Console.WriteLine(response.Status);
This sample shows how to call RemoveBlocklistItemsAsync with all parameters and request content.
Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
BlocklistClient client = new BlocklistClient(endpoint, credential);
using RequestContent content = RequestContent.Create(new
{
blocklistItemIds = new object[]
{
"<blocklistItemIds>"
},
});
Response response = await client.RemoveBlocklistItemsAsync("<Name>", content);
Console.WriteLine(response.Status);
Applies to
Azure SDK for .NET