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 31543 in Azure/azure-rest-api-specs
Merge b9933f6f77779bdd9c747533813f3b4766b4230f into 43ce04961ccb6496e421789c54798ba1e0880f64
- Loading branch information
SDKAuto
committed
Nov 29, 2024
1 parent
8b0eef6
commit eac19b2
Showing
23 changed files
with
702 additions
and
5 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
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("This is text example")); | ||
// 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 | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
...samples/java/com/azure/ai/contentsafety/generated/DeleteTextBlocklistByBlocklistName.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,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.BlocklistClient; | ||
import com.azure.ai.contentsafety.BlocklistClientBuilder; | ||
import com.azure.core.util.Configuration; | ||
import com.azure.identity.DefaultAzureCredentialBuilder; | ||
|
||
public class DeleteTextBlocklistByBlocklistName { | ||
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.deletetextblocklist.deletetextblocklistbyblocklistname | ||
blocklistClient.deleteTextBlocklist("TestBlocklist"); | ||
// END:com.azure.ai.contentsafety.generated.deletetextblocklist.deletetextblocklistbyblocklistname | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...rc/samples/java/com/azure/ai/contentsafety/generated/GetAllBlockItemsByBlocklistName.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.BlocklistClient; | ||
import com.azure.ai.contentsafety.BlocklistClientBuilder; | ||
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) { | ||
BlocklistClient blocklistClient | ||
= new BlocklistClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) | ||
.endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) | ||
.buildClient(); | ||
// BEGIN:com.azure.ai.contentsafety.generated.listtextblocklistitems.getallblockitemsbyblocklistname | ||
PagedIterable<TextBlocklistItem> response = blocklistClient.listTextBlocklistItems("TestBlocklist", null, null); | ||
// END:com.azure.ai.contentsafety.generated.listtextblocklistitems.getallblockitemsbyblocklistname | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...entsafety/src/samples/java/com/azure/ai/contentsafety/generated/GetAllTextBlocklists.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.BlocklistClient; | ||
import com.azure.ai.contentsafety.BlocklistClientBuilder; | ||
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) { | ||
BlocklistClient blocklistClient | ||
= new BlocklistClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) | ||
.endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) | ||
.buildClient(); | ||
// BEGIN:com.azure.ai.contentsafety.generated.listtextblocklists.getalltextblocklists | ||
PagedIterable<TextBlocklist> response = blocklistClient.listTextBlocklists(); | ||
// END:com.azure.ai.contentsafety.generated.listtextblocklists.getalltextblocklists | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...a/com/azure/ai/contentsafety/generated/GetBlockItemByBlocklistNameAndBlocklistItemId.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.BlocklistClient; | ||
import com.azure.ai.contentsafety.BlocklistClientBuilder; | ||
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) { | ||
BlocklistClient blocklistClient | ||
= new BlocklistClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) | ||
.endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) | ||
.buildClient(); | ||
// BEGIN:com.azure.ai.contentsafety.generated.gettextblocklistitem.getblockitembyblocklistnameandblocklistitemid | ||
TextBlocklistItem response | ||
= blocklistClient.getTextBlocklistItem("TestBlocklist", "9511969e-f1e3-4604-9127-05ee16c509ec"); | ||
// END:com.azure.ai.contentsafety.generated.gettextblocklistitem.getblockitembyblocklistnameandblocklistitemid | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...rc/samples/java/com/azure/ai/contentsafety/generated/GetTextBlocklistByBlocklistName.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 GetTextBlocklistByBlocklistName { | ||
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.gettextblocklist.gettextblocklistbyblocklistname | ||
TextBlocklist response = blocklistClient.getTextBlocklist("TestBlocklist"); | ||
// END:com.azure.ai.contentsafety.generated.gettextblocklist.gettextblocklistbyblocklistname | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
.../samples/java/com/azure/ai/contentsafety/generated/RemoveBlockItemsFromTextBlocklist.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,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.BlocklistClient; | ||
import com.azure.ai.contentsafety.BlocklistClientBuilder; | ||
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) { | ||
BlocklistClient blocklistClient | ||
= new BlocklistClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) | ||
.endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) | ||
.buildClient(); | ||
// BEGIN:com.azure.ai.contentsafety.generated.removeblocklistitems.removeblockitemsfromtextblocklist | ||
blocklistClient.removeBlocklistItems("TestBlocklist", | ||
new RemoveTextBlocklistItemsOptions(Arrays.asList("9511969e-f1e3-4604-9127-05ee16c509ec"))); | ||
// END:com.azure.ai.contentsafety.generated.removeblocklistitems.removeblockitemsfromtextblocklist | ||
} | ||
} |
Oops, something went wrong.