forked from Azure/azure-sdk-for-java
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CodeGen from PR 3383 in test-repo-billy/azure-rest-api-specs
Merge 12d12592e186a02f280c2f6a28d663d6d96e5aa2 into 152d42215263aa8bd9e2d635120581fff0d14608
- Loading branch information
SDKAuto
committed
Oct 29, 2024
1 parent
5a36dcb
commit 2b35003
Showing
27 changed files
with
758 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...s/java/com/azure/ai/contentsafety/generated/AddOrUpdateBlocklistItemsToTextBlocklist.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.BlocklistClient; | ||
import com.azure.ai.contentsafety.BlocklistClientBuilder; | ||
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) { | ||
BlocklistClient blocklistClient | ||
= new BlocklistClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) | ||
.endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) | ||
.buildClient(); | ||
// BEGIN:com.azure.ai.contentsafety.generated.addorupdateblocklistitems.addorupdateblocklistitemstotextblocklist | ||
AddOrUpdateTextBlocklistItemsResult response | ||
= blocklistClient.addOrUpdateBlocklistItems("TestBlocklist", new AddOrUpdateTextBlocklistItemsOptions( | ||
Arrays.asList(new TextBlocklistItem("hate").setDescription("Hate word")))); | ||
// END:com.azure.ai.contentsafety.generated.addorupdateblocklistitems.addorupdateblocklistitemstotextblocklist | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...-ai-contentsafety/src/samples/java/com/azure/ai/contentsafety/generated/AnalyzeImage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.AnalyzeImageOptions; | ||
import com.azure.ai.contentsafety.models.AnalyzeImageResult; | ||
import com.azure.ai.contentsafety.models.ContentSafetyImageData; | ||
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 ContentSafetyImageData().setContent("Y29udGVudDE=".getBytes()))); | ||
// END:com.azure.ai.contentsafety.generated.analyzeimage.analyzeimage | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...e-ai-contentsafety/src/samples/java/com/azure/ai/contentsafety/generated/AnalyzeText.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.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(null)); | ||
// END:com.azure.ai.contentsafety.generated.analyzetext.analyzetext | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...ty/src/samples/java/com/azure/ai/contentsafety/generated/CreateOrUpdateTextBlocklist.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.BlocklistClient; | ||
import com.azure.ai.contentsafety.BlocklistClientBuilder; | ||
import com.azure.ai.contentsafety.models.TextBlocklist; | ||
import com.azure.core.util.Configuration; | ||
import com.azure.identity.DefaultAzureCredentialBuilder; | ||
|
||
public class CreateOrUpdateTextBlocklist { | ||
public static void main(String[] args) { | ||
BlocklistClient blocklistClient | ||
= new BlocklistClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) | ||
.endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) | ||
.buildClient(); | ||
// BEGIN:com.azure.ai.contentsafety.generated.createorupdatetextblocklist.createorupdatetextblocklist | ||
TextBlocklist response = blocklistClient.createOrUpdateTextBlocklist("TestBlocklist", null); | ||
// END:com.azure.ai.contentsafety.generated.createorupdatetextblocklist.createorupdatetextblocklist | ||
} | ||
} |
Oops, something went wrong.