ContentSafetyClient.RemoveBlockItems 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
RemoveBlockItems(String, RemoveBlockItemsOptions, CancellationToken) |
Remove BlockItems From Text Blocklist. |
RemoveBlockItems(String, RequestContent, RequestContext) |
[Protocol Method] Remove BlockItems From Text Blocklist
|
RemoveBlockItems(String, RemoveBlockItemsOptions, CancellationToken)
- Source:
- ContentSafetyClient.cs
Remove BlockItems From Text Blocklist.
public virtual Azure.Response RemoveBlockItems (string blocklistName, Azure.AI.ContentSafety.RemoveBlockItemsOptions removeBlockItemsOptions, System.Threading.CancellationToken cancellationToken = default);
abstract member RemoveBlockItems : string * Azure.AI.ContentSafety.RemoveBlockItemsOptions * System.Threading.CancellationToken -> Azure.Response
override this.RemoveBlockItems : string * Azure.AI.ContentSafety.RemoveBlockItemsOptions * System.Threading.CancellationToken -> Azure.Response
Public Overridable Function RemoveBlockItems (blocklistName As String, removeBlockItemsOptions As RemoveBlockItemsOptions, Optional cancellationToken As CancellationToken = Nothing) As 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 RemoveBlockItems 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 = client.RemoveBlockItems("<blocklistName>", removeBlockItemsOptions);
Remarks
Remove blockItems from a text blocklist. You can remove at most 100 BlockItems in one request.
Applies to
RemoveBlockItems(String, RequestContent, RequestContext)
- Source:
- ContentSafetyClient.cs
[Protocol Method] Remove BlockItems From Text Blocklist
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
- Please try the simpler RemoveBlockItems(String, RemoveBlockItemsOptions, CancellationToken) convenience overload with strongly typed models first.
public virtual Azure.Response RemoveBlockItems (string blocklistName, Azure.Core.RequestContent content, Azure.RequestContext context = default);
abstract member RemoveBlockItems : string * Azure.Core.RequestContent * Azure.RequestContext -> Azure.Response
override this.RemoveBlockItems : string * Azure.Core.RequestContent * Azure.RequestContext -> Azure.Response
Public Overridable Function RemoveBlockItems (blocklistName As String, content As RequestContent, Optional context As RequestContext = Nothing) As 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 RemoveBlockItems 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 = client.RemoveBlockItems("<blocklistName>", RequestContent.Create(data), new RequestContext());
Console.WriteLine(response.Status);
Applies to
Azure SDK for .NET