Class BlocklistAsyncClient

java.lang.Object
com.azure.ai.contentsafety.BlocklistAsyncClient

public final class BlocklistAsyncClient extends Object
Initializes a new instance of the asynchronous BlocklistClient type.
  • Method Details

    • addOrUpdateBlocklistItemsWithResponse

      public Mono<com.azure.core.http.rest.Response<com.azure.core.util.BinaryData>> addOrUpdateBlocklistItemsWithResponse(String name, com.azure.core.util.BinaryData options, com.azure.core.http.rest.RequestOptions requestOptions)
      Add or update BlocklistItems To Text Blocklist Add or update blocklistItems to a text blocklist. You can add or update at most 100 blocklistItems in one request.

      Request Body Schema

      
       {
           blocklistItems (Required): [
                (Required){
                   blocklistItemId: String (Required)
                   description: String (Optional)
                   text: String (Required)
               }
           ]
       }
       

      Response Body Schema

      
       {
           blocklistItems (Required): [
                (Required){
                   blocklistItemId: String (Required)
                   description: String (Optional)
                   text: String (Required)
               }
           ]
       }
       
      Parameters:
      name - Text blocklist name.
      options - Options for adding or updating blocklist items.
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      the response of adding blocklistItems to the text blocklist along with Response on successful completion of Mono.
      Throws:
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.
    • createOrUpdateTextBlocklistWithResponse

      public Mono<com.azure.core.http.rest.Response<com.azure.core.util.BinaryData>> createOrUpdateTextBlocklistWithResponse(String name, com.azure.core.util.BinaryData options, com.azure.core.http.rest.RequestOptions requestOptions)
      Create Or Update Text Blocklist Updates a text blocklist. If the blocklistName does not exist, a new blocklist will be created.

      Request Body Schema

      
       {
           blocklistName: String (Required)
           description: String (Optional)
       }
       

      Response Body Schema

      
       {
           blocklistName: String (Required)
           description: String (Optional)
       }
       
      Parameters:
      name - Text blocklist name.
      options - The resource instance.
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      text Blocklist along with Response on successful completion of Mono.
      Throws:
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.
    • deleteTextBlocklistWithResponse

      public Mono<com.azure.core.http.rest.Response<Void>> deleteTextBlocklistWithResponse(String name, com.azure.core.http.rest.RequestOptions requestOptions)
      Delete Text Blocklist By blocklistName Deletes a text blocklist.
      Parameters:
      name - Text blocklist name.
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      the Response on successful completion of Mono.
      Throws:
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.
    • getTextBlocklistWithResponse

      public Mono<com.azure.core.http.rest.Response<com.azure.core.util.BinaryData>> getTextBlocklistWithResponse(String name, com.azure.core.http.rest.RequestOptions requestOptions)
      Get Text Blocklist By blocklistName Returns text blocklist details.

      Response Body Schema

      
       {
           blocklistName: String (Required)
           description: String (Optional)
       }
       
      Parameters:
      name - Text blocklist name.
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      text Blocklist along with Response on successful completion of Mono.
      Throws:
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.
    • getTextBlocklistItemWithResponse

      public Mono<com.azure.core.http.rest.Response<com.azure.core.util.BinaryData>> getTextBlocklistItemWithResponse(String name, String blocklistItemId, com.azure.core.http.rest.RequestOptions requestOptions)
      Get BlocklistItem By blocklistName And blocklistItemId Get blocklistItem by blocklistName and blocklistItemId from a text blocklist.

      Response Body Schema

      
       {
           blocklistItemId: String (Required)
           description: String (Optional)
           text: String (Required)
       }
       
      Parameters:
      name - Text blocklist name.
      blocklistItemId - The service will generate a BlocklistItemId, which will be a UUID.
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      blocklistItem by blocklistName and blocklistItemId from a text blocklist along with Response on successful completion of Mono.
      Throws:
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.
    • listTextBlocklistItems

      public com.azure.core.http.rest.PagedFlux<com.azure.core.util.BinaryData> listTextBlocklistItems(String name, com.azure.core.http.rest.RequestOptions requestOptions)
      Get All BlocklistItems By blocklistName Get all blocklistItems in a text blocklist.

      Query Parameters

      Query Parameters
      Name Type Required Description
      top Integer No The number of result items to return.
      skip Integer No The number of result items to skip.
      maxpagesize Integer No The maximum number of result items per page.
      You can add these to a request with RequestOptions.addQueryParam(java.lang.String, java.lang.String)

      Response Body Schema

      
       {
           blocklistItemId: String (Required)
           description: String (Optional)
           text: String (Required)
       }
       
      Parameters:
      name - Text blocklist name.
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      all blocklistItems in a text blocklist as paginated response with PagedFlux.
      Throws:
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.
    • listTextBlocklists

      public com.azure.core.http.rest.PagedFlux<com.azure.core.util.BinaryData> listTextBlocklists(com.azure.core.http.rest.RequestOptions requestOptions)
      Get All Text Blocklists Get all text blocklists details.

      Response Body Schema

      
       {
           blocklistName: String (Required)
           description: String (Optional)
       }
       
      Parameters:
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      all text blocklists details as paginated response with PagedFlux.
      Throws:
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.
    • removeBlocklistItemsWithResponse

      public Mono<com.azure.core.http.rest.Response<Void>> removeBlocklistItemsWithResponse(String name, com.azure.core.util.BinaryData options, com.azure.core.http.rest.RequestOptions requestOptions)
      Remove BlocklistItems From Text Blocklist Remove blocklistItems from a text blocklist. You can remove at most 100 BlocklistItems in one request.

      Request Body Schema

      
       {
           blocklistItemIds (Required): [
               String (Required)
           ]
       }
       
      Parameters:
      name - Text blocklist name.
      options - Options for removing blocklist items.
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      the Response on successful completion of Mono.
      Throws:
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.
    • addOrUpdateBlocklistItems

      public Mono<AddOrUpdateTextBlocklistItemsResult> addOrUpdateBlocklistItems(String name, AddOrUpdateTextBlocklistItemsOptions options)
      Add or update BlocklistItems To Text Blocklist Add or update blocklistItems to a text blocklist. You can add or update at most 100 blocklistItems in one request.
      Parameters:
      name - Text blocklist name.
      options - Options for adding or updating blocklist items.
      Returns:
      the response of adding blocklistItems to the text blocklist on successful completion of Mono.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • deleteTextBlocklist

      public Mono<Void> deleteTextBlocklist(String name)
      Delete Text Blocklist By blocklistName Deletes a text blocklist.
      Parameters:
      name - Text blocklist name.
      Returns:
      A Mono that completes when a successful response is received.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getTextBlocklist

      public Mono<TextBlocklist> getTextBlocklist(String name)
      Get Text Blocklist By blocklistName Returns text blocklist details.
      Parameters:
      name - Text blocklist name.
      Returns:
      text Blocklist on successful completion of Mono.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getTextBlocklistItem

      public Mono<TextBlocklistItem> getTextBlocklistItem(String name, String blocklistItemId)
      Get BlocklistItem By blocklistName And blocklistItemId Get blocklistItem by blocklistName and blocklistItemId from a text blocklist.
      Parameters:
      name - Text blocklist name.
      blocklistItemId - The service will generate a BlocklistItemId, which will be a UUID.
      Returns:
      blocklistItem by blocklistName and blocklistItemId from a text blocklist on successful completion of Mono.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • listTextBlocklistItems

      public com.azure.core.http.rest.PagedFlux<TextBlocklistItem> listTextBlocklistItems(String name, Integer top, Integer skip)
      Get All BlocklistItems By blocklistName Get all blocklistItems in a text blocklist.
      Parameters:
      name - Text blocklist name.
      top - The number of result items to return.
      skip - The number of result items to skip.
      Returns:
      all blocklistItems in a text blocklist as paginated response with PagedFlux.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • listTextBlocklistItems

      public com.azure.core.http.rest.PagedFlux<TextBlocklistItem> listTextBlocklistItems(String name)
      Get All BlocklistItems By blocklistName Get all blocklistItems in a text blocklist.
      Parameters:
      name - Text blocklist name.
      Returns:
      all blocklistItems in a text blocklist as paginated response with PagedFlux.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • listTextBlocklists

      public com.azure.core.http.rest.PagedFlux<TextBlocklist> listTextBlocklists()
      Get All Text Blocklists Get all text blocklists details.
      Returns:
      all text blocklists details as paginated response with PagedFlux.
      Throws:
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • removeBlocklistItems

      public Mono<Void> removeBlocklistItems(String name, RemoveTextBlocklistItemsOptions options)
      Remove BlocklistItems From Text Blocklist Remove blocklistItems from a text blocklist. You can remove at most 100 BlocklistItems in one request.
      Parameters:
      name - Text blocklist name.
      options - Options for removing blocklist items.
      Returns:
      A Mono that completes when a successful response is received.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.