diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/ContentSafetyAsyncClient.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/ContentSafetyAsyncClient.java
index f8d2ca6abb07..099e48b8acae 100644
--- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/ContentSafetyAsyncClient.java
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/ContentSafetyAsyncClient.java
@@ -5,15 +5,15 @@
package com.azure.ai.contentsafety;
import com.azure.ai.contentsafety.implementation.ContentSafetyClientImpl;
-import com.azure.ai.contentsafety.models.AddBlockItemsOptions;
-import com.azure.ai.contentsafety.models.AddBlockItemsResult;
+import com.azure.ai.contentsafety.models.AddOrUpdateTextBlocklistItemsOptions;
+import com.azure.ai.contentsafety.models.AddOrUpdateTextBlocklistItemsResult;
import com.azure.ai.contentsafety.models.AnalyzeImageOptions;
import com.azure.ai.contentsafety.models.AnalyzeImageResult;
import com.azure.ai.contentsafety.models.AnalyzeTextOptions;
import com.azure.ai.contentsafety.models.AnalyzeTextResult;
-import com.azure.ai.contentsafety.models.RemoveBlockItemsOptions;
-import com.azure.ai.contentsafety.models.TextBlockItem;
+import com.azure.ai.contentsafety.models.RemoveTextBlocklistItemsOptions;
import com.azure.ai.contentsafety.models.TextBlocklist;
+import com.azure.ai.contentsafety.models.TextBlocklistItem;
import com.azure.core.annotation.Generated;
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceClient;
@@ -51,8 +51,8 @@ public final class ContentSafetyAsyncClient {
/**
* Analyze Text
*
- *
A sync API for harmful content analysis for text. Currently, we support four categories: Hate, SelfHarm,
- * Sexual, Violence.
+ *
A synchronous API for the analysis of potentially harmful text content. Currently, it supports four
+ * categories: Hate, SelfHarm, Sexual, and Violence.
*
*
> analyzeTextWithResponse(BinaryData body, Reque
/**
* Analyze Image
*
- * A sync API for harmful content analysis for image. Currently, we support four categories: Hate, SelfHarm,
- * Sexual, Violence.
+ *
A synchronous API for the analysis of potentially harmful image content. Currently, it supports four
+ * categories: Hate, SelfHarm, Sexual, and Violence.
*
*
Request Body Schema
*
@@ -123,6 +121,7 @@ public Mono> analyzeTextWithResponse(BinaryData body, Reque
* categories (Optional): [
* String(Hate/SelfHarm/Sexual/Violence) (Optional)
* ]
+ * outputType: String(FourSeverityLevels) (Optional)
* }
* }
*
@@ -130,23 +129,22 @@ public Mono> analyzeTextWithResponse(BinaryData body, Reque
*
* {@code
* {
- * hateResult (Optional): {
- * category: String(Hate/SelfHarm/Sexual/Violence) (Required)
- * severity: int (Required)
- * }
- * selfHarmResult (Optional): (recursive schema, see selfHarmResult above)
- * sexualResult (Optional): (recursive schema, see sexualResult above)
- * violenceResult (Optional): (recursive schema, see violenceResult above)
+ * categoriesAnalysis (Required): [
+ * (Required){
+ * category: String(Hate/SelfHarm/Sexual/Violence) (Required)
+ * severity: Integer (Optional)
+ * }
+ * ]
* }
* }
*
- * @param body The analysis request of the image.
+ * @param body The image analysis request.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return the analysis response of the image along with {@link Response} on successful completion of {@link Mono}.
+ * @return the image analysis response along with {@link Response} on successful completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
@@ -186,7 +184,7 @@ public Mono> getTextBlocklistWithResponse(
/**
* Create Or Update Text Blocklist
*
- * Updates a text blocklist, if blocklistName does not exist, create a new blocklist.
+ *
Updates a text blocklist. If the blocklistName does not exist, a new blocklist will be created.
*
*
Request Body Schema
*
@@ -271,16 +269,18 @@ public PagedFlux listTextBlocklists(RequestOptions requestOptions) {
}
/**
- * Add BlockItems To Text Blocklist
+ * Add or update BlocklistItems To Text Blocklist
*
- * Add blockItems to a text blocklist. You can add at most 100 BlockItems in one request.
+ *
Add or update blocklistItems to a text blocklist. You can add or update at most 100 blocklistItems in one
+ * request.
*
*
Request Body Schema
*
*
{@code
* {
- * blockItems (Required): [
+ * blocklistItems (Required): [
* (Required){
+ * blocklistItemId: String (Required)
* description: String (Optional)
* text: String (Required)
* }
@@ -292,9 +292,9 @@ public PagedFlux listTextBlocklists(RequestOptions requestOptions) {
*
* {@code
* {
- * value (Optional): [
- * (Optional){
- * blockItemId: String (Required)
+ * blocklistItems (Required): [
+ * (Required){
+ * blocklistItemId: String (Required)
* description: String (Optional)
* text: String (Required)
* }
@@ -303,39 +303,40 @@ public PagedFlux listTextBlocklists(RequestOptions requestOptions) {
* }
*
* @param blocklistName Text blocklist name.
- * @param addBlockItemsOptions The request of adding blockItems to text blocklist.
+ * @param addOrUpdateTextBlocklistItemsOptions The request to add blocklistItems to a text blocklist.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return the response of adding blockItems to text blocklist along with {@link Response} on successful completion
- * of {@link Mono}.
+ * @return the response of adding blocklistItems to the text blocklist along with {@link Response} on successful
+ * completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
- public Mono> addBlockItemsWithResponse(
- String blocklistName, BinaryData addBlockItemsOptions, RequestOptions requestOptions) {
- return this.serviceClient.addBlockItemsWithResponseAsync(blocklistName, addBlockItemsOptions, requestOptions);
+ public Mono> addOrUpdateBlocklistItemsWithResponse(
+ String blocklistName, BinaryData addOrUpdateTextBlocklistItemsOptions, RequestOptions requestOptions) {
+ return this.serviceClient.addOrUpdateBlocklistItemsWithResponseAsync(
+ blocklistName, addOrUpdateTextBlocklistItemsOptions, requestOptions);
}
/**
- * Remove BlockItems From Text Blocklist
+ * Remove BlocklistItems From Text Blocklist
*
- * Remove blockItems from a text blocklist. You can remove at most 100 BlockItems in one request.
+ *
Remove blocklistItems from a text blocklist. You can remove at most 100 BlocklistItems in one request.
*
*
Request Body Schema
*
*
{@code
* {
- * blockItemIds (Required): [
+ * blocklistItemIds (Required): [
* String (Required)
* ]
* }
* }
*
* @param blocklistName Text blocklist name.
- * @param removeBlockItemsOptions The request of removing blockItems from text blocklist.
+ * @param removeTextBlocklistItemsOptions The request to remove blocklistItems from a text blocklist.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
@@ -345,48 +346,48 @@ public Mono> addBlockItemsWithResponse(
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
- public Mono> removeBlockItemsWithResponse(
- String blocklistName, BinaryData removeBlockItemsOptions, RequestOptions requestOptions) {
- return this.serviceClient.removeBlockItemsWithResponseAsync(
- blocklistName, removeBlockItemsOptions, requestOptions);
+ public Mono> removeBlocklistItemsWithResponse(
+ String blocklistName, BinaryData removeTextBlocklistItemsOptions, RequestOptions requestOptions) {
+ return this.serviceClient.removeBlocklistItemsWithResponseAsync(
+ blocklistName, removeTextBlocklistItemsOptions, requestOptions);
}
/**
- * Get BlockItem By blocklistName And blockItemId
+ * Get BlocklistItem By blocklistName And blocklistItemId
*
- * Get blockItem By blockItemId from a text blocklist.
+ *
Get blocklistItem by blocklistName and blocklistItemId from a text blocklist.
*
*
Response Body Schema
*
*
{@code
* {
- * blockItemId: String (Required)
+ * blocklistItemId: String (Required)
* description: String (Optional)
* text: String (Required)
* }
* }
*
* @param blocklistName Text blocklist name.
- * @param blockItemId Block Item Id. It will be uuid.
+ * @param blocklistItemId The service will generate a BlocklistItemId, which will be a UUID.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return blockItem By blockItemId from a text blocklist along with {@link Response} on successful completion of
- * {@link Mono}.
+ * @return blocklistItem by blocklistName and blocklistItemId from a text blocklist along with {@link Response} on
+ * successful completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> getTextBlocklistItemWithResponse(
- String blocklistName, String blockItemId, RequestOptions requestOptions) {
- return this.serviceClient.getTextBlocklistItemWithResponseAsync(blocklistName, blockItemId, requestOptions);
+ String blocklistName, String blocklistItemId, RequestOptions requestOptions) {
+ return this.serviceClient.getTextBlocklistItemWithResponseAsync(blocklistName, blocklistItemId, requestOptions);
}
/**
- * Get All BlockItems By blocklistName
+ * Get All BlocklistItems By blocklistName
*
- * Get all blockItems in a text blocklist.
+ *
Get all blocklistItems in a text blocklist.
*
*
Query Parameters
*
@@ -404,7 +405,7 @@ public Mono> getTextBlocklistItemWithResponse(
*
* {@code
* {
- * blockItemId: String (Required)
+ * blocklistItemId: String (Required)
* description: String (Optional)
* text: String (Required)
* }
@@ -416,7 +417,7 @@ public Mono> getTextBlocklistItemWithResponse(
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return all blockItems in a text blocklist as paginated response with {@link PagedFlux}.
+ * @return all blocklistItems in a text blocklist as paginated response with {@link PagedFlux}.
*/
@Generated
@ServiceMethod(returns = ReturnType.COLLECTION)
@@ -427,17 +428,17 @@ public PagedFlux listTextBlocklistItems(String blocklistName, Reques
/**
* Analyze Text
*
- * A sync API for harmful content analysis for text. Currently, we support four categories: Hate, SelfHarm,
- * Sexual, Violence.
+ *
A synchronous API for the analysis of potentially harmful text content. Currently, it supports four
+ * categories: Hate, SelfHarm, Sexual, and Violence.
*
- * @param body The request of text analysis.
+ * @param body The text analysis request.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the analysis response of the text on successful completion of {@link Mono}.
+ * @return the text analysis response on successful completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
@@ -452,17 +453,17 @@ public Mono analyzeText(AnalyzeTextOptions body) {
/**
* Analyze Image
*
- * A sync API for harmful content analysis for image. Currently, we support four categories: Hate, SelfHarm,
- * Sexual, Violence.
+ *
A synchronous API for the analysis of potentially harmful image content. Currently, it supports four
+ * categories: Hate, SelfHarm, Sexual, and Violence.
*
- * @param body The analysis request of the image.
+ * @param body The image analysis request.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the analysis response of the image on successful completion of {@link Mono}.
+ * @return the image analysis response on successful completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
@@ -563,37 +564,40 @@ public PagedFlux listTextBlocklists() {
}
/**
- * Add BlockItems To Text Blocklist
+ * Add or update BlocklistItems To Text Blocklist
*
- * Add blockItems to a text blocklist. You can add at most 100 BlockItems in one request.
+ *
Add or update blocklistItems to a text blocklist. You can add or update at most 100 blocklistItems in one
+ * request.
*
* @param blocklistName Text blocklist name.
- * @param addBlockItemsOptions The request of adding blockItems to text blocklist.
+ * @param addOrUpdateTextBlocklistItemsOptions The request to add blocklistItems to a text blocklist.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the response of adding blockItems to text blocklist on successful completion of {@link Mono}.
+ * @return the response of adding blocklistItems to the text blocklist on successful completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
- public Mono addBlockItems(String blocklistName, AddBlockItemsOptions addBlockItemsOptions) {
- // Generated convenience method for addBlockItemsWithResponse
+ public Mono addOrUpdateBlocklistItems(
+ String blocklistName, AddOrUpdateTextBlocklistItemsOptions addOrUpdateTextBlocklistItemsOptions) {
+ // Generated convenience method for addOrUpdateBlocklistItemsWithResponse
RequestOptions requestOptions = new RequestOptions();
- return addBlockItemsWithResponse(blocklistName, BinaryData.fromObject(addBlockItemsOptions), requestOptions)
+ return addOrUpdateBlocklistItemsWithResponse(
+ blocklistName, BinaryData.fromObject(addOrUpdateTextBlocklistItemsOptions), requestOptions)
.flatMap(FluxUtil::toMono)
- .map(protocolMethodData -> protocolMethodData.toObject(AddBlockItemsResult.class));
+ .map(protocolMethodData -> protocolMethodData.toObject(AddOrUpdateTextBlocklistItemsResult.class));
}
/**
- * Remove BlockItems From Text Blocklist
+ * Remove BlocklistItems From Text Blocklist
*
- * Remove blockItems from a text blocklist. You can remove at most 100 BlockItems in one request.
+ *
Remove blocklistItems from a text blocklist. You can remove at most 100 BlocklistItems in one request.
*
* @param blocklistName Text blocklist name.
- * @param removeBlockItemsOptions The request of removing blockItems from text blocklist.
+ * @param removeTextBlocklistItemsOptions The request to remove blocklistItems from a text blocklist.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
@@ -604,43 +608,45 @@ public Mono addBlockItems(String blocklistName, AddBlockIte
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
- public Mono removeBlockItems(String blocklistName, RemoveBlockItemsOptions removeBlockItemsOptions) {
- // Generated convenience method for removeBlockItemsWithResponse
+ public Mono removeBlocklistItems(
+ String blocklistName, RemoveTextBlocklistItemsOptions removeTextBlocklistItemsOptions) {
+ // Generated convenience method for removeBlocklistItemsWithResponse
RequestOptions requestOptions = new RequestOptions();
- return removeBlockItemsWithResponse(
- blocklistName, BinaryData.fromObject(removeBlockItemsOptions), requestOptions)
+ return removeBlocklistItemsWithResponse(
+ blocklistName, BinaryData.fromObject(removeTextBlocklistItemsOptions), requestOptions)
.flatMap(FluxUtil::toMono);
}
/**
- * Get BlockItem By blocklistName And blockItemId
+ * Get BlocklistItem By blocklistName And blocklistItemId
*
- * Get blockItem By blockItemId from a text blocklist.
+ *
Get blocklistItem by blocklistName and blocklistItemId from a text blocklist.
*
* @param blocklistName Text blocklist name.
- * @param blockItemId Block Item Id. It will be uuid.
+ * @param blocklistItemId The service will generate a BlocklistItemId, which will be a UUID.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return blockItem By blockItemId from a text blocklist on successful completion of {@link Mono}.
+ * @return blocklistItem by blocklistName and blocklistItemId from a text blocklist on successful completion of
+ * {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
- public Mono getTextBlocklistItem(String blocklistName, String blockItemId) {
+ public Mono getTextBlocklistItem(String blocklistName, String blocklistItemId) {
// Generated convenience method for getTextBlocklistItemWithResponse
RequestOptions requestOptions = new RequestOptions();
- return getTextBlocklistItemWithResponse(blocklistName, blockItemId, requestOptions)
+ return getTextBlocklistItemWithResponse(blocklistName, blocklistItemId, requestOptions)
.flatMap(FluxUtil::toMono)
- .map(protocolMethodData -> protocolMethodData.toObject(TextBlockItem.class));
+ .map(protocolMethodData -> protocolMethodData.toObject(TextBlocklistItem.class));
}
/**
- * Get All BlockItems By blocklistName
+ * Get All BlocklistItems By blocklistName
*
- * Get all blockItems in a text blocklist.
+ *
Get all blocklistItems in a text blocklist.
*
* @param blocklistName Text blocklist name.
* @param top The number of result items to return.
@@ -651,11 +657,11 @@ public Mono getTextBlocklistItem(String blocklistName, String blo
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return all blockItems in a text blocklist as paginated response with {@link PagedFlux}.
+ * @return all blocklistItems in a text blocklist as paginated response with {@link PagedFlux}.
*/
@Generated
@ServiceMethod(returns = ReturnType.COLLECTION)
- public PagedFlux listTextBlocklistItems(String blocklistName, Integer top, Integer skip) {
+ public PagedFlux listTextBlocklistItems(String blocklistName, Integer top, Integer skip) {
// Generated convenience method for listTextBlocklistItems
RequestOptions requestOptions = new RequestOptions();
if (top != null) {
@@ -674,7 +680,7 @@ public PagedFlux listTextBlocklistItems(String blocklistName, Int
: pagedFluxResponse.byPage(continuationToken).take(1);
return flux.map(
pagedResponse ->
- new PagedResponseBase(
+ new PagedResponseBase(
pagedResponse.getRequest(),
pagedResponse.getStatusCode(),
pagedResponse.getHeaders(),
@@ -682,7 +688,7 @@ public PagedFlux listTextBlocklistItems(String blocklistName, Int
.map(
protocolMethodData ->
protocolMethodData.toObject(
- TextBlockItem.class))
+ TextBlocklistItem.class))
.collect(Collectors.toList()),
pagedResponse.getContinuationToken(),
null));
@@ -690,9 +696,9 @@ public PagedFlux listTextBlocklistItems(String blocklistName, Int
}
/**
- * Get All BlockItems By blocklistName
+ * Get All BlocklistItems By blocklistName
*
- * Get all blockItems in a text blocklist.
+ *
Get all blocklistItems in a text blocklist.
*
* @param blocklistName Text blocklist name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -701,11 +707,11 @@ public PagedFlux listTextBlocklistItems(String blocklistName, Int
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return all blockItems in a text blocklist as paginated response with {@link PagedFlux}.
+ * @return all blocklistItems in a text blocklist as paginated response with {@link PagedFlux}.
*/
@Generated
@ServiceMethod(returns = ReturnType.COLLECTION)
- public PagedFlux listTextBlocklistItems(String blocklistName) {
+ public PagedFlux listTextBlocklistItems(String blocklistName) {
// Generated convenience method for listTextBlocklistItems
RequestOptions requestOptions = new RequestOptions();
PagedFlux pagedFluxResponse = listTextBlocklistItems(blocklistName, requestOptions);
@@ -718,7 +724,7 @@ public PagedFlux listTextBlocklistItems(String blocklistName) {
: pagedFluxResponse.byPage(continuationToken).take(1);
return flux.map(
pagedResponse ->
- new PagedResponseBase(
+ new PagedResponseBase(
pagedResponse.getRequest(),
pagedResponse.getStatusCode(),
pagedResponse.getHeaders(),
@@ -726,7 +732,7 @@ public PagedFlux listTextBlocklistItems(String blocklistName) {
.map(
protocolMethodData ->
protocolMethodData.toObject(
- TextBlockItem.class))
+ TextBlocklistItem.class))
.collect(Collectors.toList()),
pagedResponse.getContinuationToken(),
null));
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/ContentSafetyClient.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/ContentSafetyClient.java
index 9b124aecf597..760b199ecc2a 100644
--- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/ContentSafetyClient.java
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/ContentSafetyClient.java
@@ -5,15 +5,15 @@
package com.azure.ai.contentsafety;
import com.azure.ai.contentsafety.implementation.ContentSafetyClientImpl;
-import com.azure.ai.contentsafety.models.AddBlockItemsOptions;
-import com.azure.ai.contentsafety.models.AddBlockItemsResult;
+import com.azure.ai.contentsafety.models.AddOrUpdateTextBlocklistItemsOptions;
+import com.azure.ai.contentsafety.models.AddOrUpdateTextBlocklistItemsResult;
import com.azure.ai.contentsafety.models.AnalyzeImageOptions;
import com.azure.ai.contentsafety.models.AnalyzeImageResult;
import com.azure.ai.contentsafety.models.AnalyzeTextOptions;
import com.azure.ai.contentsafety.models.AnalyzeTextResult;
-import com.azure.ai.contentsafety.models.RemoveBlockItemsOptions;
-import com.azure.ai.contentsafety.models.TextBlockItem;
+import com.azure.ai.contentsafety.models.RemoveTextBlocklistItemsOptions;
import com.azure.ai.contentsafety.models.TextBlocklist;
+import com.azure.ai.contentsafety.models.TextBlocklistItem;
import com.azure.core.annotation.Generated;
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceClient;
@@ -45,8 +45,8 @@ public final class ContentSafetyClient {
/**
* Analyze Text
*
- * A sync API for harmful content analysis for text. Currently, we support four categories: Hate, SelfHarm,
- * Sexual, Violence.
+ *
A synchronous API for the analysis of potentially harmful text content. Currently, it supports four
+ * categories: Hate, SelfHarm, Sexual, and Violence.
*
*
Request Body Schema
*
@@ -59,7 +59,8 @@ public final class ContentSafetyClient {
* blocklistNames (Optional): [
* String (Optional)
* ]
- * breakByBlocklists: Boolean (Optional)
+ * haltOnBlocklistHit: Boolean (Optional)
+ * outputType: String(FourSeverityLevels/EightSeverityLevels) (Optional)
* }
* }
*
@@ -67,32 +68,29 @@ public final class ContentSafetyClient {
*
* {@code
* {
- * blocklistsMatchResults (Optional): [
+ * blocklistsMatch (Optional): [
* (Optional){
* blocklistName: String (Required)
- * blockItemId: String (Required)
- * blockItemText: String (Required)
- * offset: int (Required)
- * length: int (Required)
+ * blocklistItemId: String (Required)
+ * blocklistItemText: String (Required)
+ * }
+ * ]
+ * categoriesAnalysis (Required): [
+ * (Required){
+ * category: String(Hate/SelfHarm/Sexual/Violence) (Required)
+ * severity: Integer (Optional)
* }
* ]
- * hateResult (Optional): {
- * category: String(Hate/SelfHarm/Sexual/Violence) (Required)
- * severity: int (Required)
- * }
- * selfHarmResult (Optional): (recursive schema, see selfHarmResult above)
- * sexualResult (Optional): (recursive schema, see sexualResult above)
- * violenceResult (Optional): (recursive schema, see violenceResult above)
* }
* }
*
- * @param body The request of text analysis.
+ * @param body The text analysis request.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return the analysis response of the text along with {@link Response}.
+ * @return the text analysis response along with {@link Response}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
@@ -103,8 +101,8 @@ public Response analyzeTextWithResponse(BinaryData body, RequestOpti
/**
* Analyze Image
*
- * A sync API for harmful content analysis for image. Currently, we support four categories: Hate, SelfHarm,
- * Sexual, Violence.
+ *
A synchronous API for the analysis of potentially harmful image content. Currently, it supports four
+ * categories: Hate, SelfHarm, Sexual, and Violence.
*
*
Request Body Schema
*
@@ -117,6 +115,7 @@ public Response analyzeTextWithResponse(BinaryData body, RequestOpti
* categories (Optional): [
* String(Hate/SelfHarm/Sexual/Violence) (Optional)
* ]
+ * outputType: String(FourSeverityLevels) (Optional)
* }
* }
*
@@ -124,23 +123,22 @@ public Response analyzeTextWithResponse(BinaryData body, RequestOpti
*
* {@code
* {
- * hateResult (Optional): {
- * category: String(Hate/SelfHarm/Sexual/Violence) (Required)
- * severity: int (Required)
- * }
- * selfHarmResult (Optional): (recursive schema, see selfHarmResult above)
- * sexualResult (Optional): (recursive schema, see sexualResult above)
- * violenceResult (Optional): (recursive schema, see violenceResult above)
+ * categoriesAnalysis (Required): [
+ * (Required){
+ * category: String(Hate/SelfHarm/Sexual/Violence) (Required)
+ * severity: Integer (Optional)
+ * }
+ * ]
* }
* }
*
- * @param body The analysis request of the image.
+ * @param body The image analysis request.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return the analysis response of the image along with {@link Response}.
+ * @return the image analysis response along with {@link Response}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
@@ -179,7 +177,7 @@ public Response getTextBlocklistWithResponse(String blocklistName, R
/**
* Create Or Update Text Blocklist
*
- * Updates a text blocklist, if blocklistName does not exist, create a new blocklist.
+ *
Updates a text blocklist. If the blocklistName does not exist, a new blocklist will be created.
*
*
Request Body Schema
*
@@ -264,16 +262,18 @@ public PagedIterable listTextBlocklists(RequestOptions requestOption
}
/**
- * Add BlockItems To Text Blocklist
+ * Add or update BlocklistItems To Text Blocklist
*
- * Add blockItems to a text blocklist. You can add at most 100 BlockItems in one request.
+ *
Add or update blocklistItems to a text blocklist. You can add or update at most 100 blocklistItems in one
+ * request.
*
*
Request Body Schema
*
*
{@code
* {
- * blockItems (Required): [
+ * blocklistItems (Required): [
* (Required){
+ * blocklistItemId: String (Required)
* description: String (Optional)
* text: String (Required)
* }
@@ -285,9 +285,9 @@ public PagedIterable listTextBlocklists(RequestOptions requestOption
*
* {@code
* {
- * value (Optional): [
- * (Optional){
- * blockItemId: String (Required)
+ * blocklistItems (Required): [
+ * (Required){
+ * blocklistItemId: String (Required)
* description: String (Optional)
* text: String (Required)
* }
@@ -296,38 +296,39 @@ public PagedIterable listTextBlocklists(RequestOptions requestOption
* }
*
* @param blocklistName Text blocklist name.
- * @param addBlockItemsOptions The request of adding blockItems to text blocklist.
+ * @param addOrUpdateTextBlocklistItemsOptions The request to add blocklistItems to a text blocklist.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return the response of adding blockItems to text blocklist along with {@link Response}.
+ * @return the response of adding blocklistItems to the text blocklist along with {@link Response}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
- public Response addBlockItemsWithResponse(
- String blocklistName, BinaryData addBlockItemsOptions, RequestOptions requestOptions) {
- return this.serviceClient.addBlockItemsWithResponse(blocklistName, addBlockItemsOptions, requestOptions);
+ public Response addOrUpdateBlocklistItemsWithResponse(
+ String blocklistName, BinaryData addOrUpdateTextBlocklistItemsOptions, RequestOptions requestOptions) {
+ return this.serviceClient.addOrUpdateBlocklistItemsWithResponse(
+ blocklistName, addOrUpdateTextBlocklistItemsOptions, requestOptions);
}
/**
- * Remove BlockItems From Text Blocklist
+ * Remove BlocklistItems From Text Blocklist
*
- * Remove blockItems from a text blocklist. You can remove at most 100 BlockItems in one request.
+ *
Remove blocklistItems from a text blocklist. You can remove at most 100 BlocklistItems in one request.
*
*
Request Body Schema
*
*
{@code
* {
- * blockItemIds (Required): [
+ * blocklistItemIds (Required): [
* String (Required)
* ]
* }
* }
*
* @param blocklistName Text blocklist name.
- * @param removeBlockItemsOptions The request of removing blockItems from text blocklist.
+ * @param removeTextBlocklistItemsOptions The request to remove blocklistItems from a text blocklist.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
@@ -337,46 +338,47 @@ public Response addBlockItemsWithResponse(
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
- public Response removeBlockItemsWithResponse(
- String blocklistName, BinaryData removeBlockItemsOptions, RequestOptions requestOptions) {
- return this.serviceClient.removeBlockItemsWithResponse(blocklistName, removeBlockItemsOptions, requestOptions);
+ public Response removeBlocklistItemsWithResponse(
+ String blocklistName, BinaryData removeTextBlocklistItemsOptions, RequestOptions requestOptions) {
+ return this.serviceClient.removeBlocklistItemsWithResponse(
+ blocklistName, removeTextBlocklistItemsOptions, requestOptions);
}
/**
- * Get BlockItem By blocklistName And blockItemId
+ * Get BlocklistItem By blocklistName And blocklistItemId
*
- * Get blockItem By blockItemId from a text blocklist.
+ *
Get blocklistItem by blocklistName and blocklistItemId from a text blocklist.
*
*
Response Body Schema
*
*
{@code
* {
- * blockItemId: String (Required)
+ * blocklistItemId: String (Required)
* description: String (Optional)
* text: String (Required)
* }
* }
*
* @param blocklistName Text blocklist name.
- * @param blockItemId Block Item Id. It will be uuid.
+ * @param blocklistItemId The service will generate a BlocklistItemId, which will be a UUID.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return blockItem By blockItemId from a text blocklist along with {@link Response}.
+ * @return blocklistItem by blocklistName and blocklistItemId from a text blocklist along with {@link Response}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getTextBlocklistItemWithResponse(
- String blocklistName, String blockItemId, RequestOptions requestOptions) {
- return this.serviceClient.getTextBlocklistItemWithResponse(blocklistName, blockItemId, requestOptions);
+ String blocklistName, String blocklistItemId, RequestOptions requestOptions) {
+ return this.serviceClient.getTextBlocklistItemWithResponse(blocklistName, blocklistItemId, requestOptions);
}
/**
- * Get All BlockItems By blocklistName
+ * Get All BlocklistItems By blocklistName
*
- * Get all blockItems in a text blocklist.
+ *
Get all blocklistItems in a text blocklist.
*
*
Query Parameters
*
@@ -394,7 +396,7 @@ public Response getTextBlocklistItemWithResponse(
*
* {@code
* {
- * blockItemId: String (Required)
+ * blocklistItemId: String (Required)
* description: String (Optional)
* text: String (Required)
* }
@@ -406,7 +408,7 @@ public Response getTextBlocklistItemWithResponse(
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return all blockItems in a text blocklist as paginated response with {@link PagedIterable}.
+ * @return all blocklistItems in a text blocklist as paginated response with {@link PagedIterable}.
*/
@Generated
@ServiceMethod(returns = ReturnType.COLLECTION)
@@ -417,17 +419,17 @@ public PagedIterable listTextBlocklistItems(String blocklistName, Re
/**
* Analyze Text
*
- * A sync API for harmful content analysis for text. Currently, we support four categories: Hate, SelfHarm,
- * Sexual, Violence.
+ *
A synchronous API for the analysis of potentially harmful text content. Currently, it supports four
+ * categories: Hate, SelfHarm, Sexual, and Violence.
*
- * @param body The request of text analysis.
+ * @param body The text analysis request.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the analysis response of the text.
+ * @return the text analysis response.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
@@ -442,17 +444,17 @@ public AnalyzeTextResult analyzeText(AnalyzeTextOptions body) {
/**
* Analyze Image
*
- *
A sync API for harmful content analysis for image. Currently, we support four categories: Hate, SelfHarm,
- * Sexual, Violence.
+ *
A synchronous API for the analysis of potentially harmful image content. Currently, it supports four
+ * categories: Hate, SelfHarm, Sexual, and Violence.
*
- * @param body The analysis request of the image.
+ * @param body The image analysis request.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the analysis response of the image.
+ * @return the image analysis response.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
@@ -530,37 +532,40 @@ public PagedIterable listTextBlocklists() {
}
/**
- * Add BlockItems To Text Blocklist
+ * Add or update BlocklistItems To Text Blocklist
*
- * Add blockItems to a text blocklist. You can add at most 100 BlockItems in one request.
+ *
Add or update blocklistItems to a text blocklist. You can add or update at most 100 blocklistItems in one
+ * request.
*
* @param blocklistName Text blocklist name.
- * @param addBlockItemsOptions The request of adding blockItems to text blocklist.
+ * @param addOrUpdateTextBlocklistItemsOptions The request to add blocklistItems to a text blocklist.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the response of adding blockItems to text blocklist.
+ * @return the response of adding blocklistItems to the text blocklist.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
- public AddBlockItemsResult addBlockItems(String blocklistName, AddBlockItemsOptions addBlockItemsOptions) {
- // Generated convenience method for addBlockItemsWithResponse
+ public AddOrUpdateTextBlocklistItemsResult addOrUpdateBlocklistItems(
+ String blocklistName, AddOrUpdateTextBlocklistItemsOptions addOrUpdateTextBlocklistItemsOptions) {
+ // Generated convenience method for addOrUpdateBlocklistItemsWithResponse
RequestOptions requestOptions = new RequestOptions();
- return addBlockItemsWithResponse(blocklistName, BinaryData.fromObject(addBlockItemsOptions), requestOptions)
+ return addOrUpdateBlocklistItemsWithResponse(
+ blocklistName, BinaryData.fromObject(addOrUpdateTextBlocklistItemsOptions), requestOptions)
.getValue()
- .toObject(AddBlockItemsResult.class);
+ .toObject(AddOrUpdateTextBlocklistItemsResult.class);
}
/**
- * Remove BlockItems From Text Blocklist
+ * Remove BlocklistItems From Text Blocklist
*
- *
Remove blockItems from a text blocklist. You can remove at most 100 BlockItems in one request.
+ *
Remove blocklistItems from a text blocklist. You can remove at most 100 BlocklistItems in one request.
*
* @param blocklistName Text blocklist name.
- * @param removeBlockItemsOptions The request of removing blockItems from text blocklist.
+ * @param removeTextBlocklistItemsOptions The request to remove blocklistItems from a text blocklist.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
@@ -570,42 +575,44 @@ public AddBlockItemsResult addBlockItems(String blocklistName, AddBlockItemsOpti
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
- public void removeBlockItems(String blocklistName, RemoveBlockItemsOptions removeBlockItemsOptions) {
- // Generated convenience method for removeBlockItemsWithResponse
+ public void removeBlocklistItems(
+ String blocklistName, RemoveTextBlocklistItemsOptions removeTextBlocklistItemsOptions) {
+ // Generated convenience method for removeBlocklistItemsWithResponse
RequestOptions requestOptions = new RequestOptions();
- removeBlockItemsWithResponse(blocklistName, BinaryData.fromObject(removeBlockItemsOptions), requestOptions)
+ removeBlocklistItemsWithResponse(
+ blocklistName, BinaryData.fromObject(removeTextBlocklistItemsOptions), requestOptions)
.getValue();
}
/**
- * Get BlockItem By blocklistName And blockItemId
+ * Get BlocklistItem By blocklistName And blocklistItemId
*
- *
Get blockItem By blockItemId from a text blocklist.
+ *
Get blocklistItem by blocklistName and blocklistItemId from a text blocklist.
*
* @param blocklistName Text blocklist name.
- * @param blockItemId Block Item Id. It will be uuid.
+ * @param blocklistItemId The service will generate a BlocklistItemId, which will be a UUID.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return blockItem By blockItemId from a text blocklist.
+ * @return blocklistItem by blocklistName and blocklistItemId from a text blocklist.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
- public TextBlockItem getTextBlocklistItem(String blocklistName, String blockItemId) {
+ public TextBlocklistItem getTextBlocklistItem(String blocklistName, String blocklistItemId) {
// Generated convenience method for getTextBlocklistItemWithResponse
RequestOptions requestOptions = new RequestOptions();
- return getTextBlocklistItemWithResponse(blocklistName, blockItemId, requestOptions)
+ return getTextBlocklistItemWithResponse(blocklistName, blocklistItemId, requestOptions)
.getValue()
- .toObject(TextBlockItem.class);
+ .toObject(TextBlocklistItem.class);
}
/**
- * Get All BlockItems By blocklistName
+ * Get All BlocklistItems By blocklistName
*
- *
Get all blockItems in a text blocklist.
+ *
Get all blocklistItems in a text blocklist.
*
* @param blocklistName Text blocklist name.
* @param top The number of result items to return.
@@ -616,11 +623,11 @@ public TextBlockItem getTextBlocklistItem(String blocklistName, String blockItem
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return all blockItems in a text blocklist as paginated response with {@link PagedIterable}.
+ * @return all blocklistItems in a text blocklist as paginated response with {@link PagedIterable}.
*/
@Generated
@ServiceMethod(returns = ReturnType.COLLECTION)
- public PagedIterable listTextBlocklistItems(String blocklistName, Integer top, Integer skip) {
+ public PagedIterable listTextBlocklistItems(String blocklistName, Integer top, Integer skip) {
// Generated convenience method for listTextBlocklistItems
RequestOptions requestOptions = new RequestOptions();
if (top != null) {
@@ -631,13 +638,13 @@ public PagedIterable listTextBlocklistItems(String blocklistName,
}
return serviceClient
.listTextBlocklistItems(blocklistName, requestOptions)
- .mapPage(bodyItemValue -> bodyItemValue.toObject(TextBlockItem.class));
+ .mapPage(bodyItemValue -> bodyItemValue.toObject(TextBlocklistItem.class));
}
/**
- * Get All BlockItems By blocklistName
+ * Get All BlocklistItems By blocklistName
*
- * Get all blockItems in a text blocklist.
+ *
Get all blocklistItems in a text blocklist.
*
* @param blocklistName Text blocklist name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -646,15 +653,15 @@ public PagedIterable listTextBlocklistItems(String blocklistName,
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return all blockItems in a text blocklist as paginated response with {@link PagedIterable}.
+ * @return all blocklistItems in a text blocklist as paginated response with {@link PagedIterable}.
*/
@Generated
@ServiceMethod(returns = ReturnType.COLLECTION)
- public PagedIterable listTextBlocklistItems(String blocklistName) {
+ public PagedIterable listTextBlocklistItems(String blocklistName) {
// Generated convenience method for listTextBlocklistItems
RequestOptions requestOptions = new RequestOptions();
return serviceClient
.listTextBlocklistItems(blocklistName, requestOptions)
- .mapPage(bodyItemValue -> bodyItemValue.toObject(TextBlockItem.class));
+ .mapPage(bodyItemValue -> bodyItemValue.toObject(TextBlocklistItem.class));
}
}
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/ContentSafetyClientBuilder.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/ContentSafetyClientBuilder.java
index cd00472d7e55..201055b25b15 100644
--- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/ContentSafetyClientBuilder.java
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/ContentSafetyClientBuilder.java
@@ -11,7 +11,9 @@
import com.azure.core.client.traits.EndpointTrait;
import com.azure.core.client.traits.HttpTrait;
import com.azure.core.client.traits.KeyCredentialTrait;
+import com.azure.core.client.traits.TokenCredentialTrait;
import com.azure.core.credential.KeyCredential;
+import com.azure.core.credential.TokenCredential;
import com.azure.core.http.HttpClient;
import com.azure.core.http.HttpHeaderName;
import com.azure.core.http.HttpHeaders;
@@ -21,6 +23,7 @@
import com.azure.core.http.policy.AddDatePolicy;
import com.azure.core.http.policy.AddHeadersFromContextPolicy;
import com.azure.core.http.policy.AddHeadersPolicy;
+import com.azure.core.http.policy.BearerTokenAuthenticationPolicy;
import com.azure.core.http.policy.HttpLogOptions;
import com.azure.core.http.policy.HttpLoggingPolicy;
import com.azure.core.http.policy.HttpPipelinePolicy;
@@ -46,12 +49,16 @@
public final class ContentSafetyClientBuilder
implements HttpTrait,
ConfigurationTrait,
+ TokenCredentialTrait,
KeyCredentialTrait,
EndpointTrait {
@Generated private static final String SDK_NAME = "name";
@Generated private static final String SDK_VERSION = "version";
+ @Generated
+ private static final String[] DEFAULT_SCOPES = new String[] {"https://cognitiveservices.azure.com/.default"};
+
@Generated
private static final Map PROPERTIES = CoreUtils.getProperties("azure-ai-contentsafety.properties");
@@ -153,6 +160,19 @@ public ContentSafetyClientBuilder configuration(Configuration configuration) {
return this;
}
+ /*
+ * The TokenCredential used for authentication.
+ */
+ @Generated private TokenCredential tokenCredential;
+
+ /** {@inheritDoc}. */
+ @Generated
+ @Override
+ public ContentSafetyClientBuilder credential(TokenCredential tokenCredential) {
+ this.tokenCredential = tokenCredential;
+ return this;
+ }
+
/*
* The KeyCredential used for authentication.
*/
@@ -261,6 +281,9 @@ private HttpPipeline createHttpPipeline() {
if (keyCredential != null) {
policies.add(new KeyCredentialPolicy("Ocp-Apim-Subscription-Key", keyCredential));
}
+ if (tokenCredential != null) {
+ policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES));
+ }
this.pipelinePolicies.stream()
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
.forEach(p -> policies.add(p));
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/ContentSafetyServiceVersion.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/ContentSafetyServiceVersion.java
index de967742593d..7437ce436417 100644
--- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/ContentSafetyServiceVersion.java
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/ContentSafetyServiceVersion.java
@@ -8,8 +8,8 @@
/** Service version of ContentSafetyClient. */
public enum ContentSafetyServiceVersion implements ServiceVersion {
- /** Enum value 2023-04-30-preview. */
- V2023_04_30_PREVIEW("2023-04-30-preview");
+ /** Enum value 2023-10-01. */
+ V2023_10_01("2023-10-01");
private final String version;
@@ -29,6 +29,6 @@ public String getVersion() {
* @return The latest {@link ContentSafetyServiceVersion}.
*/
public static ContentSafetyServiceVersion getLatest() {
- return V2023_04_30_PREVIEW;
+ return V2023_10_01;
}
}
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/implementation/ContentSafetyClientImpl.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/implementation/ContentSafetyClientImpl.java
index 84603c9cf974..361743d32f1d 100644
--- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/implementation/ContentSafetyClientImpl.java
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/implementation/ContentSafetyClientImpl.java
@@ -402,7 +402,7 @@ Response listTextBlocklistsSync(
RequestOptions requestOptions,
Context context);
- @Post("/text/blocklists/{blocklistName}:addBlockItems")
+ @Post("/text/blocklists/{blocklistName}:addOrUpdateBlocklistItems")
@ExpectedResponses({200})
@UnexpectedResponseExceptionType(
value = ClientAuthenticationException.class,
@@ -414,16 +414,16 @@ Response listTextBlocklistsSync(
value = ResourceModifiedException.class,
code = {409})
@UnexpectedResponseExceptionType(HttpResponseException.class)
- Mono> addBlockItems(
+ Mono> addOrUpdateBlocklistItems(
@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion,
@PathParam("blocklistName") String blocklistName,
@HeaderParam("accept") String accept,
- @BodyParam("application/json") BinaryData addBlockItemsOptions,
+ @BodyParam("application/json") BinaryData addOrUpdateTextBlocklistItemsOptions,
RequestOptions requestOptions,
Context context);
- @Post("/text/blocklists/{blocklistName}:addBlockItems")
+ @Post("/text/blocklists/{blocklistName}:addOrUpdateBlocklistItems")
@ExpectedResponses({200})
@UnexpectedResponseExceptionType(
value = ClientAuthenticationException.class,
@@ -435,16 +435,16 @@ Mono> addBlockItems(
value = ResourceModifiedException.class,
code = {409})
@UnexpectedResponseExceptionType(HttpResponseException.class)
- Response addBlockItemsSync(
+ Response addOrUpdateBlocklistItemsSync(
@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion,
@PathParam("blocklistName") String blocklistName,
@HeaderParam("accept") String accept,
- @BodyParam("application/json") BinaryData addBlockItemsOptions,
+ @BodyParam("application/json") BinaryData addOrUpdateTextBlocklistItemsOptions,
RequestOptions requestOptions,
Context context);
- @Post("/text/blocklists/{blocklistName}:removeBlockItems")
+ @Post("/text/blocklists/{blocklistName}:removeBlocklistItems")
@ExpectedResponses({204})
@UnexpectedResponseExceptionType(
value = ClientAuthenticationException.class,
@@ -456,16 +456,16 @@ Response addBlockItemsSync(
value = ResourceModifiedException.class,
code = {409})
@UnexpectedResponseExceptionType(HttpResponseException.class)
- Mono> removeBlockItems(
+ Mono> removeBlocklistItems(
@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion,
@PathParam("blocklistName") String blocklistName,
@HeaderParam("accept") String accept,
- @BodyParam("application/json") BinaryData removeBlockItemsOptions,
+ @BodyParam("application/json") BinaryData removeTextBlocklistItemsOptions,
RequestOptions requestOptions,
Context context);
- @Post("/text/blocklists/{blocklistName}:removeBlockItems")
+ @Post("/text/blocklists/{blocklistName}:removeBlocklistItems")
@ExpectedResponses({204})
@UnexpectedResponseExceptionType(
value = ClientAuthenticationException.class,
@@ -477,16 +477,16 @@ Mono> removeBlockItems(
value = ResourceModifiedException.class,
code = {409})
@UnexpectedResponseExceptionType(HttpResponseException.class)
- Response removeBlockItemsSync(
+ Response removeBlocklistItemsSync(
@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion,
@PathParam("blocklistName") String blocklistName,
@HeaderParam("accept") String accept,
- @BodyParam("application/json") BinaryData removeBlockItemsOptions,
+ @BodyParam("application/json") BinaryData removeTextBlocklistItemsOptions,
RequestOptions requestOptions,
Context context);
- @Get("/text/blocklists/{blocklistName}/blockItems/{blockItemId}")
+ @Get("/text/blocklists/{blocklistName}/blocklistItems/{blocklistItemId}")
@ExpectedResponses({200})
@UnexpectedResponseExceptionType(
value = ClientAuthenticationException.class,
@@ -502,12 +502,12 @@ Mono> getTextBlocklistItem(
@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion,
@PathParam("blocklistName") String blocklistName,
- @PathParam("blockItemId") String blockItemId,
+ @PathParam("blocklistItemId") String blocklistItemId,
@HeaderParam("accept") String accept,
RequestOptions requestOptions,
Context context);
- @Get("/text/blocklists/{blocklistName}/blockItems/{blockItemId}")
+ @Get("/text/blocklists/{blocklistName}/blocklistItems/{blocklistItemId}")
@ExpectedResponses({200})
@UnexpectedResponseExceptionType(
value = ClientAuthenticationException.class,
@@ -523,12 +523,12 @@ Response getTextBlocklistItemSync(
@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion,
@PathParam("blocklistName") String blocklistName,
- @PathParam("blockItemId") String blockItemId,
+ @PathParam("blocklistItemId") String blocklistItemId,
@HeaderParam("accept") String accept,
RequestOptions requestOptions,
Context context);
- @Get("/text/blocklists/{blocklistName}/blockItems")
+ @Get("/text/blocklists/{blocklistName}/blocklistItems")
@ExpectedResponses({200})
@UnexpectedResponseExceptionType(
value = ClientAuthenticationException.class,
@@ -548,7 +548,7 @@ Mono> listTextBlocklistItems(
RequestOptions requestOptions,
Context context);
- @Get("/text/blocklists/{blocklistName}/blockItems")
+ @Get("/text/blocklists/{blocklistName}/blocklistItems")
@ExpectedResponses({200})
@UnexpectedResponseExceptionType(
value = ClientAuthenticationException.class,
@@ -648,8 +648,8 @@ Response listTextBlocklistItemsNextSync(
/**
* Analyze Text
*
- * A sync API for harmful content analysis for text. Currently, we support four categories: Hate, SelfHarm,
- * Sexual, Violence.
+ *
A synchronous API for the analysis of potentially harmful text content. Currently, it supports four
+ * categories: Hate, SelfHarm, Sexual, and Violence.
*
*
Request Body Schema
*
@@ -662,7 +662,8 @@ Response listTextBlocklistItemsNextSync(
* blocklistNames (Optional): [
* String (Optional)
* ]
- * breakByBlocklists: Boolean (Optional)
+ * haltOnBlocklistHit: Boolean (Optional)
+ * outputType: String(FourSeverityLevels/EightSeverityLevels) (Optional)
* }
* }
*
@@ -670,32 +671,29 @@ Response listTextBlocklistItemsNextSync(
*
* {@code
* {
- * blocklistsMatchResults (Optional): [
+ * blocklistsMatch (Optional): [
* (Optional){
* blocklistName: String (Required)
- * blockItemId: String (Required)
- * blockItemText: String (Required)
- * offset: int (Required)
- * length: int (Required)
+ * blocklistItemId: String (Required)
+ * blocklistItemText: String (Required)
+ * }
+ * ]
+ * categoriesAnalysis (Required): [
+ * (Required){
+ * category: String(Hate/SelfHarm/Sexual/Violence) (Required)
+ * severity: Integer (Optional)
* }
* ]
- * hateResult (Optional): {
- * category: String(Hate/SelfHarm/Sexual/Violence) (Required)
- * severity: int (Required)
- * }
- * selfHarmResult (Optional): (recursive schema, see selfHarmResult above)
- * sexualResult (Optional): (recursive schema, see sexualResult above)
- * violenceResult (Optional): (recursive schema, see violenceResult above)
* }
* }
*
- * @param body The request of text analysis.
+ * @param body The text analysis request.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return the analysis response of the text along with {@link Response} on successful completion of {@link Mono}.
+ * @return the text analysis response along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> analyzeTextWithResponseAsync(BinaryData body, RequestOptions requestOptions) {
@@ -714,8 +712,8 @@ public Mono> analyzeTextWithResponseAsync(BinaryData body,
/**
* Analyze Text
*
- * A sync API for harmful content analysis for text. Currently, we support four categories: Hate, SelfHarm,
- * Sexual, Violence.
+ *
A synchronous API for the analysis of potentially harmful text content. Currently, it supports four
+ * categories: Hate, SelfHarm, Sexual, and Violence.
*
*
Request Body Schema
*
@@ -728,7 +726,8 @@ public Mono> analyzeTextWithResponseAsync(BinaryData body,
* blocklistNames (Optional): [
* String (Optional)
* ]
- * breakByBlocklists: Boolean (Optional)
+ * haltOnBlocklistHit: Boolean (Optional)
+ * outputType: String(FourSeverityLevels/EightSeverityLevels) (Optional)
* }
* }
*
@@ -736,32 +735,29 @@ public Mono> analyzeTextWithResponseAsync(BinaryData body,
*
* {@code
* {
- * blocklistsMatchResults (Optional): [
+ * blocklistsMatch (Optional): [
* (Optional){
* blocklistName: String (Required)
- * blockItemId: String (Required)
- * blockItemText: String (Required)
- * offset: int (Required)
- * length: int (Required)
+ * blocklistItemId: String (Required)
+ * blocklistItemText: String (Required)
+ * }
+ * ]
+ * categoriesAnalysis (Required): [
+ * (Required){
+ * category: String(Hate/SelfHarm/Sexual/Violence) (Required)
+ * severity: Integer (Optional)
* }
* ]
- * hateResult (Optional): {
- * category: String(Hate/SelfHarm/Sexual/Violence) (Required)
- * severity: int (Required)
- * }
- * selfHarmResult (Optional): (recursive schema, see selfHarmResult above)
- * sexualResult (Optional): (recursive schema, see sexualResult above)
- * violenceResult (Optional): (recursive schema, see violenceResult above)
* }
* }
*
- * @param body The request of text analysis.
+ * @param body The text analysis request.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return the analysis response of the text along with {@link Response}.
+ * @return the text analysis response along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response analyzeTextWithResponse(BinaryData body, RequestOptions requestOptions) {
@@ -773,8 +769,8 @@ public Response analyzeTextWithResponse(BinaryData body, RequestOpti
/**
* Analyze Image
*
- * A sync API for harmful content analysis for image. Currently, we support four categories: Hate, SelfHarm,
- * Sexual, Violence.
+ *
A synchronous API for the analysis of potentially harmful image content. Currently, it supports four
+ * categories: Hate, SelfHarm, Sexual, and Violence.
*
*
Request Body Schema
*
@@ -787,6 +783,7 @@ public Response analyzeTextWithResponse(BinaryData body, RequestOpti
* categories (Optional): [
* String(Hate/SelfHarm/Sexual/Violence) (Optional)
* ]
+ * outputType: String(FourSeverityLevels) (Optional)
* }
* }
*
@@ -794,23 +791,22 @@ public Response analyzeTextWithResponse(BinaryData body, RequestOpti
*
* {@code
* {
- * hateResult (Optional): {
- * category: String(Hate/SelfHarm/Sexual/Violence) (Required)
- * severity: int (Required)
- * }
- * selfHarmResult (Optional): (recursive schema, see selfHarmResult above)
- * sexualResult (Optional): (recursive schema, see sexualResult above)
- * violenceResult (Optional): (recursive schema, see violenceResult above)
+ * categoriesAnalysis (Required): [
+ * (Required){
+ * category: String(Hate/SelfHarm/Sexual/Violence) (Required)
+ * severity: Integer (Optional)
+ * }
+ * ]
* }
* }
*
- * @param body The analysis request of the image.
+ * @param body The image analysis request.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return the analysis response of the image along with {@link Response} on successful completion of {@link Mono}.
+ * @return the image analysis response along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> analyzeImageWithResponseAsync(BinaryData body, RequestOptions requestOptions) {
@@ -829,8 +825,8 @@ public Mono> analyzeImageWithResponseAsync(BinaryData body,
/**
* Analyze Image
*
- * A sync API for harmful content analysis for image. Currently, we support four categories: Hate, SelfHarm,
- * Sexual, Violence.
+ *
A synchronous API for the analysis of potentially harmful image content. Currently, it supports four
+ * categories: Hate, SelfHarm, Sexual, and Violence.
*
*
Request Body Schema
*
@@ -843,6 +839,7 @@ public Mono> analyzeImageWithResponseAsync(BinaryData body,
* categories (Optional): [
* String(Hate/SelfHarm/Sexual/Violence) (Optional)
* ]
+ * outputType: String(FourSeverityLevels) (Optional)
* }
* }
*
@@ -850,23 +847,22 @@ public Mono> analyzeImageWithResponseAsync(BinaryData body,
*
* {@code
* {
- * hateResult (Optional): {
- * category: String(Hate/SelfHarm/Sexual/Violence) (Required)
- * severity: int (Required)
- * }
- * selfHarmResult (Optional): (recursive schema, see selfHarmResult above)
- * sexualResult (Optional): (recursive schema, see sexualResult above)
- * violenceResult (Optional): (recursive schema, see violenceResult above)
+ * categoriesAnalysis (Required): [
+ * (Required){
+ * category: String(Hate/SelfHarm/Sexual/Violence) (Required)
+ * severity: Integer (Optional)
+ * }
+ * ]
* }
* }
*
- * @param body The analysis request of the image.
+ * @param body The image analysis request.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return the analysis response of the image along with {@link Response}.
+ * @return the image analysis response along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response analyzeImageWithResponse(BinaryData body, RequestOptions requestOptions) {
@@ -949,7 +945,7 @@ public Response getTextBlocklistWithResponse(String blocklistName, R
/**
* Create Or Update Text Blocklist
*
- * Updates a text blocklist, if blocklistName does not exist, create a new blocklist.
+ *
Updates a text blocklist. If the blocklistName does not exist, a new blocklist will be created.
*
*
Request Body Schema
*
@@ -999,7 +995,7 @@ public Mono> createOrUpdateTextBlocklistWithResponseAsync(
/**
* Create Or Update Text Blocklist
*
- * Updates a text blocklist, if blocklistName does not exist, create a new blocklist.
+ *
Updates a text blocklist. If the blocklistName does not exist, a new blocklist will be created.
*
*
Request Body Schema
*
@@ -1247,16 +1243,18 @@ public PagedIterable listTextBlocklists(RequestOptions requestOption
}
/**
- * Add BlockItems To Text Blocklist
+ * Add or update BlocklistItems To Text Blocklist
*
- * Add blockItems to a text blocklist. You can add at most 100 BlockItems in one request.
+ *
Add or update blocklistItems to a text blocklist. You can add or update at most 100 blocklistItems in one
+ * request.
*
*
Request Body Schema
*
*
{@code
* {
- * blockItems (Required): [
+ * blocklistItems (Required): [
* (Required){
+ * blocklistItemId: String (Required)
* description: String (Optional)
* text: String (Required)
* }
@@ -1268,9 +1266,9 @@ public PagedIterable listTextBlocklists(RequestOptions requestOption
*
* {@code
* {
- * value (Optional): [
- * (Optional){
- * blockItemId: String (Required)
+ * blocklistItems (Required): [
+ * (Required){
+ * blocklistItemId: String (Required)
* description: String (Optional)
* text: String (Required)
* }
@@ -1279,42 +1277,44 @@ public PagedIterable listTextBlocklists(RequestOptions requestOption
* }
*
* @param blocklistName Text blocklist name.
- * @param addBlockItemsOptions The request of adding blockItems to text blocklist.
+ * @param addOrUpdateTextBlocklistItemsOptions The request to add blocklistItems to a text blocklist.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return the response of adding blockItems to text blocklist along with {@link Response} on successful completion
- * of {@link Mono}.
+ * @return the response of adding blocklistItems to the text blocklist along with {@link Response} on successful
+ * completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Mono> addBlockItemsWithResponseAsync(
- String blocklistName, BinaryData addBlockItemsOptions, RequestOptions requestOptions) {
+ public Mono> addOrUpdateBlocklistItemsWithResponseAsync(
+ String blocklistName, BinaryData addOrUpdateTextBlocklistItemsOptions, RequestOptions requestOptions) {
final String accept = "application/json";
return FluxUtil.withContext(
context ->
- service.addBlockItems(
+ service.addOrUpdateBlocklistItems(
this.getEndpoint(),
this.getServiceVersion().getVersion(),
blocklistName,
accept,
- addBlockItemsOptions,
+ addOrUpdateTextBlocklistItemsOptions,
requestOptions,
context));
}
/**
- * Add BlockItems To Text Blocklist
+ * Add or update BlocklistItems To Text Blocklist
*
- * Add blockItems to a text blocklist. You can add at most 100 BlockItems in one request.
+ *
Add or update blocklistItems to a text blocklist. You can add or update at most 100 blocklistItems in one
+ * request.
*
*
Request Body Schema
*
*
{@code
* {
- * blockItems (Required): [
+ * blocklistItems (Required): [
* (Required){
+ * blocklistItemId: String (Required)
* description: String (Optional)
* text: String (Required)
* }
@@ -1326,9 +1326,9 @@ public Mono> addBlockItemsWithResponseAsync(
*
* {@code
* {
- * value (Optional): [
- * (Optional){
- * blockItemId: String (Required)
+ * blocklistItems (Required): [
+ * (Required){
+ * blocklistItemId: String (Required)
* description: String (Optional)
* text: String (Required)
* }
@@ -1337,45 +1337,45 @@ public Mono> addBlockItemsWithResponseAsync(
* }
*
* @param blocklistName Text blocklist name.
- * @param addBlockItemsOptions The request of adding blockItems to text blocklist.
+ * @param addOrUpdateTextBlocklistItemsOptions The request to add blocklistItems to a text blocklist.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return the response of adding blockItems to text blocklist along with {@link Response}.
+ * @return the response of adding blocklistItems to the text blocklist along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Response addBlockItemsWithResponse(
- String blocklistName, BinaryData addBlockItemsOptions, RequestOptions requestOptions) {
+ public Response addOrUpdateBlocklistItemsWithResponse(
+ String blocklistName, BinaryData addOrUpdateTextBlocklistItemsOptions, RequestOptions requestOptions) {
final String accept = "application/json";
- return service.addBlockItemsSync(
+ return service.addOrUpdateBlocklistItemsSync(
this.getEndpoint(),
this.getServiceVersion().getVersion(),
blocklistName,
accept,
- addBlockItemsOptions,
+ addOrUpdateTextBlocklistItemsOptions,
requestOptions,
Context.NONE);
}
/**
- * Remove BlockItems From Text Blocklist
+ * Remove BlocklistItems From Text Blocklist
*
- * Remove blockItems from a text blocklist. You can remove at most 100 BlockItems in one request.
+ *
Remove blocklistItems from a text blocklist. You can remove at most 100 BlocklistItems in one request.
*
*
Request Body Schema
*
*
{@code
* {
- * blockItemIds (Required): [
+ * blocklistItemIds (Required): [
* String (Required)
* ]
* }
* }
*
* @param blocklistName Text blocklist name.
- * @param removeBlockItemsOptions The request of removing blockItems from text blocklist.
+ * @param removeTextBlocklistItemsOptions The request to remove blocklistItems from a text blocklist.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
@@ -1384,38 +1384,38 @@ public Response addBlockItemsWithResponse(
* @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Mono> removeBlockItemsWithResponseAsync(
- String blocklistName, BinaryData removeBlockItemsOptions, RequestOptions requestOptions) {
+ public Mono> removeBlocklistItemsWithResponseAsync(
+ String blocklistName, BinaryData removeTextBlocklistItemsOptions, RequestOptions requestOptions) {
final String accept = "application/json";
return FluxUtil.withContext(
context ->
- service.removeBlockItems(
+ service.removeBlocklistItems(
this.getEndpoint(),
this.getServiceVersion().getVersion(),
blocklistName,
accept,
- removeBlockItemsOptions,
+ removeTextBlocklistItemsOptions,
requestOptions,
context));
}
/**
- * Remove BlockItems From Text Blocklist
+ * Remove BlocklistItems From Text Blocklist
*
- * Remove blockItems from a text blocklist. You can remove at most 100 BlockItems in one request.
+ *
Remove blocklistItems from a text blocklist. You can remove at most 100 BlocklistItems in one request.
*
*
Request Body Schema
*
*
{@code
* {
- * blockItemIds (Required): [
+ * blocklistItemIds (Required): [
* String (Required)
* ]
* }
* }
*
* @param blocklistName Text blocklist name.
- * @param removeBlockItemsOptions The request of removing blockItems from text blocklist.
+ * @param removeTextBlocklistItemsOptions The request to remove blocklistItems from a text blocklist.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
@@ -1424,47 +1424,47 @@ public Mono> removeBlockItemsWithResponseAsync(
* @return the {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Response removeBlockItemsWithResponse(
- String blocklistName, BinaryData removeBlockItemsOptions, RequestOptions requestOptions) {
+ public Response removeBlocklistItemsWithResponse(
+ String blocklistName, BinaryData removeTextBlocklistItemsOptions, RequestOptions requestOptions) {
final String accept = "application/json";
- return service.removeBlockItemsSync(
+ return service.removeBlocklistItemsSync(
this.getEndpoint(),
this.getServiceVersion().getVersion(),
blocklistName,
accept,
- removeBlockItemsOptions,
+ removeTextBlocklistItemsOptions,
requestOptions,
Context.NONE);
}
/**
- * Get BlockItem By blocklistName And blockItemId
+ * Get BlocklistItem By blocklistName And blocklistItemId
*
- * Get blockItem By blockItemId from a text blocklist.
+ *
Get blocklistItem by blocklistName and blocklistItemId from a text blocklist.
*
*
Response Body Schema
*
*
{@code
* {
- * blockItemId: String (Required)
+ * blocklistItemId: String (Required)
* description: String (Optional)
* text: String (Required)
* }
* }
*
* @param blocklistName Text blocklist name.
- * @param blockItemId Block Item Id. It will be uuid.
+ * @param blocklistItemId The service will generate a BlocklistItemId, which will be a UUID.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return blockItem By blockItemId from a text blocklist along with {@link Response} on successful completion of
- * {@link Mono}.
+ * @return blocklistItem by blocklistName and blocklistItemId from a text blocklist along with {@link Response} on
+ * successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> getTextBlocklistItemWithResponseAsync(
- String blocklistName, String blockItemId, RequestOptions requestOptions) {
+ String blocklistName, String blocklistItemId, RequestOptions requestOptions) {
final String accept = "application/json";
return FluxUtil.withContext(
context ->
@@ -1472,54 +1472,54 @@ public Mono> getTextBlocklistItemWithResponseAsync(
this.getEndpoint(),
this.getServiceVersion().getVersion(),
blocklistName,
- blockItemId,
+ blocklistItemId,
accept,
requestOptions,
context));
}
/**
- * Get BlockItem By blocklistName And blockItemId
+ * Get BlocklistItem By blocklistName And blocklistItemId
*
- * Get blockItem By blockItemId from a text blocklist.
+ *
Get blocklistItem by blocklistName and blocklistItemId from a text blocklist.
*
*
Response Body Schema
*
*
{@code
* {
- * blockItemId: String (Required)
+ * blocklistItemId: String (Required)
* description: String (Optional)
* text: String (Required)
* }
* }
*
* @param blocklistName Text blocklist name.
- * @param blockItemId Block Item Id. It will be uuid.
+ * @param blocklistItemId The service will generate a BlocklistItemId, which will be a UUID.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return blockItem By blockItemId from a text blocklist along with {@link Response}.
+ * @return blocklistItem by blocklistName and blocklistItemId from a text blocklist along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getTextBlocklistItemWithResponse(
- String blocklistName, String blockItemId, RequestOptions requestOptions) {
+ String blocklistName, String blocklistItemId, RequestOptions requestOptions) {
final String accept = "application/json";
return service.getTextBlocklistItemSync(
this.getEndpoint(),
this.getServiceVersion().getVersion(),
blocklistName,
- blockItemId,
+ blocklistItemId,
accept,
requestOptions,
Context.NONE);
}
/**
- * Get All BlockItems By blocklistName
+ * Get All BlocklistItems By blocklistName
*
- * Get all blockItems in a text blocklist.
+ *
Get all blocklistItems in a text blocklist.
*
*
Query Parameters
*
@@ -1537,7 +1537,7 @@ public Response getTextBlocklistItemWithResponse(
*
* {@code
* {
- * blockItemId: String (Required)
+ * blocklistItemId: String (Required)
* description: String (Optional)
* text: String (Required)
* }
@@ -1549,8 +1549,8 @@ public Response getTextBlocklistItemWithResponse(
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return all blockItems in a text blocklist along with {@link PagedResponse} on successful completion of {@link
- * Mono}.
+ * @return all blocklistItems in a text blocklist along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listTextBlocklistItemsSinglePageAsync(
@@ -1577,9 +1577,9 @@ private Mono> listTextBlocklistItemsSinglePageAsync(
}
/**
- * Get All BlockItems By blocklistName
+ * Get All BlocklistItems By blocklistName
*
- * Get all blockItems in a text blocklist.
+ *
Get all blocklistItems in a text blocklist.
*
*
Query Parameters
*
@@ -1597,7 +1597,7 @@ private Mono> listTextBlocklistItemsSinglePageAsync(
*
* {@code
* {
- * blockItemId: String (Required)
+ * blocklistItemId: String (Required)
* description: String (Optional)
* text: String (Required)
* }
@@ -1609,7 +1609,7 @@ private Mono> listTextBlocklistItemsSinglePageAsync(
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return all blockItems in a text blocklist as paginated response with {@link PagedFlux}.
+ * @return all blocklistItems in a text blocklist as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedFlux listTextBlocklistItemsAsync(String blocklistName, RequestOptions requestOptions) {
@@ -1647,9 +1647,9 @@ public PagedFlux listTextBlocklistItemsAsync(String blocklistName, R
}
/**
- * Get All BlockItems By blocklistName
+ * Get All BlocklistItems By blocklistName
*
- * Get all blockItems in a text blocklist.
+ *
Get all blocklistItems in a text blocklist.
*
*
Query Parameters
*
@@ -1667,7 +1667,7 @@ public PagedFlux listTextBlocklistItemsAsync(String blocklistName, R
*
* {@code
* {
- * blockItemId: String (Required)
+ * blocklistItemId: String (Required)
* description: String (Optional)
* text: String (Required)
* }
@@ -1679,7 +1679,7 @@ public PagedFlux listTextBlocklistItemsAsync(String blocklistName, R
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return all blockItems in a text blocklist along with {@link PagedResponse}.
+ * @return all blocklistItems in a text blocklist along with {@link PagedResponse}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private PagedResponse listTextBlocklistItemsSinglePage(
@@ -1703,9 +1703,9 @@ private PagedResponse listTextBlocklistItemsSinglePage(
}
/**
- * Get All BlockItems By blocklistName
+ * Get All BlocklistItems By blocklistName
*
- * Get all blockItems in a text blocklist.
+ *
Get all blocklistItems in a text blocklist.
*
*
Query Parameters
*
@@ -1723,7 +1723,7 @@ private PagedResponse listTextBlocklistItemsSinglePage(
*
* {@code
* {
- * blockItemId: String (Required)
+ * blocklistItemId: String (Required)
* description: String (Optional)
* text: String (Required)
* }
@@ -1735,7 +1735,7 @@ private PagedResponse listTextBlocklistItemsSinglePage(
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return all blockItems in a text blocklist as paginated response with {@link PagedIterable}.
+ * @return all blocklistItems in a text blocklist as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listTextBlocklistItems(String blocklistName, RequestOptions requestOptions) {
@@ -1853,7 +1853,7 @@ private PagedResponse listTextBlocklistsNextSinglePage(String nextLi
}
/**
- * Get All BlockItems By blocklistName
+ * Get All BlocklistItems By blocklistName
*
* Get the next page of items.
*
@@ -1861,7 +1861,7 @@ private PagedResponse listTextBlocklistsNextSinglePage(String nextLi
*
* {@code
* {
- * blockItemId: String (Required)
+ * blocklistItemId: String (Required)
* description: String (Optional)
* text: String (Required)
* }
@@ -1874,7 +1874,7 @@ private PagedResponse listTextBlocklistsNextSinglePage(String nextLi
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return paged collection of TextBlockItem items along with {@link PagedResponse} on successful completion of
+ * @return paged collection of TextBlocklistItem items along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@@ -1897,7 +1897,7 @@ private Mono> listTextBlocklistItemsNextSinglePageAsyn
}
/**
- * Get All BlockItems By blocklistName
+ * Get All BlocklistItems By blocklistName
*
* Get the next page of items.
*
@@ -1905,7 +1905,7 @@ private Mono> listTextBlocklistItemsNextSinglePageAsyn
*
* {@code
* {
- * blockItemId: String (Required)
+ * blocklistItemId: String (Required)
* description: String (Optional)
* text: String (Required)
* }
@@ -1918,7 +1918,7 @@ private Mono> listTextBlocklistItemsNextSinglePageAsyn
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return paged collection of TextBlockItem items along with {@link PagedResponse}.
+ * @return paged collection of TextBlocklistItem items along with {@link PagedResponse}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private PagedResponse listTextBlocklistItemsNextSinglePage(
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AddOrUpdateTextBlocklistItemsOptions.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AddOrUpdateTextBlocklistItemsOptions.java
new file mode 100644
index 000000000000..52923feda15b
--- /dev/null
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AddOrUpdateTextBlocklistItemsOptions.java
@@ -0,0 +1,44 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.ai.contentsafety.models;
+
+import com.azure.core.annotation.Generated;
+import com.azure.core.annotation.Immutable;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+
+/** The request to add blocklistItems to a text blocklist. */
+@Immutable
+public final class AddOrUpdateTextBlocklistItemsOptions {
+ /*
+ * Array of blocklistItems to add.
+ */
+ @Generated
+ @JsonProperty(value = "blocklistItems")
+ private List blocklistItems;
+
+ /**
+ * Creates an instance of AddOrUpdateTextBlocklistItemsOptions class.
+ *
+ * @param blocklistItems the blocklistItems value to set.
+ */
+ @Generated
+ @JsonCreator
+ public AddOrUpdateTextBlocklistItemsOptions(
+ @JsonProperty(value = "blocklistItems") List blocklistItems) {
+ this.blocklistItems = blocklistItems;
+ }
+
+ /**
+ * Get the blocklistItems property: Array of blocklistItems to add.
+ *
+ * @return the blocklistItems value.
+ */
+ @Generated
+ public List getBlocklistItems() {
+ return this.blocklistItems;
+ }
+}
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AddOrUpdateTextBlocklistItemsResult.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AddOrUpdateTextBlocklistItemsResult.java
new file mode 100644
index 000000000000..d074745ed00d
--- /dev/null
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AddOrUpdateTextBlocklistItemsResult.java
@@ -0,0 +1,44 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.ai.contentsafety.models;
+
+import com.azure.core.annotation.Generated;
+import com.azure.core.annotation.Immutable;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+
+/** The response of adding blocklistItems to the text blocklist. */
+@Immutable
+public final class AddOrUpdateTextBlocklistItemsResult {
+ /*
+ * Array of blocklistItems have been added.
+ */
+ @Generated
+ @JsonProperty(value = "blocklistItems")
+ private List blocklistItems;
+
+ /**
+ * Creates an instance of AddOrUpdateTextBlocklistItemsResult class.
+ *
+ * @param blocklistItems the blocklistItems value to set.
+ */
+ @Generated
+ @JsonCreator
+ private AddOrUpdateTextBlocklistItemsResult(
+ @JsonProperty(value = "blocklistItems") List blocklistItems) {
+ this.blocklistItems = blocklistItems;
+ }
+
+ /**
+ * Get the blocklistItems property: Array of blocklistItems have been added.
+ *
+ * @return the blocklistItems value.
+ */
+ @Generated
+ public List getBlocklistItems() {
+ return this.blocklistItems;
+ }
+}
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeImageOptions.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeImageOptions.java
index 1bae3af92367..bd3fddb7dab4 100644
--- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeImageOptions.java
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeImageOptions.java
@@ -10,7 +10,7 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
-/** The analysis request of the image. */
+/** The image analysis request. */
@Fluent
public final class AnalyzeImageOptions {
/*
@@ -21,13 +21,21 @@ public final class AnalyzeImageOptions {
private ImageData image;
/*
- * The categories will be analyzed. If not assigned, a default set of the categories' analysis results will be
- * returned.
+ * The categories will be analyzed. If they are not assigned, a default set of analysis results for the categories
+ * will be returned.
*/
@Generated
@JsonProperty(value = "categories")
private List categories;
+ /*
+ * This refers to the type of image analysis output. If no value is assigned, the default value will be
+ * "FourSeverityLevels".
+ */
+ @Generated
+ @JsonProperty(value = "outputType")
+ private AnalyzeImageOutputType outputType;
+
/**
* Creates an instance of AnalyzeImageOptions class.
*
@@ -50,8 +58,8 @@ public ImageData getImage() {
}
/**
- * Get the categories property: The categories will be analyzed. If not assigned, a default set of the categories'
- * analysis results will be returned.
+ * Get the categories property: The categories will be analyzed. If they are not assigned, a default set of analysis
+ * results for the categories will be returned.
*
* @return the categories value.
*/
@@ -61,8 +69,8 @@ public List getCategories() {
}
/**
- * Set the categories property: The categories will be analyzed. If not assigned, a default set of the categories'
- * analysis results will be returned.
+ * Set the categories property: The categories will be analyzed. If they are not assigned, a default set of analysis
+ * results for the categories will be returned.
*
* @param categories the categories value to set.
* @return the AnalyzeImageOptions object itself.
@@ -72,4 +80,28 @@ public AnalyzeImageOptions setCategories(List categories) {
this.categories = categories;
return this;
}
+
+ /**
+ * Get the outputType property: This refers to the type of image analysis output. If no value is assigned, the
+ * default value will be "FourSeverityLevels".
+ *
+ * @return the outputType value.
+ */
+ @Generated
+ public AnalyzeImageOutputType getOutputType() {
+ return this.outputType;
+ }
+
+ /**
+ * Set the outputType property: This refers to the type of image analysis output. If no value is assigned, the
+ * default value will be "FourSeverityLevels".
+ *
+ * @param outputType the outputType value to set.
+ * @return the AnalyzeImageOptions object itself.
+ */
+ @Generated
+ public AnalyzeImageOptions setOutputType(AnalyzeImageOutputType outputType) {
+ this.outputType = outputType;
+ return this;
+ }
}
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeImageOutputType.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeImageOutputType.java
new file mode 100644
index 000000000000..c27daab4f62e
--- /dev/null
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeImageOutputType.java
@@ -0,0 +1,47 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.ai.contentsafety.models;
+
+import com.azure.core.annotation.Generated;
+import com.azure.core.util.ExpandableStringEnum;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import java.util.Collection;
+
+/** The type of image analysis output. */
+public final class AnalyzeImageOutputType extends ExpandableStringEnum {
+ /** Output severities in four levels, the value could be 0,2,4,6. */
+ @Generated public static final AnalyzeImageOutputType FOUR_SEVERITY_LEVELS = fromString("FourSeverityLevels");
+
+ /**
+ * Creates a new instance of AnalyzeImageOutputType value.
+ *
+ * @deprecated Use the {@link #fromString(String)} factory method.
+ */
+ @Generated
+ @Deprecated
+ public AnalyzeImageOutputType() {}
+
+ /**
+ * Creates or finds a AnalyzeImageOutputType from its string representation.
+ *
+ * @param name a name to look for.
+ * @return the corresponding AnalyzeImageOutputType.
+ */
+ @Generated
+ @JsonCreator
+ public static AnalyzeImageOutputType fromString(String name) {
+ return fromString(name, AnalyzeImageOutputType.class);
+ }
+
+ /**
+ * Gets known AnalyzeImageOutputType values.
+ *
+ * @return known AnalyzeImageOutputType values.
+ */
+ @Generated
+ public static Collection values() {
+ return values(AnalyzeImageOutputType.class);
+ }
+}
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeImageResult.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeImageResult.java
index d33e2980c04d..d0d5d7fdbf4e 100644
--- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeImageResult.java
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeImageResult.java
@@ -6,80 +6,39 @@
import com.azure.core.annotation.Generated;
import com.azure.core.annotation.Immutable;
+import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
-/** The analysis response of the image. */
+/** The image analysis response. */
@Immutable
public final class AnalyzeImageResult {
/*
- * Analysis result for Hate category.
+ * Analysis result for categories.
*/
@Generated
- @JsonProperty(value = "hateResult")
- private ImageAnalyzeSeverityResult hateResult;
-
- /*
- * Analysis result for SelfHarm category.
- */
- @Generated
- @JsonProperty(value = "selfHarmResult")
- private ImageAnalyzeSeverityResult selfHarmResult;
-
- /*
- * Analysis result for Sexual category.
- */
- @Generated
- @JsonProperty(value = "sexualResult")
- private ImageAnalyzeSeverityResult sexualResult;
-
- /*
- * Analysis result for Violence category.
- */
- @Generated
- @JsonProperty(value = "violenceResult")
- private ImageAnalyzeSeverityResult violenceResult;
-
- /** Creates an instance of AnalyzeImageResult class. */
- @Generated
- private AnalyzeImageResult() {}
-
- /**
- * Get the hateResult property: Analysis result for Hate category.
- *
- * @return the hateResult value.
- */
- @Generated
- public ImageAnalyzeSeverityResult getHateResult() {
- return this.hateResult;
- }
-
- /**
- * Get the selfHarmResult property: Analysis result for SelfHarm category.
- *
- * @return the selfHarmResult value.
- */
- @Generated
- public ImageAnalyzeSeverityResult getSelfHarmResult() {
- return this.selfHarmResult;
- }
+ @JsonProperty(value = "categoriesAnalysis")
+ private List categoriesAnalysis;
/**
- * Get the sexualResult property: Analysis result for Sexual category.
+ * Creates an instance of AnalyzeImageResult class.
*
- * @return the sexualResult value.
+ * @param categoriesAnalysis the categoriesAnalysis value to set.
*/
@Generated
- public ImageAnalyzeSeverityResult getSexualResult() {
- return this.sexualResult;
+ @JsonCreator
+ private AnalyzeImageResult(
+ @JsonProperty(value = "categoriesAnalysis") List categoriesAnalysis) {
+ this.categoriesAnalysis = categoriesAnalysis;
}
/**
- * Get the violenceResult property: Analysis result for Violence category.
+ * Get the categoriesAnalysis property: Analysis result for categories.
*
- * @return the violenceResult value.
+ * @return the categoriesAnalysis value.
*/
@Generated
- public ImageAnalyzeSeverityResult getViolenceResult() {
- return this.violenceResult;
+ public List getCategoriesAnalysis() {
+ return this.categoriesAnalysis;
}
}
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeTextOptions.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeTextOptions.java
index a6e28b8434de..b05bc72d8759 100644
--- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeTextOptions.java
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeTextOptions.java
@@ -10,19 +10,20 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
-/** The analysis request of the text. */
+/** The text analysis request. */
@Fluent
public final class AnalyzeTextOptions {
/*
- * The text needs to be scanned. We support at most 1000 characters (unicode code points) in text of one request.
+ * The text needs to be analyzed. We support a maximum of 10k Unicode characters (Unicode code points) in the text
+ * of one request.
*/
@Generated
@JsonProperty(value = "text")
private String text;
/*
- * The categories will be analyzed. If not assigned, a default set of the categories' analysis results will be
- * returned.
+ * The categories will be analyzed. If they are not assigned, a default set of analysis results for the categories
+ * will be returned.
*/
@Generated
@JsonProperty(value = "categories")
@@ -40,8 +41,16 @@ public final class AnalyzeTextOptions {
* When set to false, all analyses of harmful content will be performed, whether or not blocklists are hit.
*/
@Generated
- @JsonProperty(value = "breakByBlocklists")
- private Boolean breakByBlocklists;
+ @JsonProperty(value = "haltOnBlocklistHit")
+ private Boolean haltOnBlocklistHit;
+
+ /*
+ * This refers to the type of text analysis output. If no value is assigned, the default value will be
+ * "FourSeverityLevels".
+ */
+ @Generated
+ @JsonProperty(value = "outputType")
+ private AnalyzeTextOutputType outputType;
/**
* Creates an instance of AnalyzeTextOptions class.
@@ -55,8 +64,8 @@ public AnalyzeTextOptions(@JsonProperty(value = "text") String text) {
}
/**
- * Get the text property: The text needs to be scanned. We support at most 1000 characters (unicode code points) in
- * text of one request.
+ * Get the text property: The text needs to be analyzed. We support a maximum of 10k Unicode characters (Unicode
+ * code points) in the text of one request.
*
* @return the text value.
*/
@@ -66,8 +75,8 @@ public String getText() {
}
/**
- * Get the categories property: The categories will be analyzed. If not assigned, a default set of the categories'
- * analysis results will be returned.
+ * Get the categories property: The categories will be analyzed. If they are not assigned, a default set of analysis
+ * results for the categories will be returned.
*
* @return the categories value.
*/
@@ -77,8 +86,8 @@ public List getCategories() {
}
/**
- * Set the categories property: The categories will be analyzed. If not assigned, a default set of the categories'
- * analysis results will be returned.
+ * Set the categories property: The categories will be analyzed. If they are not assigned, a default set of analysis
+ * results for the categories will be returned.
*
* @param categories the categories value to set.
* @return the AnalyzeTextOptions object itself.
@@ -112,28 +121,52 @@ public AnalyzeTextOptions setBlocklistNames(List blocklistNames) {
}
/**
- * Get the breakByBlocklists property: When set to true, further analyses of harmful content will not be performed
+ * Get the haltOnBlocklistHit property: When set to true, further analyses of harmful content will not be performed
* in cases where blocklists are hit. When set to false, all analyses of harmful content will be performed, whether
* or not blocklists are hit.
*
- * @return the breakByBlocklists value.
+ * @return the haltOnBlocklistHit value.
*/
@Generated
- public Boolean isBreakByBlocklists() {
- return this.breakByBlocklists;
+ public Boolean isHaltOnBlocklistHit() {
+ return this.haltOnBlocklistHit;
}
/**
- * Set the breakByBlocklists property: When set to true, further analyses of harmful content will not be performed
+ * Set the haltOnBlocklistHit property: When set to true, further analyses of harmful content will not be performed
* in cases where blocklists are hit. When set to false, all analyses of harmful content will be performed, whether
* or not blocklists are hit.
*
- * @param breakByBlocklists the breakByBlocklists value to set.
+ * @param haltOnBlocklistHit the haltOnBlocklistHit value to set.
+ * @return the AnalyzeTextOptions object itself.
+ */
+ @Generated
+ public AnalyzeTextOptions setHaltOnBlocklistHit(Boolean haltOnBlocklistHit) {
+ this.haltOnBlocklistHit = haltOnBlocklistHit;
+ return this;
+ }
+
+ /**
+ * Get the outputType property: This refers to the type of text analysis output. If no value is assigned, the
+ * default value will be "FourSeverityLevels".
+ *
+ * @return the outputType value.
+ */
+ @Generated
+ public AnalyzeTextOutputType getOutputType() {
+ return this.outputType;
+ }
+
+ /**
+ * Set the outputType property: This refers to the type of text analysis output. If no value is assigned, the
+ * default value will be "FourSeverityLevels".
+ *
+ * @param outputType the outputType value to set.
* @return the AnalyzeTextOptions object itself.
*/
@Generated
- public AnalyzeTextOptions setBreakByBlocklists(Boolean breakByBlocklists) {
- this.breakByBlocklists = breakByBlocklists;
+ public AnalyzeTextOptions setOutputType(AnalyzeTextOutputType outputType) {
+ this.outputType = outputType;
return this;
}
}
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeTextOutputType.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeTextOutputType.java
new file mode 100644
index 000000000000..84110301453b
--- /dev/null
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeTextOutputType.java
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.ai.contentsafety.models;
+
+import com.azure.core.annotation.Generated;
+import com.azure.core.util.ExpandableStringEnum;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import java.util.Collection;
+
+/** The type of text analysis output. */
+public final class AnalyzeTextOutputType extends ExpandableStringEnum {
+ /** Output severities in four levels, the value could be 0,2,4,6. */
+ @Generated public static final AnalyzeTextOutputType FOUR_SEVERITY_LEVELS = fromString("FourSeverityLevels");
+
+ /** Output severities in eight levels, the value could be 0,1,2,3,4,5,6,7. */
+ @Generated public static final AnalyzeTextOutputType EIGHT_SEVERITY_LEVELS = fromString("EightSeverityLevels");
+
+ /**
+ * Creates a new instance of AnalyzeTextOutputType value.
+ *
+ * @deprecated Use the {@link #fromString(String)} factory method.
+ */
+ @Generated
+ @Deprecated
+ public AnalyzeTextOutputType() {}
+
+ /**
+ * Creates or finds a AnalyzeTextOutputType from its string representation.
+ *
+ * @param name a name to look for.
+ * @return the corresponding AnalyzeTextOutputType.
+ */
+ @Generated
+ @JsonCreator
+ public static AnalyzeTextOutputType fromString(String name) {
+ return fromString(name, AnalyzeTextOutputType.class);
+ }
+
+ /**
+ * Gets known AnalyzeTextOutputType values.
+ *
+ * @return known AnalyzeTextOutputType values.
+ */
+ @Generated
+ public static Collection values() {
+ return values(AnalyzeTextOutputType.class);
+ }
+}
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeTextResult.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeTextResult.java
index e0ae7ea8e2d2..7a71cf10b39d 100644
--- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeTextResult.java
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/AnalyzeTextResult.java
@@ -6,98 +6,56 @@
import com.azure.core.annotation.Generated;
import com.azure.core.annotation.Immutable;
+import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
-/** The analysis response of the text. */
+/** The text analysis response. */
@Immutable
public final class AnalyzeTextResult {
/*
- * The details of blocklist match.
+ * The blocklist match details.
*/
@Generated
- @JsonProperty(value = "blocklistsMatchResults")
- private List blocklistsMatchResults;
+ @JsonProperty(value = "blocklistsMatch")
+ private List blocklistsMatch;
/*
- * Analysis result for Hate category.
+ * Analysis result for categories.
*/
@Generated
- @JsonProperty(value = "hateResult")
- private TextAnalyzeSeverityResult hateResult;
-
- /*
- * Analysis result for SelfHarm category.
- */
- @Generated
- @JsonProperty(value = "selfHarmResult")
- private TextAnalyzeSeverityResult selfHarmResult;
-
- /*
- * Analysis result for Sexual category.
- */
- @Generated
- @JsonProperty(value = "sexualResult")
- private TextAnalyzeSeverityResult sexualResult;
-
- /*
- * Analysis result for Violence category.
- */
- @Generated
- @JsonProperty(value = "violenceResult")
- private TextAnalyzeSeverityResult violenceResult;
-
- /** Creates an instance of AnalyzeTextResult class. */
- @Generated
- private AnalyzeTextResult() {}
-
- /**
- * Get the blocklistsMatchResults property: The details of blocklist match.
- *
- * @return the blocklistsMatchResults value.
- */
- @Generated
- public List getBlocklistsMatchResults() {
- return this.blocklistsMatchResults;
- }
-
- /**
- * Get the hateResult property: Analysis result for Hate category.
- *
- * @return the hateResult value.
- */
- @Generated
- public TextAnalyzeSeverityResult getHateResult() {
- return this.hateResult;
- }
+ @JsonProperty(value = "categoriesAnalysis")
+ private List categoriesAnalysis;
/**
- * Get the selfHarmResult property: Analysis result for SelfHarm category.
+ * Creates an instance of AnalyzeTextResult class.
*
- * @return the selfHarmResult value.
+ * @param categoriesAnalysis the categoriesAnalysis value to set.
*/
@Generated
- public TextAnalyzeSeverityResult getSelfHarmResult() {
- return this.selfHarmResult;
+ @JsonCreator
+ private AnalyzeTextResult(
+ @JsonProperty(value = "categoriesAnalysis") List categoriesAnalysis) {
+ this.categoriesAnalysis = categoriesAnalysis;
}
/**
- * Get the sexualResult property: Analysis result for Sexual category.
+ * Get the blocklistsMatch property: The blocklist match details.
*
- * @return the sexualResult value.
+ * @return the blocklistsMatch value.
*/
@Generated
- public TextAnalyzeSeverityResult getSexualResult() {
- return this.sexualResult;
+ public List getBlocklistsMatch() {
+ return this.blocklistsMatch;
}
/**
- * Get the violenceResult property: Analysis result for Violence category.
+ * Get the categoriesAnalysis property: Analysis result for categories.
*
- * @return the violenceResult value.
+ * @return the categoriesAnalysis value.
*/
@Generated
- public TextAnalyzeSeverityResult getViolenceResult() {
- return this.violenceResult;
+ public List getCategoriesAnalysis() {
+ return this.categoriesAnalysis;
}
}
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/ImageCategoriesAnalysis.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/ImageCategoriesAnalysis.java
new file mode 100644
index 000000000000..6c5114218191
--- /dev/null
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/ImageCategoriesAnalysis.java
@@ -0,0 +1,63 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.ai.contentsafety.models;
+
+import com.azure.core.annotation.Generated;
+import com.azure.core.annotation.Immutable;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** Image analysis result. */
+@Immutable
+public final class ImageCategoriesAnalysis {
+ /*
+ * The image analysis category.
+ */
+ @Generated
+ @JsonProperty(value = "category")
+ private ImageCategory category;
+
+ /*
+ * The value increases with the severity of the input content. The value of this field is determined by the output
+ * type specified in the request. The output type could be ‘FourSeverityLevels’, and the output value can be 0, 2,
+ * 4, 6.
+ */
+ @Generated
+ @JsonProperty(value = "severity")
+ private Integer severity;
+
+ /**
+ * Creates an instance of ImageCategoriesAnalysis class.
+ *
+ * @param category the category value to set.
+ */
+ @Generated
+ @JsonCreator
+ private ImageCategoriesAnalysis(@JsonProperty(value = "category") ImageCategory category) {
+ this.category = category;
+ }
+
+ /**
+ * Get the category property: The image analysis category.
+ *
+ * @return the category value.
+ */
+ @Generated
+ public ImageCategory getCategory() {
+ return this.category;
+ }
+
+ /**
+ * Get the severity property: The value increases with the severity of the input content. The value of this field is
+ * determined by the output type specified in the request. The output type could be ‘FourSeverityLevels’, and the
+ * output value can be 0, 2, 4, 6.
+ *
+ * @return the severity value.
+ */
+ @Generated
+ public Integer getSeverity() {
+ return this.severity;
+ }
+}
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/ImageData.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/ImageData.java
index 0f33dbeba6b5..d19f1c69d5af 100644
--- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/ImageData.java
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/ImageData.java
@@ -10,21 +10,21 @@
import com.fasterxml.jackson.annotation.JsonProperty;
/**
- * The content or blob url of image, could be base64 encoding bytes or blob url. If both are given, the request will be
- * refused. The maximum size of image is 2048 pixels * 2048 pixels, no larger than 4MB at the same time. The minimum
- * size of image is 50 pixels * 50 pixels.
+ * The image can be either base64 encoded bytes or a blob URL. You can choose only one of these options. If both are
+ * provided, the request will be refused. The maximum image size is 2048 x 2048 pixels and should not exceed 4 MB, while
+ * the minimum image size is 50 x 50 pixels.
*/
@Fluent
public final class ImageData {
/*
- * Base64 encoding of image.
+ * The Base64 encoding of the image.
*/
@Generated
@JsonProperty(value = "content")
private byte[] content;
/*
- * The blob url of image.
+ * The blob url of the image.
*/
@Generated
@JsonProperty(value = "blobUrl")
@@ -35,7 +35,7 @@ public final class ImageData {
public ImageData() {}
/**
- * Get the content property: Base64 encoding of image.
+ * Get the content property: The Base64 encoding of the image.
*
* @return the content value.
*/
@@ -45,7 +45,7 @@ public byte[] getContent() {
}
/**
- * Set the content property: Base64 encoding of image.
+ * Set the content property: The Base64 encoding of the image.
*
* @param content the content value to set.
* @return the ImageData object itself.
@@ -57,7 +57,7 @@ public ImageData setContent(byte[] content) {
}
/**
- * Get the blobUrl property: The blob url of image.
+ * Get the blobUrl property: The blob url of the image.
*
* @return the blobUrl value.
*/
@@ -67,7 +67,7 @@ public String getBlobUrl() {
}
/**
- * Set the blobUrl property: The blob url of image.
+ * Set the blobUrl property: The blob url of the image.
*
* @param blobUrl the blobUrl value to set.
* @return the ImageData object itself.
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/RemoveTextBlocklistItemsOptions.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/RemoveTextBlocklistItemsOptions.java
new file mode 100644
index 000000000000..7f92e820fed3
--- /dev/null
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/RemoveTextBlocklistItemsOptions.java
@@ -0,0 +1,43 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.ai.contentsafety.models;
+
+import com.azure.core.annotation.Generated;
+import com.azure.core.annotation.Immutable;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+
+/** The request to remove blocklistItems from a text blocklist. */
+@Immutable
+public final class RemoveTextBlocklistItemsOptions {
+ /*
+ * Array of blocklistItemIds to remove.
+ */
+ @Generated
+ @JsonProperty(value = "blocklistItemIds")
+ private List blocklistItemIds;
+
+ /**
+ * Creates an instance of RemoveTextBlocklistItemsOptions class.
+ *
+ * @param blocklistItemIds the blocklistItemIds value to set.
+ */
+ @Generated
+ @JsonCreator
+ public RemoveTextBlocklistItemsOptions(@JsonProperty(value = "blocklistItemIds") List blocklistItemIds) {
+ this.blocklistItemIds = blocklistItemIds;
+ }
+
+ /**
+ * Get the blocklistItemIds property: Array of blocklistItemIds to remove.
+ *
+ * @return the blocklistItemIds value.
+ */
+ @Generated
+ public List getBlocklistItemIds() {
+ return this.blocklistItemIds;
+ }
+}
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/TextBlocklistItem.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/TextBlocklistItem.java
new file mode 100644
index 000000000000..8113de47618e
--- /dev/null
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/TextBlocklistItem.java
@@ -0,0 +1,88 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.ai.contentsafety.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.annotation.Generated;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** Item in a TextBlocklist. */
+@Fluent
+public final class TextBlocklistItem {
+ /*
+ * The service will generate a BlocklistItemId, which will be a UUID.
+ */
+ @Generated
+ @JsonProperty(value = "blocklistItemId", access = JsonProperty.Access.WRITE_ONLY)
+ private String blocklistItemId;
+
+ /*
+ * BlocklistItem description.
+ */
+ @Generated
+ @JsonProperty(value = "description")
+ private String description;
+
+ /*
+ * BlocklistItem content.
+ */
+ @Generated
+ @JsonProperty(value = "text")
+ private String text;
+
+ /**
+ * Creates an instance of TextBlocklistItem class.
+ *
+ * @param text the text value to set.
+ */
+ @Generated
+ @JsonCreator
+ public TextBlocklistItem(@JsonProperty(value = "text") String text) {
+ this.text = text;
+ }
+
+ /**
+ * Get the blocklistItemId property: The service will generate a BlocklistItemId, which will be a UUID.
+ *
+ * @return the blocklistItemId value.
+ */
+ @Generated
+ public String getBlocklistItemId() {
+ return this.blocklistItemId;
+ }
+
+ /**
+ * Get the description property: BlocklistItem description.
+ *
+ * @return the description value.
+ */
+ @Generated
+ public String getDescription() {
+ return this.description;
+ }
+
+ /**
+ * Set the description property: BlocklistItem description.
+ *
+ * @param description the description value to set.
+ * @return the TextBlocklistItem object itself.
+ */
+ @Generated
+ public TextBlocklistItem setDescription(String description) {
+ this.description = description;
+ return this;
+ }
+
+ /**
+ * Get the text property: BlocklistItem content.
+ *
+ * @return the text value.
+ */
+ @Generated
+ public String getText() {
+ return this.text;
+ }
+}
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/TextBlocklistMatch.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/TextBlocklistMatch.java
new file mode 100644
index 000000000000..aaf357327af1
--- /dev/null
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/TextBlocklistMatch.java
@@ -0,0 +1,83 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.ai.contentsafety.models;
+
+import com.azure.core.annotation.Generated;
+import com.azure.core.annotation.Immutable;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** The result of blocklist match. */
+@Immutable
+public final class TextBlocklistMatch {
+ /*
+ * The name of the matched blocklist.
+ */
+ @Generated
+ @JsonProperty(value = "blocklistName")
+ private String blocklistName;
+
+ /*
+ * The ID of the matched item.
+ */
+ @Generated
+ @JsonProperty(value = "blocklistItemId")
+ private String blocklistItemId;
+
+ /*
+ * The content of the matched item.
+ */
+ @Generated
+ @JsonProperty(value = "blocklistItemText")
+ private String blocklistItemText;
+
+ /**
+ * Creates an instance of TextBlocklistMatch class.
+ *
+ * @param blocklistName the blocklistName value to set.
+ * @param blocklistItemId the blocklistItemId value to set.
+ * @param blocklistItemText the blocklistItemText value to set.
+ */
+ @Generated
+ @JsonCreator
+ private TextBlocklistMatch(
+ @JsonProperty(value = "blocklistName") String blocklistName,
+ @JsonProperty(value = "blocklistItemId") String blocklistItemId,
+ @JsonProperty(value = "blocklistItemText") String blocklistItemText) {
+ this.blocklistName = blocklistName;
+ this.blocklistItemId = blocklistItemId;
+ this.blocklistItemText = blocklistItemText;
+ }
+
+ /**
+ * Get the blocklistName property: The name of the matched blocklist.
+ *
+ * @return the blocklistName value.
+ */
+ @Generated
+ public String getBlocklistName() {
+ return this.blocklistName;
+ }
+
+ /**
+ * Get the blocklistItemId property: The ID of the matched item.
+ *
+ * @return the blocklistItemId value.
+ */
+ @Generated
+ public String getBlocklistItemId() {
+ return this.blocklistItemId;
+ }
+
+ /**
+ * Get the blocklistItemText property: The content of the matched item.
+ *
+ * @return the blocklistItemText value.
+ */
+ @Generated
+ public String getBlocklistItemText() {
+ return this.blocklistItemText;
+ }
+}
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/TextCategoriesAnalysis.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/TextCategoriesAnalysis.java
new file mode 100644
index 000000000000..7df8d70ffb03
--- /dev/null
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/models/TextCategoriesAnalysis.java
@@ -0,0 +1,63 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.ai.contentsafety.models;
+
+import com.azure.core.annotation.Generated;
+import com.azure.core.annotation.Immutable;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** Text analysis result. */
+@Immutable
+public final class TextCategoriesAnalysis {
+ /*
+ * The text analysis category.
+ */
+ @Generated
+ @JsonProperty(value = "category")
+ private TextCategory category;
+
+ /*
+ * The value increases with the severity of the input content. The value of this field is determined by the output
+ * type specified in the request. The output type could be ‘FourSeverityLevels’ or ‘EightSeverity Levels’, and the
+ * output value can be 0, 2, 4, 6 or 0, 1, 2, 3, 4, 5, 6, or 7.
+ */
+ @Generated
+ @JsonProperty(value = "severity")
+ private Integer severity;
+
+ /**
+ * Creates an instance of TextCategoriesAnalysis class.
+ *
+ * @param category the category value to set.
+ */
+ @Generated
+ @JsonCreator
+ private TextCategoriesAnalysis(@JsonProperty(value = "category") TextCategory category) {
+ this.category = category;
+ }
+
+ /**
+ * Get the category property: The text analysis category.
+ *
+ * @return the category value.
+ */
+ @Generated
+ public TextCategory getCategory() {
+ return this.category;
+ }
+
+ /**
+ * Get the severity property: The value increases with the severity of the input content. The value of this field is
+ * determined by the output type specified in the request. The output type could be ‘FourSeverityLevels’ or
+ * ‘EightSeverity Levels’, and the output value can be 0, 2, 4, 6 or 0, 1, 2, 3, 4, 5, 6, or 7.
+ *
+ * @return the severity value.
+ */
+ @Generated
+ public Integer getSeverity() {
+ return this.severity;
+ }
+}
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/samples/java/com/azure/ai/contentsafety/generated/AddOrUpdateBlocklistItemsToTextBlocklist.java b/sdk/contentsafety/azure-ai-contentsafety/src/samples/java/com/azure/ai/contentsafety/generated/AddOrUpdateBlocklistItemsToTextBlocklist.java
new file mode 100644
index 000000000000..df176fd89249
--- /dev/null
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/samples/java/com/azure/ai/contentsafety/generated/AddOrUpdateBlocklistItemsToTextBlocklist.java
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.ai.contentsafety.generated;
+
+import com.azure.ai.contentsafety.ContentSafetyClient;
+import com.azure.ai.contentsafety.ContentSafetyClientBuilder;
+import com.azure.ai.contentsafety.models.AddOrUpdateTextBlocklistItemsOptions;
+import com.azure.ai.contentsafety.models.AddOrUpdateTextBlocklistItemsResult;
+import com.azure.ai.contentsafety.models.TextBlocklistItem;
+import com.azure.core.util.Configuration;
+import com.azure.identity.DefaultAzureCredentialBuilder;
+import java.util.Arrays;
+
+public class AddOrUpdateBlocklistItemsToTextBlocklist {
+ public static void main(String[] args) {
+ ContentSafetyClient contentSafetyClient =
+ new ContentSafetyClientBuilder()
+ .credential(new DefaultAzureCredentialBuilder().build())
+ .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT"))
+ .buildClient();
+ // BEGIN:com.azure.ai.contentsafety.generated.addorupdateblocklistitems.addorupdateblocklistitemstotextblocklist
+ AddOrUpdateTextBlocklistItemsResult response =
+ contentSafetyClient.addOrUpdateBlocklistItems(
+ "TestBlocklist",
+ new AddOrUpdateTextBlocklistItemsOptions(
+ Arrays.asList(new TextBlocklistItem("hate").setDescription("Hate word"))));
+ // END:com.azure.ai.contentsafety.generated.addorupdateblocklistitems.addorupdateblocklistitemstotextblocklist
+ }
+}
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/samples/java/com/azure/ai/contentsafety/generated/AnalyzeImage.java b/sdk/contentsafety/azure-ai-contentsafety/src/samples/java/com/azure/ai/contentsafety/generated/AnalyzeImage.java
new file mode 100644
index 000000000000..cad1a86b6882
--- /dev/null
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/samples/java/com/azure/ai/contentsafety/generated/AnalyzeImage.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.ai.contentsafety.generated;
+
+import com.azure.ai.contentsafety.ContentSafetyClient;
+import com.azure.ai.contentsafety.ContentSafetyClientBuilder;
+import com.azure.ai.contentsafety.models.AnalyzeImageOptions;
+import com.azure.ai.contentsafety.models.AnalyzeImageResult;
+import com.azure.ai.contentsafety.models.ImageData;
+import com.azure.core.util.Configuration;
+import com.azure.identity.DefaultAzureCredentialBuilder;
+
+public class AnalyzeImage {
+ public static void main(String[] args) {
+ ContentSafetyClient contentSafetyClient =
+ new ContentSafetyClientBuilder()
+ .credential(new DefaultAzureCredentialBuilder().build())
+ .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT"))
+ .buildClient();
+ // BEGIN:com.azure.ai.contentsafety.generated.analyzeimage.analyzeimage
+ AnalyzeImageResult response =
+ contentSafetyClient.analyzeImage(
+ new AnalyzeImageOptions(new ImageData().setContent("Y29udGVudDE=".getBytes())));
+ // END:com.azure.ai.contentsafety.generated.analyzeimage.analyzeimage
+ }
+}
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/samples/java/com/azure/ai/contentsafety/generated/AnalyzeText.java b/sdk/contentsafety/azure-ai-contentsafety/src/samples/java/com/azure/ai/contentsafety/generated/AnalyzeText.java
new file mode 100644
index 000000000000..3225c9b5bac9
--- /dev/null
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/samples/java/com/azure/ai/contentsafety/generated/AnalyzeText.java
@@ -0,0 +1,25 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.ai.contentsafety.generated;
+
+import com.azure.ai.contentsafety.ContentSafetyClient;
+import com.azure.ai.contentsafety.ContentSafetyClientBuilder;
+import com.azure.ai.contentsafety.models.AnalyzeTextOptions;
+import com.azure.ai.contentsafety.models.AnalyzeTextResult;
+import com.azure.core.util.Configuration;
+import com.azure.identity.DefaultAzureCredentialBuilder;
+
+public class AnalyzeText {
+ public static void main(String[] args) {
+ ContentSafetyClient contentSafetyClient =
+ new ContentSafetyClientBuilder()
+ .credential(new DefaultAzureCredentialBuilder().build())
+ .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT"))
+ .buildClient();
+ // BEGIN:com.azure.ai.contentsafety.generated.analyzetext.analyzetext
+ AnalyzeTextResult response = contentSafetyClient.analyzeText(new AnalyzeTextOptions("This is text example"));
+ // END:com.azure.ai.contentsafety.generated.analyzetext.analyzetext
+ }
+}
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/samples/java/com/azure/ai/contentsafety/generated/CreateOrUpdateTextBlocklist.java b/sdk/contentsafety/azure-ai-contentsafety/src/samples/java/com/azure/ai/contentsafety/generated/CreateOrUpdateTextBlocklist.java
new file mode 100644
index 000000000000..35794b19a711
--- /dev/null
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/samples/java/com/azure/ai/contentsafety/generated/CreateOrUpdateTextBlocklist.java
@@ -0,0 +1,29 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.ai.contentsafety.generated;
+
+import com.azure.ai.contentsafety.ContentSafetyClient;
+import com.azure.ai.contentsafety.ContentSafetyClientBuilder;
+import com.azure.core.http.rest.RequestOptions;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.BinaryData;
+import com.azure.core.util.Configuration;
+import com.azure.identity.DefaultAzureCredentialBuilder;
+
+public class CreateOrUpdateTextBlocklist {
+ public static void main(String[] args) {
+ ContentSafetyClient contentSafetyClient =
+ new ContentSafetyClientBuilder()
+ .credential(new DefaultAzureCredentialBuilder().build())
+ .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT"))
+ .buildClient();
+ // BEGIN:com.azure.ai.contentsafety.generated.createorupdatetextblocklist.createorupdatetextblocklist
+ BinaryData resource = BinaryData.fromString("{\"description\":\"Test Blocklist\"}");
+ RequestOptions requestOptions = new RequestOptions();
+ Response response =
+ contentSafetyClient.createOrUpdateTextBlocklistWithResponse("TestBlocklist", resource, requestOptions);
+ // END:com.azure.ai.contentsafety.generated.createorupdatetextblocklist.createorupdatetextblocklist
+ }
+}
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/samples/java/com/azure/ai/contentsafety/generated/DeleteTextBlocklistByBlocklistName.java b/sdk/contentsafety/azure-ai-contentsafety/src/samples/java/com/azure/ai/contentsafety/generated/DeleteTextBlocklistByBlocklistName.java
new file mode 100644
index 000000000000..8d064218451f
--- /dev/null
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/samples/java/com/azure/ai/contentsafety/generated/DeleteTextBlocklistByBlocklistName.java
@@ -0,0 +1,23 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.ai.contentsafety.generated;
+
+import com.azure.ai.contentsafety.ContentSafetyClient;
+import com.azure.ai.contentsafety.ContentSafetyClientBuilder;
+import com.azure.core.util.Configuration;
+import com.azure.identity.DefaultAzureCredentialBuilder;
+
+public class DeleteTextBlocklistByBlocklistName {
+ public static void main(String[] args) {
+ ContentSafetyClient contentSafetyClient =
+ new ContentSafetyClientBuilder()
+ .credential(new DefaultAzureCredentialBuilder().build())
+ .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT"))
+ .buildClient();
+ // BEGIN:com.azure.ai.contentsafety.generated.deletetextblocklist.deletetextblocklistbyblocklistname
+ contentSafetyClient.deleteTextBlocklist("TestBlocklist");
+ // END:com.azure.ai.contentsafety.generated.deletetextblocklist.deletetextblocklistbyblocklistname
+ }
+}
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/samples/java/com/azure/ai/contentsafety/generated/GetAllBlockItemsByBlocklistName.java b/sdk/contentsafety/azure-ai-contentsafety/src/samples/java/com/azure/ai/contentsafety/generated/GetAllBlockItemsByBlocklistName.java
new file mode 100644
index 000000000000..12536a4a5e12
--- /dev/null
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/samples/java/com/azure/ai/contentsafety/generated/GetAllBlockItemsByBlocklistName.java
@@ -0,0 +1,26 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.ai.contentsafety.generated;
+
+import com.azure.ai.contentsafety.ContentSafetyClient;
+import com.azure.ai.contentsafety.ContentSafetyClientBuilder;
+import com.azure.ai.contentsafety.models.TextBlocklistItem;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Configuration;
+import com.azure.identity.DefaultAzureCredentialBuilder;
+
+public class GetAllBlockItemsByBlocklistName {
+ public static void main(String[] args) {
+ ContentSafetyClient contentSafetyClient =
+ new ContentSafetyClientBuilder()
+ .credential(new DefaultAzureCredentialBuilder().build())
+ .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT"))
+ .buildClient();
+ // BEGIN:com.azure.ai.contentsafety.generated.listtextblocklistitems.getallblockitemsbyblocklistname
+ PagedIterable response =
+ contentSafetyClient.listTextBlocklistItems("TestBlocklist", null, null);
+ // END:com.azure.ai.contentsafety.generated.listtextblocklistitems.getallblockitemsbyblocklistname
+ }
+}
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/samples/java/com/azure/ai/contentsafety/generated/GetAllTextBlocklists.java b/sdk/contentsafety/azure-ai-contentsafety/src/samples/java/com/azure/ai/contentsafety/generated/GetAllTextBlocklists.java
new file mode 100644
index 000000000000..d9b2f5cdcf8d
--- /dev/null
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/samples/java/com/azure/ai/contentsafety/generated/GetAllTextBlocklists.java
@@ -0,0 +1,25 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.ai.contentsafety.generated;
+
+import com.azure.ai.contentsafety.ContentSafetyClient;
+import com.azure.ai.contentsafety.ContentSafetyClientBuilder;
+import com.azure.ai.contentsafety.models.TextBlocklist;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Configuration;
+import com.azure.identity.DefaultAzureCredentialBuilder;
+
+public class GetAllTextBlocklists {
+ public static void main(String[] args) {
+ ContentSafetyClient contentSafetyClient =
+ new ContentSafetyClientBuilder()
+ .credential(new DefaultAzureCredentialBuilder().build())
+ .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT"))
+ .buildClient();
+ // BEGIN:com.azure.ai.contentsafety.generated.listtextblocklists.getalltextblocklists
+ PagedIterable response = contentSafetyClient.listTextBlocklists();
+ // END:com.azure.ai.contentsafety.generated.listtextblocklists.getalltextblocklists
+ }
+}
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/samples/java/com/azure/ai/contentsafety/generated/GetBlockItemByBlocklistNameAndBlocklistItemId.java b/sdk/contentsafety/azure-ai-contentsafety/src/samples/java/com/azure/ai/contentsafety/generated/GetBlockItemByBlocklistNameAndBlocklistItemId.java
new file mode 100644
index 000000000000..29bf5ae9bee9
--- /dev/null
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/samples/java/com/azure/ai/contentsafety/generated/GetBlockItemByBlocklistNameAndBlocklistItemId.java
@@ -0,0 +1,25 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.ai.contentsafety.generated;
+
+import com.azure.ai.contentsafety.ContentSafetyClient;
+import com.azure.ai.contentsafety.ContentSafetyClientBuilder;
+import com.azure.ai.contentsafety.models.TextBlocklistItem;
+import com.azure.core.util.Configuration;
+import com.azure.identity.DefaultAzureCredentialBuilder;
+
+public class GetBlockItemByBlocklistNameAndBlocklistItemId {
+ public static void main(String[] args) {
+ ContentSafetyClient contentSafetyClient =
+ new ContentSafetyClientBuilder()
+ .credential(new DefaultAzureCredentialBuilder().build())
+ .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT"))
+ .buildClient();
+ // BEGIN:com.azure.ai.contentsafety.generated.gettextblocklistitem.getblockitembyblocklistnameandblocklistitemid
+ TextBlocklistItem response =
+ contentSafetyClient.getTextBlocklistItem("TestBlocklist", "9511969e-f1e3-4604-9127-05ee16c509ec");
+ // END:com.azure.ai.contentsafety.generated.gettextblocklistitem.getblockitembyblocklistnameandblocklistitemid
+ }
+}
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/samples/java/com/azure/ai/contentsafety/generated/GetTextBlocklistByBlocklistName.java b/sdk/contentsafety/azure-ai-contentsafety/src/samples/java/com/azure/ai/contentsafety/generated/GetTextBlocklistByBlocklistName.java
new file mode 100644
index 000000000000..d1865ff8c59e
--- /dev/null
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/samples/java/com/azure/ai/contentsafety/generated/GetTextBlocklistByBlocklistName.java
@@ -0,0 +1,24 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.ai.contentsafety.generated;
+
+import com.azure.ai.contentsafety.ContentSafetyClient;
+import com.azure.ai.contentsafety.ContentSafetyClientBuilder;
+import com.azure.ai.contentsafety.models.TextBlocklist;
+import com.azure.core.util.Configuration;
+import com.azure.identity.DefaultAzureCredentialBuilder;
+
+public class GetTextBlocklistByBlocklistName {
+ public static void main(String[] args) {
+ ContentSafetyClient contentSafetyClient =
+ new ContentSafetyClientBuilder()
+ .credential(new DefaultAzureCredentialBuilder().build())
+ .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT"))
+ .buildClient();
+ // BEGIN:com.azure.ai.contentsafety.generated.gettextblocklist.gettextblocklistbyblocklistname
+ TextBlocklist response = contentSafetyClient.getTextBlocklist("TestBlocklist");
+ // END:com.azure.ai.contentsafety.generated.gettextblocklist.gettextblocklistbyblocklistname
+ }
+}
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/samples/java/com/azure/ai/contentsafety/generated/RemoveBlockItemsFromTextBlocklist.java b/sdk/contentsafety/azure-ai-contentsafety/src/samples/java/com/azure/ai/contentsafety/generated/RemoveBlockItemsFromTextBlocklist.java
new file mode 100644
index 000000000000..8e8f12a8744f
--- /dev/null
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/samples/java/com/azure/ai/contentsafety/generated/RemoveBlockItemsFromTextBlocklist.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.ai.contentsafety.generated;
+
+import com.azure.ai.contentsafety.ContentSafetyClient;
+import com.azure.ai.contentsafety.ContentSafetyClientBuilder;
+import com.azure.ai.contentsafety.models.RemoveTextBlocklistItemsOptions;
+import com.azure.core.util.Configuration;
+import com.azure.identity.DefaultAzureCredentialBuilder;
+import java.util.Arrays;
+
+public class RemoveBlockItemsFromTextBlocklist {
+ public static void main(String[] args) {
+ ContentSafetyClient contentSafetyClient =
+ new ContentSafetyClientBuilder()
+ .credential(new DefaultAzureCredentialBuilder().build())
+ .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT"))
+ .buildClient();
+ // BEGIN:com.azure.ai.contentsafety.generated.removeblocklistitems.removeblockitemsfromtextblocklist
+ contentSafetyClient.removeBlocklistItems(
+ "TestBlocklist",
+ new RemoveTextBlocklistItemsOptions(Arrays.asList("9511969e-f1e3-4604-9127-05ee16c509ec")));
+ // END:com.azure.ai.contentsafety.generated.removeblocklistitems.removeblockitemsfromtextblocklist
+ }
+}
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/test/java/com/azure/ai/contentsafety/generated/AddOrUpdateBlocklistItemsToTextBlocklistTests.java b/sdk/contentsafety/azure-ai-contentsafety/src/test/java/com/azure/ai/contentsafety/generated/AddOrUpdateBlocklistItemsToTextBlocklistTests.java
new file mode 100644
index 000000000000..7a21d7a94d65
--- /dev/null
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/test/java/com/azure/ai/contentsafety/generated/AddOrUpdateBlocklistItemsToTextBlocklistTests.java
@@ -0,0 +1,39 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.ai.contentsafety.generated;
+
+import com.azure.ai.contentsafety.models.AddOrUpdateTextBlocklistItemsOptions;
+import com.azure.ai.contentsafety.models.AddOrUpdateTextBlocklistItemsResult;
+import com.azure.ai.contentsafety.models.TextBlocklistItem;
+import java.util.Arrays;
+import java.util.List;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+@Disabled
+public final class AddOrUpdateBlocklistItemsToTextBlocklistTests extends ContentSafetyClientTestBase {
+ @Test
+ @Disabled
+ public void testAddOrUpdateBlocklistItemsToTextBlocklistTests() {
+ // method invocation
+ AddOrUpdateTextBlocklistItemsResult response =
+ contentSafetyClient.addOrUpdateBlocklistItems(
+ "TestBlocklist",
+ new AddOrUpdateTextBlocklistItemsOptions(
+ Arrays.asList(new TextBlocklistItem("hate").setDescription("Hate word"))));
+
+ // response assertion
+ Assertions.assertNotNull(response);
+ // verify property "blocklistItems"
+ List responseBlocklistItems = response.getBlocklistItems();
+ TextBlocklistItem responseBlocklistItemsFirstItem = responseBlocklistItems.iterator().next();
+ Assertions.assertNotNull(responseBlocklistItemsFirstItem);
+ Assertions.assertEquals(
+ "9511969e-f1e3-4604-9127-05ee16c509ec", responseBlocklistItemsFirstItem.getBlocklistItemId());
+ Assertions.assertEquals("Hate word", responseBlocklistItemsFirstItem.getDescription());
+ Assertions.assertEquals("hate", responseBlocklistItemsFirstItem.getText());
+ }
+}
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/test/java/com/azure/ai/contentsafety/generated/AnalyzeImageTests.java b/sdk/contentsafety/azure-ai-contentsafety/src/test/java/com/azure/ai/contentsafety/generated/AnalyzeImageTests.java
new file mode 100644
index 000000000000..bb427805d3d8
--- /dev/null
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/test/java/com/azure/ai/contentsafety/generated/AnalyzeImageTests.java
@@ -0,0 +1,36 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.ai.contentsafety.generated;
+
+import com.azure.ai.contentsafety.models.AnalyzeImageOptions;
+import com.azure.ai.contentsafety.models.AnalyzeImageResult;
+import com.azure.ai.contentsafety.models.ImageCategoriesAnalysis;
+import com.azure.ai.contentsafety.models.ImageCategory;
+import com.azure.ai.contentsafety.models.ImageData;
+import java.util.List;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+@Disabled
+public final class AnalyzeImageTests extends ContentSafetyClientTestBase {
+ @Test
+ @Disabled
+ public void testAnalyzeImageTests() {
+ // method invocation
+ AnalyzeImageResult response =
+ contentSafetyClient.analyzeImage(
+ new AnalyzeImageOptions(new ImageData().setContent("Y29udGVudDE=".getBytes())));
+
+ // response assertion
+ Assertions.assertNotNull(response);
+ // verify property "categoriesAnalysis"
+ List responseCategoriesAnalysis = response.getCategoriesAnalysis();
+ ImageCategoriesAnalysis responseCategoriesAnalysisFirstItem = responseCategoriesAnalysis.iterator().next();
+ Assertions.assertNotNull(responseCategoriesAnalysisFirstItem);
+ Assertions.assertEquals(ImageCategory.HATE, responseCategoriesAnalysisFirstItem.getCategory());
+ Assertions.assertEquals(0, responseCategoriesAnalysisFirstItem.getSeverity());
+ }
+}
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/test/java/com/azure/ai/contentsafety/generated/AnalyzeTextTests.java b/sdk/contentsafety/azure-ai-contentsafety/src/test/java/com/azure/ai/contentsafety/generated/AnalyzeTextTests.java
new file mode 100644
index 000000000000..1337f14af98c
--- /dev/null
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/test/java/com/azure/ai/contentsafety/generated/AnalyzeTextTests.java
@@ -0,0 +1,37 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.ai.contentsafety.generated;
+
+import com.azure.ai.contentsafety.models.AnalyzeTextOptions;
+import com.azure.ai.contentsafety.models.AnalyzeTextResult;
+import com.azure.ai.contentsafety.models.TextBlocklistMatch;
+import com.azure.ai.contentsafety.models.TextCategoriesAnalysis;
+import com.azure.ai.contentsafety.models.TextCategory;
+import java.util.List;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+@Disabled
+public final class AnalyzeTextTests extends ContentSafetyClientTestBase {
+ @Test
+ @Disabled
+ public void testAnalyzeTextTests() {
+ // method invocation
+ AnalyzeTextResult response = contentSafetyClient.analyzeText(new AnalyzeTextOptions("This is text example"));
+
+ // response assertion
+ Assertions.assertNotNull(response);
+ // verify property "blocklistsMatch"
+ List responseBlocklistsMatch = response.getBlocklistsMatch();
+ Assertions.assertEquals(0, responseBlocklistsMatch.size());
+ // verify property "categoriesAnalysis"
+ List responseCategoriesAnalysis = response.getCategoriesAnalysis();
+ TextCategoriesAnalysis responseCategoriesAnalysisFirstItem = responseCategoriesAnalysis.iterator().next();
+ Assertions.assertNotNull(responseCategoriesAnalysisFirstItem);
+ Assertions.assertEquals(TextCategory.HATE, responseCategoriesAnalysisFirstItem.getCategory());
+ Assertions.assertEquals(0, responseCategoriesAnalysisFirstItem.getSeverity());
+ }
+}
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/test/java/com/azure/ai/contentsafety/generated/ContentSafetyClientTestBase.java b/sdk/contentsafety/azure-ai-contentsafety/src/test/java/com/azure/ai/contentsafety/generated/ContentSafetyClientTestBase.java
new file mode 100644
index 000000000000..2cc44e5c8e08
--- /dev/null
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/test/java/com/azure/ai/contentsafety/generated/ContentSafetyClientTestBase.java
@@ -0,0 +1,47 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.ai.contentsafety.generated;
+
+// The Java test files under 'generated' package are generated for your reference.
+// If you wish to modify these files, please copy them out of the 'generated' package, and modify there.
+// See https://aka.ms/azsdk/dpg/java/tests for guide on adding a test.
+
+import com.azure.ai.contentsafety.ContentSafetyClient;
+import com.azure.ai.contentsafety.ContentSafetyClientBuilder;
+import com.azure.core.credential.AccessToken;
+import com.azure.core.http.HttpClient;
+import com.azure.core.http.policy.HttpLogDetailLevel;
+import com.azure.core.http.policy.HttpLogOptions;
+import com.azure.core.test.TestMode;
+import com.azure.core.test.TestProxyTestBase;
+import com.azure.core.util.Configuration;
+import com.azure.identity.DefaultAzureCredentialBuilder;
+import java.time.OffsetDateTime;
+import reactor.core.publisher.Mono;
+
+class ContentSafetyClientTestBase extends TestProxyTestBase {
+ protected ContentSafetyClient contentSafetyClient;
+
+ @Override
+ protected void beforeTest() {
+ ContentSafetyClientBuilder contentSafetyClientbuilder =
+ new ContentSafetyClientBuilder()
+ .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint"))
+ .httpClient(HttpClient.createDefault())
+ .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC));
+ if (getTestMode() == TestMode.PLAYBACK) {
+ contentSafetyClientbuilder
+ .httpClient(interceptorManager.getPlaybackClient())
+ .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)));
+ } else if (getTestMode() == TestMode.RECORD) {
+ contentSafetyClientbuilder
+ .addPolicy(interceptorManager.getRecordPolicy())
+ .credential(new DefaultAzureCredentialBuilder().build());
+ } else if (getTestMode() == TestMode.LIVE) {
+ contentSafetyClientbuilder.credential(new DefaultAzureCredentialBuilder().build());
+ }
+ contentSafetyClient = contentSafetyClientbuilder.buildClient();
+ }
+}
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/test/java/com/azure/ai/contentsafety/generated/CreateOrUpdateTextBlocklistTests.java b/sdk/contentsafety/azure-ai-contentsafety/src/test/java/com/azure/ai/contentsafety/generated/CreateOrUpdateTextBlocklistTests.java
new file mode 100644
index 000000000000..a4819c9ae620
--- /dev/null
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/test/java/com/azure/ai/contentsafety/generated/CreateOrUpdateTextBlocklistTests.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.ai.contentsafety.generated;
+
+import com.azure.core.http.rest.RequestOptions;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.BinaryData;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+public final class CreateOrUpdateTextBlocklistTests extends ContentSafetyClientTestBase {
+ @Test
+ @Disabled
+ public void testCreateOrUpdateTextBlocklistTests() {
+ BinaryData resource = BinaryData.fromString("{\"description\":\"Test Blocklist\"}");
+ RequestOptions requestOptions = new RequestOptions();
+ Response response =
+ contentSafetyClient.createOrUpdateTextBlocklistWithResponse("TestBlocklist", resource, requestOptions);
+ Assertions.assertEquals(200, response.getStatusCode());
+ Assertions.assertEquals(
+ BinaryData.fromString("{\"blocklistName\":\"TestBlocklist\",\"description\":\"Test Blocklist\"}")
+ .toObject(Object.class),
+ response.getValue().toObject(Object.class));
+ }
+}
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/test/java/com/azure/ai/contentsafety/generated/DeleteTextBlocklistByBlocklistNameTests.java b/sdk/contentsafety/azure-ai-contentsafety/src/test/java/com/azure/ai/contentsafety/generated/DeleteTextBlocklistByBlocklistNameTests.java
new file mode 100644
index 000000000000..bcd737412f73
--- /dev/null
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/test/java/com/azure/ai/contentsafety/generated/DeleteTextBlocklistByBlocklistNameTests.java
@@ -0,0 +1,18 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.ai.contentsafety.generated;
+
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+@Disabled
+public final class DeleteTextBlocklistByBlocklistNameTests extends ContentSafetyClientTestBase {
+ @Test
+ @Disabled
+ public void testDeleteTextBlocklistByBlocklistNameTests() {
+ // method invocation
+ contentSafetyClient.deleteTextBlocklist("TestBlocklist");
+ }
+}
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/test/java/com/azure/ai/contentsafety/generated/GetAllBlockItemsByBlocklistNameTests.java b/sdk/contentsafety/azure-ai-contentsafety/src/test/java/com/azure/ai/contentsafety/generated/GetAllBlockItemsByBlocklistNameTests.java
new file mode 100644
index 000000000000..f5992a361b3f
--- /dev/null
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/test/java/com/azure/ai/contentsafety/generated/GetAllBlockItemsByBlocklistNameTests.java
@@ -0,0 +1,33 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.ai.contentsafety.generated;
+
+import com.azure.ai.contentsafety.models.TextBlocklistItem;
+import com.azure.core.http.rest.PagedIterable;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+@Disabled
+public final class GetAllBlockItemsByBlocklistNameTests extends ContentSafetyClientTestBase {
+ @Test
+ @Disabled
+ public void testGetAllBlockItemsByBlocklistNameTests() {
+ // method invocation
+ PagedIterable response =
+ contentSafetyClient.listTextBlocklistItems("TestBlocklist", null, null);
+
+ // response assertion
+ Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode());
+ TextBlocklistItem firstItem = response.iterator().next();
+ Assertions.assertNotNull(firstItem);
+ // verify property "blocklistItemId"
+ Assertions.assertEquals("9511969e-f1e3-4604-9127-05ee16c509ec", firstItem.getBlocklistItemId());
+ // verify property "description"
+ Assertions.assertEquals("Hate word", firstItem.getDescription());
+ // verify property "text"
+ Assertions.assertEquals("hate", firstItem.getText());
+ }
+}
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/test/java/com/azure/ai/contentsafety/generated/GetAllTextBlocklistsTests.java b/sdk/contentsafety/azure-ai-contentsafety/src/test/java/com/azure/ai/contentsafety/generated/GetAllTextBlocklistsTests.java
new file mode 100644
index 000000000000..8330a3d409df
--- /dev/null
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/test/java/com/azure/ai/contentsafety/generated/GetAllTextBlocklistsTests.java
@@ -0,0 +1,30 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.ai.contentsafety.generated;
+
+import com.azure.ai.contentsafety.models.TextBlocklist;
+import com.azure.core.http.rest.PagedIterable;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+@Disabled
+public final class GetAllTextBlocklistsTests extends ContentSafetyClientTestBase {
+ @Test
+ @Disabled
+ public void testGetAllTextBlocklistsTests() {
+ // method invocation
+ PagedIterable response = contentSafetyClient.listTextBlocklists();
+
+ // response assertion
+ Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode());
+ TextBlocklist firstItem = response.iterator().next();
+ Assertions.assertNotNull(firstItem);
+ // verify property "blocklistName"
+ Assertions.assertEquals("TestBlocklist", firstItem.getBlocklistName());
+ // verify property "description"
+ Assertions.assertEquals("Test Blocklist", firstItem.getDescription());
+ }
+}
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/test/java/com/azure/ai/contentsafety/generated/GetBlockItemByBlocklistNameAndBlocklistItemIdTests.java b/sdk/contentsafety/azure-ai-contentsafety/src/test/java/com/azure/ai/contentsafety/generated/GetBlockItemByBlocklistNameAndBlocklistItemIdTests.java
new file mode 100644
index 000000000000..45cf6b2af347
--- /dev/null
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/test/java/com/azure/ai/contentsafety/generated/GetBlockItemByBlocklistNameAndBlocklistItemIdTests.java
@@ -0,0 +1,30 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.ai.contentsafety.generated;
+
+import com.azure.ai.contentsafety.models.TextBlocklistItem;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+@Disabled
+public final class GetBlockItemByBlocklistNameAndBlocklistItemIdTests extends ContentSafetyClientTestBase {
+ @Test
+ @Disabled
+ public void testGetBlockItemByBlocklistNameAndBlocklistItemIdTests() {
+ // method invocation
+ TextBlocklistItem response =
+ contentSafetyClient.getTextBlocklistItem("TestBlocklist", "9511969e-f1e3-4604-9127-05ee16c509ec");
+
+ // response assertion
+ Assertions.assertNotNull(response);
+ // verify property "blocklistItemId"
+ Assertions.assertEquals("9511969e-f1e3-4604-9127-05ee16c509ec", response.getBlocklistItemId());
+ // verify property "description"
+ Assertions.assertEquals("Hate word", response.getDescription());
+ // verify property "text"
+ Assertions.assertEquals("hate", response.getText());
+ }
+}
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/test/java/com/azure/ai/contentsafety/generated/GetTextBlocklistByBlocklistNameTests.java b/sdk/contentsafety/azure-ai-contentsafety/src/test/java/com/azure/ai/contentsafety/generated/GetTextBlocklistByBlocklistNameTests.java
new file mode 100644
index 000000000000..ae645b3a2bd8
--- /dev/null
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/test/java/com/azure/ai/contentsafety/generated/GetTextBlocklistByBlocklistNameTests.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.ai.contentsafety.generated;
+
+import com.azure.ai.contentsafety.models.TextBlocklist;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+@Disabled
+public final class GetTextBlocklistByBlocklistNameTests extends ContentSafetyClientTestBase {
+ @Test
+ @Disabled
+ public void testGetTextBlocklistByBlocklistNameTests() {
+ // method invocation
+ TextBlocklist response = contentSafetyClient.getTextBlocklist("TestBlocklist");
+
+ // response assertion
+ Assertions.assertNotNull(response);
+ // verify property "blocklistName"
+ Assertions.assertEquals("TestBlocklist", response.getBlocklistName());
+ // verify property "description"
+ Assertions.assertEquals("Test Blocklist", response.getDescription());
+ }
+}
diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/test/java/com/azure/ai/contentsafety/generated/RemoveBlockItemsFromTextBlocklistTests.java b/sdk/contentsafety/azure-ai-contentsafety/src/test/java/com/azure/ai/contentsafety/generated/RemoveBlockItemsFromTextBlocklistTests.java
new file mode 100644
index 000000000000..402f830ab1f3
--- /dev/null
+++ b/sdk/contentsafety/azure-ai-contentsafety/src/test/java/com/azure/ai/contentsafety/generated/RemoveBlockItemsFromTextBlocklistTests.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.ai.contentsafety.generated;
+
+import com.azure.ai.contentsafety.models.RemoveTextBlocklistItemsOptions;
+import java.util.Arrays;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+@Disabled
+public final class RemoveBlockItemsFromTextBlocklistTests extends ContentSafetyClientTestBase {
+ @Test
+ @Disabled
+ public void testRemoveBlockItemsFromTextBlocklistTests() {
+ // method invocation
+ contentSafetyClient.removeBlocklistItems(
+ "TestBlocklist",
+ new RemoveTextBlocklistItemsOptions(Arrays.asList("9511969e-f1e3-4604-9127-05ee16c509ec")));
+ }
+}
diff --git a/sdk/contentsafety/azure-ai-contentsafety/tsp-location.yaml b/sdk/contentsafety/azure-ai-contentsafety/tsp-location.yaml
index 36893b3adfe0..781ac1f522fc 100644
--- a/sdk/contentsafety/azure-ai-contentsafety/tsp-location.yaml
+++ b/sdk/contentsafety/azure-ai-contentsafety/tsp-location.yaml
@@ -1,5 +1,5 @@
+commit: e794a040efdd683ddc3c4ed7aa6a3ea6f685fdba
directory: specification/cognitiveservices/ContentSafety
-repo: Azure/azure-rest-api-specs
-commit: b253e331e2f0365f698e88eb3058a4f69bcc502a
additionalDirectories: []
+repo: Azure/azure-rest-api-specs