ContentSafetyClient.GetTextBlocklist Method

Definition

Overloads

GetTextBlocklist(String, RequestContext)

[Protocol Method] Get Text Blocklist By blocklistName

GetTextBlocklist(String, CancellationToken)

Get Text Blocklist By blocklistName.

GetTextBlocklist(String, RequestContext)

Source:
ContentSafetyClient.cs

[Protocol Method] Get Text Blocklist By blocklistName

public virtual Azure.Response GetTextBlocklist (string blocklistName, Azure.RequestContext context);
abstract member GetTextBlocklist : string * Azure.RequestContext -> Azure.Response
override this.GetTextBlocklist : string * Azure.RequestContext -> Azure.Response
Public Overridable Function GetTextBlocklist (blocklistName As String, context As RequestContext) As Response

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 response returned from the service.

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 GetTextBlocklist 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);

Response response = client.GetTextBlocklist("<blocklistName>", new RequestContext());

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("blocklistName").ToString());
Console.WriteLine(result.GetProperty("description").ToString());

Applies to

GetTextBlocklist(String, CancellationToken)

Source:
ContentSafetyClient.cs

Get Text Blocklist By blocklistName.

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

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 GetTextBlocklist with required parameters.

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

var result = client.GetTextBlocklist("<blocklistName>");

Remarks

Returns text blocklist details.

Applies to