diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/CHANGELOG.md b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/CHANGELOG.md index 48eae2897d3e..bede689e6d72 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/CHANGELOG.md +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/CHANGELOG.md @@ -1,14 +1,145 @@ # Release History -## 1.2.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2025-04-17) + +- Azure Resource Manager CognitiveServices client library for Java. This package contains Microsoft Azure SDK for CognitiveServices Management SDK. Cognitive Services Management Client. Package tag package-2025-04-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added -### Breaking Changes +* `models.ProjectListResult` was added + +* `models.Project$Update` was added + +* `models.ConnectionOAuth2` was added + +* `models.CapabilityHost$Update` was added + +* `models.ConnectionServicePrincipal` was added + +* `models.ConnectionSharedAccessSignature` was added + +* `models.CapabilityHost$UpdateStages` was added + +* `models.CapabilityHost` was added + +* `models.ResourceBase` was added + +* `models.ConnectionPropertiesV2BasicResource` was added + +* `models.ServicePrincipalAuthTypeConnectionProperties` was added + +* `models.CapabilityHost$Definition` was added + +* `models.CapabilityHostKind` was added + +* `models.CapabilityHostProperties` was added + +* `models.Project$UpdateStages` was added + +* `models.ConnectionPropertiesV2` was added + +* `models.ConnectionAccessKey` was added + +* `models.CustomKeysConnectionProperties` was added + +* `models.ProjectConnections` was added + +* `models.AccountConnections` was added + +* `models.ConnectionAuthType` was added + +* `models.ManagedPERequirement` was added + +* `models.Project$Definition` was added + +* `models.PatAuthTypeConnectionProperties` was added + +* `models.ConnectionPropertiesV2BasicResource$Definition` was added + +* `models.NoneAuthTypeConnectionProperties` was added + +* `models.AccountKeyAuthTypeConnectionProperties` was added + +* `models.AccessKeyAuthTypeConnectionProperties` was added + +* `models.ConnectionApiKey` was added + +* `models.AccountCapabilityHosts` was added + +* `models.ManagedPEStatus` was added -### Bugs Fixed +* `models.ConnectionUpdateContent` was added + +* `models.ConnectionManagedIdentity` was added + +* `models.ConnectionPropertiesV2BasicResource$Update` was added + +* `models.CapabilityHostProvisioningState` was added + +* `models.CustomKeys` was added + +* `models.ManagedIdentityAuthTypeConnectionProperties` was added + +* `models.ProjectProperties` was added + +* `models.ConnectionCategory` was added + +* `models.ProjectCapabilityHosts` was added + +* `models.Projects` was added + +* `models.Project` was added + +* `models.OAuth2AuthTypeConnectionProperties` was added + +* `models.ApiKeyAuthConnectionProperties` was added + +* `models.Project$DefinitionStages` was added + +* `models.ConnectionAccountKey` was added + +* `models.NetworkInjections` was added + +* `models.SasAuthTypeConnectionProperties` was added + +* `models.UsernamePasswordAuthTypeConnectionProperties` was added + +* `models.CapabilityHost$DefinitionStages` was added + +* `models.ConnectionPropertiesV2BasicResourceArmPaginatedResult` was added + +* `models.ConnectionGroup` was added + +* `models.AadAuthTypeConnectionProperties` was added + +* `models.ConnectionUsernamePassword` was added + +* `models.ConnectionPropertiesV2BasicResource$DefinitionStages` was added + +* `models.ConnectionPropertiesV2BasicResource$UpdateStages` was added + +* `models.ConnectionPersonalAccessToken` was added + +* `models.ScenarioType` was added + +#### `CognitiveServicesManager` was modified + +* `projectConnections()` was added +* `accountConnections()` was added +* `projects()` was added +* `projectCapabilityHosts()` was added +* `accountCapabilityHosts()` was added + +#### `models.AccountProperties` was modified -### Other Changes +* `withAssociatedProjects(java.util.List)` was added +* `withDefaultProject(java.lang.String)` was added +* `associatedProjects()` was added +* `networkInjections()` was added +* `allowProjectManagement()` was added +* `defaultProject()` was added +* `withAllowProjectManagement(java.lang.Boolean)` was added +* `withNetworkInjections(models.NetworkInjections)` was added ## 1.1.0 (2024-11-22) diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/README.md b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/README.md index 979346d1e8a5..50ea34548e20 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/README.md +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/README.md @@ -2,7 +2,7 @@ Azure Resource Manager CognitiveServices client library for Java. -This package contains Microsoft Azure SDK for CognitiveServices Management SDK. Cognitive Services Management Client. Package tag package-2024-10. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for CognitiveServices Management SDK. Cognitive Services Management Client. Package tag package-2025-04-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -52,7 +52,7 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java -AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); @@ -60,7 +60,7 @@ CognitiveServicesManager manager = CognitiveServicesManager .authenticate(credential, profile); ``` -The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. See [Authentication][authenticate] for more options. @@ -109,5 +109,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ - - diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/SAMPLE.md b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/SAMPLE.md index 958848eec213..bbce122bc6e9 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/SAMPLE.md +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/SAMPLE.md @@ -1,6 +1,20 @@ # Code snippets and samples +## AccountCapabilityHosts + +- [CreateOrUpdate](#accountcapabilityhosts_createorupdate) +- [Delete](#accountcapabilityhosts_delete) +- [Get](#accountcapabilityhosts_get) + +## AccountConnection + +- [Create](#accountconnection_create) +- [Delete](#accountconnection_delete) +- [Get](#accountconnection_get) +- [List](#accountconnection_list) +- [Update](#accountconnection_update) + ## Accounts - [Create](#accounts_create) @@ -98,6 +112,28 @@ - [List](#privatelinkresources_list) +## ProjectCapabilityHosts + +- [CreateOrUpdate](#projectcapabilityhosts_createorupdate) +- [Delete](#projectcapabilityhosts_delete) +- [Get](#projectcapabilityhosts_get) + +## ProjectConnection + +- [Create](#projectconnection_create) +- [Delete](#projectconnection_delete) +- [Get](#projectconnection_get) +- [List](#projectconnection_list) +- [Update](#projectconnection_update) + +## Projects + +- [Create](#projects_create) +- [Delete](#projects_delete) +- [Get](#projects_get) +- [List](#projects_list) +- [Update](#projects_update) + ## RaiBlocklistItems - [BatchAdd](#raiblocklistitems_batchadd) @@ -139,123 +175,183 @@ ## Usages - [List](#usages_list) -### Accounts_Create +### AccountCapabilityHosts_CreateOrUpdate ```java -import com.azure.resourcemanager.cognitiveservices.models.AccountProperties; -import com.azure.resourcemanager.cognitiveservices.models.Encryption; -import com.azure.resourcemanager.cognitiveservices.models.Identity; -import com.azure.resourcemanager.cognitiveservices.models.KeySource; -import com.azure.resourcemanager.cognitiveservices.models.KeyVaultProperties; -import com.azure.resourcemanager.cognitiveservices.models.ResourceIdentityType; -import com.azure.resourcemanager.cognitiveservices.models.Sku; -import com.azure.resourcemanager.cognitiveservices.models.UserOwnedStorage; +import com.azure.resourcemanager.cognitiveservices.models.ContentLevel; +import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentFilter; +import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentSource; +import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyMode; +import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyProperties; import java.util.Arrays; /** - * Samples for Accounts Create. + * Samples for RaiPolicies CreateOrUpdate. */ -public final class AccountsCreateSamples { +public final class RaiPoliciesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * CreateAccountMin.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * PutRaiPolicy.json */ /** - * Sample code: Create Account Min. + * Sample code: PutRaiPolicy. * * @param manager Entry point to CognitiveServicesManager. */ - public static void createAccountMin(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.accounts() - .define("testCreate1") - .withExistingResourceGroup("myResourceGroup") - .withRegion("West US") - .withKind("CognitiveServices") - .withSku(new Sku().withName("S0")) - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withProperties(new AccountProperties()) + public static void putRaiPolicy(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.raiPolicies() + .define("raiPolicyName") + .withExistingAccount("resourceGroupName", "accountName") + .withProperties(new RaiPolicyProperties().withMode(RaiPolicyMode.ASYNCHRONOUS_FILTER) + .withBasePolicyName("Microsoft.Default") + .withContentFilters(Arrays.asList( + new RaiPolicyContentFilter().withName("Hate") + .withEnabled(false) + .withSeverityThreshold(ContentLevel.HIGH) + .withBlocking(false) + .withSource(RaiPolicyContentSource.PROMPT), + new RaiPolicyContentFilter().withName("Hate") + .withEnabled(true) + .withSeverityThreshold(ContentLevel.MEDIUM) + .withBlocking(true) + .withSource(RaiPolicyContentSource.COMPLETION), + new RaiPolicyContentFilter().withName("Sexual") + .withEnabled(true) + .withSeverityThreshold(ContentLevel.HIGH) + .withBlocking(true) + .withSource(RaiPolicyContentSource.PROMPT), + new RaiPolicyContentFilter().withName("Sexual") + .withEnabled(true) + .withSeverityThreshold(ContentLevel.MEDIUM) + .withBlocking(true) + .withSource(RaiPolicyContentSource.COMPLETION), + new RaiPolicyContentFilter().withName("Selfharm") + .withEnabled(true) + .withSeverityThreshold(ContentLevel.HIGH) + .withBlocking(true) + .withSource(RaiPolicyContentSource.PROMPT), + new RaiPolicyContentFilter().withName("Selfharm") + .withEnabled(true) + .withSeverityThreshold(ContentLevel.MEDIUM) + .withBlocking(true) + .withSource(RaiPolicyContentSource.COMPLETION), + new RaiPolicyContentFilter().withName("Violence") + .withEnabled(true) + .withSeverityThreshold(ContentLevel.MEDIUM) + .withBlocking(true) + .withSource(RaiPolicyContentSource.PROMPT), + new RaiPolicyContentFilter().withName("Violence") + .withEnabled(true) + .withSeverityThreshold(ContentLevel.MEDIUM) + .withBlocking(true) + .withSource(RaiPolicyContentSource.COMPLETION), + new RaiPolicyContentFilter().withName("Jailbreak") + .withEnabled(true) + .withBlocking(true) + .withSource(RaiPolicyContentSource.PROMPT), + new RaiPolicyContentFilter().withName("Protected Material Text") + .withEnabled(true) + .withBlocking(true) + .withSource(RaiPolicyContentSource.COMPLETION), + new RaiPolicyContentFilter().withName("Protected Material Code") + .withEnabled(true) + .withBlocking(true) + .withSource(RaiPolicyContentSource.COMPLETION), + new RaiPolicyContentFilter().withName("Profanity") + .withEnabled(true) + .withBlocking(true) + .withSource(RaiPolicyContentSource.PROMPT)))) .create(); } +} +``` +### AccountCapabilityHosts_Delete + +```java +/** + * Samples for Projects Get. + */ +public final class ProjectsGetSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * CreateAccount.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * GetProject.json */ /** - * Sample code: Create Account. + * Sample code: Get Project. * * @param manager Entry point to CognitiveServicesManager. */ - public static void createAccount(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.accounts() - .define("testCreate1") - .withExistingResourceGroup("myResourceGroup") - .withRegion("West US") - .withKind("Emotion") - .withSku(new Sku().withName("S0")) - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withProperties(new AccountProperties() - .withEncryption( - new Encryption().withKeyVaultProperties(new KeyVaultProperties().withKeyName("fakeTokenPlaceholder") - .withKeyVersion("fakeTokenPlaceholder") - .withKeyVaultUri("fakeTokenPlaceholder")).withKeySource(KeySource.MICROSOFT_KEY_VAULT)) - .withUserOwnedStorage(Arrays.asList(new UserOwnedStorage().withResourceId( - "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount")))) - .create(); + public static void getProject(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.projects() + .getWithResponse("myResourceGroup", "myAccount", "myProject", com.azure.core.util.Context.NONE); } } ``` -### Accounts_Delete +### AccountCapabilityHosts_Get ```java +import com.azure.resourcemanager.cognitiveservices.models.Project; +import com.azure.resourcemanager.cognitiveservices.models.ProjectProperties; + /** - * Samples for Accounts Delete. + * Samples for Projects Update. */ -public final class AccountsDeleteSamples { +public final class ProjectsUpdateSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * DeleteAccount.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * UpdateProjects.json */ /** - * Sample code: Delete Account. + * Sample code: Update Project. * * @param manager Entry point to CognitiveServicesManager. */ - public static void deleteAccount(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.accounts().delete("myResourceGroup", "PropTest01", com.azure.core.util.Context.NONE); + public static void updateProject(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + Project resource = manager.projects() + .getWithResponse("bvttest", "bingSearch", "projectName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withProperties(new ProjectProperties().withDescription("new description.")).apply(); } } ``` -### Accounts_GetByResourceGroup +### AccountConnection_Create ```java +import com.azure.resourcemanager.cognitiveservices.fluent.models.CapabilityHostInner; +import com.azure.resourcemanager.cognitiveservices.models.CapabilityHostProperties; + /** - * Samples for Accounts GetByResourceGroup. + * Samples for ProjectCapabilityHosts CreateOrUpdate. */ -public final class AccountsGetByResourceGroupSamples { +public final class ProjectCapabilityHostsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * GetAccount.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * ProjectCapabilityHost/createOrUpdate.json */ /** - * Sample code: Get Account. + * Sample code: CreateOrUpdate Project CapabilityHost. * * @param manager Entry point to CognitiveServicesManager. */ - public static void getAccount(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.accounts() - .getByResourceGroupWithResponse("myResourceGroup", "myAccount", com.azure.core.util.Context.NONE); + public static void createOrUpdateProjectCapabilityHost( + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.projectCapabilityHosts() + .createOrUpdate("test-rg", "account-1", "project-1", "capabilityHostName", + new CapabilityHostInner().withProperties(new CapabilityHostProperties().withCustomerSubnet( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroups/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet")), + com.azure.core.util.Context.NONE); } } ``` -### Accounts_List +### AccountConnection_Delete ```java /** @@ -264,7 +360,7 @@ public final class AccountsGetByResourceGroupSamples { public final class AccountsListSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * ListAccountsBySubscription.json */ /** @@ -279,100 +375,155 @@ public final class AccountsListSamples { } ``` -### Accounts_ListByResourceGroup +### AccountConnection_Get ```java /** - * Samples for Accounts ListByResourceGroup. + * Samples for Accounts Delete. */ -public final class AccountsListByResourceGroupSamples { +public final class AccountsDeleteSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * ListAccountsByResourceGroup.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * DeleteAccount.json */ /** - * Sample code: List Accounts by Resource Group. + * Sample code: Delete Account. * * @param manager Entry point to CognitiveServicesManager. */ - public static void - listAccountsByResourceGroup(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.accounts().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); + public static void deleteAccount(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.accounts().delete("myResourceGroup", "PropTest01", com.azure.core.util.Context.NONE); } } ``` -### Accounts_ListKeys +### AccountConnection_List ```java +import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistItemBulkRequest; +import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistItemProperties; +import java.util.Arrays; + /** - * Samples for Accounts ListKeys. + * Samples for RaiBlocklistItems BatchAdd. */ -public final class AccountsListKeysSamples { +public final class RaiBlocklistItemsBatchAddSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListKeys. - * json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * AddRaiBlocklistItems.json */ /** - * Sample code: List Keys. + * Sample code: AddRaiBlocklistItems. * * @param manager Entry point to CognitiveServicesManager. */ - public static void listKeys(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.accounts().listKeysWithResponse("myResourceGroup", "myAccount", com.azure.core.util.Context.NONE); + public static void + addRaiBlocklistItems(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.raiBlocklistItems() + .batchAddWithResponse("resourceGroupName", "accountName", "myblocklist", + Arrays.asList( + new RaiBlocklistItemBulkRequest().withName("myblocklistitem1") + .withProperties( + new RaiBlocklistItemProperties().withPattern("^[a-z0-9_-]{2,16}$").withIsRegex(true)), + new RaiBlocklistItemBulkRequest().withName("myblocklistitem2") + .withProperties(new RaiBlocklistItemProperties().withPattern("blockwords").withIsRegex(false))), + com.azure.core.util.Context.NONE); } } ``` -### Accounts_ListModels +### AccountConnection_Update ```java +import com.azure.resourcemanager.cognitiveservices.models.Identity; +import com.azure.resourcemanager.cognitiveservices.models.ProjectProperties; +import com.azure.resourcemanager.cognitiveservices.models.ResourceIdentityType; + /** - * Samples for Accounts ListModels. + * Samples for Projects Create. */ -public final class AccountsListModelsSamples { +public final class ProjectsCreateSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * ListAccountModels.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * CreateProjectMin.json */ /** - * Sample code: List AccountModels. + * Sample code: Create Project Min. * * @param manager Entry point to CognitiveServicesManager. */ - public static void listAccountModels(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.accounts().listModels("resourceGroupName", "accountName", com.azure.core.util.Context.NONE); + public static void createProjectMin(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.projects() + .define("testProject1") + .withExistingAccount("myResourceGroup", "testCreate1") + .withRegion("West US") + .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) + .withProperties(new ProjectProperties()) + .create(); + } + + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * CreateProject.json + */ + /** + * Sample code: Create Project. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void createProject(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.projects() + .define("testProject1") + .withExistingAccount("myResourceGroup", "testCreate1") + .withRegion("West US") + .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) + .withProperties( + new ProjectProperties().withDisplayName("p1").withDescription("Description of this project")) + .create(); } } ``` -### Accounts_ListSkus +### Accounts_Create ```java +import com.azure.resourcemanager.cognitiveservices.fluent.models.ConnectionPropertiesV2BasicResourceInner; +import com.azure.resourcemanager.cognitiveservices.models.ConnectionCategory; +import com.azure.resourcemanager.cognitiveservices.models.NoneAuthTypeConnectionProperties; +import java.time.OffsetDateTime; + /** - * Samples for Accounts ListSkus. + * Samples for ProjectConnection Create. */ -public final class AccountsListSkusSamples { +public final class ProjectConnectionCreateSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListSkus. - * json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * ProjectConnection/create.json */ /** - * Sample code: List SKUs. + * Sample code: CreateProjectConnection. * * @param manager Entry point to CognitiveServicesManager. */ - public static void listSKUs(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.accounts().listSkusWithResponse("myResourceGroup", "myAccount", com.azure.core.util.Context.NONE); + public static void + createProjectConnection(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.projectConnections() + .createWithResponse("resourceGroup-1", "account-1", "project-1", "connection-1", + new ConnectionPropertiesV2BasicResourceInner().withProperties( + new NoneAuthTypeConnectionProperties().withCategory(ConnectionCategory.CONTAINER_REGISTRY) + .withExpiryTime(OffsetDateTime.parse("2024-03-15T14:30:00Z")) + .withTarget("[tartget url]")), + com.azure.core.util.Context.NONE); } } ``` -### Accounts_ListUsages +### Accounts_Delete ```java /** @@ -381,7 +532,7 @@ public final class AccountsListSkusSamples { public final class AccountsListUsagesSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetUsages + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetUsages * .json */ /** @@ -396,1198 +547,1215 @@ public final class AccountsListUsagesSamples { } ``` -### Accounts_RegenerateKey +### Accounts_GetByResourceGroup ```java -import com.azure.resourcemanager.cognitiveservices.models.KeyName; -import com.azure.resourcemanager.cognitiveservices.models.RegenerateKeyParameters; - /** - * Samples for Accounts RegenerateKey. + * Samples for DefenderForAISettings Get. */ -public final class AccountsRegenerateKeySamples { +public final class DefenderForAISettingsGetSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * RegenerateKey.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * GetDefenderForAISetting.json */ /** - * Sample code: Regenerate Keys. + * Sample code: GetDefenderForAISetting. * * @param manager Entry point to CognitiveServicesManager. */ - public static void regenerateKeys(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.accounts() - .regenerateKeyWithResponse("myResourceGroup", "myAccount", - new RegenerateKeyParameters().withKeyName(KeyName.KEY2), com.azure.core.util.Context.NONE); + public static void + getDefenderForAISetting(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.defenderForAISettings() + .getWithResponse("resourceGroupName", "accountName", "Default", com.azure.core.util.Context.NONE); } } ``` -### Accounts_Update +### Accounts_List ```java -import com.azure.resourcemanager.cognitiveservices.models.Account; -import com.azure.resourcemanager.cognitiveservices.models.Sku; - /** - * Samples for Accounts Update. + * Samples for Models List. */ -public final class AccountsUpdateSamples { +public final class ModelsListSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * UpdateAccount.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * ListLocationModels.json */ /** - * Sample code: Update Account. + * Sample code: ListLocationModels. * * @param manager Entry point to CognitiveServicesManager. */ - public static void updateAccount(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - Account resource = manager.accounts() - .getByResourceGroupWithResponse("bvttest", "bingSearch", com.azure.core.util.Context.NONE) - .getValue(); - resource.update().withSku(new Sku().withName("S2")).apply(); + public static void + listLocationModels(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.models().list("WestUS", com.azure.core.util.Context.NONE); } } ``` -### CommitmentPlans_CreateOrUpdate +### Accounts_ListByResourceGroup ```java -import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentPlanInner; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPeriod; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlanProperties; -import com.azure.resourcemanager.cognitiveservices.models.HostingModel; - /** - * Samples for CommitmentPlans CreateOrUpdate. + * Samples for CommitmentPlans List. */ -public final class CommitmentPlansCreateOrUpdateSamples { +public final class CommitmentPlansListSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * PutCommitmentPlan.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * ListCommitmentPlans.json */ /** - * Sample code: PutCommitmentPlan. + * Sample code: ListCommitmentPlans. * * @param manager Entry point to CognitiveServicesManager. */ - public static void putCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.commitmentPlans() - .createOrUpdateWithResponse("resourceGroupName", "accountName", "commitmentPlanName", - new CommitmentPlanInner() - .withProperties(new CommitmentPlanProperties().withHostingModel(HostingModel.WEB) - .withPlanType("Speech2Text") - .withCurrent(new CommitmentPeriod().withTier("T1")) - .withAutoRenew(true)), - com.azure.core.util.Context.NONE); + public static void + listCommitmentPlans(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.commitmentPlans().list("resourceGroupName", "accountName", com.azure.core.util.Context.NONE); } } ``` -### CommitmentPlans_CreateOrUpdateAssociation +### Accounts_ListKeys ```java /** - * Samples for CommitmentPlans CreateOrUpdateAssociation. + * Samples for RaiBlocklistItems Get. */ -public final class CommitmentPlansCreateOrUpdateAssociationSamples { +public final class RaiBlocklistItemsGetSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * CreateSharedCommitmentPlanAssociation.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * GetRaiBlocklistItem.json */ /** - * Sample code: PutCommitmentPlan. + * Sample code: GetRaiBlocklistItem. * * @param manager Entry point to CognitiveServicesManager. */ - public static void putCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.commitmentPlans() - .defineAssociation("commitmentPlanAssociationName") - .withExistingCommitmentPlan("resourceGroupName", "commitmentPlanName") - .withAccountId( - "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.CognitiveServices/accounts/accountName") - .create(); + public static void + getRaiBlocklistItem(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.raiBlocklistItems() + .getWithResponse("resourceGroupName", "accountName", "raiBlocklistName", "raiBlocklistItemName", + com.azure.core.util.Context.NONE); } } ``` -### CommitmentPlans_CreateOrUpdatePlan +### Accounts_ListModels ```java -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPeriod; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlanProperties; -import com.azure.resourcemanager.cognitiveservices.models.HostingModel; -import com.azure.resourcemanager.cognitiveservices.models.Sku; +import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistItemProperties; /** - * Samples for CommitmentPlans CreateOrUpdatePlan. + * Samples for RaiBlocklistItems CreateOrUpdate. */ -public final class CommitmentPlansCreateOrUpdatePlanSamples { +public final class RaiBlocklistItemsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * CreateSharedCommitmentPlan.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * PutRaiBlocklistItem.json */ /** - * Sample code: Create Commitment Plan. + * Sample code: PutRaiBlocklistItem. * * @param manager Entry point to CognitiveServicesManager. */ public static void - createCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.commitmentPlans() - .definePlan("commitmentPlanName") - .withExistingResourceGroup("resourceGroupName") - .withRegion("West US") - .withKind("SpeechServices") - .withSku(new Sku().withName("S0")) - .withProperties(new CommitmentPlanProperties().withHostingModel(HostingModel.WEB) - .withPlanType("STT") - .withCurrent(new CommitmentPeriod().withTier("T1")) - .withAutoRenew(true)) + putRaiBlocklistItem(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.raiBlocklistItems() + .define("raiBlocklistItemName") + .withExistingRaiBlocklist("resourceGroupName", "accountName", "raiBlocklistName") + .withProperties(new RaiBlocklistItemProperties().withPattern("Pattern To Block").withIsRegex(false)) .create(); } } ``` -### CommitmentPlans_Delete +### Accounts_ListSkus ```java /** - * Samples for CommitmentPlans Delete. + * Samples for AccountConnection Get. */ -public final class CommitmentPlansDeleteSamples { +public final class AccountConnectionGetSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * DeleteCommitmentPlan.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * AccountConnection/get.json */ /** - * Sample code: DeleteCommitmentPlan. + * Sample code: GetAccountConnection. * * @param manager Entry point to CognitiveServicesManager. */ public static void - deleteCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.commitmentPlans() - .delete("resourceGroupName", "accountName", "commitmentPlanName", com.azure.core.util.Context.NONE); + getAccountConnection(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.accountConnections() + .getWithResponse("resourceGroup-1", "account-1", "connection-1", com.azure.core.util.Context.NONE); } } ``` -### CommitmentPlans_DeleteAssociation +### Accounts_ListUsages ```java /** - * Samples for CommitmentPlans DeleteAssociation. + * Samples for AccountCapabilityHosts Delete. */ -public final class CommitmentPlansDeleteAssociationSamples { +public final class AccountCapabilityHostsDeleteSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * DeleteSharedCommitmentPlanAssociation.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * AccountCapabilityHost/delete.json */ /** - * Sample code: DeleteCommitmentPlan. + * Sample code: Delete Account CapabilityHost. * * @param manager Entry point to CognitiveServicesManager. */ public static void - deleteCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.commitmentPlans() - .deleteAssociation("resourceGroupName", "commitmentPlanName", "commitmentPlanAssociationName", - com.azure.core.util.Context.NONE); + deleteAccountCapabilityHost(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.accountCapabilityHosts() + .delete("test-rg", "account-1", "capabilityHostName", com.azure.core.util.Context.NONE); } } ``` -### CommitmentPlans_DeletePlan +### Accounts_RegenerateKey ```java /** - * Samples for CommitmentPlans DeletePlan. + * Samples for RaiBlocklists List. */ -public final class CommitmentPlansDeletePlanSamples { +public final class RaiBlocklistsListSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * DeleteSharedCommitmentPlan.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * ListBlocklists.json */ /** - * Sample code: Delete Commitment Plan. + * Sample code: ListBlocklists. * * @param manager Entry point to CognitiveServicesManager. */ - public static void - deleteCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.commitmentPlans() - .deletePlan("resourceGroupName", "commitmentPlanName", com.azure.core.util.Context.NONE); + public static void listBlocklists(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.raiBlocklists().list("resourceGroupName", "accountName", com.azure.core.util.Context.NONE); } } ``` -### CommitmentPlans_Get +### Accounts_Update ```java /** - * Samples for CommitmentPlans Get. + * Samples for DeletedAccounts Get. */ -public final class CommitmentPlansGetSamples { +public final class DeletedAccountsGetSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * GetCommitmentPlan.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * GetDeletedAccount.json */ /** - * Sample code: GetCommitmentPlan. + * Sample code: Get Account. * * @param manager Entry point to CognitiveServicesManager. */ - public static void getCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.commitmentPlans() - .getWithResponse("resourceGroupName", "accountName", "commitmentPlanName", - com.azure.core.util.Context.NONE); + public static void getAccount(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.deletedAccounts() + .getWithResponse("westus", "myResourceGroup", "myAccount", com.azure.core.util.Context.NONE); } } ``` -### CommitmentPlans_GetAssociation +### CommitmentPlans_CreateOrUpdate ```java +import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentPlanInner; +import com.azure.resourcemanager.cognitiveservices.models.CommitmentPeriod; +import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlanProperties; +import com.azure.resourcemanager.cognitiveservices.models.HostingModel; + /** - * Samples for CommitmentPlans GetAssociation. + * Samples for CommitmentPlans CreateOrUpdate. */ -public final class CommitmentPlansGetAssociationSamples { +public final class CommitmentPlansCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * GetSharedCommitmentPlanAssociation.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * PutCommitmentPlan.json */ /** - * Sample code: GetCommitmentPlan. + * Sample code: PutCommitmentPlan. * * @param manager Entry point to CognitiveServicesManager. */ - public static void getCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + public static void putCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { manager.commitmentPlans() - .getAssociationWithResponse("resourceGroupName", "commitmentPlanName", "commitmentPlanAssociationName", + .createOrUpdateWithResponse("resourceGroupName", "accountName", "commitmentPlanName", + new CommitmentPlanInner() + .withProperties(new CommitmentPlanProperties().withHostingModel(HostingModel.WEB) + .withPlanType("Speech2Text") + .withCurrent(new CommitmentPeriod().withTier("T1")) + .withAutoRenew(true)), com.azure.core.util.Context.NONE); } } ``` -### CommitmentPlans_GetByResourceGroup +### CommitmentPlans_CreateOrUpdateAssociation ```java /** - * Samples for CommitmentPlans GetByResourceGroup. + * Samples for CommitmentPlans DeleteAssociation. */ -public final class CommitmentPlansGetByResourceGroupSamples { +public final class CommitmentPlansDeleteAssociationSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * GetSharedCommitmentPlan.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * DeleteSharedCommitmentPlanAssociation.json */ /** - * Sample code: Get Commitment Plan. + * Sample code: DeleteCommitmentPlan. * * @param manager Entry point to CognitiveServicesManager. */ - public static void getCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + public static void + deleteCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { manager.commitmentPlans() - .getByResourceGroupWithResponse("resourceGroupName", "commitmentPlanName", + .deleteAssociation("resourceGroupName", "commitmentPlanName", "commitmentPlanAssociationName", com.azure.core.util.Context.NONE); } } ``` -### CommitmentPlans_List +### CommitmentPlans_CreateOrUpdatePlan ```java +import com.azure.resourcemanager.cognitiveservices.models.CalculateModelCapacityParameter; +import com.azure.resourcemanager.cognitiveservices.models.DeploymentModel; +import com.azure.resourcemanager.cognitiveservices.models.ModelCapacityCalculatorWorkload; +import com.azure.resourcemanager.cognitiveservices.models.ModelCapacityCalculatorWorkloadRequestParam; +import java.util.Arrays; + /** - * Samples for CommitmentPlans List. + * Samples for ResourceProvider CalculateModelCapacity. */ -public final class CommitmentPlansListSamples { +public final class ResourceProviderCalculateModelCapacitySamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * ListCommitmentPlans.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * CalculateModelCapacity.json */ /** - * Sample code: ListCommitmentPlans. + * Sample code: Calculate Model Capacity. * * @param manager Entry point to CognitiveServicesManager. */ public static void - listCommitmentPlans(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.commitmentPlans().list("resourceGroupName", "accountName", com.azure.core.util.Context.NONE); + calculateModelCapacity(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.resourceProviders() + .calculateModelCapacityWithResponse(new CalculateModelCapacityParameter() + .withModel(new DeploymentModel().withFormat("OpenAI").withName("gpt-4").withVersion("0613")) + .withSkuName("ProvisionedManaged") + .withWorkloads(Arrays.asList(new ModelCapacityCalculatorWorkload().withRequestPerMinute(10L) + .withRequestParameters(new ModelCapacityCalculatorWorkloadRequestParam().withAvgPromptTokens(30L) + .withAvgGeneratedTokens(50L)), + new ModelCapacityCalculatorWorkload().withRequestPerMinute(20L) + .withRequestParameters( + new ModelCapacityCalculatorWorkloadRequestParam().withAvgPromptTokens(60L) + .withAvgGeneratedTokens(20L)))), + com.azure.core.util.Context.NONE); } } ``` -### CommitmentPlans_ListAssociations +### CommitmentPlans_Delete ```java /** - * Samples for CommitmentPlans ListAssociations. + * Samples for AccountCapabilityHosts Get. */ -public final class CommitmentPlansListAssociationsSamples { +public final class AccountCapabilityHostsGetSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * ListSharedCommitmentPlanAssociations.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * AccountCapabilityHost/get.json */ /** - * Sample code: ListCommitmentPlans. + * Sample code: Get Account CapabilityHost. * * @param manager Entry point to CognitiveServicesManager. */ public static void - listCommitmentPlans(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.commitmentPlans() - .listAssociations("resourceGroupName", "commitmentPlanName", com.azure.core.util.Context.NONE); + getAccountCapabilityHost(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.accountCapabilityHosts() + .getWithResponse("test-rg", "account-1", "capabilityHostName", com.azure.core.util.Context.NONE); } } ``` -### CommitmentPlans_ListByResourceGroup +### CommitmentPlans_DeleteAssociation ```java +import com.azure.resourcemanager.cognitiveservices.models.AccountProperties; +import com.azure.resourcemanager.cognitiveservices.models.Encryption; +import com.azure.resourcemanager.cognitiveservices.models.Identity; +import com.azure.resourcemanager.cognitiveservices.models.KeySource; +import com.azure.resourcemanager.cognitiveservices.models.KeyVaultProperties; +import com.azure.resourcemanager.cognitiveservices.models.ResourceIdentityType; +import com.azure.resourcemanager.cognitiveservices.models.Sku; +import com.azure.resourcemanager.cognitiveservices.models.UserOwnedStorage; +import java.util.Arrays; + /** - * Samples for CommitmentPlans ListByResourceGroup. + * Samples for Accounts Create. */ -public final class CommitmentPlansListByResourceGroupSamples { +public final class AccountsCreateSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * ListSharedCommitmentPlansByResourceGroup.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * CreateAccountMin.json */ /** - * Sample code: List Commitment Plans by Resource Group. + * Sample code: Create Account Min. * * @param manager Entry point to CognitiveServicesManager. */ - public static void listCommitmentPlansByResourceGroup( - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.commitmentPlans().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + public static void createAccountMin(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.accounts() + .define("testCreate1") + .withExistingResourceGroup("myResourceGroup") + .withRegion("West US") + .withKind("CognitiveServices") + .withSku(new Sku().withName("S0")) + .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) + .withProperties(new AccountProperties()) + .create(); } -} -``` - -### CommitmentPlans_ListPlansBySubscription -```java -/** - * Samples for CommitmentPlans ListPlansBySubscription. - */ -public final class CommitmentPlansListPlansBySubscriptionSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * ListSharedCommitmentPlansBySubscription.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * CreateAccount.json */ /** - * Sample code: List Accounts by Subscription. + * Sample code: Create Account. * * @param manager Entry point to CognitiveServicesManager. */ - public static void - listAccountsBySubscription(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.commitmentPlans().listPlansBySubscription(com.azure.core.util.Context.NONE); + public static void createAccount(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.accounts() + .define("testCreate1") + .withExistingResourceGroup("myResourceGroup") + .withRegion("West US") + .withKind("Emotion") + .withSku(new Sku().withName("S0")) + .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) + .withProperties(new AccountProperties() + .withEncryption( + new Encryption().withKeyVaultProperties(new KeyVaultProperties().withKeyName("fakeTokenPlaceholder") + .withKeyVersion("fakeTokenPlaceholder") + .withKeyVaultUri("fakeTokenPlaceholder")).withKeySource(KeySource.MICROSOFT_KEY_VAULT)) + .withUserOwnedStorage(Arrays.asList(new UserOwnedStorage().withResourceId( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount")))) + .create(); } } ``` -### CommitmentPlans_UpdatePlan +### CommitmentPlans_DeletePlan ```java -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlan; -import java.util.HashMap; -import java.util.Map; - /** - * Samples for CommitmentPlans UpdatePlan. + * Samples for CommitmentPlans ListAssociations. */ -public final class CommitmentPlansUpdatePlanSamples { +public final class CommitmentPlansListAssociationsSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * UpdateSharedCommitmentPlan.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * ListSharedCommitmentPlanAssociations.json */ /** - * Sample code: Create Commitment Plan. + * Sample code: ListCommitmentPlans. * * @param manager Entry point to CognitiveServicesManager. */ public static void - createCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - CommitmentPlan resource = manager.commitmentPlans() - .getByResourceGroupWithResponse("resourceGroupName", "commitmentPlanName", com.azure.core.util.Context.NONE) - .getValue(); - resource.update().withTags(mapOf("name", "value")).apply(); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + listCommitmentPlans(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.commitmentPlans() + .listAssociations("resourceGroupName", "commitmentPlanName", com.azure.core.util.Context.NONE); } } ``` -### CommitmentTiers_List +### CommitmentPlans_Get ```java /** - * Samples for CommitmentTiers List. + * Samples for RaiBlocklistItems Delete. */ -public final class CommitmentTiersListSamples { +public final class RaiBlocklistItemsDeleteSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * ListCommitmentTiers.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * DeleteRaiBlocklistItem.json */ /** - * Sample code: ListCommitmentTiers. + * Sample code: DeleteRaiBlocklistItem. * * @param manager Entry point to CognitiveServicesManager. */ public static void - listCommitmentTiers(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.commitmentTiers().list("location", com.azure.core.util.Context.NONE); + deleteRaiBlocklistItem(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.raiBlocklistItems() + .delete("resourceGroupName", "accountName", "raiBlocklistName", "raiBlocklistItemName", + com.azure.core.util.Context.NONE); } } ``` -### DefenderForAISettings_CreateOrUpdate +### CommitmentPlans_GetAssociation ```java -import com.azure.resourcemanager.cognitiveservices.models.DefenderForAISettingState; +import com.azure.resourcemanager.cognitiveservices.models.Deployment; +import com.azure.resourcemanager.cognitiveservices.models.Sku; /** - * Samples for DefenderForAISettings CreateOrUpdate. + * Samples for Deployments Update. */ -public final class DefenderForAISettingsCreateOrUpdateSamples { +public final class DeploymentsUpdateSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * PutDefenderForAISetting.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * UpdateDeployment.json */ /** - * Sample code: PutDefenderForAISetting. + * Sample code: UpdateDeployment. * * @param manager Entry point to CognitiveServicesManager. */ - public static void - putDefenderForAISetting(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.defenderForAISettings() - .define("Default") - .withExistingAccount("resourceGroupName", "accountName") - .withState(DefenderForAISettingState.ENABLED) - .create(); + public static void updateDeployment(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + Deployment resource = manager.deployments() + .getWithResponse("resourceGroupName", "accountName", "deploymentName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withSku(new Sku().withName("Standard").withCapacity(1)).apply(); } } ``` -### DefenderForAISettings_Get +### CommitmentPlans_GetByResourceGroup ```java /** - * Samples for DefenderForAISettings Get. + * Samples for RaiBlocklistItems List. */ -public final class DefenderForAISettingsGetSamples { +public final class RaiBlocklistItemsListSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * GetDefenderForAISetting.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * ListBlocklistItems.json */ /** - * Sample code: GetDefenderForAISetting. + * Sample code: ListBlocklistItems. * * @param manager Entry point to CognitiveServicesManager. */ public static void - getDefenderForAISetting(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.defenderForAISettings() - .getWithResponse("resourceGroupName", "accountName", "Default", com.azure.core.util.Context.NONE); + listBlocklistItems(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.raiBlocklistItems() + .list("resourceGroupName", "accountName", "raiBlocklistName", com.azure.core.util.Context.NONE); } } ``` -### DefenderForAISettings_List +### CommitmentPlans_List ```java /** - * Samples for DefenderForAISettings List. + * Samples for EncryptionScopes List. */ -public final class DefenderForAISettingsListSamples { +public final class EncryptionScopesListSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * ListDefenderForAISetting.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * ListEncryptionScopes.json */ /** - * Sample code: ListDefenderForAISetting. + * Sample code: ListEncryptionScopes. * * @param manager Entry point to CognitiveServicesManager. */ public static void - listDefenderForAISetting(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.defenderForAISettings().list("resourceGroupName", "accountName", com.azure.core.util.Context.NONE); + listEncryptionScopes(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.encryptionScopes().list("resourceGroupName", "accountName", com.azure.core.util.Context.NONE); } } ``` -### DefenderForAISettings_Update +### CommitmentPlans_ListAssociations ```java -import com.azure.resourcemanager.cognitiveservices.models.DefenderForAISetting; -import com.azure.resourcemanager.cognitiveservices.models.DefenderForAISettingState; - /** - * Samples for DefenderForAISettings Update. + * Samples for ProjectConnection Delete. */ -public final class DefenderForAISettingsUpdateSamples { +public final class ProjectConnectionDeleteSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * UpdateDefenderForAISetting.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * ProjectConnection/delete.json */ /** - * Sample code: UpdateDefenderForAISetting. + * Sample code: DeleteProjectConnection. * * @param manager Entry point to CognitiveServicesManager. */ public static void - updateDefenderForAISetting(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - DefenderForAISetting resource = manager.defenderForAISettings() - .getWithResponse("resourceGroupName", "accountName", "Default", com.azure.core.util.Context.NONE) - .getValue(); - resource.update().withState(DefenderForAISettingState.ENABLED).apply(); + deleteProjectConnection(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.projectConnections() + .deleteWithResponse("resourceGroup-1", "account-1", "project-1", "connection-1", + com.azure.core.util.Context.NONE); } } ``` -### DeletedAccounts_Get +### CommitmentPlans_ListByResourceGroup ```java /** - * Samples for DeletedAccounts Get. + * Samples for NetworkSecurityPerimeterConfigurations Get. */ -public final class DeletedAccountsGetSamples { +public final class NetworkSecurityPerimeterConfigurationsGetSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * GetDeletedAccount.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * GetNetworkSecurityPerimeterConfigurations.json */ /** - * Sample code: Get Account. + * Sample code: GetNetworkSecurityPerimeterConfigurations. * * @param manager Entry point to CognitiveServicesManager. */ - public static void getAccount(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.deletedAccounts() - .getWithResponse("westus", "myResourceGroup", "myAccount", com.azure.core.util.Context.NONE); + public static void getNetworkSecurityPerimeterConfigurations( + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.networkSecurityPerimeterConfigurations() + .getWithResponse("resourceGroupName", "accountName", "NSPConfigurationName", + com.azure.core.util.Context.NONE); } } ``` -### DeletedAccounts_List +### CommitmentPlans_ListPlansBySubscription ```java /** - * Samples for DeletedAccounts List. + * Samples for Accounts ListSkus. */ -public final class DeletedAccountsListSamples { +public final class AccountsListSkusSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * ListDeletedAccountsBySubscription.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ListSkus. + * json */ /** - * Sample code: List Deleted Accounts by Subscription. + * Sample code: List SKUs. * * @param manager Entry point to CognitiveServicesManager. */ - public static void listDeletedAccountsBySubscription( - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.deletedAccounts().list(com.azure.core.util.Context.NONE); + public static void listSKUs(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.accounts().listSkusWithResponse("myResourceGroup", "myAccount", com.azure.core.util.Context.NONE); } } ``` -### DeletedAccounts_Purge +### CommitmentPlans_UpdatePlan ```java +import com.azure.resourcemanager.cognitiveservices.models.CommitmentPeriod; +import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlanProperties; +import com.azure.resourcemanager.cognitiveservices.models.HostingModel; +import com.azure.resourcemanager.cognitiveservices.models.Sku; + /** - * Samples for DeletedAccounts Purge. + * Samples for CommitmentPlans CreateOrUpdatePlan. */ -public final class DeletedAccountsPurgeSamples { +public final class CommitmentPlansCreateOrUpdatePlanSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * PurgeDeletedAccount.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * CreateSharedCommitmentPlan.json */ /** - * Sample code: Delete Account. + * Sample code: Create Commitment Plan. * * @param manager Entry point to CognitiveServicesManager. */ - public static void deleteAccount(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.deletedAccounts().purge("westus", "myResourceGroup", "PropTest01", com.azure.core.util.Context.NONE); + public static void + createCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.commitmentPlans() + .definePlan("commitmentPlanName") + .withExistingResourceGroup("resourceGroupName") + .withRegion("West US") + .withKind("SpeechServices") + .withSku(new Sku().withName("S0")) + .withProperties(new CommitmentPlanProperties().withHostingModel(HostingModel.WEB) + .withPlanType("STT") + .withCurrent(new CommitmentPeriod().withTier("T1")) + .withAutoRenew(true)) + .create(); } } ``` -### Deployments_CreateOrUpdate +### CommitmentTiers_List ```java -import com.azure.resourcemanager.cognitiveservices.models.DeploymentModel; -import com.azure.resourcemanager.cognitiveservices.models.DeploymentProperties; -import com.azure.resourcemanager.cognitiveservices.models.Sku; - /** - * Samples for Deployments CreateOrUpdate. + * Samples for Projects Delete. */ -public final class DeploymentsCreateOrUpdateSamples { +public final class ProjectsDeleteSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * PutDeployment.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * DeleteProject.json */ /** - * Sample code: PutDeployment. + * Sample code: Delete Project. * * @param manager Entry point to CognitiveServicesManager. */ - public static void putDeployment(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.deployments() - .define("deploymentName") - .withExistingAccount("resourceGroupName", "accountName") - .withSku(new Sku().withName("Standard").withCapacity(1)) - .withProperties(new DeploymentProperties() - .withModel(new DeploymentModel().withFormat("OpenAI").withName("ada").withVersion("1"))) - .create(); + public static void deleteProject(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.projects().delete("myResourceGroup", "PropTest01", "myProject", com.azure.core.util.Context.NONE); } } ``` -### Deployments_Delete +### DefenderForAISettings_CreateOrUpdate ```java +import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistProperties; + /** - * Samples for Deployments Delete. + * Samples for RaiBlocklists CreateOrUpdate. */ -public final class DeploymentsDeleteSamples { +public final class RaiBlocklistsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * DeleteDeployment.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * PutRaiBlocklist.json */ /** - * Sample code: DeleteDeployment. + * Sample code: PutRaiBlocklist. * * @param manager Entry point to CognitiveServicesManager. */ - public static void deleteDeployment(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.deployments() - .delete("resourceGroupName", "accountName", "deploymentName", com.azure.core.util.Context.NONE); + public static void putRaiBlocklist(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.raiBlocklists() + .define("raiBlocklistName") + .withExistingAccount("resourceGroupName", "accountName") + .withProperties(new RaiBlocklistProperties().withDescription("Basic blocklist description")) + .create(); } } ``` -### Deployments_Get +### DefenderForAISettings_Get ```java -/** - * Samples for Deployments Get. +import com.azure.resourcemanager.cognitiveservices.models.Account; +import com.azure.resourcemanager.cognitiveservices.models.Sku; + +/** + * Samples for Accounts Update. */ -public final class DeploymentsGetSamples { +public final class AccountsUpdateSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * GetDeployment.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * UpdateAccount.json */ /** - * Sample code: GetDeployment. + * Sample code: Update Account. * * @param manager Entry point to CognitiveServicesManager. */ - public static void getDeployment(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.deployments() - .getWithResponse("resourceGroupName", "accountName", "deploymentName", com.azure.core.util.Context.NONE); + public static void updateAccount(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + Account resource = manager.accounts() + .getByResourceGroupWithResponse("bvttest", "bingSearch", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withSku(new Sku().withName("S2")).apply(); } } ``` -### Deployments_List +### DefenderForAISettings_List ```java /** - * Samples for Deployments List. + * Samples for LocationBasedModelCapacities List. */ -public final class DeploymentsListSamples { +public final class LocationBasedModelCapacitiesListSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * ListDeployments.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * ListLocationBasedModelCapacities.json */ /** - * Sample code: ListDeployments. + * Sample code: ListLocationBasedModelCapacities. * * @param manager Entry point to CognitiveServicesManager. */ - public static void listDeployments(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.deployments().list("resourceGroupName", "accountName", com.azure.core.util.Context.NONE); + public static void + listLocationBasedModelCapacities(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.locationBasedModelCapacities().list("WestUS", "OpenAI", "ada", "1", com.azure.core.util.Context.NONE); } } ``` -### Deployments_ListSkus +### DefenderForAISettings_Update ```java /** - * Samples for Deployments ListSkus. + * Samples for Deployments Delete. */ -public final class DeploymentsListSkusSamples { +public final class DeploymentsDeleteSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * ListDeploymentSkus.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * DeleteDeployment.json */ /** - * Sample code: ListDeploymentSkus. + * Sample code: DeleteDeployment. * * @param manager Entry point to CognitiveServicesManager. */ - public static void - listDeploymentSkus(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + public static void deleteDeployment(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { manager.deployments() - .listSkus("resourceGroupName", "accountName", "deploymentName", com.azure.core.util.Context.NONE); + .delete("resourceGroupName", "accountName", "deploymentName", com.azure.core.util.Context.NONE); } } ``` -### Deployments_Update +### DeletedAccounts_Get ```java -import com.azure.resourcemanager.cognitiveservices.models.Deployment; -import com.azure.resourcemanager.cognitiveservices.models.Sku; - /** - * Samples for Deployments Update. + * Samples for DefenderForAISettings List. */ -public final class DeploymentsUpdateSamples { +public final class DefenderForAISettingsListSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * UpdateDeployment.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * ListDefenderForAISetting.json */ /** - * Sample code: UpdateDeployment. + * Sample code: ListDefenderForAISetting. * * @param manager Entry point to CognitiveServicesManager. */ - public static void updateDeployment(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - Deployment resource = manager.deployments() - .getWithResponse("resourceGroupName", "accountName", "deploymentName", com.azure.core.util.Context.NONE) - .getValue(); - resource.update().withSku(new Sku().withName("Standard").withCapacity(1)).apply(); + public static void + listDefenderForAISetting(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.defenderForAISettings().list("resourceGroupName", "accountName", com.azure.core.util.Context.NONE); } } ``` -### EncryptionScopes_CreateOrUpdate +### DeletedAccounts_List ```java -import com.azure.resourcemanager.cognitiveservices.models.EncryptionScopeProperties; -import com.azure.resourcemanager.cognitiveservices.models.EncryptionScopeState; -import com.azure.resourcemanager.cognitiveservices.models.KeySource; -import com.azure.resourcemanager.cognitiveservices.models.KeyVaultProperties; - /** - * Samples for EncryptionScopes CreateOrUpdate. + * Samples for RaiContentFilters List. */ -public final class EncryptionScopesCreateOrUpdateSamples { +public final class RaiContentFiltersListSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * PutEncryptionScope.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * ListRaiContentFilters.json */ /** - * Sample code: PutEncryptionScope. + * Sample code: ListRaiContentFilters. * * @param manager Entry point to CognitiveServicesManager. */ public static void - putEncryptionScope(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.encryptionScopes() - .define("encryptionScopeName") - .withExistingAccount("resourceGroupName", "accountName") - .withProperties(new EncryptionScopeProperties() - .withKeyVaultProperties(new KeyVaultProperties().withKeyName("fakeTokenPlaceholder") - .withKeyVersion("fakeTokenPlaceholder") - .withKeyVaultUri("fakeTokenPlaceholder") - .withIdentityClientId("00000000-0000-0000-0000-000000000000")) - .withKeySource(KeySource.MICROSOFT_KEY_VAULT) - .withState(EncryptionScopeState.ENABLED)) - .create(); + listRaiContentFilters(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.raiContentFilters().list("WestUS", com.azure.core.util.Context.NONE); } } ``` -### EncryptionScopes_Delete +### DeletedAccounts_Purge ```java /** - * Samples for EncryptionScopes Delete. + * Samples for CommitmentPlans GetAssociation. */ -public final class EncryptionScopesDeleteSamples { +public final class CommitmentPlansGetAssociationSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * DeleteEncryptionScope.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * GetSharedCommitmentPlanAssociation.json */ /** - * Sample code: DeleteEncryptionScope. + * Sample code: GetCommitmentPlan. * * @param manager Entry point to CognitiveServicesManager. */ - public static void - deleteEncryptionScope(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.encryptionScopes() - .delete("resourceGroupName", "accountName", "encryptionScopeName", com.azure.core.util.Context.NONE); + public static void getCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.commitmentPlans() + .getAssociationWithResponse("resourceGroupName", "commitmentPlanName", "commitmentPlanAssociationName", + com.azure.core.util.Context.NONE); } } ``` -### EncryptionScopes_Get +### Deployments_CreateOrUpdate ```java /** - * Samples for EncryptionScopes Get. + * Samples for Deployments ListSkus. */ -public final class EncryptionScopesGetSamples { +public final class DeploymentsListSkusSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * GetEncryptionScope.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * ListDeploymentSkus.json */ /** - * Sample code: GetEncryptionScope. + * Sample code: ListDeploymentSkus. * * @param manager Entry point to CognitiveServicesManager. */ public static void - getEncryptionScope(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.encryptionScopes() - .getWithResponse("resourceGroupName", "accountName", "encryptionScopeName", - com.azure.core.util.Context.NONE); + listDeploymentSkus(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.deployments() + .listSkus("resourceGroupName", "accountName", "deploymentName", com.azure.core.util.Context.NONE); } } ``` -### EncryptionScopes_List +### Deployments_Delete ```java /** - * Samples for EncryptionScopes List. + * Samples for RaiPolicies Delete. */ -public final class EncryptionScopesListSamples { +public final class RaiPoliciesDeleteSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * ListEncryptionScopes.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * DeleteRaiPolicy.json */ /** - * Sample code: ListEncryptionScopes. + * Sample code: DeleteRaiPolicy. * * @param manager Entry point to CognitiveServicesManager. */ - public static void - listEncryptionScopes(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.encryptionScopes().list("resourceGroupName", "accountName", com.azure.core.util.Context.NONE); + public static void deleteRaiPolicy(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.raiPolicies() + .delete("resourceGroupName", "accountName", "raiPolicyName", com.azure.core.util.Context.NONE); } } ``` -### LocationBasedModelCapacities_List +### Deployments_Get ```java /** - * Samples for LocationBasedModelCapacities List. + * Samples for RaiBlocklists Get. */ -public final class LocationBasedModelCapacitiesListSamples { +public final class RaiBlocklistsGetSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * ListLocationBasedModelCapacities.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * GetRaiBlocklist.json */ /** - * Sample code: ListLocationBasedModelCapacities. + * Sample code: GetRaiBlocklist. * * @param manager Entry point to CognitiveServicesManager. */ - public static void - listLocationBasedModelCapacities(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.locationBasedModelCapacities().list("WestUS", "OpenAI", "ada", "1", com.azure.core.util.Context.NONE); + public static void getRaiBlocklist(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.raiBlocklists() + .getWithResponse("resourceGroupName", "accountName", "raiBlocklistName", com.azure.core.util.Context.NONE); } } ``` -### ModelCapacities_List +### Deployments_List ```java /** - * Samples for ModelCapacities List. + * Samples for CommitmentTiers List. */ -public final class ModelCapacitiesListSamples { +public final class CommitmentTiersListSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * ListModelCapacities.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * ListCommitmentTiers.json */ /** - * Sample code: ListModelCapacities. + * Sample code: ListCommitmentTiers. * * @param manager Entry point to CognitiveServicesManager. */ public static void - listModelCapacities(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.modelCapacities().list("OpenAI", "ada", "1", com.azure.core.util.Context.NONE); + listCommitmentTiers(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.commitmentTiers().list("location", com.azure.core.util.Context.NONE); } } ``` -### Models_List +### Deployments_ListSkus ```java +import com.azure.resourcemanager.cognitiveservices.models.AccessKeyAuthTypeConnectionProperties; +import com.azure.resourcemanager.cognitiveservices.models.ConnectionAccessKey; +import com.azure.resourcemanager.cognitiveservices.models.ConnectionCategory; +import com.azure.resourcemanager.cognitiveservices.models.ConnectionUpdateContent; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; + /** - * Samples for Models List. + * Samples for ProjectConnection Update. */ -public final class ModelsListSamples { +public final class ProjectConnectionUpdateSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * ListLocationModels.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * ProjectConnection/update.json */ /** - * Sample code: ListLocationModels. + * Sample code: UpdateProjectConnection. * * @param manager Entry point to CognitiveServicesManager. */ public static void - listLocationModels(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.models().list("WestUS", com.azure.core.util.Context.NONE); + updateProjectConnection(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.projectConnections() + .updateWithResponse("test-rg", "account-1", "project-1", "connection-1", + new ConnectionUpdateContent().withProperties( + new AccessKeyAuthTypeConnectionProperties().withCategory(ConnectionCategory.ADLSGEN2) + .withExpiryTime(OffsetDateTime.parse("2020-01-01T00:00:00Z")) + .withMetadata(mapOf()) + .withTarget("some_string") + .withCredentials(new ConnectionAccessKey().withAccessKeyId("fakeTokenPlaceholder") + .withSecretAccessKey("fakeTokenPlaceholder"))), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } } ``` -### NetworkSecurityPerimeterConfigurations_Get +### Deployments_Update ```java /** - * Samples for NetworkSecurityPerimeterConfigurations Get. + * Samples for CommitmentPlans Get. */ -public final class NetworkSecurityPerimeterConfigurationsGetSamples { +public final class CommitmentPlansGetSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * GetNetworkSecurityPerimeterConfigurations.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * GetCommitmentPlan.json */ /** - * Sample code: GetNetworkSecurityPerimeterConfigurations. + * Sample code: GetCommitmentPlan. * * @param manager Entry point to CognitiveServicesManager. */ - public static void getNetworkSecurityPerimeterConfigurations( - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.networkSecurityPerimeterConfigurations() - .getWithResponse("resourceGroupName", "accountName", "NSPConfigurationName", + public static void getCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.commitmentPlans() + .getWithResponse("resourceGroupName", "accountName", "commitmentPlanName", com.azure.core.util.Context.NONE); } } ``` -### NetworkSecurityPerimeterConfigurations_List +### EncryptionScopes_CreateOrUpdate ```java /** - * Samples for NetworkSecurityPerimeterConfigurations List. + * Samples for RaiBlocklists Delete. */ -public final class NetworkSecurityPerimeterConfigurationsListSamples { +public final class RaiBlocklistsDeleteSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * ListNetworkSecurityPerimeterConfigurations.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * DeleteRaiBlocklist.json */ /** - * Sample code: ListNetworkSecurityPerimeterConfigurations. + * Sample code: DeleteRaiBlocklist. * * @param manager Entry point to CognitiveServicesManager. */ - public static void listNetworkSecurityPerimeterConfigurations( - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.networkSecurityPerimeterConfigurations() - .list("resourceGroupName", "accountName", com.azure.core.util.Context.NONE); + public static void + deleteRaiBlocklist(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.raiBlocklists() + .delete("resourceGroupName", "accountName", "raiBlocklistName", com.azure.core.util.Context.NONE); } } ``` -### NetworkSecurityPerimeterConfigurations_Reconcile +### EncryptionScopes_Delete ```java /** - * Samples for NetworkSecurityPerimeterConfigurations Reconcile. + * Samples for CommitmentPlans GetByResourceGroup. */ -public final class NetworkSecurityPerimeterConfigurationsReconcileSamples { +public final class CommitmentPlansGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * ReconcileNetworkSecurityPerimeterConfigurations.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * GetSharedCommitmentPlan.json */ /** - * Sample code: ReconcileNetworkSecurityPerimeterConfigurations. + * Sample code: Get Commitment Plan. * * @param manager Entry point to CognitiveServicesManager. */ - public static void reconcileNetworkSecurityPerimeterConfigurations( - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.networkSecurityPerimeterConfigurations() - .reconcile("resourceGroupName", "accountName", "NSPConfigurationName", com.azure.core.util.Context.NONE); - } -} + public static void getCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.commitmentPlans() + .getByResourceGroupWithResponse("resourceGroupName", "commitmentPlanName", + com.azure.core.util.Context.NONE); + } +} ``` -### Operations_List +### EncryptionScopes_Get ```java /** - * Samples for Operations List. + * Samples for ProjectCapabilityHosts Delete. */ -public final class OperationsListSamples { +public final class ProjectCapabilityHostsDeleteSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * GetOperations.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * ProjectCapabilityHost/delete.json */ /** - * Sample code: Get Operations. + * Sample code: Delete Project CapabilityHost. * * @param manager Entry point to CognitiveServicesManager. */ - public static void getOperations(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.operations().list(com.azure.core.util.Context.NONE); + public static void + deleteProjectCapabilityHost(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.projectCapabilityHosts() + .delete("test-rg", "account-1", "project-1", "capabilityHostName", com.azure.core.util.Context.NONE); } } ``` -### PrivateEndpointConnections_CreateOrUpdate +### EncryptionScopes_List ```java -import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointConnectionProperties; -import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.cognitiveservices.models.PrivateLinkServiceConnectionState; - /** - * Samples for PrivateEndpointConnections CreateOrUpdate. + * Samples for ResourceSkus List. */ -public final class PrivateEndpointConnectionsCreateOrUpdateSamples { +public final class ResourceSkusListSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * PutPrivateEndpointConnection.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetSkus. + * json */ /** - * Sample code: PutPrivateEndpointConnection. + * Sample code: Regenerate Keys. * * @param manager Entry point to CognitiveServicesManager. */ - public static void - putPrivateEndpointConnection(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.privateEndpointConnections() - .define("{privateEndpointConnectionName}") - .withExistingAccount("res7687", "sto9699") - .withProperties(new PrivateEndpointConnectionProperties().withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("Auto-Approved"))) - .create(); + public static void regenerateKeys(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.resourceSkus().list(com.azure.core.util.Context.NONE); } } ``` -### PrivateEndpointConnections_Delete +### LocationBasedModelCapacities_List ```java +import com.azure.resourcemanager.cognitiveservices.models.CheckSkuAvailabilityParameter; +import java.util.Arrays; + /** - * Samples for PrivateEndpointConnections Delete. + * Samples for ResourceProvider CheckSkuAvailability. */ -public final class PrivateEndpointConnectionsDeleteSamples { +public final class ResourceProviderCheckSkuAvailabilitySamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * DeletePrivateEndpointConnection.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * CheckSkuAvailability.json */ /** - * Sample code: DeletePrivateEndpointConnection. + * Sample code: Check SKU Availability. * * @param manager Entry point to CognitiveServicesManager. */ public static void - deletePrivateEndpointConnection(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.privateEndpointConnections() - .delete("res6977", "sto2527", "{privateEndpointConnectionName}", com.azure.core.util.Context.NONE); + checkSKUAvailability(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.resourceProviders() + .checkSkuAvailabilityWithResponse("westus", + new CheckSkuAvailabilityParameter().withSkus(Arrays.asList("S0")) + .withKind("Face") + .withType("Microsoft.CognitiveServices/accounts"), + com.azure.core.util.Context.NONE); } } ``` -### PrivateEndpointConnections_Get +### ModelCapacities_List ```java /** - * Samples for PrivateEndpointConnections Get. + * Samples for EncryptionScopes Get. */ -public final class PrivateEndpointConnectionsGetSamples { +public final class EncryptionScopesGetSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * GetPrivateEndpointConnection.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * GetEncryptionScope.json */ /** - * Sample code: GetPrivateEndpointConnection. + * Sample code: GetEncryptionScope. * * @param manager Entry point to CognitiveServicesManager. */ public static void - getPrivateEndpointConnection(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.privateEndpointConnections() - .getWithResponse("res6977", "sto2527", "{privateEndpointConnectionName}", com.azure.core.util.Context.NONE); + getEncryptionScope(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.encryptionScopes() + .getWithResponse("resourceGroupName", "accountName", "encryptionScopeName", + com.azure.core.util.Context.NONE); } } ``` -### PrivateEndpointConnections_List +### Models_List ```java /** - * Samples for PrivateEndpointConnections List. + * Samples for PrivateEndpointConnections Get. */ -public final class PrivateEndpointConnectionsListSamples { +public final class PrivateEndpointConnectionsGetSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * ListPrivateEndpointConnections.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * GetPrivateEndpointConnection.json */ /** * Sample code: GetPrivateEndpointConnection. @@ -1596,284 +1764,864 @@ public final class PrivateEndpointConnectionsListSamples { */ public static void getPrivateEndpointConnection(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.privateEndpointConnections().listWithResponse("res6977", "sto2527", com.azure.core.util.Context.NONE); + manager.privateEndpointConnections() + .getWithResponse("res6977", "sto2527", "{privateEndpointConnectionName}", com.azure.core.util.Context.NONE); } } ``` -### PrivateLinkResources_List +### NetworkSecurityPerimeterConfigurations_Get ```java /** - * Samples for PrivateLinkResources List. + * Samples for DeletedAccounts Purge. */ -public final class PrivateLinkResourcesListSamples { +public final class DeletedAccountsPurgeSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * ListPrivateLinkResources.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * PurgeDeletedAccount.json */ /** - * Sample code: ListPrivateLinkResources. + * Sample code: Delete Account. * * @param manager Entry point to CognitiveServicesManager. */ - public static void - listPrivateLinkResources(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.privateLinkResources().listWithResponse("res6977", "sto2527", com.azure.core.util.Context.NONE); + public static void deleteAccount(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.deletedAccounts().purge("westus", "myResourceGroup", "PropTest01", com.azure.core.util.Context.NONE); } } ``` -### RaiBlocklistItems_BatchAdd +### NetworkSecurityPerimeterConfigurations_List ```java -import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistItemBulkRequest; -import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistItemProperties; -import java.util.Arrays; +import com.azure.resourcemanager.cognitiveservices.models.CheckDomainAvailabilityParameter; /** - * Samples for RaiBlocklistItems BatchAdd. + * Samples for ResourceProvider CheckDomainAvailability. */ -public final class RaiBlocklistItemsBatchAddSamples { +public final class ResourceProviderCheckDomainAvailabilitySamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * AddRaiBlocklistItems.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * CheckDomainAvailability.json */ /** - * Sample code: AddRaiBlocklistItems. + * Sample code: Check SKU Availability. * * @param manager Entry point to CognitiveServicesManager. */ public static void - addRaiBlocklistItems(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.raiBlocklistItems() - .batchAddWithResponse("resourceGroupName", "accountName", "myblocklist", - Arrays.asList( - new RaiBlocklistItemBulkRequest().withName("myblocklistitem1") - .withProperties( - new RaiBlocklistItemProperties().withPattern("^[a-z0-9_-]{2,16}$").withIsRegex(true)), - new RaiBlocklistItemBulkRequest().withName("myblocklistitem2") - .withProperties(new RaiBlocklistItemProperties().withPattern("blockwords").withIsRegex(false))), + checkSKUAvailability(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.resourceProviders() + .checkDomainAvailabilityWithResponse( + new CheckDomainAvailabilityParameter().withSubdomainName("contosodemoapp1") + .withType("Microsoft.CognitiveServices/accounts"), com.azure.core.util.Context.NONE); } } ``` -### RaiBlocklistItems_BatchDelete +### NetworkSecurityPerimeterConfigurations_Reconcile ```java -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -import java.io.IOException; - /** - * Samples for RaiBlocklistItems BatchDelete. + * Samples for NetworkSecurityPerimeterConfigurations Reconcile. */ -public final class RaiBlocklistItemsBatchDeleteSamples { +public final class NetworkSecurityPerimeterConfigurationsReconcileSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * DeleteRaiBlocklistItems.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * ReconcileNetworkSecurityPerimeterConfigurations.json */ /** - * Sample code: DeleteRaiBlocklistItems. + * Sample code: ReconcileNetworkSecurityPerimeterConfigurations. * * @param manager Entry point to CognitiveServicesManager. */ - public static void deleteRaiBlocklistItems( - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) throws IOException { - manager.raiBlocklistItems() - .batchDeleteWithResponse("resourceGroupName", "accountName", "raiBlocklistName", - SerializerFactory.createDefaultManagementSerializerAdapter() - .deserialize("[\"myblocklistitem1\",\"myblocklistitem2\"]", Object.class, SerializerEncoding.JSON), - com.azure.core.util.Context.NONE); + public static void reconcileNetworkSecurityPerimeterConfigurations( + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.networkSecurityPerimeterConfigurations() + .reconcile("resourceGroupName", "accountName", "NSPConfigurationName", com.azure.core.util.Context.NONE); } } ``` -### RaiBlocklistItems_CreateOrUpdate +### Operations_List ```java -import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistItemProperties; - /** - * Samples for RaiBlocklistItems CreateOrUpdate. + * Samples for Accounts ListKeys. */ -public final class RaiBlocklistItemsCreateOrUpdateSamples { +public final class AccountsListKeysSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * PutRaiBlocklistItem.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ListKeys. + * json */ /** - * Sample code: PutRaiBlocklistItem. + * Sample code: List Keys. * * @param manager Entry point to CognitiveServicesManager. */ - public static void - putRaiBlocklistItem(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.raiBlocklistItems() - .define("raiBlocklistItemName") - .withExistingRaiBlocklist("resourceGroupName", "accountName", "raiBlocklistName") - .withProperties(new RaiBlocklistItemProperties().withPattern("Pattern To Block").withIsRegex(false)) - .create(); + public static void listKeys(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.accounts().listKeysWithResponse("myResourceGroup", "myAccount", com.azure.core.util.Context.NONE); } } ``` -### RaiBlocklistItems_Delete +### PrivateEndpointConnections_CreateOrUpdate ```java /** - * Samples for RaiBlocklistItems Delete. + * Samples for RaiPolicies List. */ -public final class RaiBlocklistItemsDeleteSamples { +public final class RaiPoliciesListSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * DeleteRaiBlocklistItem.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * ListRaiPolicies.json */ /** - * Sample code: DeleteRaiBlocklistItem. + * Sample code: ListRaiPolicies. * * @param manager Entry point to CognitiveServicesManager. */ - public static void - deleteRaiBlocklistItem(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.raiBlocklistItems() - .delete("resourceGroupName", "accountName", "raiBlocklistName", "raiBlocklistItemName", - com.azure.core.util.Context.NONE); + public static void listRaiPolicies(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.raiPolicies().list("resourceGroupName", "accountName", com.azure.core.util.Context.NONE); } } ``` -### RaiBlocklistItems_Get +### PrivateEndpointConnections_Delete ```java /** - * Samples for RaiBlocklistItems Get. + * Samples for AccountConnection Delete. */ -public final class RaiBlocklistItemsGetSamples { +public final class AccountConnectionDeleteSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * GetRaiBlocklistItem.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * AccountConnection/delete.json */ /** - * Sample code: GetRaiBlocklistItem. + * Sample code: DeleteAccountConnection. * * @param manager Entry point to CognitiveServicesManager. */ public static void - getRaiBlocklistItem(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.raiBlocklistItems() - .getWithResponse("resourceGroupName", "accountName", "raiBlocklistName", "raiBlocklistItemName", - com.azure.core.util.Context.NONE); + deleteAccountConnection(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.accountConnections() + .deleteWithResponse("resourceGroup-1", "account-1", "connection-1", com.azure.core.util.Context.NONE); } } ``` -### RaiBlocklistItems_List +### PrivateEndpointConnections_Get ```java /** - * Samples for RaiBlocklistItems List. + * Samples for AccountConnection List. */ -public final class RaiBlocklistItemsListSamples { +public final class AccountConnectionListSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * ListBlocklistItems.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * AccountConnection/list.json */ /** - * Sample code: ListBlocklistItems. + * Sample code: ListAccountConnections. * * @param manager Entry point to CognitiveServicesManager. */ public static void - listBlocklistItems(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.raiBlocklistItems() - .list("resourceGroupName", "accountName", "raiBlocklistName", com.azure.core.util.Context.NONE); + listAccountConnections(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.accountConnections() + .list("resourceGroup-1", "account-1", "[tartget url]", "ContainerRegistry", null, + com.azure.core.util.Context.NONE); } } ``` -### RaiBlocklists_CreateOrUpdate +### PrivateEndpointConnections_List ```java -import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistProperties; - /** - * Samples for RaiBlocklists CreateOrUpdate. + * Samples for Accounts ListModels. */ -public final class RaiBlocklistsCreateOrUpdateSamples { +public final class AccountsListModelsSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * PutRaiBlocklist.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * ListAccountModels.json */ /** - * Sample code: PutRaiBlocklist. + * Sample code: List AccountModels. * * @param manager Entry point to CognitiveServicesManager. */ - public static void putRaiBlocklist(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.raiBlocklists() - .define("raiBlocklistName") - .withExistingAccount("resourceGroupName", "accountName") - .withProperties(new RaiBlocklistProperties().withDescription("Basic blocklist description")) - .create(); + public static void listAccountModels(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.accounts().listModels("resourceGroupName", "accountName", com.azure.core.util.Context.NONE); } } ``` -### RaiBlocklists_Delete +### PrivateLinkResources_List ```java +import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlan; +import java.util.HashMap; +import java.util.Map; + /** - * Samples for RaiBlocklists Delete. + * Samples for CommitmentPlans UpdatePlan. */ -public final class RaiBlocklistsDeleteSamples { +public final class CommitmentPlansUpdatePlanSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * DeleteRaiBlocklist.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * UpdateSharedCommitmentPlan.json */ /** - * Sample code: DeleteRaiBlocklist. + * Sample code: Create Commitment Plan. * * @param manager Entry point to CognitiveServicesManager. */ public static void - deleteRaiBlocklist(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.raiBlocklists() - .delete("resourceGroupName", "accountName", "raiBlocklistName", com.azure.core.util.Context.NONE); - } -} + createCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + CommitmentPlan resource = manager.commitmentPlans() + .getByResourceGroupWithResponse("resourceGroupName", "commitmentPlanName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("name", "value")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ProjectCapabilityHosts_CreateOrUpdate + +```java +/** + * Samples for PrivateEndpointConnections Delete. + */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * DeletePrivateEndpointConnection.json + */ + /** + * Sample code: DeletePrivateEndpointConnection. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + deletePrivateEndpointConnection(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.privateEndpointConnections() + .delete("res6977", "sto2527", "{privateEndpointConnectionName}", com.azure.core.util.Context.NONE); + } +} +``` + +### ProjectCapabilityHosts_Delete + +```java +/** + * Samples for Accounts ListByResourceGroup. + */ +public final class AccountsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * ListAccountsByResourceGroup.json + */ + /** + * Sample code: List Accounts by Resource Group. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + listAccountsByResourceGroup(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.accounts().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); + } +} +``` + +### ProjectCapabilityHosts_Get + +```java +/** + * Samples for RaiPolicies Get. + */ +public final class RaiPoliciesGetSamples { + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * GetRaiPolicy.json + */ + /** + * Sample code: GetRaiPolicy. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void getRaiPolicy(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.raiPolicies() + .getWithResponse("resourceGroupName", "accountName", "raiPolicyName", com.azure.core.util.Context.NONE); + } +} +``` + +### ProjectConnection_Create + +```java +import com.azure.resourcemanager.cognitiveservices.models.DeploymentModel; +import com.azure.resourcemanager.cognitiveservices.models.DeploymentProperties; +import com.azure.resourcemanager.cognitiveservices.models.Sku; + +/** + * Samples for Deployments CreateOrUpdate. + */ +public final class DeploymentsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * PutDeployment.json + */ + /** + * Sample code: PutDeployment. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void putDeployment(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.deployments() + .define("deploymentName") + .withExistingAccount("resourceGroupName", "accountName") + .withSku(new Sku().withName("Standard").withCapacity(1)) + .withProperties(new DeploymentProperties() + .withModel(new DeploymentModel().withFormat("OpenAI").withName("ada").withVersion("1"))) + .create(); + } +} +``` + +### ProjectConnection_Delete + +```java +/** + * Samples for ProjectConnection List. + */ +public final class ProjectConnectionListSamples { + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * ProjectConnection/list.json + */ + /** + * Sample code: ListProjectConnection. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + listProjectConnection(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.projectConnections() + .list("resourceGroup-1", "account-1", "project-1", "[tartget url]", "ContainerRegistry", null, + com.azure.core.util.Context.NONE); + } +} +``` + +### ProjectConnection_Get + +```java +/** + * Samples for Deployments Get. + */ +public final class DeploymentsGetSamples { + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * GetDeployment.json + */ + /** + * Sample code: GetDeployment. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void getDeployment(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.deployments() + .getWithResponse("resourceGroupName", "accountName", "deploymentName", com.azure.core.util.Context.NONE); + } +} +``` + +### ProjectConnection_List + +```java +import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointConnectionProperties; +import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.cognitiveservices.models.PrivateLinkServiceConnectionState; + +/** + * Samples for PrivateEndpointConnections CreateOrUpdate. + */ +public final class PrivateEndpointConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * PutPrivateEndpointConnection.json + */ + /** + * Sample code: PutPrivateEndpointConnection. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + putPrivateEndpointConnection(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.privateEndpointConnections() + .define("{privateEndpointConnectionName}") + .withExistingAccount("res7687", "sto9699") + .withProperties(new PrivateEndpointConnectionProperties().withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Auto-Approved"))) + .create(); + } +} +``` + +### ProjectConnection_Update + +```java +import com.azure.resourcemanager.cognitiveservices.models.AccessKeyAuthTypeConnectionProperties; +import com.azure.resourcemanager.cognitiveservices.models.ConnectionAccessKey; +import com.azure.resourcemanager.cognitiveservices.models.ConnectionCategory; +import com.azure.resourcemanager.cognitiveservices.models.ConnectionPropertiesV2BasicResource; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for AccountConnection Update. + */ +public final class AccountConnectionUpdateSamples { + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * AccountConnection/update.json + */ + /** + * Sample code: UpdateAccountConnection. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + updateAccountConnection(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + ConnectionPropertiesV2BasicResource resource = manager.accountConnections() + .getWithResponse("test-rg", "account-1", "connection-1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new AccessKeyAuthTypeConnectionProperties().withCategory(ConnectionCategory.ADLSGEN2) + .withExpiryTime(OffsetDateTime.parse("2020-01-01T00:00:00Z")) + .withMetadata(mapOf()) + .withTarget("some_string") + .withCredentials(new ConnectionAccessKey().withAccessKeyId("fakeTokenPlaceholder") + .withSecretAccessKey("fakeTokenPlaceholder"))) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Projects_Create + +```java +/** + * Samples for CommitmentPlans Delete. + */ +public final class CommitmentPlansDeleteSamples { + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * DeleteCommitmentPlan.json + */ + /** + * Sample code: DeleteCommitmentPlan. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + deleteCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.commitmentPlans() + .delete("resourceGroupName", "accountName", "commitmentPlanName", com.azure.core.util.Context.NONE); + } +} +``` + +### Projects_Delete + +```java +/** + * Samples for ProjectConnection Get. + */ +public final class ProjectConnectionGetSamples { + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * ProjectConnection/get.json + */ + /** + * Sample code: GetProjectConnection. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + getProjectConnection(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.projectConnections() + .getWithResponse("resourceGroup-1", "account-1", "project-1", "connection-1", + com.azure.core.util.Context.NONE); + } +} +``` + +### Projects_Get + +```java +/** + * Samples for CommitmentPlans DeletePlan. + */ +public final class CommitmentPlansDeletePlanSamples { + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * DeleteSharedCommitmentPlan.json + */ + /** + * Sample code: Delete Commitment Plan. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + deleteCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.commitmentPlans() + .deletePlan("resourceGroupName", "commitmentPlanName", com.azure.core.util.Context.NONE); + } +} +``` + +### Projects_List + +```java +/** + * Samples for Accounts GetByResourceGroup. + */ +public final class AccountsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * GetAccount.json + */ + /** + * Sample code: Get Account. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void getAccount(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.accounts() + .getByResourceGroupWithResponse("myResourceGroup", "myAccount", com.azure.core.util.Context.NONE); + } +} +``` + +### Projects_Update + +```java +/** + * Samples for CommitmentPlans ListByResourceGroup. + */ +public final class CommitmentPlansListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * ListSharedCommitmentPlansByResourceGroup.json + */ + /** + * Sample code: List Commitment Plans by Resource Group. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void listCommitmentPlansByResourceGroup( + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.commitmentPlans().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} +``` + +### RaiBlocklistItems_BatchAdd + +```java +/** + * Samples for ProjectCapabilityHosts Get. + */ +public final class ProjectCapabilityHostsGetSamples { + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * ProjectCapabilityHost/get.json + */ + /** + * Sample code: Get Project CapabilityHost. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + getProjectCapabilityHost(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.projectCapabilityHosts() + .getWithResponse("test-rg", "account-1", "project-1", "capabilityHostName", + com.azure.core.util.Context.NONE); + } +} +``` + +### RaiBlocklistItems_BatchDelete + +```java +import com.azure.resourcemanager.cognitiveservices.models.DefenderForAISetting; +import com.azure.resourcemanager.cognitiveservices.models.DefenderForAISettingState; + +/** + * Samples for DefenderForAISettings Update. + */ +public final class DefenderForAISettingsUpdateSamples { + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * UpdateDefenderForAISetting.json + */ + /** + * Sample code: UpdateDefenderForAISetting. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + updateDefenderForAISetting(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + DefenderForAISetting resource = manager.defenderForAISettings() + .getWithResponse("resourceGroupName", "accountName", "Default", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withState(DefenderForAISettingState.ENABLED).apply(); + } +} +``` + +### RaiBlocklistItems_CreateOrUpdate + +```java +/** + * Samples for DeletedAccounts List. + */ +public final class DeletedAccountsListSamples { + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * ListDeletedAccountsBySubscription.json + */ + /** + * Sample code: List Deleted Accounts by Subscription. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void listDeletedAccountsBySubscription( + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.deletedAccounts().list(com.azure.core.util.Context.NONE); + } +} +``` + +### RaiBlocklistItems_Delete + +```java +/** + * Samples for PrivateEndpointConnections List. + */ +public final class PrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * ListPrivateEndpointConnections.json + */ + /** + * Sample code: GetPrivateEndpointConnection. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + getPrivateEndpointConnection(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.privateEndpointConnections().listWithResponse("res6977", "sto2527", com.azure.core.util.Context.NONE); + } +} +``` + +### RaiBlocklistItems_Get + +```java +/** + * Samples for CommitmentPlans CreateOrUpdateAssociation. + */ +public final class CommitmentPlansCreateOrUpdateAssociationSamples { + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * CreateSharedCommitmentPlanAssociation.json + */ + /** + * Sample code: PutCommitmentPlan. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void putCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.commitmentPlans() + .defineAssociation("commitmentPlanAssociationName") + .withExistingCommitmentPlan("resourceGroupName", "commitmentPlanName") + .withAccountId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.CognitiveServices/accounts/accountName") + .create(); + } +} +``` + +### RaiBlocklistItems_List + +```java +import com.azure.resourcemanager.cognitiveservices.models.ConnectionCategory; +import com.azure.resourcemanager.cognitiveservices.models.NoneAuthTypeConnectionProperties; +import java.time.OffsetDateTime; + +/** + * Samples for AccountConnection Create. + */ +public final class AccountConnectionCreateSamples { + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * AccountConnection/create.json + */ + /** + * Sample code: CreateAccountConnection. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + createAccountConnection(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.accountConnections() + .define("connection-1") + .withExistingAccount("resourceGroup-1", "account-1") + .withProperties(new NoneAuthTypeConnectionProperties().withCategory(ConnectionCategory.CONTAINER_REGISTRY) + .withExpiryTime(OffsetDateTime.parse("2024-03-15T14:30:00Z")) + .withTarget("[tartget url]")) + .create(); + } +} +``` + +### RaiBlocklists_CreateOrUpdate + +```java +import com.azure.resourcemanager.cognitiveservices.models.KeyName; +import com.azure.resourcemanager.cognitiveservices.models.RegenerateKeyParameters; + +/** + * Samples for Accounts RegenerateKey. + */ +public final class AccountsRegenerateKeySamples { + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * RegenerateKey.json + */ + /** + * Sample code: Regenerate Keys. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void regenerateKeys(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.accounts() + .regenerateKeyWithResponse("myResourceGroup", "myAccount", + new RegenerateKeyParameters().withKeyName(KeyName.KEY2), com.azure.core.util.Context.NONE); + } +} +``` + +### RaiBlocklists_Delete + +```java +/** + * Samples for Projects List. + */ +public final class ProjectsListSamples { + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * ListProjects.json + */ + /** + * Sample code: List Project. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void listProject(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.projects().list("myResourceGroup", "myAccount", com.azure.core.util.Context.NONE); + } +} ``` ### RaiBlocklists_Get ```java +import com.azure.resourcemanager.cognitiveservices.models.DefenderForAISettingState; + /** - * Samples for RaiBlocklists Get. + * Samples for DefenderForAISettings CreateOrUpdate. */ -public final class RaiBlocklistsGetSamples { +public final class DefenderForAISettingsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * GetRaiBlocklist.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * PutDefenderForAISetting.json */ /** - * Sample code: GetRaiBlocklist. + * Sample code: PutDefenderForAISetting. * * @param manager Entry point to CognitiveServicesManager. */ - public static void getRaiBlocklist(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.raiBlocklists() - .getWithResponse("resourceGroupName", "accountName", "raiBlocklistName", com.azure.core.util.Context.NONE); + public static void + putDefenderForAISetting(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.defenderForAISettings() + .define("Default") + .withExistingAccount("resourceGroupName", "accountName") + .withState(DefenderForAISettingState.ENABLED) + .create(); } } ``` @@ -1882,21 +2630,22 @@ public final class RaiBlocklistsGetSamples { ```java /** - * Samples for RaiBlocklists List. + * Samples for ModelCapacities List. */ -public final class RaiBlocklistsListSamples { +public final class ModelCapacitiesListSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * ListBlocklists.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * ListModelCapacities.json */ /** - * Sample code: ListBlocklists. + * Sample code: ListModelCapacities. * * @param manager Entry point to CognitiveServicesManager. */ - public static void listBlocklists(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.raiBlocklists().list("resourceGroupName", "accountName", com.azure.core.util.Context.NONE); + public static void + listModelCapacities(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.modelCapacities().list("OpenAI", "ada", "1", com.azure.core.util.Context.NONE); } } ``` @@ -1905,22 +2654,22 @@ public final class RaiBlocklistsListSamples { ```java /** - * Samples for RaiContentFilters Get. + * Samples for PrivateLinkResources List. */ -public final class RaiContentFiltersGetSamples { +public final class PrivateLinkResourcesListSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * GetRaiContentFilter.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * ListPrivateLinkResources.json */ /** - * Sample code: GetRaiContentFilters. + * Sample code: ListPrivateLinkResources. * * @param manager Entry point to CognitiveServicesManager. */ public static void - getRaiContentFilters(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.raiContentFilters().getWithResponse("WestUS", "IndirectAttack", com.azure.core.util.Context.NONE); + listPrivateLinkResources(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.privateLinkResources().listWithResponse("res6977", "sto2527", com.azure.core.util.Context.NONE); } } ``` @@ -1929,22 +2678,22 @@ public final class RaiContentFiltersGetSamples { ```java /** - * Samples for RaiContentFilters List. + * Samples for CommitmentPlans ListPlansBySubscription. */ -public final class RaiContentFiltersListSamples { +public final class CommitmentPlansListPlansBySubscriptionSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * ListRaiContentFilters.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * ListSharedCommitmentPlansBySubscription.json */ /** - * Sample code: ListRaiContentFilters. + * Sample code: List Accounts by Subscription. * * @param manager Entry point to CognitiveServicesManager. */ public static void - listRaiContentFilters(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.raiContentFilters().list("WestUS", com.azure.core.util.Context.NONE); + listAccountsBySubscription(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.commitmentPlans().listPlansBySubscription(com.azure.core.util.Context.NONE); } } ``` @@ -1952,91 +2701,22 @@ public final class RaiContentFiltersListSamples { ### RaiPolicies_CreateOrUpdate ```java -import com.azure.resourcemanager.cognitiveservices.models.ContentLevel; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentFilter; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentSource; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyMode; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyProperties; -import java.util.Arrays; - /** - * Samples for RaiPolicies CreateOrUpdate. + * Samples for Usages List. */ -public final class RaiPoliciesCreateOrUpdateSamples { +public final class UsagesListSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * PutRaiPolicy.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * ListUsages.json */ /** - * Sample code: PutRaiPolicy. + * Sample code: Get Usages. * * @param manager Entry point to CognitiveServicesManager. */ - public static void putRaiPolicy(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.raiPolicies() - .define("raiPolicyName") - .withExistingAccount("resourceGroupName", "accountName") - .withProperties(new RaiPolicyProperties().withMode(RaiPolicyMode.ASYNCHRONOUS_FILTER) - .withBasePolicyName("Microsoft.Default") - .withContentFilters(Arrays.asList( - new RaiPolicyContentFilter().withName("Hate") - .withEnabled(false) - .withSeverityThreshold(ContentLevel.HIGH) - .withBlocking(false) - .withSource(RaiPolicyContentSource.PROMPT), - new RaiPolicyContentFilter().withName("Hate") - .withEnabled(true) - .withSeverityThreshold(ContentLevel.MEDIUM) - .withBlocking(true) - .withSource(RaiPolicyContentSource.COMPLETION), - new RaiPolicyContentFilter().withName("Sexual") - .withEnabled(true) - .withSeverityThreshold(ContentLevel.HIGH) - .withBlocking(true) - .withSource(RaiPolicyContentSource.PROMPT), - new RaiPolicyContentFilter().withName("Sexual") - .withEnabled(true) - .withSeverityThreshold(ContentLevel.MEDIUM) - .withBlocking(true) - .withSource(RaiPolicyContentSource.COMPLETION), - new RaiPolicyContentFilter().withName("Selfharm") - .withEnabled(true) - .withSeverityThreshold(ContentLevel.HIGH) - .withBlocking(true) - .withSource(RaiPolicyContentSource.PROMPT), - new RaiPolicyContentFilter().withName("Selfharm") - .withEnabled(true) - .withSeverityThreshold(ContentLevel.MEDIUM) - .withBlocking(true) - .withSource(RaiPolicyContentSource.COMPLETION), - new RaiPolicyContentFilter().withName("Violence") - .withEnabled(true) - .withSeverityThreshold(ContentLevel.MEDIUM) - .withBlocking(true) - .withSource(RaiPolicyContentSource.PROMPT), - new RaiPolicyContentFilter().withName("Violence") - .withEnabled(true) - .withSeverityThreshold(ContentLevel.MEDIUM) - .withBlocking(true) - .withSource(RaiPolicyContentSource.COMPLETION), - new RaiPolicyContentFilter().withName("Jailbreak") - .withEnabled(true) - .withBlocking(true) - .withSource(RaiPolicyContentSource.PROMPT), - new RaiPolicyContentFilter().withName("Protected Material Text") - .withEnabled(true) - .withBlocking(true) - .withSource(RaiPolicyContentSource.COMPLETION), - new RaiPolicyContentFilter().withName("Protected Material Code") - .withEnabled(true) - .withBlocking(true) - .withSource(RaiPolicyContentSource.COMPLETION), - new RaiPolicyContentFilter().withName("Profanity") - .withEnabled(true) - .withBlocking(true) - .withSource(RaiPolicyContentSource.PROMPT)))) - .create(); + public static void getUsages(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.usages().list("WestUS", null, com.azure.core.util.Context.NONE); } } ``` @@ -2045,22 +2725,21 @@ public final class RaiPoliciesCreateOrUpdateSamples { ```java /** - * Samples for RaiPolicies Delete. + * Samples for Deployments List. */ -public final class RaiPoliciesDeleteSamples { +public final class DeploymentsListSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * DeleteRaiPolicy.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * ListDeployments.json */ /** - * Sample code: DeleteRaiPolicy. + * Sample code: ListDeployments. * * @param manager Entry point to CognitiveServicesManager. */ - public static void deleteRaiPolicy(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.raiPolicies() - .delete("resourceGroupName", "accountName", "raiPolicyName", com.azure.core.util.Context.NONE); + public static void listDeployments(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.deployments().list("resourceGroupName", "accountName", com.azure.core.util.Context.NONE); } } ``` @@ -2068,23 +2747,30 @@ public final class RaiPoliciesDeleteSamples { ### RaiPolicies_Get ```java +import com.azure.resourcemanager.cognitiveservices.models.CapabilityHostProperties; + /** - * Samples for RaiPolicies Get. + * Samples for AccountCapabilityHosts CreateOrUpdate. */ -public final class RaiPoliciesGetSamples { +public final class AccountCapabilityHostsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * GetRaiPolicy.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * AccountCapabilityHost/createOrUpdate.json */ /** - * Sample code: GetRaiPolicy. + * Sample code: CreateOrUpdate Account CapabilityHost. * * @param manager Entry point to CognitiveServicesManager. */ - public static void getRaiPolicy(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.raiPolicies() - .getWithResponse("resourceGroupName", "accountName", "raiPolicyName", com.azure.core.util.Context.NONE); + public static void createOrUpdateAccountCapabilityHost( + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.accountCapabilityHosts() + .define("capabilityHostName") + .withExistingAccount("test-rg", "account-1") + .withProperties(new CapabilityHostProperties().withCustomerSubnet( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroups/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet")) + .create(); } } ``` @@ -2093,21 +2779,23 @@ public final class RaiPoliciesGetSamples { ```java /** - * Samples for RaiPolicies List. + * Samples for NetworkSecurityPerimeterConfigurations List. */ -public final class RaiPoliciesListSamples { +public final class NetworkSecurityPerimeterConfigurationsListSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * ListRaiPolicies.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * ListNetworkSecurityPerimeterConfigurations.json */ /** - * Sample code: ListRaiPolicies. + * Sample code: ListNetworkSecurityPerimeterConfigurations. * * @param manager Entry point to CognitiveServicesManager. */ - public static void listRaiPolicies(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.raiPolicies().list("resourceGroupName", "accountName", com.azure.core.util.Context.NONE); + public static void listNetworkSecurityPerimeterConfigurations( + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.networkSecurityPerimeterConfigurations() + .list("resourceGroupName", "accountName", com.azure.core.util.Context.NONE); } } ``` @@ -2115,40 +2803,23 @@ public final class RaiPoliciesListSamples { ### ResourceProvider_CalculateModelCapacity ```java -import com.azure.resourcemanager.cognitiveservices.models.CalculateModelCapacityParameter; -import com.azure.resourcemanager.cognitiveservices.models.DeploymentModel; -import com.azure.resourcemanager.cognitiveservices.models.ModelCapacityCalculatorWorkload; -import com.azure.resourcemanager.cognitiveservices.models.ModelCapacityCalculatorWorkloadRequestParam; -import java.util.Arrays; - /** - * Samples for ResourceProvider CalculateModelCapacity. + * Samples for RaiContentFilters Get. */ -public final class ResourceProviderCalculateModelCapacitySamples { +public final class RaiContentFiltersGetSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * CalculateModelCapacity.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * GetRaiContentFilter.json */ /** - * Sample code: Calculate Model Capacity. + * Sample code: GetRaiContentFilters. * * @param manager Entry point to CognitiveServicesManager. */ public static void - calculateModelCapacity(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.resourceProviders() - .calculateModelCapacityWithResponse(new CalculateModelCapacityParameter() - .withModel(new DeploymentModel().withFormat("OpenAI").withName("gpt-4").withVersion("0613")) - .withSkuName("ProvisionedManaged") - .withWorkloads(Arrays.asList(new ModelCapacityCalculatorWorkload().withRequestPerMinute(10L) - .withRequestParameters(new ModelCapacityCalculatorWorkloadRequestParam().withAvgPromptTokens(30L) - .withAvgGeneratedTokens(50L)), - new ModelCapacityCalculatorWorkload().withRequestPerMinute(20L) - .withRequestParameters( - new ModelCapacityCalculatorWorkloadRequestParam().withAvgPromptTokens(60L) - .withAvgGeneratedTokens(20L)))), - com.azure.core.util.Context.NONE); + getRaiContentFilters(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.raiContentFilters().getWithResponse("WestUS", "IndirectAttack", com.azure.core.util.Context.NONE); } } ``` @@ -2156,28 +2827,30 @@ public final class ResourceProviderCalculateModelCapacitySamples { ### ResourceProvider_CheckDomainAvailability ```java -import com.azure.resourcemanager.cognitiveservices.models.CheckDomainAvailabilityParameter; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import java.io.IOException; /** - * Samples for ResourceProvider CheckDomainAvailability. + * Samples for RaiBlocklistItems BatchDelete. */ -public final class ResourceProviderCheckDomainAvailabilitySamples { +public final class RaiBlocklistItemsBatchDeleteSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * CheckDomainAvailability.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * DeleteRaiBlocklistItems.json */ /** - * Sample code: Check SKU Availability. + * Sample code: DeleteRaiBlocklistItems. * * @param manager Entry point to CognitiveServicesManager. */ - public static void - checkSKUAvailability(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.resourceProviders() - .checkDomainAvailabilityWithResponse( - new CheckDomainAvailabilityParameter().withSubdomainName("contosodemoapp1") - .withType("Microsoft.CognitiveServices/accounts"), + public static void deleteRaiBlocklistItems( + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) throws IOException { + manager.raiBlocklistItems() + .batchDeleteWithResponse("resourceGroupName", "accountName", "raiBlocklistName", + SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("[\"myblocklistitem1\",\"myblocklistitem2\"]", Object.class, SerializerEncoding.JSON), com.azure.core.util.Context.NONE); } } @@ -2186,31 +2859,22 @@ public final class ResourceProviderCheckDomainAvailabilitySamples { ### ResourceProvider_CheckSkuAvailability ```java -import com.azure.resourcemanager.cognitiveservices.models.CheckSkuAvailabilityParameter; -import java.util.Arrays; - /** - * Samples for ResourceProvider CheckSkuAvailability. + * Samples for Operations List. */ -public final class ResourceProviderCheckSkuAvailabilitySamples { +public final class OperationsListSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * CheckSkuAvailability.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * GetOperations.json */ /** - * Sample code: Check SKU Availability. + * Sample code: Get Operations. * * @param manager Entry point to CognitiveServicesManager. */ - public static void - checkSKUAvailability(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.resourceProviders() - .checkSkuAvailabilityWithResponse("westus", - new CheckSkuAvailabilityParameter().withSkus(Arrays.asList("S0")) - .withKind("Face") - .withType("Microsoft.CognitiveServices/accounts"), - com.azure.core.util.Context.NONE); + public static void getOperations(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); } } ``` @@ -2219,21 +2883,23 @@ public final class ResourceProviderCheckSkuAvailabilitySamples { ```java /** - * Samples for ResourceSkus List. + * Samples for EncryptionScopes Delete. */ -public final class ResourceSkusListSamples { +public final class EncryptionScopesDeleteSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetSkus. - * json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * DeleteEncryptionScope.json */ /** - * Sample code: Regenerate Keys. + * Sample code: DeleteEncryptionScope. * * @param manager Entry point to CognitiveServicesManager. */ - public static void regenerateKeys(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.resourceSkus().list(com.azure.core.util.Context.NONE); + public static void + deleteEncryptionScope(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.encryptionScopes() + .delete("resourceGroupName", "accountName", "encryptionScopeName", com.azure.core.util.Context.NONE); } } ``` @@ -2241,22 +2907,38 @@ public final class ResourceSkusListSamples { ### Usages_List ```java +import com.azure.resourcemanager.cognitiveservices.models.EncryptionScopeProperties; +import com.azure.resourcemanager.cognitiveservices.models.EncryptionScopeState; +import com.azure.resourcemanager.cognitiveservices.models.KeySource; +import com.azure.resourcemanager.cognitiveservices.models.KeyVaultProperties; + /** - * Samples for Usages List. + * Samples for EncryptionScopes CreateOrUpdate. */ -public final class UsagesListSamples { +public final class EncryptionScopesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ - * ListUsages.json + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * PutEncryptionScope.json */ /** - * Sample code: Get Usages. + * Sample code: PutEncryptionScope. * * @param manager Entry point to CognitiveServicesManager. */ - public static void getUsages(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.usages().list("WestUS", null, com.azure.core.util.Context.NONE); + public static void + putEncryptionScope(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.encryptionScopes() + .define("encryptionScopeName") + .withExistingAccount("resourceGroupName", "accountName") + .withProperties(new EncryptionScopeProperties() + .withKeyVaultProperties(new KeyVaultProperties().withKeyName("fakeTokenPlaceholder") + .withKeyVersion("fakeTokenPlaceholder") + .withKeyVaultUri("fakeTokenPlaceholder") + .withIdentityClientId("00000000-0000-0000-0000-000000000000")) + .withKeySource(KeySource.MICROSOFT_KEY_VAULT) + .withState(EncryptionScopeState.ENABLED)) + .create(); } } ``` diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/pom.xml b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/pom.xml index 35da387f500f..b17acf64fef6 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/pom.xml +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/pom.xml @@ -18,7 +18,7 @@ jar Microsoft Azure SDK for CognitiveServices Management - This package contains Microsoft Azure SDK for CognitiveServices Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Cognitive Services Management Client. Package tag package-2024-10. + This package contains Microsoft Azure SDK for CognitiveServices Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Cognitive Services Management Client. Package tag package-2025-04-01. https://github.com/Azure/azure-sdk-for-java @@ -45,7 +45,6 @@ UTF-8 0 0 - false true diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/CognitiveServicesManager.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/CognitiveServicesManager.java index 9f295cdbebe4..c0c9cae0bad7 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/CognitiveServicesManager.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/CognitiveServicesManager.java @@ -22,8 +22,11 @@ import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.cognitiveservices.fluent.CognitiveServicesManagementClient; +import com.azure.resourcemanager.cognitiveservices.implementation.AccountCapabilityHostsImpl; +import com.azure.resourcemanager.cognitiveservices.implementation.AccountConnectionsImpl; import com.azure.resourcemanager.cognitiveservices.implementation.AccountsImpl; import com.azure.resourcemanager.cognitiveservices.implementation.CognitiveServicesManagementClientBuilder; import com.azure.resourcemanager.cognitiveservices.implementation.CommitmentPlansImpl; @@ -39,6 +42,9 @@ import com.azure.resourcemanager.cognitiveservices.implementation.OperationsImpl; import com.azure.resourcemanager.cognitiveservices.implementation.PrivateEndpointConnectionsImpl; import com.azure.resourcemanager.cognitiveservices.implementation.PrivateLinkResourcesImpl; +import com.azure.resourcemanager.cognitiveservices.implementation.ProjectCapabilityHostsImpl; +import com.azure.resourcemanager.cognitiveservices.implementation.ProjectConnectionsImpl; +import com.azure.resourcemanager.cognitiveservices.implementation.ProjectsImpl; import com.azure.resourcemanager.cognitiveservices.implementation.RaiBlocklistItemsImpl; import com.azure.resourcemanager.cognitiveservices.implementation.RaiBlocklistsImpl; import com.azure.resourcemanager.cognitiveservices.implementation.RaiContentFiltersImpl; @@ -46,6 +52,8 @@ import com.azure.resourcemanager.cognitiveservices.implementation.ResourceProvidersImpl; import com.azure.resourcemanager.cognitiveservices.implementation.ResourceSkusImpl; import com.azure.resourcemanager.cognitiveservices.implementation.UsagesImpl; +import com.azure.resourcemanager.cognitiveservices.models.AccountCapabilityHosts; +import com.azure.resourcemanager.cognitiveservices.models.AccountConnections; import com.azure.resourcemanager.cognitiveservices.models.Accounts; import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlans; import com.azure.resourcemanager.cognitiveservices.models.CommitmentTiers; @@ -60,6 +68,9 @@ import com.azure.resourcemanager.cognitiveservices.models.Operations; import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointConnections; import com.azure.resourcemanager.cognitiveservices.models.PrivateLinkResources; +import com.azure.resourcemanager.cognitiveservices.models.ProjectCapabilityHosts; +import com.azure.resourcemanager.cognitiveservices.models.ProjectConnections; +import com.azure.resourcemanager.cognitiveservices.models.Projects; import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistItems; import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklists; import com.azure.resourcemanager.cognitiveservices.models.RaiContentFilters; @@ -71,6 +82,7 @@ import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; @@ -121,6 +133,16 @@ public final class CognitiveServicesManager { private DefenderForAISettings defenderForAISettings; + private Projects projects; + + private AccountConnections accountConnections; + + private ProjectConnections projectConnections; + + private AccountCapabilityHosts accountCapabilityHosts; + + private ProjectCapabilityHosts projectCapabilityHosts; + private final CognitiveServicesManagementClient clientObject; private CognitiveServicesManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -173,6 +195,9 @@ public static Configurable configure() { */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-cognitiveservices.properties"); private HttpClient httpClient; private HttpLogOptions httpLogOptions; @@ -280,12 +305,14 @@ public CognitiveServicesManager authenticate(TokenCredential credential, AzurePr Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + StringBuilder userAgentBuilder = new StringBuilder(); userAgentBuilder.append("azsdk-java") .append("-") .append("com.azure.resourcemanager.cognitiveservices") .append("/") - .append("1.1.0"); + .append(clientVersion); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -586,6 +613,68 @@ public DefenderForAISettings defenderForAISettings() { return defenderForAISettings; } + /** + * Gets the resource collection API of Projects. It manages Project. + * + * @return Resource collection API of Projects. + */ + public Projects projects() { + if (this.projects == null) { + this.projects = new ProjectsImpl(clientObject.getProjects(), this); + } + return projects; + } + + /** + * Gets the resource collection API of AccountConnections. It manages ConnectionPropertiesV2BasicResource. + * + * @return Resource collection API of AccountConnections. + */ + public AccountConnections accountConnections() { + if (this.accountConnections == null) { + this.accountConnections = new AccountConnectionsImpl(clientObject.getAccountConnections(), this); + } + return accountConnections; + } + + /** + * Gets the resource collection API of ProjectConnections. + * + * @return Resource collection API of ProjectConnections. + */ + public ProjectConnections projectConnections() { + if (this.projectConnections == null) { + this.projectConnections = new ProjectConnectionsImpl(clientObject.getProjectConnections(), this); + } + return projectConnections; + } + + /** + * Gets the resource collection API of AccountCapabilityHosts. It manages CapabilityHost. + * + * @return Resource collection API of AccountCapabilityHosts. + */ + public AccountCapabilityHosts accountCapabilityHosts() { + if (this.accountCapabilityHosts == null) { + this.accountCapabilityHosts + = new AccountCapabilityHostsImpl(clientObject.getAccountCapabilityHosts(), this); + } + return accountCapabilityHosts; + } + + /** + * Gets the resource collection API of ProjectCapabilityHosts. + * + * @return Resource collection API of ProjectCapabilityHosts. + */ + public ProjectCapabilityHosts projectCapabilityHosts() { + if (this.projectCapabilityHosts == null) { + this.projectCapabilityHosts + = new ProjectCapabilityHostsImpl(clientObject.getProjectCapabilityHosts(), this); + } + return projectCapabilityHosts; + } + /** * Gets wrapped service client CognitiveServicesManagementClient providing direct access to the underlying * auto-generated API implementation, based on Azure REST API. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AccountCapabilityHostsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AccountCapabilityHostsClient.java new file mode 100644 index 000000000000..158ac772fffc --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AccountCapabilityHostsClient.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cognitiveservices.fluent.models.CapabilityHostInner; + +/** + * An instance of this class provides access to all the operations defined in AccountCapabilityHostsClient. + */ +public interface AccountCapabilityHostsClient { + /** + * Delete account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, + String capabilityHostname); + + /** + * Delete account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, + String capabilityHostname, Context context); + + /** + * Delete account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String capabilityHostname); + + /** + * Delete account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String capabilityHostname, Context context); + + /** + * Get account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return account capabilityHost along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String accountName, + String capabilityHostname, Context context); + + /** + * Get account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return account capabilityHost. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CapabilityHostInner get(String resourceGroupName, String accountName, String capabilityHostname); + + /** + * Create or update account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param body CapabilityHost definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CapabilityHostInner> beginCreateOrUpdate(String resourceGroupName, + String accountName, String capabilityHostname, CapabilityHostInner body); + + /** + * Create or update account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param body CapabilityHost definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CapabilityHostInner> beginCreateOrUpdate(String resourceGroupName, + String accountName, String capabilityHostname, CapabilityHostInner body, Context context); + + /** + * Create or update account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param body CapabilityHost definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CapabilityHostInner createOrUpdate(String resourceGroupName, String accountName, String capabilityHostname, + CapabilityHostInner body); + + /** + * Create or update account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param body CapabilityHost definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CapabilityHostInner createOrUpdate(String resourceGroupName, String accountName, String capabilityHostname, + CapabilityHostInner body, Context context); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AccountConnectionsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AccountConnectionsClient.java new file mode 100644 index 000000000000..060fa71f1604 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AccountConnectionsClient.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ConnectionPropertiesV2BasicResourceInner; +import com.azure.resourcemanager.cognitiveservices.models.ConnectionUpdateContent; + +/** + * An instance of this class provides access to all the operations defined in AccountConnectionsClient. + */ +public interface AccountConnectionsClient { + /** + * Delete Cognitive Services account connection by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param connectionName Friendly name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String accountName, String connectionName, + Context context); + + /** + * Delete Cognitive Services account connection by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param connectionName Friendly name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String connectionName); + + /** + * Lists Cognitive Services account connection by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param connectionName Friendly name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String accountName, + String connectionName, Context context); + + /** + * Lists Cognitive Services account connection by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param connectionName Friendly name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectionPropertiesV2BasicResourceInner get(String resourceGroupName, String accountName, String connectionName); + + /** + * Update Cognitive Services account connection under the specified account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param connectionName Friendly name of the connection. + * @param body Parameters for account connection update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, String accountName, + String connectionName, ConnectionUpdateContent body, Context context); + + /** + * Update Cognitive Services account connection under the specified account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param connectionName Friendly name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectionPropertiesV2BasicResourceInner update(String resourceGroupName, String accountName, + String connectionName); + + /** + * Create or update Cognitive Services account connection under the specified account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param connectionName Friendly name of the connection. + * @param body The object for creating or updating a new account connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse(String resourceGroupName, String accountName, + String connectionName, ConnectionPropertiesV2BasicResourceInner body, Context context); + + /** + * Create or update Cognitive Services account connection under the specified account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param connectionName Friendly name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectionPropertiesV2BasicResourceInner create(String resourceGroupName, String accountName, + String connectionName); + + /** + * Lists all the available Cognitive Services account connections under the specified account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Lists all the available Cognitive Services account connections under the specified account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param target Target of the connection. + * @param category Category of the connection. + * @param includeAll query parameter that indicates if get connection call should return both connections and + * datastores. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, + String target, String category, Boolean includeAll, Context context); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/CognitiveServicesManagementClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/CognitiveServicesManagementClient.java index cd49bb4032cf..cf94dc1ceb39 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/CognitiveServicesManagementClient.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/CognitiveServicesManagementClient.java @@ -192,4 +192,39 @@ public interface CognitiveServicesManagementClient { * @return the DefenderForAISettingsClient object. */ DefenderForAISettingsClient getDefenderForAISettings(); + + /** + * Gets the ProjectsClient object to access its operations. + * + * @return the ProjectsClient object. + */ + ProjectsClient getProjects(); + + /** + * Gets the AccountConnectionsClient object to access its operations. + * + * @return the AccountConnectionsClient object. + */ + AccountConnectionsClient getAccountConnections(); + + /** + * Gets the ProjectConnectionsClient object to access its operations. + * + * @return the ProjectConnectionsClient object. + */ + ProjectConnectionsClient getProjectConnections(); + + /** + * Gets the AccountCapabilityHostsClient object to access its operations. + * + * @return the AccountCapabilityHostsClient object. + */ + AccountCapabilityHostsClient getAccountCapabilityHosts(); + + /** + * Gets the ProjectCapabilityHostsClient object to access its operations. + * + * @return the ProjectCapabilityHostsClient object. + */ + ProjectCapabilityHostsClient getProjectCapabilityHosts(); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ProjectCapabilityHostsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ProjectCapabilityHostsClient.java new file mode 100644 index 000000000000..35e363375483 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ProjectCapabilityHostsClient.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cognitiveservices.fluent.models.CapabilityHostInner; + +/** + * An instance of this class provides access to all the operations defined in ProjectCapabilityHostsClient. + */ +public interface ProjectCapabilityHostsClient { + /** + * Delete project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, String projectName, + String capabilityHostname); + + /** + * Delete project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, String projectName, + String capabilityHostname, Context context); + + /** + * Delete project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String projectName, String capabilityHostname); + + /** + * Delete project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String projectName, String capabilityHostname, + Context context); + + /** + * Get project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return project capabilityHost along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String accountName, String projectName, + String capabilityHostname, Context context); + + /** + * Get project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return project capabilityHost. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CapabilityHostInner get(String resourceGroupName, String accountName, String projectName, + String capabilityHostname); + + /** + * Create or update project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param body CapabilityHost definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CapabilityHostInner> beginCreateOrUpdate(String resourceGroupName, + String accountName, String projectName, String capabilityHostname, CapabilityHostInner body); + + /** + * Create or update project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param body CapabilityHost definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CapabilityHostInner> beginCreateOrUpdate(String resourceGroupName, + String accountName, String projectName, String capabilityHostname, CapabilityHostInner body, Context context); + + /** + * Create or update project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param body CapabilityHost definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CapabilityHostInner createOrUpdate(String resourceGroupName, String accountName, String projectName, + String capabilityHostname, CapabilityHostInner body); + + /** + * Create or update project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param body CapabilityHost definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CapabilityHostInner createOrUpdate(String resourceGroupName, String accountName, String projectName, + String capabilityHostname, CapabilityHostInner body, Context context); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ProjectConnectionsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ProjectConnectionsClient.java new file mode 100644 index 000000000000..db7b26302e93 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ProjectConnectionsClient.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ConnectionPropertiesV2BasicResourceInner; +import com.azure.resourcemanager.cognitiveservices.models.ConnectionUpdateContent; + +/** + * An instance of this class provides access to all the operations defined in ProjectConnectionsClient. + */ +public interface ProjectConnectionsClient { + /** + * Delete Cognitive Services project connection by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param connectionName Friendly name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String accountName, String projectName, + String connectionName, Context context); + + /** + * Delete Cognitive Services project connection by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param connectionName Friendly name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String projectName, String connectionName); + + /** + * Lists Cognitive Services project connection by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param connectionName Friendly name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String accountName, + String projectName, String connectionName, Context context); + + /** + * Lists Cognitive Services project connection by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param connectionName Friendly name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectionPropertiesV2BasicResourceInner get(String resourceGroupName, String accountName, String projectName, + String connectionName); + + /** + * Update Cognitive Services project connection under the specified project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param connectionName Friendly name of the connection. + * @param body Parameters for account connection update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, String accountName, + String projectName, String connectionName, ConnectionUpdateContent body, Context context); + + /** + * Update Cognitive Services project connection under the specified project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param connectionName Friendly name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectionPropertiesV2BasicResourceInner update(String resourceGroupName, String accountName, String projectName, + String connectionName); + + /** + * Create or update Cognitive Services project connection under the specified project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param connectionName Friendly name of the connection. + * @param body The object for creating or updating a new account connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse(String resourceGroupName, String accountName, + String projectName, String connectionName, ConnectionPropertiesV2BasicResourceInner body, Context context); + + /** + * Create or update Cognitive Services project connection under the specified project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param connectionName Friendly name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectionPropertiesV2BasicResourceInner create(String resourceGroupName, String accountName, String projectName, + String connectionName); + + /** + * Lists all the available Cognitive Services project connections under the specified project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, + String projectName); + + /** + * Lists all the available Cognitive Services project connections under the specified project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param target Target of the connection. + * @param category Category of the connection. + * @param includeAll query parameter that indicates if get connection call should return both connections and + * datastores. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, + String projectName, String target, String category, Boolean includeAll, Context context); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ProjectsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ProjectsClient.java new file mode 100644 index 000000000000..1ebfb264756e --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ProjectsClient.java @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ProjectInner; + +/** + * An instance of this class provides access to all the operations defined in ProjectsClient. + */ +public interface ProjectsClient { + /** + * Create Cognitive Services Account's Project. Project is a sub-resource of an account which give AI developer it's + * individual container to work on. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param project The parameters to provide for the created project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cognitive Services project is an Azure resource representing the + * provisioned account's project, it's type, location and SKU. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ProjectInner> beginCreate(String resourceGroupName, String accountName, + String projectName, ProjectInner project); + + /** + * Create Cognitive Services Account's Project. Project is a sub-resource of an account which give AI developer it's + * individual container to work on. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param project The parameters to provide for the created project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cognitive Services project is an Azure resource representing the + * provisioned account's project, it's type, location and SKU. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ProjectInner> beginCreate(String resourceGroupName, String accountName, + String projectName, ProjectInner project, Context context); + + /** + * Create Cognitive Services Account's Project. Project is a sub-resource of an account which give AI developer it's + * individual container to work on. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param project The parameters to provide for the created project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's + * type, location and SKU. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProjectInner create(String resourceGroupName, String accountName, String projectName, ProjectInner project); + + /** + * Create Cognitive Services Account's Project. Project is a sub-resource of an account which give AI developer it's + * individual container to work on. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param project The parameters to provide for the created project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's + * type, location and SKU. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProjectInner create(String resourceGroupName, String accountName, String projectName, ProjectInner project, + Context context); + + /** + * Updates a Cognitive Services Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param project The parameters to provide for the created project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cognitive Services project is an Azure resource representing the + * provisioned account's project, it's type, location and SKU. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ProjectInner> beginUpdate(String resourceGroupName, String accountName, + String projectName, ProjectInner project); + + /** + * Updates a Cognitive Services Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param project The parameters to provide for the created project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cognitive Services project is an Azure resource representing the + * provisioned account's project, it's type, location and SKU. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ProjectInner> beginUpdate(String resourceGroupName, String accountName, + String projectName, ProjectInner project, Context context); + + /** + * Updates a Cognitive Services Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param project The parameters to provide for the created project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's + * type, location and SKU. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProjectInner update(String resourceGroupName, String accountName, String projectName, ProjectInner project); + + /** + * Updates a Cognitive Services Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param project The parameters to provide for the created project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's + * type, location and SKU. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProjectInner update(String resourceGroupName, String accountName, String projectName, ProjectInner project, + Context context); + + /** + * Deletes a Cognitive Services project from the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, String projectName); + + /** + * Deletes a Cognitive Services project from the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, String projectName, + Context context); + + /** + * Deletes a Cognitive Services project from the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String projectName); + + /** + * Deletes a Cognitive Services project from the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String projectName, Context context); + + /** + * Returns a Cognitive Services project specified by the parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's + * type, location and SKU along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String accountName, String projectName, + Context context); + + /** + * Returns a Cognitive Services project specified by the parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's + * type, location and SKU. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProjectInner get(String resourceGroupName, String accountName, String projectName); + + /** + * Returns all the projects in a Cognitive Services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of cognitive services projects operation response as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Returns all the projects in a Cognitive Services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of cognitive services projects operation response as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, Context context); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CapabilityHostInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CapabilityHostInner.java new file mode 100644 index 000000000000..b2d882b2c134 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CapabilityHostInner.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cognitiveservices.models.CapabilityHostProperties; +import java.io.IOException; + +/** + * Azure Resource Manager resource envelope. + */ +@Fluent +public final class CapabilityHostInner extends ProxyResource { + /* + * [Required] Additional attributes of the entity. + */ + private CapabilityHostProperties properties; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of CapabilityHostInner class. + */ + public CapabilityHostInner() { + } + + /** + * Get the properties property: [Required] Additional attributes of the entity. + * + * @return the properties value. + */ + public CapabilityHostProperties properties() { + return this.properties; + } + + /** + * Set the properties property: [Required] Additional attributes of the entity. + * + * @param properties the properties value to set. + * @return the CapabilityHostInner object itself. + */ + public CapabilityHostInner withProperties(CapabilityHostProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property properties in model CapabilityHostInner")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CapabilityHostInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CapabilityHostInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CapabilityHostInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CapabilityHostInner. + */ + public static CapabilityHostInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CapabilityHostInner deserializedCapabilityHostInner = new CapabilityHostInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCapabilityHostInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedCapabilityHostInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCapabilityHostInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedCapabilityHostInner.properties = CapabilityHostProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCapabilityHostInner; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ConnectionPropertiesV2BasicResourceInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ConnectionPropertiesV2BasicResourceInner.java new file mode 100644 index 000000000000..6672a30321d7 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ConnectionPropertiesV2BasicResourceInner.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cognitiveservices.models.ConnectionPropertiesV2; +import java.io.IOException; + +/** + * Connection base resource schema. + */ +@Fluent +public final class ConnectionPropertiesV2BasicResourceInner extends ProxyResource { + /* + * Connection property base schema. + */ + private ConnectionPropertiesV2 properties; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ConnectionPropertiesV2BasicResourceInner class. + */ + public ConnectionPropertiesV2BasicResourceInner() { + } + + /** + * Get the properties property: Connection property base schema. + * + * @return the properties value. + */ + public ConnectionPropertiesV2 properties() { + return this.properties; + } + + /** + * Set the properties property: Connection property base schema. + * + * @param properties the properties value to set. + * @return the ConnectionPropertiesV2BasicResourceInner object itself. + */ + public ConnectionPropertiesV2BasicResourceInner withProperties(ConnectionPropertiesV2 properties) { + this.properties = properties; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property properties in model ConnectionPropertiesV2BasicResourceInner")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectionPropertiesV2BasicResourceInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionPropertiesV2BasicResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionPropertiesV2BasicResourceInner if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ConnectionPropertiesV2BasicResourceInner. + */ + public static ConnectionPropertiesV2BasicResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionPropertiesV2BasicResourceInner deserializedConnectionPropertiesV2BasicResourceInner + = new ConnectionPropertiesV2BasicResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedConnectionPropertiesV2BasicResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedConnectionPropertiesV2BasicResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedConnectionPropertiesV2BasicResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedConnectionPropertiesV2BasicResourceInner.properties + = ConnectionPropertiesV2.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionPropertiesV2BasicResourceInner; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ProjectInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ProjectInner.java new file mode 100644 index 000000000000..d71baebef5ca --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ProjectInner.java @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cognitiveservices.models.AzureEntityResource; +import com.azure.resourcemanager.cognitiveservices.models.Identity; +import com.azure.resourcemanager.cognitiveservices.models.ProjectProperties; +import java.io.IOException; +import java.util.Map; + +/** + * Cognitive Services project is an Azure resource representing the provisioned account's project, it's type, location + * and SKU. + */ +@Fluent +public final class ProjectInner extends AzureEntityResource { + /* + * Identity for the resource. + */ + private Identity identity; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + private SystemData systemData; + + /* + * Resource tags. + */ + private Map tags; + + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Properties of Cognitive Services project. + */ + private ProjectProperties properties; + + /* + * Resource Etag. + */ + private String etag; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ProjectInner class. + */ + public ProjectInner() { + } + + /** + * Get the identity property: Identity for the resource. + * + * @return the identity value. + */ + public Identity identity() { + return this.identity; + } + + /** + * Set the identity property: Identity for the resource. + * + * @param identity the identity value to set. + * @return the ProjectInner object itself. + */ + public ProjectInner withIdentity(Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the ProjectInner object itself. + */ + public ProjectInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The geo-location where the resource lives. + * + * @param location the location value to set. + * @return the ProjectInner object itself. + */ + public ProjectInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the properties property: Properties of Cognitive Services project. + * + * @return the properties value. + */ + public ProjectProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of Cognitive Services project. + * + * @param properties the properties value to set. + * @return the ProjectInner object itself. + */ + public ProjectInner withProperties(ProjectProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the etag property: Resource Etag. + * + * @return the etag value. + */ + @Override + public String etag() { + return this.etag; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProjectInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProjectInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ProjectInner. + */ + public static ProjectInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProjectInner deserializedProjectInner = new ProjectInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedProjectInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedProjectInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedProjectInner.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedProjectInner.etag = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedProjectInner.identity = Identity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedProjectInner.systemData = SystemData.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedProjectInner.tags = tags; + } else if ("location".equals(fieldName)) { + deserializedProjectInner.location = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedProjectInner.properties = ProjectProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedProjectInner; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountCapabilityHostsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountCapabilityHostsClientImpl.java new file mode 100644 index 000000000000..f033767cf8ce --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountCapabilityHostsClientImpl.java @@ -0,0 +1,709 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cognitiveservices.fluent.AccountCapabilityHostsClient; +import com.azure.resourcemanager.cognitiveservices.fluent.models.CapabilityHostInner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AccountCapabilityHostsClient. + */ +public final class AccountCapabilityHostsClientImpl implements AccountCapabilityHostsClient { + /** + * The proxy service used to perform REST calls. + */ + private final AccountCapabilityHostsService service; + + /** + * The service client containing this operation class. + */ + private final CognitiveServicesManagementClientImpl client; + + /** + * Initializes an instance of AccountCapabilityHostsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AccountCapabilityHostsClientImpl(CognitiveServicesManagementClientImpl client) { + this.service = RestProxy.create(AccountCapabilityHostsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CognitiveServicesManagementClientAccountCapabilityHosts to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CognitiveServicesMan") + public interface AccountCapabilityHostsService { + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts/{capabilityHostName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("capabilityHostName") String capabilityHostname, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts/{capabilityHostName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("capabilityHostName") String capabilityHostname, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts/{capabilityHostName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("capabilityHostName") String capabilityHostname, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CapabilityHostInner body, @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Delete account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String accountName, + String capabilityHostname) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (capabilityHostname == null) { + return Mono + .error(new IllegalArgumentException("Parameter capabilityHostname is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, accountName, capabilityHostname, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String accountName, + String capabilityHostname, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (capabilityHostname == null) { + return Mono + .error(new IllegalArgumentException("Parameter capabilityHostname is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + accountName, capabilityHostname, this.client.getApiVersion(), accept, context); + } + + /** + * Delete account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String accountName, + String capabilityHostname) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, accountName, capabilityHostname); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String accountName, + String capabilityHostname, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, accountName, capabilityHostname, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, + String capabilityHostname) { + return this.beginDeleteAsync(resourceGroupName, accountName, capabilityHostname).getSyncPoller(); + } + + /** + * Delete account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, + String capabilityHostname, Context context) { + return this.beginDeleteAsync(resourceGroupName, accountName, capabilityHostname, context).getSyncPoller(); + } + + /** + * Delete account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String capabilityHostname) { + return beginDeleteAsync(resourceGroupName, accountName, capabilityHostname).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String capabilityHostname, + Context context) { + return beginDeleteAsync(resourceGroupName, accountName, capabilityHostname, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String capabilityHostname) { + deleteAsync(resourceGroupName, accountName, capabilityHostname).block(); + } + + /** + * Delete account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String capabilityHostname, Context context) { + deleteAsync(resourceGroupName, accountName, capabilityHostname, context).block(); + } + + /** + * Get account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return account capabilityHost along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String capabilityHostname) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (capabilityHostname == null) { + return Mono + .error(new IllegalArgumentException("Parameter capabilityHostname is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, accountName, capabilityHostname, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return account capabilityHost along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String capabilityHostname, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (capabilityHostname == null) { + return Mono + .error(new IllegalArgumentException("Parameter capabilityHostname is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, accountName, + capabilityHostname, this.client.getApiVersion(), accept, context); + } + + /** + * Get account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return account capabilityHost on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, + String capabilityHostname) { + return getWithResponseAsync(resourceGroupName, accountName, capabilityHostname) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return account capabilityHost along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String accountName, + String capabilityHostname, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, capabilityHostname, context).block(); + } + + /** + * Get account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return account capabilityHost. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CapabilityHostInner get(String resourceGroupName, String accountName, String capabilityHostname) { + return getWithResponse(resourceGroupName, accountName, capabilityHostname, Context.NONE).getValue(); + } + + /** + * Create or update account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param body CapabilityHost definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String accountName, String capabilityHostname, CapabilityHostInner body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (capabilityHostname == null) { + return Mono + .error(new IllegalArgumentException("Parameter capabilityHostname is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, accountName, capabilityHostname, this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param body CapabilityHost definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String accountName, String capabilityHostname, CapabilityHostInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (capabilityHostname == null) { + return Mono + .error(new IllegalArgumentException("Parameter capabilityHostname is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + accountName, capabilityHostname, this.client.getApiVersion(), body, accept, context); + } + + /** + * Create or update account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param body CapabilityHost definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CapabilityHostInner> beginCreateOrUpdateAsync( + String resourceGroupName, String accountName, String capabilityHostname, CapabilityHostInner body) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, accountName, capabilityHostname, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + CapabilityHostInner.class, CapabilityHostInner.class, this.client.getContext()); + } + + /** + * Create or update account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param body CapabilityHost definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CapabilityHostInner> beginCreateOrUpdateAsync( + String resourceGroupName, String accountName, String capabilityHostname, CapabilityHostInner body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, accountName, capabilityHostname, body, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + CapabilityHostInner.class, CapabilityHostInner.class, context); + } + + /** + * Create or update account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param body CapabilityHost definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CapabilityHostInner> beginCreateOrUpdate( + String resourceGroupName, String accountName, String capabilityHostname, CapabilityHostInner body) { + return this.beginCreateOrUpdateAsync(resourceGroupName, accountName, capabilityHostname, body).getSyncPoller(); + } + + /** + * Create or update account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param body CapabilityHost definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CapabilityHostInner> beginCreateOrUpdate( + String resourceGroupName, String accountName, String capabilityHostname, CapabilityHostInner body, + Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, accountName, capabilityHostname, body, context) + .getSyncPoller(); + } + + /** + * Create or update account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param body CapabilityHost definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String accountName, + String capabilityHostname, CapabilityHostInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, accountName, capabilityHostname, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param body CapabilityHost definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String accountName, + String capabilityHostname, CapabilityHostInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, accountName, capabilityHostname, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param body CapabilityHost definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CapabilityHostInner createOrUpdate(String resourceGroupName, String accountName, String capabilityHostname, + CapabilityHostInner body) { + return createOrUpdateAsync(resourceGroupName, accountName, capabilityHostname, body).block(); + } + + /** + * Create or update account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param body CapabilityHost definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CapabilityHostInner createOrUpdate(String resourceGroupName, String accountName, String capabilityHostname, + CapabilityHostInner body, Context context) { + return createOrUpdateAsync(resourceGroupName, accountName, capabilityHostname, body, context).block(); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountCapabilityHostsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountCapabilityHostsImpl.java new file mode 100644 index 000000000000..443f74406126 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountCapabilityHostsImpl.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cognitiveservices.fluent.AccountCapabilityHostsClient; +import com.azure.resourcemanager.cognitiveservices.fluent.models.CapabilityHostInner; +import com.azure.resourcemanager.cognitiveservices.models.AccountCapabilityHosts; +import com.azure.resourcemanager.cognitiveservices.models.CapabilityHost; + +public final class AccountCapabilityHostsImpl implements AccountCapabilityHosts { + private static final ClientLogger LOGGER = new ClientLogger(AccountCapabilityHostsImpl.class); + + private final AccountCapabilityHostsClient innerClient; + + private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; + + public AccountCapabilityHostsImpl(AccountCapabilityHostsClient innerClient, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String accountName, String capabilityHostname) { + this.serviceClient().delete(resourceGroupName, accountName, capabilityHostname); + } + + public void delete(String resourceGroupName, String accountName, String capabilityHostname, Context context) { + this.serviceClient().delete(resourceGroupName, accountName, capabilityHostname, context); + } + + public Response getWithResponse(String resourceGroupName, String accountName, + String capabilityHostname, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, accountName, capabilityHostname, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CapabilityHostImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CapabilityHost get(String resourceGroupName, String accountName, String capabilityHostname) { + CapabilityHostInner inner = this.serviceClient().get(resourceGroupName, accountName, capabilityHostname); + if (inner != null) { + return new CapabilityHostImpl(inner, this.manager()); + } else { + return null; + } + } + + public CapabilityHost getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String capabilityHostname = ResourceManagerUtils.getValueFromIdByName(id, "capabilityHosts"); + if (capabilityHostname == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'capabilityHosts'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, capabilityHostname, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String capabilityHostname = ResourceManagerUtils.getValueFromIdByName(id, "capabilityHosts"); + if (capabilityHostname == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'capabilityHosts'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, capabilityHostname, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String capabilityHostname = ResourceManagerUtils.getValueFromIdByName(id, "capabilityHosts"); + if (capabilityHostname == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'capabilityHosts'.", id))); + } + this.delete(resourceGroupName, accountName, capabilityHostname, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String capabilityHostname = ResourceManagerUtils.getValueFromIdByName(id, "capabilityHosts"); + if (capabilityHostname == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'capabilityHosts'.", id))); + } + this.delete(resourceGroupName, accountName, capabilityHostname, context); + } + + private AccountCapabilityHostsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { + return this.serviceManager; + } + + public CapabilityHostImpl define(String name) { + return new CapabilityHostImpl(name, this.manager()); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountConnectionsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountConnectionsClientImpl.java new file mode 100644 index 000000000000..2c7cd9509f56 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountConnectionsClientImpl.java @@ -0,0 +1,914 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.cognitiveservices.fluent.AccountConnectionsClient; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ConnectionPropertiesV2BasicResourceInner; +import com.azure.resourcemanager.cognitiveservices.models.ConnectionPropertiesV2BasicResourceArmPaginatedResult; +import com.azure.resourcemanager.cognitiveservices.models.ConnectionUpdateContent; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AccountConnectionsClient. + */ +public final class AccountConnectionsClientImpl implements AccountConnectionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final AccountConnectionsService service; + + /** + * The service client containing this operation class. + */ + private final CognitiveServicesManagementClientImpl client; + + /** + * Initializes an instance of AccountConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AccountConnectionsClientImpl(CognitiveServicesManagementClientImpl client) { + this.service = RestProxy.create(AccountConnectionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CognitiveServicesManagementClientAccountConnections to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CognitiveServicesMan") + public interface AccountConnectionsService { + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("connectionName") String connectionName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("connectionName") String connectionName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("connectionName") String connectionName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ConnectionUpdateContent body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("connectionName") String connectionName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ConnectionPropertiesV2BasicResourceInner body, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("target") String target, @QueryParam("category") String category, + @QueryParam("api-version") String apiVersion, @QueryParam("includeAll") Boolean includeAll, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Delete Cognitive Services account connection by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param connectionName Friendly name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String accountName, + String connectionName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, accountName, connectionName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete Cognitive Services account connection by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param connectionName Friendly name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String accountName, + String connectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + accountName, connectionName, this.client.getApiVersion(), accept, context); + } + + /** + * Delete Cognitive Services account connection by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param connectionName Friendly name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String connectionName) { + return deleteWithResponseAsync(resourceGroupName, accountName, connectionName).flatMap(ignored -> Mono.empty()); + } + + /** + * Delete Cognitive Services account connection by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param connectionName Friendly name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String accountName, String connectionName, + Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, connectionName, context).block(); + } + + /** + * Delete Cognitive Services account connection by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param connectionName Friendly name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String connectionName) { + deleteWithResponse(resourceGroupName, accountName, connectionName, Context.NONE); + } + + /** + * Lists Cognitive Services account connection by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param connectionName Friendly name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String accountName, String connectionName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, accountName, connectionName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists Cognitive Services account connection by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param connectionName Friendly name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String accountName, String connectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, accountName, + connectionName, this.client.getApiVersion(), accept, context); + } + + /** + * Lists Cognitive Services account connection by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param connectionName Friendly name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, + String connectionName) { + return getWithResponseAsync(resourceGroupName, accountName, connectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Lists Cognitive Services account connection by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param connectionName Friendly name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, + String accountName, String connectionName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, connectionName, context).block(); + } + + /** + * Lists Cognitive Services account connection by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param connectionName Friendly name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectionPropertiesV2BasicResourceInner get(String resourceGroupName, String accountName, + String connectionName) { + return getWithResponse(resourceGroupName, accountName, connectionName, Context.NONE).getValue(); + } + + /** + * Update Cognitive Services account connection under the specified account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param connectionName Friendly name of the connection. + * @param body Parameters for account connection update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, + String accountName, String connectionName, ConnectionUpdateContent body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, accountName, connectionName, this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update Cognitive Services account connection under the specified account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param connectionName Friendly name of the connection. + * @param body Parameters for account connection update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, + String accountName, String connectionName, ConnectionUpdateContent body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + accountName, connectionName, this.client.getApiVersion(), body, accept, context); + } + + /** + * Update Cognitive Services account connection under the specified account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param connectionName Friendly name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String accountName, + String connectionName) { + final ConnectionUpdateContent body = null; + return updateWithResponseAsync(resourceGroupName, accountName, connectionName, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Update Cognitive Services account connection under the specified account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param connectionName Friendly name of the connection. + * @param body Parameters for account connection update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, + String accountName, String connectionName, ConnectionUpdateContent body, Context context) { + return updateWithResponseAsync(resourceGroupName, accountName, connectionName, body, context).block(); + } + + /** + * Update Cognitive Services account connection under the specified account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param connectionName Friendly name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectionPropertiesV2BasicResourceInner update(String resourceGroupName, String accountName, + String connectionName) { + final ConnectionUpdateContent body = null; + return updateWithResponse(resourceGroupName, accountName, connectionName, body, Context.NONE).getValue(); + } + + /** + * Create or update Cognitive Services account connection under the specified account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param connectionName Friendly name of the connection. + * @param body The object for creating or updating a new account connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync(String resourceGroupName, + String accountName, String connectionName, ConnectionPropertiesV2BasicResourceInner body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, accountName, connectionName, this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update Cognitive Services account connection under the specified account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param connectionName Friendly name of the connection. + * @param body The object for creating or updating a new account connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync(String resourceGroupName, + String accountName, String connectionName, ConnectionPropertiesV2BasicResourceInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + accountName, connectionName, this.client.getApiVersion(), body, accept, context); + } + + /** + * Create or update Cognitive Services account connection under the specified account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param connectionName Friendly name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String accountName, + String connectionName) { + final ConnectionPropertiesV2BasicResourceInner body = null; + return createWithResponseAsync(resourceGroupName, accountName, connectionName, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create or update Cognitive Services account connection under the specified account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param connectionName Friendly name of the connection. + * @param body The object for creating or updating a new account connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse(String resourceGroupName, + String accountName, String connectionName, ConnectionPropertiesV2BasicResourceInner body, Context context) { + return createWithResponseAsync(resourceGroupName, accountName, connectionName, body, context).block(); + } + + /** + * Create or update Cognitive Services account connection under the specified account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param connectionName Friendly name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectionPropertiesV2BasicResourceInner create(String resourceGroupName, String accountName, + String connectionName) { + final ConnectionPropertiesV2BasicResourceInner body = null; + return createWithResponse(resourceGroupName, accountName, connectionName, body, Context.NONE).getValue(); + } + + /** + * Lists all the available Cognitive Services account connections under the specified account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param target Target of the connection. + * @param category Category of the connection. + * @param includeAll query parameter that indicates if get connection call should return both connections and + * datastores. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String accountName, String target, String category, Boolean includeAll) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + accountName, target, category, this.client.getApiVersion(), includeAll, accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the available Cognitive Services account connections under the specified account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param target Target of the connection. + * @param category Category of the connection. + * @param includeAll query parameter that indicates if get connection call should return both connections and + * datastores. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String accountName, String target, String category, Boolean includeAll, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, accountName, target, + category, this.client.getApiVersion(), includeAll, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all the available Cognitive Services account connections under the specified account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param target Target of the connection. + * @param category Category of the connection. + * @param includeAll query parameter that indicates if get connection call should return both connections and + * datastores. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, + String target, String category, Boolean includeAll) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, target, category, includeAll), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the available Cognitive Services account connections under the specified account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, + String accountName) { + final String target = null; + final String category = null; + final Boolean includeAll = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, target, category, includeAll), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the available Cognitive Services account connections under the specified account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param target Target of the connection. + * @param category Category of the connection. + * @param includeAll query parameter that indicates if get connection call should return both connections and + * datastores. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, + String target, String category, Boolean includeAll, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, target, category, includeAll, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the available Cognitive Services account connections under the specified account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + final String target = null; + final String category = null; + final Boolean includeAll = null; + return new PagedIterable<>(listAsync(resourceGroupName, accountName, target, category, includeAll)); + } + + /** + * Lists all the available Cognitive Services account connections under the specified account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param target Target of the connection. + * @param category Category of the connection. + * @param includeAll query parameter that indicates if get connection call should return both connections and + * datastores. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, + String target, String category, Boolean includeAll, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, target, category, includeAll, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountConnectionsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountConnectionsImpl.java new file mode 100644 index 000000000000..52111f23a59a --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountConnectionsImpl.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cognitiveservices.fluent.AccountConnectionsClient; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ConnectionPropertiesV2BasicResourceInner; +import com.azure.resourcemanager.cognitiveservices.models.AccountConnections; +import com.azure.resourcemanager.cognitiveservices.models.ConnectionPropertiesV2BasicResource; + +public final class AccountConnectionsImpl implements AccountConnections { + private static final ClientLogger LOGGER = new ClientLogger(AccountConnectionsImpl.class); + + private final AccountConnectionsClient innerClient; + + private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; + + public AccountConnectionsImpl(AccountConnectionsClient innerClient, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response deleteWithResponse(String resourceGroupName, String accountName, String connectionName, + Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, connectionName, context); + } + + public void delete(String resourceGroupName, String accountName, String connectionName) { + this.serviceClient().delete(resourceGroupName, accountName, connectionName); + } + + public Response getWithResponse(String resourceGroupName, String accountName, + String connectionName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, accountName, connectionName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ConnectionPropertiesV2BasicResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ConnectionPropertiesV2BasicResource get(String resourceGroupName, String accountName, + String connectionName) { + ConnectionPropertiesV2BasicResourceInner inner + = this.serviceClient().get(resourceGroupName, accountName, connectionName); + if (inner != null) { + return new ConnectionPropertiesV2BasicResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, accountName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ConnectionPropertiesV2BasicResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, + String target, String category, Boolean includeAll, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, accountName, target, category, includeAll, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ConnectionPropertiesV2BasicResourceImpl(inner1, this.manager())); + } + + public ConnectionPropertiesV2BasicResource getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String connectionName = ResourceManagerUtils.getValueFromIdByName(id, "connections"); + if (connectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, connectionName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String connectionName = ResourceManagerUtils.getValueFromIdByName(id, "connections"); + if (connectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, connectionName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String connectionName = ResourceManagerUtils.getValueFromIdByName(id, "connections"); + if (connectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + } + this.deleteWithResponse(resourceGroupName, accountName, connectionName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String connectionName = ResourceManagerUtils.getValueFromIdByName(id, "connections"); + if (connectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + } + return this.deleteWithResponse(resourceGroupName, accountName, connectionName, context); + } + + private AccountConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { + return this.serviceManager; + } + + public ConnectionPropertiesV2BasicResourceImpl define(String name) { + return new ConnectionPropertiesV2BasicResourceImpl(name, this.manager()); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CapabilityHostImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CapabilityHostImpl.java new file mode 100644 index 000000000000..84ada1fff609 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CapabilityHostImpl.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.cognitiveservices.fluent.models.CapabilityHostInner; +import com.azure.resourcemanager.cognitiveservices.models.CapabilityHost; +import com.azure.resourcemanager.cognitiveservices.models.CapabilityHostProperties; + +public final class CapabilityHostImpl implements CapabilityHost, CapabilityHost.Definition, CapabilityHost.Update { + private CapabilityHostInner innerObject; + + private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public CapabilityHostProperties properties() { + return this.innerModel().properties(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public CapabilityHostInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String capabilityHostname; + + public CapabilityHostImpl withExistingAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public CapabilityHost create() { + this.innerObject = serviceManager.serviceClient() + .getAccountCapabilityHosts() + .createOrUpdate(resourceGroupName, accountName, capabilityHostname, this.innerModel(), Context.NONE); + return this; + } + + public CapabilityHost create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAccountCapabilityHosts() + .createOrUpdate(resourceGroupName, accountName, capabilityHostname, this.innerModel(), context); + return this; + } + + CapabilityHostImpl(String name, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerObject = new CapabilityHostInner(); + this.serviceManager = serviceManager; + this.capabilityHostname = name; + } + + public CapabilityHostImpl update() { + return this; + } + + public CapabilityHost apply() { + this.innerObject = serviceManager.serviceClient() + .getAccountCapabilityHosts() + .createOrUpdate(resourceGroupName, accountName, capabilityHostname, this.innerModel(), Context.NONE); + return this; + } + + public CapabilityHost apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAccountCapabilityHosts() + .createOrUpdate(resourceGroupName, accountName, capabilityHostname, this.innerModel(), context); + return this; + } + + CapabilityHostImpl(CapabilityHostInner innerObject, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "accounts"); + this.capabilityHostname = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "capabilityHosts"); + } + + public CapabilityHost refresh() { + this.innerObject = serviceManager.serviceClient() + .getAccountCapabilityHosts() + .getWithResponse(resourceGroupName, accountName, capabilityHostname, Context.NONE) + .getValue(); + return this; + } + + public CapabilityHost refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAccountCapabilityHosts() + .getWithResponse(resourceGroupName, accountName, capabilityHostname, context) + .getValue(); + return this; + } + + public CapabilityHostImpl withProperties(CapabilityHostProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CognitiveServicesManagementClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CognitiveServicesManagementClientImpl.java index 59cee0bd084c..88f826768fba 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CognitiveServicesManagementClientImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CognitiveServicesManagementClientImpl.java @@ -23,6 +23,8 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.cognitiveservices.fluent.AccountCapabilityHostsClient; +import com.azure.resourcemanager.cognitiveservices.fluent.AccountConnectionsClient; import com.azure.resourcemanager.cognitiveservices.fluent.AccountsClient; import com.azure.resourcemanager.cognitiveservices.fluent.CognitiveServicesManagementClient; import com.azure.resourcemanager.cognitiveservices.fluent.CommitmentPlansClient; @@ -38,6 +40,9 @@ import com.azure.resourcemanager.cognitiveservices.fluent.OperationsClient; import com.azure.resourcemanager.cognitiveservices.fluent.PrivateEndpointConnectionsClient; import com.azure.resourcemanager.cognitiveservices.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.cognitiveservices.fluent.ProjectCapabilityHostsClient; +import com.azure.resourcemanager.cognitiveservices.fluent.ProjectConnectionsClient; +import com.azure.resourcemanager.cognitiveservices.fluent.ProjectsClient; import com.azure.resourcemanager.cognitiveservices.fluent.RaiBlocklistItemsClient; import com.azure.resourcemanager.cognitiveservices.fluent.RaiBlocklistsClient; import com.azure.resourcemanager.cognitiveservices.fluent.RaiContentFiltersClient; @@ -437,6 +442,76 @@ public DefenderForAISettingsClient getDefenderForAISettings() { return this.defenderForAISettings; } + /** + * The ProjectsClient object to access its operations. + */ + private final ProjectsClient projects; + + /** + * Gets the ProjectsClient object to access its operations. + * + * @return the ProjectsClient object. + */ + public ProjectsClient getProjects() { + return this.projects; + } + + /** + * The AccountConnectionsClient object to access its operations. + */ + private final AccountConnectionsClient accountConnections; + + /** + * Gets the AccountConnectionsClient object to access its operations. + * + * @return the AccountConnectionsClient object. + */ + public AccountConnectionsClient getAccountConnections() { + return this.accountConnections; + } + + /** + * The ProjectConnectionsClient object to access its operations. + */ + private final ProjectConnectionsClient projectConnections; + + /** + * Gets the ProjectConnectionsClient object to access its operations. + * + * @return the ProjectConnectionsClient object. + */ + public ProjectConnectionsClient getProjectConnections() { + return this.projectConnections; + } + + /** + * The AccountCapabilityHostsClient object to access its operations. + */ + private final AccountCapabilityHostsClient accountCapabilityHosts; + + /** + * Gets the AccountCapabilityHostsClient object to access its operations. + * + * @return the AccountCapabilityHostsClient object. + */ + public AccountCapabilityHostsClient getAccountCapabilityHosts() { + return this.accountCapabilityHosts; + } + + /** + * The ProjectCapabilityHostsClient object to access its operations. + */ + private final ProjectCapabilityHostsClient projectCapabilityHosts; + + /** + * Gets the ProjectCapabilityHostsClient object to access its operations. + * + * @return the ProjectCapabilityHostsClient object. + */ + public ProjectCapabilityHostsClient getProjectCapabilityHosts() { + return this.projectCapabilityHosts; + } + /** * Initializes an instance of CognitiveServicesManagementClient client. * @@ -454,7 +529,7 @@ public DefenderForAISettingsClient getDefenderForAISettings() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2024-10-01"; + this.apiVersion = "2025-04-01"; this.accounts = new AccountsClientImpl(this); this.deletedAccounts = new DeletedAccountsClientImpl(this); this.resourceSkus = new ResourceSkusClientImpl(this); @@ -476,6 +551,11 @@ public DefenderForAISettingsClient getDefenderForAISettings() { this.raiContentFilters = new RaiContentFiltersClientImpl(this); this.networkSecurityPerimeterConfigurations = new NetworkSecurityPerimeterConfigurationsClientImpl(this); this.defenderForAISettings = new DefenderForAISettingsClientImpl(this); + this.projects = new ProjectsClientImpl(this); + this.accountConnections = new AccountConnectionsClientImpl(this); + this.projectConnections = new ProjectConnectionsClientImpl(this); + this.accountCapabilityHosts = new AccountCapabilityHostsClientImpl(this); + this.projectCapabilityHosts = new ProjectCapabilityHostsClientImpl(this); } /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ConnectionPropertiesV2BasicResourceImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ConnectionPropertiesV2BasicResourceImpl.java new file mode 100644 index 000000000000..a90ddc9fe558 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ConnectionPropertiesV2BasicResourceImpl.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ConnectionPropertiesV2BasicResourceInner; +import com.azure.resourcemanager.cognitiveservices.models.ConnectionPropertiesV2; +import com.azure.resourcemanager.cognitiveservices.models.ConnectionPropertiesV2BasicResource; +import com.azure.resourcemanager.cognitiveservices.models.ConnectionUpdateContent; + +public final class ConnectionPropertiesV2BasicResourceImpl implements ConnectionPropertiesV2BasicResource, + ConnectionPropertiesV2BasicResource.Definition, ConnectionPropertiesV2BasicResource.Update { + private ConnectionPropertiesV2BasicResourceInner innerObject; + + private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ConnectionPropertiesV2 properties() { + return this.innerModel().properties(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ConnectionPropertiesV2BasicResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String connectionName; + + private ConnectionUpdateContent updateBody; + + public ConnectionPropertiesV2BasicResourceImpl withExistingAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public ConnectionPropertiesV2BasicResource create() { + this.innerObject = serviceManager.serviceClient() + .getAccountConnections() + .createWithResponse(resourceGroupName, accountName, connectionName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ConnectionPropertiesV2BasicResource create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAccountConnections() + .createWithResponse(resourceGroupName, accountName, connectionName, this.innerModel(), context) + .getValue(); + return this; + } + + ConnectionPropertiesV2BasicResourceImpl(String name, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerObject = new ConnectionPropertiesV2BasicResourceInner(); + this.serviceManager = serviceManager; + this.connectionName = name; + } + + public ConnectionPropertiesV2BasicResourceImpl update() { + this.updateBody = new ConnectionUpdateContent(); + return this; + } + + public ConnectionPropertiesV2BasicResource apply() { + this.innerObject = serviceManager.serviceClient() + .getAccountConnections() + .updateWithResponse(resourceGroupName, accountName, connectionName, updateBody, Context.NONE) + .getValue(); + return this; + } + + public ConnectionPropertiesV2BasicResource apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAccountConnections() + .updateWithResponse(resourceGroupName, accountName, connectionName, updateBody, context) + .getValue(); + return this; + } + + ConnectionPropertiesV2BasicResourceImpl(ConnectionPropertiesV2BasicResourceInner innerObject, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "accounts"); + this.connectionName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "connections"); + } + + public ConnectionPropertiesV2BasicResource refresh() { + this.innerObject = serviceManager.serviceClient() + .getAccountConnections() + .getWithResponse(resourceGroupName, accountName, connectionName, Context.NONE) + .getValue(); + return this; + } + + public ConnectionPropertiesV2BasicResource refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAccountConnections() + .getWithResponse(resourceGroupName, accountName, connectionName, context) + .getValue(); + return this; + } + + public ConnectionPropertiesV2BasicResourceImpl withProperties(ConnectionPropertiesV2 properties) { + if (isInCreateMode()) { + this.innerModel().withProperties(properties); + return this; + } else { + this.updateBody.withProperties(properties); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectCapabilityHostsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectCapabilityHostsClientImpl.java new file mode 100644 index 000000000000..925c32b4ec0d --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectCapabilityHostsClientImpl.java @@ -0,0 +1,766 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cognitiveservices.fluent.ProjectCapabilityHostsClient; +import com.azure.resourcemanager.cognitiveservices.fluent.models.CapabilityHostInner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ProjectCapabilityHostsClient. + */ +public final class ProjectCapabilityHostsClientImpl implements ProjectCapabilityHostsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ProjectCapabilityHostsService service; + + /** + * The service client containing this operation class. + */ + private final CognitiveServicesManagementClientImpl client; + + /** + * Initializes an instance of ProjectCapabilityHostsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProjectCapabilityHostsClientImpl(CognitiveServicesManagementClientImpl client) { + this.service = RestProxy.create(ProjectCapabilityHostsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CognitiveServicesManagementClientProjectCapabilityHosts to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CognitiveServicesMan") + public interface ProjectCapabilityHostsService { + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/capabilityHosts/{capabilityHostName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @PathParam("capabilityHostName") String capabilityHostname, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/capabilityHosts/{capabilityHostName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @PathParam("capabilityHostName") String capabilityHostname, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/capabilityHosts/{capabilityHostName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @PathParam("capabilityHostName") String capabilityHostname, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") CapabilityHostInner body, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Delete project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String accountName, + String projectName, String capabilityHostname) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (capabilityHostname == null) { + return Mono + .error(new IllegalArgumentException("Parameter capabilityHostname is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + accountName, projectName, capabilityHostname, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String accountName, + String projectName, String capabilityHostname, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (capabilityHostname == null) { + return Mono + .error(new IllegalArgumentException("Parameter capabilityHostname is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + accountName, projectName, capabilityHostname, this.client.getApiVersion(), accept, context); + } + + /** + * Delete project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String accountName, + String projectName, String capabilityHostname) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, accountName, projectName, capabilityHostname); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String accountName, + String projectName, String capabilityHostname, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, accountName, projectName, capabilityHostname, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, + String projectName, String capabilityHostname) { + return this.beginDeleteAsync(resourceGroupName, accountName, projectName, capabilityHostname).getSyncPoller(); + } + + /** + * Delete project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, + String projectName, String capabilityHostname, Context context) { + return this.beginDeleteAsync(resourceGroupName, accountName, projectName, capabilityHostname, context) + .getSyncPoller(); + } + + /** + * Delete project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String projectName, + String capabilityHostname) { + return beginDeleteAsync(resourceGroupName, accountName, projectName, capabilityHostname).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String projectName, + String capabilityHostname, Context context) { + return beginDeleteAsync(resourceGroupName, accountName, projectName, capabilityHostname, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String projectName, String capabilityHostname) { + deleteAsync(resourceGroupName, accountName, projectName, capabilityHostname).block(); + } + + /** + * Delete project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String projectName, String capabilityHostname, + Context context) { + deleteAsync(resourceGroupName, accountName, projectName, capabilityHostname, context).block(); + } + + /** + * Get project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return project capabilityHost along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String projectName, String capabilityHostname) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (capabilityHostname == null) { + return Mono + .error(new IllegalArgumentException("Parameter capabilityHostname is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + accountName, projectName, capabilityHostname, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return project capabilityHost along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String projectName, String capabilityHostname, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (capabilityHostname == null) { + return Mono + .error(new IllegalArgumentException("Parameter capabilityHostname is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, accountName, + projectName, capabilityHostname, this.client.getApiVersion(), accept, context); + } + + /** + * Get project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return project capabilityHost on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, String projectName, + String capabilityHostname) { + return getWithResponseAsync(resourceGroupName, accountName, projectName, capabilityHostname) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return project capabilityHost along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String accountName, + String projectName, String capabilityHostname, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, projectName, capabilityHostname, context).block(); + } + + /** + * Get project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return project capabilityHost. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CapabilityHostInner get(String resourceGroupName, String accountName, String projectName, + String capabilityHostname) { + return getWithResponse(resourceGroupName, accountName, projectName, capabilityHostname, Context.NONE) + .getValue(); + } + + /** + * Create or update project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param body CapabilityHost definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String accountName, String projectName, String capabilityHostname, CapabilityHostInner body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (capabilityHostname == null) { + return Mono + .error(new IllegalArgumentException("Parameter capabilityHostname is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, accountName, projectName, capabilityHostname, this.client.getApiVersion(), body, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param body CapabilityHost definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String accountName, String projectName, String capabilityHostname, CapabilityHostInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (capabilityHostname == null) { + return Mono + .error(new IllegalArgumentException("Parameter capabilityHostname is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + accountName, projectName, capabilityHostname, this.client.getApiVersion(), body, accept, context); + } + + /** + * Create or update project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param body CapabilityHost definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CapabilityHostInner> beginCreateOrUpdateAsync( + String resourceGroupName, String accountName, String projectName, String capabilityHostname, + CapabilityHostInner body) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, accountName, projectName, capabilityHostname, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + CapabilityHostInner.class, CapabilityHostInner.class, this.client.getContext()); + } + + /** + * Create or update project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param body CapabilityHost definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CapabilityHostInner> beginCreateOrUpdateAsync( + String resourceGroupName, String accountName, String projectName, String capabilityHostname, + CapabilityHostInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, accountName, + projectName, capabilityHostname, body, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + CapabilityHostInner.class, CapabilityHostInner.class, context); + } + + /** + * Create or update project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param body CapabilityHost definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CapabilityHostInner> beginCreateOrUpdate( + String resourceGroupName, String accountName, String projectName, String capabilityHostname, + CapabilityHostInner body) { + return this.beginCreateOrUpdateAsync(resourceGroupName, accountName, projectName, capabilityHostname, body) + .getSyncPoller(); + } + + /** + * Create or update project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param body CapabilityHost definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CapabilityHostInner> beginCreateOrUpdate( + String resourceGroupName, String accountName, String projectName, String capabilityHostname, + CapabilityHostInner body, Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, accountName, projectName, capabilityHostname, body, context) + .getSyncPoller(); + } + + /** + * Create or update project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param body CapabilityHost definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String accountName, + String projectName, String capabilityHostname, CapabilityHostInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, accountName, projectName, capabilityHostname, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param body CapabilityHost definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String accountName, + String projectName, String capabilityHostname, CapabilityHostInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, accountName, projectName, capabilityHostname, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param body CapabilityHost definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CapabilityHostInner createOrUpdate(String resourceGroupName, String accountName, String projectName, + String capabilityHostname, CapabilityHostInner body) { + return createOrUpdateAsync(resourceGroupName, accountName, projectName, capabilityHostname, body).block(); + } + + /** + * Create or update project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param body CapabilityHost definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CapabilityHostInner createOrUpdate(String resourceGroupName, String accountName, String projectName, + String capabilityHostname, CapabilityHostInner body, Context context) { + return createOrUpdateAsync(resourceGroupName, accountName, projectName, capabilityHostname, body, context) + .block(); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectCapabilityHostsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectCapabilityHostsImpl.java new file mode 100644 index 000000000000..25a00f4048af --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectCapabilityHostsImpl.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cognitiveservices.fluent.ProjectCapabilityHostsClient; +import com.azure.resourcemanager.cognitiveservices.fluent.models.CapabilityHostInner; +import com.azure.resourcemanager.cognitiveservices.models.CapabilityHost; +import com.azure.resourcemanager.cognitiveservices.models.ProjectCapabilityHosts; + +public final class ProjectCapabilityHostsImpl implements ProjectCapabilityHosts { + private static final ClientLogger LOGGER = new ClientLogger(ProjectCapabilityHostsImpl.class); + + private final ProjectCapabilityHostsClient innerClient; + + private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; + + public ProjectCapabilityHostsImpl(ProjectCapabilityHostsClient innerClient, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String accountName, String projectName, String capabilityHostname) { + this.serviceClient().delete(resourceGroupName, accountName, projectName, capabilityHostname); + } + + public void delete(String resourceGroupName, String accountName, String projectName, String capabilityHostname, + Context context) { + this.serviceClient().delete(resourceGroupName, accountName, projectName, capabilityHostname, context); + } + + public Response getWithResponse(String resourceGroupName, String accountName, String projectName, + String capabilityHostname, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, accountName, projectName, capabilityHostname, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CapabilityHostImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CapabilityHost get(String resourceGroupName, String accountName, String projectName, + String capabilityHostname) { + CapabilityHostInner inner + = this.serviceClient().get(resourceGroupName, accountName, projectName, capabilityHostname); + if (inner != null) { + return new CapabilityHostImpl(inner, this.manager()); + } else { + return null; + } + } + + public CapabilityHost createOrUpdate(String resourceGroupName, String accountName, String projectName, + String capabilityHostname, CapabilityHostInner body) { + CapabilityHostInner inner = this.serviceClient() + .createOrUpdate(resourceGroupName, accountName, projectName, capabilityHostname, body); + if (inner != null) { + return new CapabilityHostImpl(inner, this.manager()); + } else { + return null; + } + } + + public CapabilityHost createOrUpdate(String resourceGroupName, String accountName, String projectName, + String capabilityHostname, CapabilityHostInner body, Context context) { + CapabilityHostInner inner = this.serviceClient() + .createOrUpdate(resourceGroupName, accountName, projectName, capabilityHostname, body, context); + if (inner != null) { + return new CapabilityHostImpl(inner, this.manager()); + } else { + return null; + } + } + + private ProjectCapabilityHostsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectConnectionsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectConnectionsClientImpl.java new file mode 100644 index 000000000000..d397e11d9652 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectConnectionsClientImpl.java @@ -0,0 +1,988 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.cognitiveservices.fluent.ProjectConnectionsClient; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ConnectionPropertiesV2BasicResourceInner; +import com.azure.resourcemanager.cognitiveservices.models.ConnectionPropertiesV2BasicResourceArmPaginatedResult; +import com.azure.resourcemanager.cognitiveservices.models.ConnectionUpdateContent; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ProjectConnectionsClient. + */ +public final class ProjectConnectionsClientImpl implements ProjectConnectionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ProjectConnectionsService service; + + /** + * The service client containing this operation class. + */ + private final CognitiveServicesManagementClientImpl client; + + /** + * Initializes an instance of ProjectConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProjectConnectionsClientImpl(CognitiveServicesManagementClientImpl client) { + this.service = RestProxy.create(ProjectConnectionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CognitiveServicesManagementClientProjectConnections to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CognitiveServicesMan") + public interface ProjectConnectionsService { + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") ConnectionUpdateContent body, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ConnectionPropertiesV2BasicResourceInner body, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @QueryParam("target") String target, + @QueryParam("category") String category, @QueryParam("api-version") String apiVersion, + @QueryParam("includeAll") Boolean includeAll, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Delete Cognitive Services project connection by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param connectionName Friendly name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String accountName, + String projectName, String connectionName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + accountName, projectName, connectionName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete Cognitive Services project connection by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param connectionName Friendly name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String accountName, + String projectName, String connectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + accountName, projectName, connectionName, this.client.getApiVersion(), accept, context); + } + + /** + * Delete Cognitive Services project connection by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param connectionName Friendly name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String projectName, + String connectionName) { + return deleteWithResponseAsync(resourceGroupName, accountName, projectName, connectionName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Delete Cognitive Services project connection by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param connectionName Friendly name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String accountName, String projectName, + String connectionName, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, projectName, connectionName, context).block(); + } + + /** + * Delete Cognitive Services project connection by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param connectionName Friendly name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String projectName, String connectionName) { + deleteWithResponse(resourceGroupName, accountName, projectName, connectionName, Context.NONE); + } + + /** + * Lists Cognitive Services project connection by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param connectionName Friendly name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String accountName, String projectName, String connectionName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + accountName, projectName, connectionName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists Cognitive Services project connection by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param connectionName Friendly name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String accountName, String projectName, String connectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, accountName, + projectName, connectionName, this.client.getApiVersion(), accept, context); + } + + /** + * Lists Cognitive Services project connection by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param connectionName Friendly name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, + String projectName, String connectionName) { + return getWithResponseAsync(resourceGroupName, accountName, projectName, connectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Lists Cognitive Services project connection by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param connectionName Friendly name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, + String accountName, String projectName, String connectionName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, projectName, connectionName, context).block(); + } + + /** + * Lists Cognitive Services project connection by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param connectionName Friendly name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectionPropertiesV2BasicResourceInner get(String resourceGroupName, String accountName, + String projectName, String connectionName) { + return getWithResponse(resourceGroupName, accountName, projectName, connectionName, Context.NONE).getValue(); + } + + /** + * Update Cognitive Services project connection under the specified project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param connectionName Friendly name of the connection. + * @param body Parameters for account connection update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, + String accountName, String projectName, String connectionName, ConnectionUpdateContent body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + accountName, projectName, connectionName, this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update Cognitive Services project connection under the specified project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param connectionName Friendly name of the connection. + * @param body Parameters for account connection update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, + String accountName, String projectName, String connectionName, ConnectionUpdateContent body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + accountName, projectName, connectionName, this.client.getApiVersion(), body, accept, context); + } + + /** + * Update Cognitive Services project connection under the specified project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param connectionName Friendly name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String accountName, + String projectName, String connectionName) { + final ConnectionUpdateContent body = null; + return updateWithResponseAsync(resourceGroupName, accountName, projectName, connectionName, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Update Cognitive Services project connection under the specified project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param connectionName Friendly name of the connection. + * @param body Parameters for account connection update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, + String accountName, String projectName, String connectionName, ConnectionUpdateContent body, Context context) { + return updateWithResponseAsync(resourceGroupName, accountName, projectName, connectionName, body, context) + .block(); + } + + /** + * Update Cognitive Services project connection under the specified project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param connectionName Friendly name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectionPropertiesV2BasicResourceInner update(String resourceGroupName, String accountName, + String projectName, String connectionName) { + final ConnectionUpdateContent body = null; + return updateWithResponse(resourceGroupName, accountName, projectName, connectionName, body, Context.NONE) + .getValue(); + } + + /** + * Create or update Cognitive Services project connection under the specified project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param connectionName Friendly name of the connection. + * @param body The object for creating or updating a new account connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync(String resourceGroupName, + String accountName, String projectName, String connectionName, ConnectionPropertiesV2BasicResourceInner body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + accountName, projectName, connectionName, this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update Cognitive Services project connection under the specified project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param connectionName Friendly name of the connection. + * @param body The object for creating or updating a new account connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync(String resourceGroupName, + String accountName, String projectName, String connectionName, ConnectionPropertiesV2BasicResourceInner body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + accountName, projectName, connectionName, this.client.getApiVersion(), body, accept, context); + } + + /** + * Create or update Cognitive Services project connection under the specified project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param connectionName Friendly name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String accountName, + String projectName, String connectionName) { + final ConnectionPropertiesV2BasicResourceInner body = null; + return createWithResponseAsync(resourceGroupName, accountName, projectName, connectionName, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create or update Cognitive Services project connection under the specified project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param connectionName Friendly name of the connection. + * @param body The object for creating or updating a new account connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse(String resourceGroupName, + String accountName, String projectName, String connectionName, ConnectionPropertiesV2BasicResourceInner body, + Context context) { + return createWithResponseAsync(resourceGroupName, accountName, projectName, connectionName, body, context) + .block(); + } + + /** + * Create or update Cognitive Services project connection under the specified project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param connectionName Friendly name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectionPropertiesV2BasicResourceInner create(String resourceGroupName, String accountName, + String projectName, String connectionName) { + final ConnectionPropertiesV2BasicResourceInner body = null; + return createWithResponse(resourceGroupName, accountName, projectName, connectionName, body, Context.NONE) + .getValue(); + } + + /** + * Lists all the available Cognitive Services project connections under the specified project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param target Target of the connection. + * @param category Category of the connection. + * @param includeAll query parameter that indicates if get connection call should return both connections and + * datastores. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String accountName, String projectName, String target, String category, Boolean includeAll) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, accountName, projectName, target, category, this.client.getApiVersion(), includeAll, + accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the available Cognitive Services project connections under the specified project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param target Target of the connection. + * @param category Category of the connection. + * @param includeAll query parameter that indicates if get connection call should return both connections and + * datastores. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String accountName, String projectName, String target, String category, Boolean includeAll, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, accountName, + projectName, target, category, this.client.getApiVersion(), includeAll, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all the available Cognitive Services project connections under the specified project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param target Target of the connection. + * @param category Category of the connection. + * @param includeAll query parameter that indicates if get connection call should return both connections and + * datastores. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, + String projectName, String target, String category, Boolean includeAll) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, projectName, target, category, includeAll), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the available Cognitive Services project connections under the specified project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, + String projectName) { + final String target = null; + final String category = null; + final Boolean includeAll = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, projectName, target, category, includeAll), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the available Cognitive Services project connections under the specified project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param target Target of the connection. + * @param category Category of the connection. + * @param includeAll query parameter that indicates if get connection call should return both connections and + * datastores. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, + String projectName, String target, String category, Boolean includeAll, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, projectName, target, category, + includeAll, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the available Cognitive Services project connections under the specified project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, + String projectName) { + final String target = null; + final String category = null; + final Boolean includeAll = null; + return new PagedIterable<>( + listAsync(resourceGroupName, accountName, projectName, target, category, includeAll)); + } + + /** + * Lists all the available Cognitive Services project connections under the specified project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param target Target of the connection. + * @param category Category of the connection. + * @param includeAll query parameter that indicates if get connection call should return both connections and + * datastores. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, + String projectName, String target, String category, Boolean includeAll, Context context) { + return new PagedIterable<>( + listAsync(resourceGroupName, accountName, projectName, target, category, includeAll, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectConnectionsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectConnectionsImpl.java new file mode 100644 index 000000000000..8af792cb3f3e --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectConnectionsImpl.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cognitiveservices.fluent.ProjectConnectionsClient; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ConnectionPropertiesV2BasicResourceInner; +import com.azure.resourcemanager.cognitiveservices.models.ConnectionPropertiesV2BasicResource; +import com.azure.resourcemanager.cognitiveservices.models.ConnectionUpdateContent; +import com.azure.resourcemanager.cognitiveservices.models.ProjectConnections; + +public final class ProjectConnectionsImpl implements ProjectConnections { + private static final ClientLogger LOGGER = new ClientLogger(ProjectConnectionsImpl.class); + + private final ProjectConnectionsClient innerClient; + + private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; + + public ProjectConnectionsImpl(ProjectConnectionsClient innerClient, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response deleteWithResponse(String resourceGroupName, String accountName, String projectName, + String connectionName, Context context) { + return this.serviceClient() + .deleteWithResponse(resourceGroupName, accountName, projectName, connectionName, context); + } + + public void delete(String resourceGroupName, String accountName, String projectName, String connectionName) { + this.serviceClient().delete(resourceGroupName, accountName, projectName, connectionName); + } + + public Response getWithResponse(String resourceGroupName, String accountName, + String projectName, String connectionName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, accountName, projectName, connectionName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ConnectionPropertiesV2BasicResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ConnectionPropertiesV2BasicResource get(String resourceGroupName, String accountName, String projectName, + String connectionName) { + ConnectionPropertiesV2BasicResourceInner inner + = this.serviceClient().get(resourceGroupName, accountName, projectName, connectionName); + if (inner != null) { + return new ConnectionPropertiesV2BasicResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response updateWithResponse(String resourceGroupName, + String accountName, String projectName, String connectionName, ConnectionUpdateContent body, Context context) { + Response inner = this.serviceClient() + .updateWithResponse(resourceGroupName, accountName, projectName, connectionName, body, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ConnectionPropertiesV2BasicResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ConnectionPropertiesV2BasicResource update(String resourceGroupName, String accountName, String projectName, + String connectionName) { + ConnectionPropertiesV2BasicResourceInner inner + = this.serviceClient().update(resourceGroupName, accountName, projectName, connectionName); + if (inner != null) { + return new ConnectionPropertiesV2BasicResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createWithResponse(String resourceGroupName, + String accountName, String projectName, String connectionName, ConnectionPropertiesV2BasicResourceInner body, + Context context) { + Response inner = this.serviceClient() + .createWithResponse(resourceGroupName, accountName, projectName, connectionName, body, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ConnectionPropertiesV2BasicResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ConnectionPropertiesV2BasicResource create(String resourceGroupName, String accountName, String projectName, + String connectionName) { + ConnectionPropertiesV2BasicResourceInner inner + = this.serviceClient().create(resourceGroupName, accountName, projectName, connectionName); + if (inner != null) { + return new ConnectionPropertiesV2BasicResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String accountName, + String projectName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, accountName, projectName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ConnectionPropertiesV2BasicResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, + String projectName, String target, String category, Boolean includeAll, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, accountName, projectName, target, category, includeAll, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ConnectionPropertiesV2BasicResourceImpl(inner1, this.manager())); + } + + private ProjectConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectImpl.java new file mode 100644 index 000000000000..d7690ce0e75f --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectImpl.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ProjectInner; +import com.azure.resourcemanager.cognitiveservices.models.Identity; +import com.azure.resourcemanager.cognitiveservices.models.Project; +import com.azure.resourcemanager.cognitiveservices.models.ProjectProperties; +import java.util.Collections; +import java.util.Map; + +public final class ProjectImpl implements Project, Project.Definition, Project.Update { + private ProjectInner innerObject; + + private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public Identity identity() { + return this.innerModel().identity(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String location() { + return this.innerModel().location(); + } + + public ProjectProperties properties() { + return this.innerModel().properties(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ProjectInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String projectName; + + public ProjectImpl withExistingAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public Project create() { + this.innerObject = serviceManager.serviceClient() + .getProjects() + .create(resourceGroupName, accountName, projectName, this.innerModel(), Context.NONE); + return this; + } + + public Project create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getProjects() + .create(resourceGroupName, accountName, projectName, this.innerModel(), context); + return this; + } + + ProjectImpl(String name, com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerObject = new ProjectInner(); + this.serviceManager = serviceManager; + this.projectName = name; + } + + public ProjectImpl update() { + return this; + } + + public Project apply() { + this.innerObject = serviceManager.serviceClient() + .getProjects() + .update(resourceGroupName, accountName, projectName, this.innerModel(), Context.NONE); + return this; + } + + public Project apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getProjects() + .update(resourceGroupName, accountName, projectName, this.innerModel(), context); + return this; + } + + ProjectImpl(ProjectInner innerObject, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "accounts"); + this.projectName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "projects"); + } + + public Project refresh() { + this.innerObject = serviceManager.serviceClient() + .getProjects() + .getWithResponse(resourceGroupName, accountName, projectName, Context.NONE) + .getValue(); + return this; + } + + public Project refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getProjects() + .getWithResponse(resourceGroupName, accountName, projectName, context) + .getValue(); + return this; + } + + public ProjectImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ProjectImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ProjectImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public ProjectImpl withIdentity(Identity identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public ProjectImpl withProperties(ProjectProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectsClientImpl.java new file mode 100644 index 000000000000..12e2e28ab2f4 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectsClientImpl.java @@ -0,0 +1,1198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cognitiveservices.fluent.ProjectsClient; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ProjectInner; +import com.azure.resourcemanager.cognitiveservices.models.ProjectListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ProjectsClient. + */ +public final class ProjectsClientImpl implements ProjectsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ProjectsService service; + + /** + * The service client containing this operation class. + */ + private final CognitiveServicesManagementClientImpl client; + + /** + * Initializes an instance of ProjectsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProjectsClientImpl(CognitiveServicesManagementClientImpl client) { + this.service = RestProxy.create(ProjectsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CognitiveServicesManagementClientProjects to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CognitiveServicesMan") + public interface ProjectsService { + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}") + @ExpectedResponses({ 200, 201, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @BodyParam("application/json") ProjectInner project, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @BodyParam("application/json") ProjectInner project, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Create Cognitive Services Account's Project. Project is a sub-resource of an account which give AI developer it's + * individual container to work on. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param project The parameters to provide for the created project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's + * type, location and SKU along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String accountName, + String projectName, ProjectInner project) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (project == null) { + return Mono.error(new IllegalArgumentException("Parameter project is required and cannot be null.")); + } else { + project.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), resourceGroupName, accountName, + projectName, this.client.getApiVersion(), this.client.getSubscriptionId(), project, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create Cognitive Services Account's Project. Project is a sub-resource of an account which give AI developer it's + * individual container to work on. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param project The parameters to provide for the created project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's + * type, location and SKU along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String accountName, + String projectName, ProjectInner project, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (project == null) { + return Mono.error(new IllegalArgumentException("Parameter project is required and cannot be null.")); + } else { + project.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), resourceGroupName, accountName, projectName, + this.client.getApiVersion(), this.client.getSubscriptionId(), project, accept, context); + } + + /** + * Create Cognitive Services Account's Project. Project is a sub-resource of an account which give AI developer it's + * individual container to work on. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param project The parameters to provide for the created project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of cognitive Services project is an Azure resource representing the + * provisioned account's project, it's type, location and SKU. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProjectInner> beginCreateAsync(String resourceGroupName, + String accountName, String projectName, ProjectInner project) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, accountName, projectName, project); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ProjectInner.class, ProjectInner.class, this.client.getContext()); + } + + /** + * Create Cognitive Services Account's Project. Project is a sub-resource of an account which give AI developer it's + * individual container to work on. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param project The parameters to provide for the created project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of cognitive Services project is an Azure resource representing the + * provisioned account's project, it's type, location and SKU. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProjectInner> beginCreateAsync(String resourceGroupName, + String accountName, String projectName, ProjectInner project, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createWithResponseAsync(resourceGroupName, accountName, projectName, project, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ProjectInner.class, ProjectInner.class, context); + } + + /** + * Create Cognitive Services Account's Project. Project is a sub-resource of an account which give AI developer it's + * individual container to work on. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param project The parameters to provide for the created project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cognitive Services project is an Azure resource representing the + * provisioned account's project, it's type, location and SKU. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProjectInner> beginCreate(String resourceGroupName, String accountName, + String projectName, ProjectInner project) { + return this.beginCreateAsync(resourceGroupName, accountName, projectName, project).getSyncPoller(); + } + + /** + * Create Cognitive Services Account's Project. Project is a sub-resource of an account which give AI developer it's + * individual container to work on. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param project The parameters to provide for the created project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cognitive Services project is an Azure resource representing the + * provisioned account's project, it's type, location and SKU. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProjectInner> beginCreate(String resourceGroupName, String accountName, + String projectName, ProjectInner project, Context context) { + return this.beginCreateAsync(resourceGroupName, accountName, projectName, project, context).getSyncPoller(); + } + + /** + * Create Cognitive Services Account's Project. Project is a sub-resource of an account which give AI developer it's + * individual container to work on. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param project The parameters to provide for the created project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's + * type, location and SKU on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String accountName, String projectName, + ProjectInner project) { + return beginCreateAsync(resourceGroupName, accountName, projectName, project).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create Cognitive Services Account's Project. Project is a sub-resource of an account which give AI developer it's + * individual container to work on. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param project The parameters to provide for the created project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's + * type, location and SKU on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String accountName, String projectName, + ProjectInner project, Context context) { + return beginCreateAsync(resourceGroupName, accountName, projectName, project, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create Cognitive Services Account's Project. Project is a sub-resource of an account which give AI developer it's + * individual container to work on. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param project The parameters to provide for the created project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's + * type, location and SKU. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProjectInner create(String resourceGroupName, String accountName, String projectName, ProjectInner project) { + return createAsync(resourceGroupName, accountName, projectName, project).block(); + } + + /** + * Create Cognitive Services Account's Project. Project is a sub-resource of an account which give AI developer it's + * individual container to work on. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param project The parameters to provide for the created project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's + * type, location and SKU. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProjectInner create(String resourceGroupName, String accountName, String projectName, ProjectInner project, + Context context) { + return createAsync(resourceGroupName, accountName, projectName, project, context).block(); + } + + /** + * Updates a Cognitive Services Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param project The parameters to provide for the created project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's + * type, location and SKU along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String accountName, + String projectName, ProjectInner project) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (project == null) { + return Mono.error(new IllegalArgumentException("Parameter project is required and cannot be null.")); + } else { + project.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), resourceGroupName, accountName, + projectName, this.client.getApiVersion(), this.client.getSubscriptionId(), project, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a Cognitive Services Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param project The parameters to provide for the created project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's + * type, location and SKU along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String accountName, + String projectName, ProjectInner project, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (project == null) { + return Mono.error(new IllegalArgumentException("Parameter project is required and cannot be null.")); + } else { + project.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), resourceGroupName, accountName, projectName, + this.client.getApiVersion(), this.client.getSubscriptionId(), project, accept, context); + } + + /** + * Updates a Cognitive Services Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param project The parameters to provide for the created project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of cognitive Services project is an Azure resource representing the + * provisioned account's project, it's type, location and SKU. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProjectInner> beginUpdateAsync(String resourceGroupName, + String accountName, String projectName, ProjectInner project) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, accountName, projectName, project); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ProjectInner.class, ProjectInner.class, this.client.getContext()); + } + + /** + * Updates a Cognitive Services Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param project The parameters to provide for the created project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of cognitive Services project is an Azure resource representing the + * provisioned account's project, it's type, location and SKU. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProjectInner> beginUpdateAsync(String resourceGroupName, + String accountName, String projectName, ProjectInner project, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, accountName, projectName, project, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ProjectInner.class, ProjectInner.class, context); + } + + /** + * Updates a Cognitive Services Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param project The parameters to provide for the created project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cognitive Services project is an Azure resource representing the + * provisioned account's project, it's type, location and SKU. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProjectInner> beginUpdate(String resourceGroupName, String accountName, + String projectName, ProjectInner project) { + return this.beginUpdateAsync(resourceGroupName, accountName, projectName, project).getSyncPoller(); + } + + /** + * Updates a Cognitive Services Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param project The parameters to provide for the created project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cognitive Services project is an Azure resource representing the + * provisioned account's project, it's type, location and SKU. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProjectInner> beginUpdate(String resourceGroupName, String accountName, + String projectName, ProjectInner project, Context context) { + return this.beginUpdateAsync(resourceGroupName, accountName, projectName, project, context).getSyncPoller(); + } + + /** + * Updates a Cognitive Services Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param project The parameters to provide for the created project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's + * type, location and SKU on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String accountName, String projectName, + ProjectInner project) { + return beginUpdateAsync(resourceGroupName, accountName, projectName, project).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a Cognitive Services Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param project The parameters to provide for the created project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's + * type, location and SKU on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String accountName, String projectName, + ProjectInner project, Context context) { + return beginUpdateAsync(resourceGroupName, accountName, projectName, project, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a Cognitive Services Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param project The parameters to provide for the created project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's + * type, location and SKU. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProjectInner update(String resourceGroupName, String accountName, String projectName, ProjectInner project) { + return updateAsync(resourceGroupName, accountName, projectName, project).block(); + } + + /** + * Updates a Cognitive Services Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param project The parameters to provide for the created project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's + * type, location and SKU. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProjectInner update(String resourceGroupName, String accountName, String projectName, ProjectInner project, + Context context) { + return updateAsync(resourceGroupName, accountName, projectName, project, context).block(); + } + + /** + * Deletes a Cognitive Services project from the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String accountName, + String projectName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, accountName, + projectName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a Cognitive Services project from the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String accountName, + String projectName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), resourceGroupName, accountName, projectName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + } + + /** + * Deletes a Cognitive Services project from the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String accountName, + String projectName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, accountName, projectName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes a Cognitive Services project from the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String accountName, + String projectName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, accountName, projectName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes a Cognitive Services project from the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, + String projectName) { + return this.beginDeleteAsync(resourceGroupName, accountName, projectName).getSyncPoller(); + } + + /** + * Deletes a Cognitive Services project from the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, + String projectName, Context context) { + return this.beginDeleteAsync(resourceGroupName, accountName, projectName, context).getSyncPoller(); + } + + /** + * Deletes a Cognitive Services project from the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String projectName) { + return beginDeleteAsync(resourceGroupName, accountName, projectName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Cognitive Services project from the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String projectName, Context context) { + return beginDeleteAsync(resourceGroupName, accountName, projectName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Cognitive Services project from the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String projectName) { + deleteAsync(resourceGroupName, accountName, projectName).block(); + } + + /** + * Deletes a Cognitive Services project from the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String projectName, Context context) { + deleteAsync(resourceGroupName, accountName, projectName, context).block(); + } + + /** + * Returns a Cognitive Services project specified by the parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's + * type, location and SKU along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String projectName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, accountName, projectName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns a Cognitive Services project specified by the parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's + * type, location and SKU along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String projectName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), resourceGroupName, accountName, projectName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + } + + /** + * Returns a Cognitive Services project specified by the parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's + * type, location and SKU on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, String projectName) { + return getWithResponseAsync(resourceGroupName, accountName, projectName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns a Cognitive Services project specified by the parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's + * type, location and SKU along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String accountName, String projectName, + Context context) { + return getWithResponseAsync(resourceGroupName, accountName, projectName, context).block(); + } + + /** + * Returns a Cognitive Services project specified by the parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's + * type, location and SKU. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProjectInner get(String resourceGroupName, String accountName, String projectName) { + return getWithResponse(resourceGroupName, accountName, projectName, Context.NONE).getValue(); + } + + /** + * Returns all the projects in a Cognitive Services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of cognitive services projects operation response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns all the projects in a Cognitive Services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of cognitive services projects operation response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String accountName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Returns all the projects in a Cognitive Services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of cognitive services projects operation response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Returns all the projects in a Cognitive Services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of cognitive services projects operation response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns all the projects in a Cognitive Services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of cognitive services projects operation response as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName)); + } + + /** + * Returns all the projects in a Cognitive Services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of cognitive services projects operation response as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of cognitive services projects operation response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of cognitive services projects operation response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectsImpl.java new file mode 100644 index 000000000000..a29699c999ba --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectsImpl.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cognitiveservices.fluent.ProjectsClient; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ProjectInner; +import com.azure.resourcemanager.cognitiveservices.models.Project; +import com.azure.resourcemanager.cognitiveservices.models.Projects; + +public final class ProjectsImpl implements Projects { + private static final ClientLogger LOGGER = new ClientLogger(ProjectsImpl.class); + + private final ProjectsClient innerClient; + + private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; + + public ProjectsImpl(ProjectsClient innerClient, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String accountName, String projectName) { + this.serviceClient().delete(resourceGroupName, accountName, projectName); + } + + public void delete(String resourceGroupName, String accountName, String projectName, Context context) { + this.serviceClient().delete(resourceGroupName, accountName, projectName, context); + } + + public Response getWithResponse(String resourceGroupName, String accountName, String projectName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, accountName, projectName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ProjectImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Project get(String resourceGroupName, String accountName, String projectName) { + ProjectInner inner = this.serviceClient().get(resourceGroupName, accountName, projectName); + if (inner != null) { + return new ProjectImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ProjectImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ProjectImpl(inner1, this.manager())); + } + + public Project getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, projectName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, projectName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + this.delete(resourceGroupName, accountName, projectName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + this.delete(resourceGroupName, accountName, projectName, context); + } + + private ProjectsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { + return this.serviceManager; + } + + public ProjectImpl define(String name) { + return new ProjectImpl(name, this.manager()); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AadAuthTypeConnectionProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AadAuthTypeConnectionProperties.java new file mode 100644 index 000000000000..e2987a78d5a7 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AadAuthTypeConnectionProperties.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Map; + +/** + * This connection type covers the AAD auth for any applicable Azure service. + */ +@Fluent +public final class AadAuthTypeConnectionProperties extends ConnectionPropertiesV2 { + /* + * Authentication type of the connection target + */ + private ConnectionAuthType authType = ConnectionAuthType.AAD; + + /** + * Creates an instance of AadAuthTypeConnectionProperties class. + */ + public AadAuthTypeConnectionProperties() { + } + + /** + * Get the authType property: Authentication type of the connection target. + * + * @return the authType value. + */ + @Override + public ConnectionAuthType authType() { + return this.authType; + } + + /** + * {@inheritDoc} + */ + @Override + public AadAuthTypeConnectionProperties withCategory(ConnectionCategory category) { + super.withCategory(category); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AadAuthTypeConnectionProperties withError(String error) { + super.withError(error); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AadAuthTypeConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { + super.withExpiryTime(expiryTime); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AadAuthTypeConnectionProperties withIsSharedToAll(Boolean isSharedToAll) { + super.withIsSharedToAll(isSharedToAll); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AadAuthTypeConnectionProperties withMetadata(Map metadata) { + super.withMetadata(metadata); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AadAuthTypeConnectionProperties withPeRequirement(ManagedPERequirement peRequirement) { + super.withPeRequirement(peRequirement); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AadAuthTypeConnectionProperties withPeStatus(ManagedPEStatus peStatus) { + super.withPeStatus(peStatus); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AadAuthTypeConnectionProperties withSharedUserList(List sharedUserList) { + super.withSharedUserList(sharedUserList); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AadAuthTypeConnectionProperties withTarget(String target) { + super.withTarget(target); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AadAuthTypeConnectionProperties withUseWorkspaceManagedIdentity(Boolean useWorkspaceManagedIdentity) { + super.withUseWorkspaceManagedIdentity(useWorkspaceManagedIdentity); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", category() == null ? null : category().toString()); + jsonWriter.writeStringField("error", error()); + jsonWriter.writeStringField("expiryTime", + expiryTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expiryTime())); + jsonWriter.writeBooleanField("isSharedToAll", isSharedToAll()); + jsonWriter.writeMapField("metadata", metadata(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("peRequirement", peRequirement() == null ? null : peRequirement().toString()); + jsonWriter.writeStringField("peStatus", peStatus() == null ? null : peStatus().toString()); + jsonWriter.writeArrayField("sharedUserList", sharedUserList(), + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("target", target()); + jsonWriter.writeBooleanField("useWorkspaceManagedIdentity", useWorkspaceManagedIdentity()); + jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AadAuthTypeConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AadAuthTypeConnectionProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AadAuthTypeConnectionProperties. + */ + public static AadAuthTypeConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AadAuthTypeConnectionProperties deserializedAadAuthTypeConnectionProperties + = new AadAuthTypeConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedAadAuthTypeConnectionProperties + .withCategory(ConnectionCategory.fromString(reader.getString())); + } else if ("createdByWorkspaceArmId".equals(fieldName)) { + deserializedAadAuthTypeConnectionProperties.withCreatedByWorkspaceArmId(reader.getString()); + } else if ("error".equals(fieldName)) { + deserializedAadAuthTypeConnectionProperties.withError(reader.getString()); + } else if ("expiryTime".equals(fieldName)) { + deserializedAadAuthTypeConnectionProperties.withExpiryTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("group".equals(fieldName)) { + deserializedAadAuthTypeConnectionProperties + .withGroup(ConnectionGroup.fromString(reader.getString())); + } else if ("isSharedToAll".equals(fieldName)) { + deserializedAadAuthTypeConnectionProperties + .withIsSharedToAll(reader.getNullable(JsonReader::getBoolean)); + } else if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedAadAuthTypeConnectionProperties.withMetadata(metadata); + } else if ("peRequirement".equals(fieldName)) { + deserializedAadAuthTypeConnectionProperties + .withPeRequirement(ManagedPERequirement.fromString(reader.getString())); + } else if ("peStatus".equals(fieldName)) { + deserializedAadAuthTypeConnectionProperties + .withPeStatus(ManagedPEStatus.fromString(reader.getString())); + } else if ("sharedUserList".equals(fieldName)) { + List sharedUserList = reader.readArray(reader1 -> reader1.getString()); + deserializedAadAuthTypeConnectionProperties.withSharedUserList(sharedUserList); + } else if ("target".equals(fieldName)) { + deserializedAadAuthTypeConnectionProperties.withTarget(reader.getString()); + } else if ("useWorkspaceManagedIdentity".equals(fieldName)) { + deserializedAadAuthTypeConnectionProperties + .withUseWorkspaceManagedIdentity(reader.getNullable(JsonReader::getBoolean)); + } else if ("authType".equals(fieldName)) { + deserializedAadAuthTypeConnectionProperties.authType + = ConnectionAuthType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAadAuthTypeConnectionProperties; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccessKeyAuthTypeConnectionProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccessKeyAuthTypeConnectionProperties.java new file mode 100644 index 000000000000..201c07de3975 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccessKeyAuthTypeConnectionProperties.java @@ -0,0 +1,257 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Map; + +/** + * The AccessKeyAuthTypeConnectionProperties model. + */ +@Fluent +public final class AccessKeyAuthTypeConnectionProperties extends ConnectionPropertiesV2 { + /* + * Authentication type of the connection target + */ + private ConnectionAuthType authType = ConnectionAuthType.ACCESS_KEY; + + /* + * The credentials property. + */ + private ConnectionAccessKey credentials; + + /** + * Creates an instance of AccessKeyAuthTypeConnectionProperties class. + */ + public AccessKeyAuthTypeConnectionProperties() { + } + + /** + * Get the authType property: Authentication type of the connection target. + * + * @return the authType value. + */ + @Override + public ConnectionAuthType authType() { + return this.authType; + } + + /** + * Get the credentials property: The credentials property. + * + * @return the credentials value. + */ + public ConnectionAccessKey credentials() { + return this.credentials; + } + + /** + * Set the credentials property: The credentials property. + * + * @param credentials the credentials value to set. + * @return the AccessKeyAuthTypeConnectionProperties object itself. + */ + public AccessKeyAuthTypeConnectionProperties withCredentials(ConnectionAccessKey credentials) { + this.credentials = credentials; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccessKeyAuthTypeConnectionProperties withCategory(ConnectionCategory category) { + super.withCategory(category); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccessKeyAuthTypeConnectionProperties withError(String error) { + super.withError(error); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccessKeyAuthTypeConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { + super.withExpiryTime(expiryTime); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccessKeyAuthTypeConnectionProperties withIsSharedToAll(Boolean isSharedToAll) { + super.withIsSharedToAll(isSharedToAll); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccessKeyAuthTypeConnectionProperties withMetadata(Map metadata) { + super.withMetadata(metadata); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccessKeyAuthTypeConnectionProperties withPeRequirement(ManagedPERequirement peRequirement) { + super.withPeRequirement(peRequirement); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccessKeyAuthTypeConnectionProperties withPeStatus(ManagedPEStatus peStatus) { + super.withPeStatus(peStatus); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccessKeyAuthTypeConnectionProperties withSharedUserList(List sharedUserList) { + super.withSharedUserList(sharedUserList); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccessKeyAuthTypeConnectionProperties withTarget(String target) { + super.withTarget(target); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccessKeyAuthTypeConnectionProperties withUseWorkspaceManagedIdentity(Boolean useWorkspaceManagedIdentity) { + super.withUseWorkspaceManagedIdentity(useWorkspaceManagedIdentity); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (credentials() != null) { + credentials().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", category() == null ? null : category().toString()); + jsonWriter.writeStringField("error", error()); + jsonWriter.writeStringField("expiryTime", + expiryTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expiryTime())); + jsonWriter.writeBooleanField("isSharedToAll", isSharedToAll()); + jsonWriter.writeMapField("metadata", metadata(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("peRequirement", peRequirement() == null ? null : peRequirement().toString()); + jsonWriter.writeStringField("peStatus", peStatus() == null ? null : peStatus().toString()); + jsonWriter.writeArrayField("sharedUserList", sharedUserList(), + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("target", target()); + jsonWriter.writeBooleanField("useWorkspaceManagedIdentity", useWorkspaceManagedIdentity()); + jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); + jsonWriter.writeJsonField("credentials", this.credentials); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccessKeyAuthTypeConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccessKeyAuthTypeConnectionProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AccessKeyAuthTypeConnectionProperties. + */ + public static AccessKeyAuthTypeConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccessKeyAuthTypeConnectionProperties deserializedAccessKeyAuthTypeConnectionProperties + = new AccessKeyAuthTypeConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedAccessKeyAuthTypeConnectionProperties + .withCategory(ConnectionCategory.fromString(reader.getString())); + } else if ("createdByWorkspaceArmId".equals(fieldName)) { + deserializedAccessKeyAuthTypeConnectionProperties.withCreatedByWorkspaceArmId(reader.getString()); + } else if ("error".equals(fieldName)) { + deserializedAccessKeyAuthTypeConnectionProperties.withError(reader.getString()); + } else if ("expiryTime".equals(fieldName)) { + deserializedAccessKeyAuthTypeConnectionProperties.withExpiryTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("group".equals(fieldName)) { + deserializedAccessKeyAuthTypeConnectionProperties + .withGroup(ConnectionGroup.fromString(reader.getString())); + } else if ("isSharedToAll".equals(fieldName)) { + deserializedAccessKeyAuthTypeConnectionProperties + .withIsSharedToAll(reader.getNullable(JsonReader::getBoolean)); + } else if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedAccessKeyAuthTypeConnectionProperties.withMetadata(metadata); + } else if ("peRequirement".equals(fieldName)) { + deserializedAccessKeyAuthTypeConnectionProperties + .withPeRequirement(ManagedPERequirement.fromString(reader.getString())); + } else if ("peStatus".equals(fieldName)) { + deserializedAccessKeyAuthTypeConnectionProperties + .withPeStatus(ManagedPEStatus.fromString(reader.getString())); + } else if ("sharedUserList".equals(fieldName)) { + List sharedUserList = reader.readArray(reader1 -> reader1.getString()); + deserializedAccessKeyAuthTypeConnectionProperties.withSharedUserList(sharedUserList); + } else if ("target".equals(fieldName)) { + deserializedAccessKeyAuthTypeConnectionProperties.withTarget(reader.getString()); + } else if ("useWorkspaceManagedIdentity".equals(fieldName)) { + deserializedAccessKeyAuthTypeConnectionProperties + .withUseWorkspaceManagedIdentity(reader.getNullable(JsonReader::getBoolean)); + } else if ("authType".equals(fieldName)) { + deserializedAccessKeyAuthTypeConnectionProperties.authType + = ConnectionAuthType.fromString(reader.getString()); + } else if ("credentials".equals(fieldName)) { + deserializedAccessKeyAuthTypeConnectionProperties.credentials + = ConnectionAccessKey.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAccessKeyAuthTypeConnectionProperties; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountCapabilityHosts.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountCapabilityHosts.java new file mode 100644 index 000000000000..53ac65d14e5d --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountCapabilityHosts.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of AccountCapabilityHosts. + */ +public interface AccountCapabilityHosts { + /** + * Delete account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String capabilityHostname); + + /** + * Delete account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String capabilityHostname, Context context); + + /** + * Get account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return account capabilityHost along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String accountName, String capabilityHostname, + Context context); + + /** + * Get account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return account capabilityHost. + */ + CapabilityHost get(String resourceGroupName, String accountName, String capabilityHostname); + + /** + * Get account capabilityHost. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return account capabilityHost along with {@link Response}. + */ + CapabilityHost getById(String id); + + /** + * Get account capabilityHost. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return account capabilityHost along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete account capabilityHost. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete account capabilityHost. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new CapabilityHost resource. + * + * @param name resource name. + * @return the first stage of the new CapabilityHost definition. + */ + CapabilityHost.DefinitionStages.Blank define(String name); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountConnections.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountConnections.java new file mode 100644 index 000000000000..e1cc39f7499e --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountConnections.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of AccountConnections. + */ +public interface AccountConnections { + /** + * Delete Cognitive Services account connection by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param connectionName Friendly name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String accountName, String connectionName, + Context context); + + /** + * Delete Cognitive Services account connection by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param connectionName Friendly name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String connectionName); + + /** + * Lists Cognitive Services account connection by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param connectionName Friendly name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String accountName, + String connectionName, Context context); + + /** + * Lists Cognitive Services account connection by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param connectionName Friendly name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema. + */ + ConnectionPropertiesV2BasicResource get(String resourceGroupName, String accountName, String connectionName); + + /** + * Lists all the available Cognitive Services account connections under the specified account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Lists all the available Cognitive Services account connections under the specified account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param target Target of the connection. + * @param category Category of the connection. + * @param includeAll query parameter that indicates if get connection call should return both connections and + * datastores. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName, String target, + String category, Boolean includeAll, Context context); + + /** + * Lists Cognitive Services account connection by name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema along with {@link Response}. + */ + ConnectionPropertiesV2BasicResource getById(String id); + + /** + * Lists Cognitive Services account connection by name. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete Cognitive Services account connection by name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete Cognitive Services account connection by name. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ConnectionPropertiesV2BasicResource resource. + * + * @param name resource name. + * @return the first stage of the new ConnectionPropertiesV2BasicResource definition. + */ + ConnectionPropertiesV2BasicResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountKeyAuthTypeConnectionProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountKeyAuthTypeConnectionProperties.java new file mode 100644 index 000000000000..29e752c84531 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountKeyAuthTypeConnectionProperties.java @@ -0,0 +1,257 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Map; + +/** + * This connection type covers the account key connection for Azure storage. + */ +@Fluent +public final class AccountKeyAuthTypeConnectionProperties extends ConnectionPropertiesV2 { + /* + * Authentication type of the connection target + */ + private ConnectionAuthType authType = ConnectionAuthType.ACCOUNT_KEY; + + /* + * Account key object for connection credential. + */ + private ConnectionAccountKey credentials; + + /** + * Creates an instance of AccountKeyAuthTypeConnectionProperties class. + */ + public AccountKeyAuthTypeConnectionProperties() { + } + + /** + * Get the authType property: Authentication type of the connection target. + * + * @return the authType value. + */ + @Override + public ConnectionAuthType authType() { + return this.authType; + } + + /** + * Get the credentials property: Account key object for connection credential. + * + * @return the credentials value. + */ + public ConnectionAccountKey credentials() { + return this.credentials; + } + + /** + * Set the credentials property: Account key object for connection credential. + * + * @param credentials the credentials value to set. + * @return the AccountKeyAuthTypeConnectionProperties object itself. + */ + public AccountKeyAuthTypeConnectionProperties withCredentials(ConnectionAccountKey credentials) { + this.credentials = credentials; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountKeyAuthTypeConnectionProperties withCategory(ConnectionCategory category) { + super.withCategory(category); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountKeyAuthTypeConnectionProperties withError(String error) { + super.withError(error); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountKeyAuthTypeConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { + super.withExpiryTime(expiryTime); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountKeyAuthTypeConnectionProperties withIsSharedToAll(Boolean isSharedToAll) { + super.withIsSharedToAll(isSharedToAll); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountKeyAuthTypeConnectionProperties withMetadata(Map metadata) { + super.withMetadata(metadata); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountKeyAuthTypeConnectionProperties withPeRequirement(ManagedPERequirement peRequirement) { + super.withPeRequirement(peRequirement); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountKeyAuthTypeConnectionProperties withPeStatus(ManagedPEStatus peStatus) { + super.withPeStatus(peStatus); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountKeyAuthTypeConnectionProperties withSharedUserList(List sharedUserList) { + super.withSharedUserList(sharedUserList); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountKeyAuthTypeConnectionProperties withTarget(String target) { + super.withTarget(target); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountKeyAuthTypeConnectionProperties withUseWorkspaceManagedIdentity(Boolean useWorkspaceManagedIdentity) { + super.withUseWorkspaceManagedIdentity(useWorkspaceManagedIdentity); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (credentials() != null) { + credentials().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", category() == null ? null : category().toString()); + jsonWriter.writeStringField("error", error()); + jsonWriter.writeStringField("expiryTime", + expiryTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expiryTime())); + jsonWriter.writeBooleanField("isSharedToAll", isSharedToAll()); + jsonWriter.writeMapField("metadata", metadata(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("peRequirement", peRequirement() == null ? null : peRequirement().toString()); + jsonWriter.writeStringField("peStatus", peStatus() == null ? null : peStatus().toString()); + jsonWriter.writeArrayField("sharedUserList", sharedUserList(), + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("target", target()); + jsonWriter.writeBooleanField("useWorkspaceManagedIdentity", useWorkspaceManagedIdentity()); + jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); + jsonWriter.writeJsonField("credentials", this.credentials); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccountKeyAuthTypeConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccountKeyAuthTypeConnectionProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AccountKeyAuthTypeConnectionProperties. + */ + public static AccountKeyAuthTypeConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccountKeyAuthTypeConnectionProperties deserializedAccountKeyAuthTypeConnectionProperties + = new AccountKeyAuthTypeConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedAccountKeyAuthTypeConnectionProperties + .withCategory(ConnectionCategory.fromString(reader.getString())); + } else if ("createdByWorkspaceArmId".equals(fieldName)) { + deserializedAccountKeyAuthTypeConnectionProperties.withCreatedByWorkspaceArmId(reader.getString()); + } else if ("error".equals(fieldName)) { + deserializedAccountKeyAuthTypeConnectionProperties.withError(reader.getString()); + } else if ("expiryTime".equals(fieldName)) { + deserializedAccountKeyAuthTypeConnectionProperties.withExpiryTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("group".equals(fieldName)) { + deserializedAccountKeyAuthTypeConnectionProperties + .withGroup(ConnectionGroup.fromString(reader.getString())); + } else if ("isSharedToAll".equals(fieldName)) { + deserializedAccountKeyAuthTypeConnectionProperties + .withIsSharedToAll(reader.getNullable(JsonReader::getBoolean)); + } else if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedAccountKeyAuthTypeConnectionProperties.withMetadata(metadata); + } else if ("peRequirement".equals(fieldName)) { + deserializedAccountKeyAuthTypeConnectionProperties + .withPeRequirement(ManagedPERequirement.fromString(reader.getString())); + } else if ("peStatus".equals(fieldName)) { + deserializedAccountKeyAuthTypeConnectionProperties + .withPeStatus(ManagedPEStatus.fromString(reader.getString())); + } else if ("sharedUserList".equals(fieldName)) { + List sharedUserList = reader.readArray(reader1 -> reader1.getString()); + deserializedAccountKeyAuthTypeConnectionProperties.withSharedUserList(sharedUserList); + } else if ("target".equals(fieldName)) { + deserializedAccountKeyAuthTypeConnectionProperties.withTarget(reader.getString()); + } else if ("useWorkspaceManagedIdentity".equals(fieldName)) { + deserializedAccountKeyAuthTypeConnectionProperties + .withUseWorkspaceManagedIdentity(reader.getNullable(JsonReader::getBoolean)); + } else if ("authType".equals(fieldName)) { + deserializedAccountKeyAuthTypeConnectionProperties.authType + = ConnectionAuthType.fromString(reader.getString()); + } else if ("credentials".equals(fieldName)) { + deserializedAccountKeyAuthTypeConnectionProperties.credentials + = ConnectionAccountKey.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAccountKeyAuthTypeConnectionProperties; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountProperties.java index 2690c258e601..1fb8e98bc4fa 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountProperties.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountProperties.java @@ -76,7 +76,7 @@ public final class AccountProperties implements JsonSerializable userOwnedStorage; /* - * The user owned AML workspace properties. + * The user owned AML account properties. */ private UserOwnedAmlWorkspace amlWorkspace; @@ -170,6 +170,29 @@ public final class AccountProperties implements JsonSerializable associatedProjects; + /** * Creates an instance of AccountProperties class. */ @@ -333,7 +356,7 @@ public AccountProperties withUserOwnedStorage(List userOwnedSt } /** - * Get the amlWorkspace property: The user owned AML workspace properties. + * Get the amlWorkspace property: The user owned AML account properties. * * @return the amlWorkspace value. */ @@ -342,7 +365,7 @@ public UserOwnedAmlWorkspace amlWorkspace() { } /** - * Set the amlWorkspace property: The user owned AML workspace properties. + * Set the amlWorkspace property: The user owned AML account properties. * * @param amlWorkspace the amlWorkspace value to set. * @return the AccountProperties object itself. @@ -614,6 +637,94 @@ public AccountProperties withRaiMonitorConfig(RaiMonitorConfig raiMonitorConfig) return this; } + /** + * Get the networkInjections property: Specifies in AI Foundry where virtual network injection occurs to secure + * scenarios like Agents entirely within the user's private network, eliminating public internet exposure while + * maintaining control over network configurations and resources. + * + * @return the networkInjections value. + */ + public NetworkInjections networkInjections() { + return this.networkInjections; + } + + /** + * Set the networkInjections property: Specifies in AI Foundry where virtual network injection occurs to secure + * scenarios like Agents entirely within the user's private network, eliminating public internet exposure while + * maintaining control over network configurations and resources. + * + * @param networkInjections the networkInjections value to set. + * @return the AccountProperties object itself. + */ + public AccountProperties withNetworkInjections(NetworkInjections networkInjections) { + this.networkInjections = networkInjections; + return this; + } + + /** + * Get the allowProjectManagement property: Specifies whether this resource support project management as child + * resources, used as containers for access management, data isolation and cost in AI Foundry. + * + * @return the allowProjectManagement value. + */ + public Boolean allowProjectManagement() { + return this.allowProjectManagement; + } + + /** + * Set the allowProjectManagement property: Specifies whether this resource support project management as child + * resources, used as containers for access management, data isolation and cost in AI Foundry. + * + * @param allowProjectManagement the allowProjectManagement value to set. + * @return the AccountProperties object itself. + */ + public AccountProperties withAllowProjectManagement(Boolean allowProjectManagement) { + this.allowProjectManagement = allowProjectManagement; + return this; + } + + /** + * Get the defaultProject property: Specifies the project that is targeted when data plane endpoints are called + * without a project parameter. + * + * @return the defaultProject value. + */ + public String defaultProject() { + return this.defaultProject; + } + + /** + * Set the defaultProject property: Specifies the project that is targeted when data plane endpoints are called + * without a project parameter. + * + * @param defaultProject the defaultProject value to set. + * @return the AccountProperties object itself. + */ + public AccountProperties withDefaultProject(String defaultProject) { + this.defaultProject = defaultProject; + return this; + } + + /** + * Get the associatedProjects property: Specifies the projects that are associated with this resource. + * + * @return the associatedProjects value. + */ + public List associatedProjects() { + return this.associatedProjects; + } + + /** + * Set the associatedProjects property: Specifies the projects that are associated with this resource. + * + * @param associatedProjects the associatedProjects value to set. + * @return the AccountProperties object itself. + */ + public AccountProperties withAssociatedProjects(List associatedProjects) { + this.associatedProjects = associatedProjects; + return this; + } + /** * Validates the instance. * @@ -662,6 +773,9 @@ public void validate() { if (raiMonitorConfig() != null) { raiMonitorConfig().validate(); } + if (networkInjections() != null) { + networkInjections().validate(); + } } /** @@ -688,6 +802,11 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeBooleanField("restore", this.restore); jsonWriter.writeJsonField("locations", this.locations); jsonWriter.writeJsonField("raiMonitorConfig", this.raiMonitorConfig); + jsonWriter.writeJsonField("networkInjections", this.networkInjections); + jsonWriter.writeBooleanField("allowProjectManagement", this.allowProjectManagement); + jsonWriter.writeStringField("defaultProject", this.defaultProject); + jsonWriter.writeArrayField("associatedProjects", this.associatedProjects, + (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -777,6 +896,15 @@ public static AccountProperties fromJson(JsonReader jsonReader) throws IOExcepti deserializedAccountProperties.abusePenalty = AbusePenalty.fromJson(reader); } else if ("raiMonitorConfig".equals(fieldName)) { deserializedAccountProperties.raiMonitorConfig = RaiMonitorConfig.fromJson(reader); + } else if ("networkInjections".equals(fieldName)) { + deserializedAccountProperties.networkInjections = NetworkInjections.fromJson(reader); + } else if ("allowProjectManagement".equals(fieldName)) { + deserializedAccountProperties.allowProjectManagement = reader.getNullable(JsonReader::getBoolean); + } else if ("defaultProject".equals(fieldName)) { + deserializedAccountProperties.defaultProject = reader.getString(); + } else if ("associatedProjects".equals(fieldName)) { + List associatedProjects = reader.readArray(reader1 -> reader1.getString()); + deserializedAccountProperties.associatedProjects = associatedProjects; } else { reader.skipChildren(); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApiKeyAuthConnectionProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApiKeyAuthConnectionProperties.java new file mode 100644 index 000000000000..03db65c1d70e --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApiKeyAuthConnectionProperties.java @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Map; + +/** + * This connection type covers the generic ApiKey auth connection categories, for examples: + * AzureOpenAI: + * Category:= AzureOpenAI + * AuthType:= ApiKey (as type discriminator) + * Credentials:= {ApiKey} as .ApiKey + * Target:= {ApiBase} + * + * CognitiveService: + * Category:= CognitiveService + * AuthType:= ApiKey (as type discriminator) + * Credentials:= {SubscriptionKey} as ApiKey + * Target:= ServiceRegion={serviceRegion} + * + * CognitiveSearch: + * Category:= CognitiveSearch + * AuthType:= ApiKey (as type discriminator) + * Credentials:= {Key} as ApiKey + * Target:= {Endpoint} + * + * Use Metadata property bag for ApiType, ApiVersion, Kind and other metadata fields. + */ +@Fluent +public final class ApiKeyAuthConnectionProperties extends ConnectionPropertiesV2 { + /* + * Authentication type of the connection target + */ + private ConnectionAuthType authType = ConnectionAuthType.API_KEY; + + /* + * Api key object for connection credential. + */ + private ConnectionApiKey credentials; + + /** + * Creates an instance of ApiKeyAuthConnectionProperties class. + */ + public ApiKeyAuthConnectionProperties() { + } + + /** + * Get the authType property: Authentication type of the connection target. + * + * @return the authType value. + */ + @Override + public ConnectionAuthType authType() { + return this.authType; + } + + /** + * Get the credentials property: Api key object for connection credential. + * + * @return the credentials value. + */ + public ConnectionApiKey credentials() { + return this.credentials; + } + + /** + * Set the credentials property: Api key object for connection credential. + * + * @param credentials the credentials value to set. + * @return the ApiKeyAuthConnectionProperties object itself. + */ + public ApiKeyAuthConnectionProperties withCredentials(ConnectionApiKey credentials) { + this.credentials = credentials; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ApiKeyAuthConnectionProperties withCategory(ConnectionCategory category) { + super.withCategory(category); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ApiKeyAuthConnectionProperties withError(String error) { + super.withError(error); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ApiKeyAuthConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { + super.withExpiryTime(expiryTime); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ApiKeyAuthConnectionProperties withIsSharedToAll(Boolean isSharedToAll) { + super.withIsSharedToAll(isSharedToAll); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ApiKeyAuthConnectionProperties withMetadata(Map metadata) { + super.withMetadata(metadata); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ApiKeyAuthConnectionProperties withPeRequirement(ManagedPERequirement peRequirement) { + super.withPeRequirement(peRequirement); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ApiKeyAuthConnectionProperties withPeStatus(ManagedPEStatus peStatus) { + super.withPeStatus(peStatus); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ApiKeyAuthConnectionProperties withSharedUserList(List sharedUserList) { + super.withSharedUserList(sharedUserList); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ApiKeyAuthConnectionProperties withTarget(String target) { + super.withTarget(target); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ApiKeyAuthConnectionProperties withUseWorkspaceManagedIdentity(Boolean useWorkspaceManagedIdentity) { + super.withUseWorkspaceManagedIdentity(useWorkspaceManagedIdentity); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (credentials() != null) { + credentials().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", category() == null ? null : category().toString()); + jsonWriter.writeStringField("error", error()); + jsonWriter.writeStringField("expiryTime", + expiryTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expiryTime())); + jsonWriter.writeBooleanField("isSharedToAll", isSharedToAll()); + jsonWriter.writeMapField("metadata", metadata(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("peRequirement", peRequirement() == null ? null : peRequirement().toString()); + jsonWriter.writeStringField("peStatus", peStatus() == null ? null : peStatus().toString()); + jsonWriter.writeArrayField("sharedUserList", sharedUserList(), + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("target", target()); + jsonWriter.writeBooleanField("useWorkspaceManagedIdentity", useWorkspaceManagedIdentity()); + jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); + jsonWriter.writeJsonField("credentials", this.credentials); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApiKeyAuthConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApiKeyAuthConnectionProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApiKeyAuthConnectionProperties. + */ + public static ApiKeyAuthConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApiKeyAuthConnectionProperties deserializedApiKeyAuthConnectionProperties + = new ApiKeyAuthConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedApiKeyAuthConnectionProperties + .withCategory(ConnectionCategory.fromString(reader.getString())); + } else if ("createdByWorkspaceArmId".equals(fieldName)) { + deserializedApiKeyAuthConnectionProperties.withCreatedByWorkspaceArmId(reader.getString()); + } else if ("error".equals(fieldName)) { + deserializedApiKeyAuthConnectionProperties.withError(reader.getString()); + } else if ("expiryTime".equals(fieldName)) { + deserializedApiKeyAuthConnectionProperties.withExpiryTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("group".equals(fieldName)) { + deserializedApiKeyAuthConnectionProperties + .withGroup(ConnectionGroup.fromString(reader.getString())); + } else if ("isSharedToAll".equals(fieldName)) { + deserializedApiKeyAuthConnectionProperties + .withIsSharedToAll(reader.getNullable(JsonReader::getBoolean)); + } else if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedApiKeyAuthConnectionProperties.withMetadata(metadata); + } else if ("peRequirement".equals(fieldName)) { + deserializedApiKeyAuthConnectionProperties + .withPeRequirement(ManagedPERequirement.fromString(reader.getString())); + } else if ("peStatus".equals(fieldName)) { + deserializedApiKeyAuthConnectionProperties + .withPeStatus(ManagedPEStatus.fromString(reader.getString())); + } else if ("sharedUserList".equals(fieldName)) { + List sharedUserList = reader.readArray(reader1 -> reader1.getString()); + deserializedApiKeyAuthConnectionProperties.withSharedUserList(sharedUserList); + } else if ("target".equals(fieldName)) { + deserializedApiKeyAuthConnectionProperties.withTarget(reader.getString()); + } else if ("useWorkspaceManagedIdentity".equals(fieldName)) { + deserializedApiKeyAuthConnectionProperties + .withUseWorkspaceManagedIdentity(reader.getNullable(JsonReader::getBoolean)); + } else if ("authType".equals(fieldName)) { + deserializedApiKeyAuthConnectionProperties.authType + = ConnectionAuthType.fromString(reader.getString()); + } else if ("credentials".equals(fieldName)) { + deserializedApiKeyAuthConnectionProperties.credentials = ConnectionApiKey.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedApiKeyAuthConnectionProperties; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHost.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHost.java new file mode 100644 index 000000000000..6c9e1c4a4397 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHost.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.cognitiveservices.fluent.models.CapabilityHostInner; + +/** + * An immutable client-side representation of CapabilityHost. + */ +public interface CapabilityHost { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: [Required] Additional attributes of the entity. + * + * @return the properties value. + */ + CapabilityHostProperties properties(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.CapabilityHostInner object. + * + * @return the inner object. + */ + CapabilityHostInner innerModel(); + + /** + * The entirety of the CapabilityHost definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * The CapabilityHost definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the CapabilityHost definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the CapabilityHost definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @return the next definition stage. + */ + WithProperties withExistingAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the CapabilityHost definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: [Required] Additional attributes of the entity.. + * + * @param properties [Required] Additional attributes of the entity. + * @return the next definition stage. + */ + WithCreate withProperties(CapabilityHostProperties properties); + } + + /** + * The stage of the CapabilityHost definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate { + /** + * Executes the create request. + * + * @return the created resource. + */ + CapabilityHost create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + CapabilityHost create(Context context); + } + } + + /** + * Begins update for the CapabilityHost resource. + * + * @return the stage of resource update. + */ + CapabilityHost.Update update(); + + /** + * The template for CapabilityHost update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + CapabilityHost apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + CapabilityHost apply(Context context); + } + + /** + * The CapabilityHost update stages. + */ + interface UpdateStages { + /** + * The stage of the CapabilityHost update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: [Required] Additional attributes of the entity.. + * + * @param properties [Required] Additional attributes of the entity. + * @return the next definition stage. + */ + Update withProperties(CapabilityHostProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + CapabilityHost refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + CapabilityHost refresh(Context context); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHostKind.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHostKind.java new file mode 100644 index 000000000000..03deade8d6a5 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHostKind.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for CapabilityHostKind. + */ +public final class CapabilityHostKind extends ExpandableStringEnum { + /** + * Static value Agents for CapabilityHostKind. + */ + public static final CapabilityHostKind AGENTS = fromString("Agents"); + + /** + * Creates a new instance of CapabilityHostKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CapabilityHostKind() { + } + + /** + * Creates or finds a CapabilityHostKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding CapabilityHostKind. + */ + public static CapabilityHostKind fromString(String name) { + return fromString(name, CapabilityHostKind.class); + } + + /** + * Gets known CapabilityHostKind values. + * + * @return known CapabilityHostKind values. + */ + public static Collection values() { + return values(CapabilityHostKind.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHostProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHostProperties.java new file mode 100644 index 000000000000..0a1304f68b2a --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHostProperties.java @@ -0,0 +1,287 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * The CapabilityHostProperties model. + */ +@Fluent +public final class CapabilityHostProperties extends ResourceBase { + /* + * List of AI services connections. + */ + private List aiServicesConnections; + + /* + * Kind of this capability host. + */ + private CapabilityHostKind capabilityHostKind; + + /* + * Customer subnet info to help set up this capability host. + */ + private String customerSubnet; + + /* + * Provisioning state for the CapabilityHost. + */ + private CapabilityHostProvisioningState provisioningState; + + /* + * List of Storage connections. + */ + private List storageConnections; + + /* + * List of Thread storage connections. + */ + private List threadStorageConnections; + + /* + * List of VectorStore connections. + */ + private List vectorStoreConnections; + + /** + * Creates an instance of CapabilityHostProperties class. + */ + public CapabilityHostProperties() { + } + + /** + * Get the aiServicesConnections property: List of AI services connections. + * + * @return the aiServicesConnections value. + */ + public List aiServicesConnections() { + return this.aiServicesConnections; + } + + /** + * Set the aiServicesConnections property: List of AI services connections. + * + * @param aiServicesConnections the aiServicesConnections value to set. + * @return the CapabilityHostProperties object itself. + */ + public CapabilityHostProperties withAiServicesConnections(List aiServicesConnections) { + this.aiServicesConnections = aiServicesConnections; + return this; + } + + /** + * Get the capabilityHostKind property: Kind of this capability host. + * + * @return the capabilityHostKind value. + */ + public CapabilityHostKind capabilityHostKind() { + return this.capabilityHostKind; + } + + /** + * Set the capabilityHostKind property: Kind of this capability host. + * + * @param capabilityHostKind the capabilityHostKind value to set. + * @return the CapabilityHostProperties object itself. + */ + public CapabilityHostProperties withCapabilityHostKind(CapabilityHostKind capabilityHostKind) { + this.capabilityHostKind = capabilityHostKind; + return this; + } + + /** + * Get the customerSubnet property: Customer subnet info to help set up this capability host. + * + * @return the customerSubnet value. + */ + public String customerSubnet() { + return this.customerSubnet; + } + + /** + * Set the customerSubnet property: Customer subnet info to help set up this capability host. + * + * @param customerSubnet the customerSubnet value to set. + * @return the CapabilityHostProperties object itself. + */ + public CapabilityHostProperties withCustomerSubnet(String customerSubnet) { + this.customerSubnet = customerSubnet; + return this; + } + + /** + * Get the provisioningState property: Provisioning state for the CapabilityHost. + * + * @return the provisioningState value. + */ + public CapabilityHostProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the storageConnections property: List of Storage connections. + * + * @return the storageConnections value. + */ + public List storageConnections() { + return this.storageConnections; + } + + /** + * Set the storageConnections property: List of Storage connections. + * + * @param storageConnections the storageConnections value to set. + * @return the CapabilityHostProperties object itself. + */ + public CapabilityHostProperties withStorageConnections(List storageConnections) { + this.storageConnections = storageConnections; + return this; + } + + /** + * Get the threadStorageConnections property: List of Thread storage connections. + * + * @return the threadStorageConnections value. + */ + public List threadStorageConnections() { + return this.threadStorageConnections; + } + + /** + * Set the threadStorageConnections property: List of Thread storage connections. + * + * @param threadStorageConnections the threadStorageConnections value to set. + * @return the CapabilityHostProperties object itself. + */ + public CapabilityHostProperties withThreadStorageConnections(List threadStorageConnections) { + this.threadStorageConnections = threadStorageConnections; + return this; + } + + /** + * Get the vectorStoreConnections property: List of VectorStore connections. + * + * @return the vectorStoreConnections value. + */ + public List vectorStoreConnections() { + return this.vectorStoreConnections; + } + + /** + * Set the vectorStoreConnections property: List of VectorStore connections. + * + * @param vectorStoreConnections the vectorStoreConnections value to set. + * @return the CapabilityHostProperties object itself. + */ + public CapabilityHostProperties withVectorStoreConnections(List vectorStoreConnections) { + this.vectorStoreConnections = vectorStoreConnections; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CapabilityHostProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CapabilityHostProperties withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("aiServicesConnections", this.aiServicesConnections, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("capabilityHostKind", + this.capabilityHostKind == null ? null : this.capabilityHostKind.toString()); + jsonWriter.writeStringField("customerSubnet", this.customerSubnet); + jsonWriter.writeArrayField("storageConnections", this.storageConnections, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("threadStorageConnections", this.threadStorageConnections, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("vectorStoreConnections", this.vectorStoreConnections, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CapabilityHostProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CapabilityHostProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CapabilityHostProperties. + */ + public static CapabilityHostProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CapabilityHostProperties deserializedCapabilityHostProperties = new CapabilityHostProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedCapabilityHostProperties.withDescription(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedCapabilityHostProperties.withTags(tags); + } else if ("aiServicesConnections".equals(fieldName)) { + List aiServicesConnections = reader.readArray(reader1 -> reader1.getString()); + deserializedCapabilityHostProperties.aiServicesConnections = aiServicesConnections; + } else if ("capabilityHostKind".equals(fieldName)) { + deserializedCapabilityHostProperties.capabilityHostKind + = CapabilityHostKind.fromString(reader.getString()); + } else if ("customerSubnet".equals(fieldName)) { + deserializedCapabilityHostProperties.customerSubnet = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedCapabilityHostProperties.provisioningState + = CapabilityHostProvisioningState.fromString(reader.getString()); + } else if ("storageConnections".equals(fieldName)) { + List storageConnections = reader.readArray(reader1 -> reader1.getString()); + deserializedCapabilityHostProperties.storageConnections = storageConnections; + } else if ("threadStorageConnections".equals(fieldName)) { + List threadStorageConnections = reader.readArray(reader1 -> reader1.getString()); + deserializedCapabilityHostProperties.threadStorageConnections = threadStorageConnections; + } else if ("vectorStoreConnections".equals(fieldName)) { + List vectorStoreConnections = reader.readArray(reader1 -> reader1.getString()); + deserializedCapabilityHostProperties.vectorStoreConnections = vectorStoreConnections; + } else { + reader.skipChildren(); + } + } + + return deserializedCapabilityHostProperties; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHostProvisioningState.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHostProvisioningState.java new file mode 100644 index 000000000000..d4c0094f5a54 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHostProvisioningState.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Provisioning state of capability host. + */ +public final class CapabilityHostProvisioningState extends ExpandableStringEnum { + /** + * Static value Succeeded for CapabilityHostProvisioningState. + */ + public static final CapabilityHostProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for CapabilityHostProvisioningState. + */ + public static final CapabilityHostProvisioningState FAILED = fromString("Failed"); + + /** + * Static value Canceled for CapabilityHostProvisioningState. + */ + public static final CapabilityHostProvisioningState CANCELED = fromString("Canceled"); + + /** + * Static value Creating for CapabilityHostProvisioningState. + */ + public static final CapabilityHostProvisioningState CREATING = fromString("Creating"); + + /** + * Static value Updating for CapabilityHostProvisioningState. + */ + public static final CapabilityHostProvisioningState UPDATING = fromString("Updating"); + + /** + * Static value Deleting for CapabilityHostProvisioningState. + */ + public static final CapabilityHostProvisioningState DELETING = fromString("Deleting"); + + /** + * Creates a new instance of CapabilityHostProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CapabilityHostProvisioningState() { + } + + /** + * Creates or finds a CapabilityHostProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding CapabilityHostProvisioningState. + */ + public static CapabilityHostProvisioningState fromString(String name) { + return fromString(name, CapabilityHostProvisioningState.class); + } + + /** + * Gets known CapabilityHostProvisioningState values. + * + * @return known CapabilityHostProvisioningState values. + */ + public static Collection values() { + return values(CapabilityHostProvisioningState.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionAccessKey.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionAccessKey.java new file mode 100644 index 000000000000..30c37e026de0 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionAccessKey.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The ConnectionAccessKey model. + */ +@Fluent +public final class ConnectionAccessKey implements JsonSerializable { + /* + * The accessKeyId property. + */ + private String accessKeyId; + + /* + * The secretAccessKey property. + */ + private String secretAccessKey; + + /** + * Creates an instance of ConnectionAccessKey class. + */ + public ConnectionAccessKey() { + } + + /** + * Get the accessKeyId property: The accessKeyId property. + * + * @return the accessKeyId value. + */ + public String accessKeyId() { + return this.accessKeyId; + } + + /** + * Set the accessKeyId property: The accessKeyId property. + * + * @param accessKeyId the accessKeyId value to set. + * @return the ConnectionAccessKey object itself. + */ + public ConnectionAccessKey withAccessKeyId(String accessKeyId) { + this.accessKeyId = accessKeyId; + return this; + } + + /** + * Get the secretAccessKey property: The secretAccessKey property. + * + * @return the secretAccessKey value. + */ + public String secretAccessKey() { + return this.secretAccessKey; + } + + /** + * Set the secretAccessKey property: The secretAccessKey property. + * + * @param secretAccessKey the secretAccessKey value to set. + * @return the ConnectionAccessKey object itself. + */ + public ConnectionAccessKey withSecretAccessKey(String secretAccessKey) { + this.secretAccessKey = secretAccessKey; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("accessKeyId", this.accessKeyId); + jsonWriter.writeStringField("secretAccessKey", this.secretAccessKey); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionAccessKey from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionAccessKey if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectionAccessKey. + */ + public static ConnectionAccessKey fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionAccessKey deserializedConnectionAccessKey = new ConnectionAccessKey(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("accessKeyId".equals(fieldName)) { + deserializedConnectionAccessKey.accessKeyId = reader.getString(); + } else if ("secretAccessKey".equals(fieldName)) { + deserializedConnectionAccessKey.secretAccessKey = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionAccessKey; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionAccountKey.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionAccountKey.java new file mode 100644 index 000000000000..a6fd87a4c298 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionAccountKey.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Account key object for connection credential. + */ +@Fluent +public final class ConnectionAccountKey implements JsonSerializable { + /* + * The key property. + */ + private String key; + + /** + * Creates an instance of ConnectionAccountKey class. + */ + public ConnectionAccountKey() { + } + + /** + * Get the key property: The key property. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The key property. + * + * @param key the key value to set. + * @return the ConnectionAccountKey object itself. + */ + public ConnectionAccountKey withKey(String key) { + this.key = key; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionAccountKey from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionAccountKey if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectionAccountKey. + */ + public static ConnectionAccountKey fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionAccountKey deserializedConnectionAccountKey = new ConnectionAccountKey(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedConnectionAccountKey.key = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionAccountKey; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionApiKey.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionApiKey.java new file mode 100644 index 000000000000..4938a40abfdc --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionApiKey.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Api key object for connection credential. + */ +@Fluent +public final class ConnectionApiKey implements JsonSerializable { + /* + * The key property. + */ + private String key; + + /** + * Creates an instance of ConnectionApiKey class. + */ + public ConnectionApiKey() { + } + + /** + * Get the key property: The key property. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The key property. + * + * @param key the key value to set. + * @return the ConnectionApiKey object itself. + */ + public ConnectionApiKey withKey(String key) { + this.key = key; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionApiKey from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionApiKey if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectionApiKey. + */ + public static ConnectionApiKey fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionApiKey deserializedConnectionApiKey = new ConnectionApiKey(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedConnectionApiKey.key = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionApiKey; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionAuthType.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionAuthType.java new file mode 100644 index 000000000000..641213de5d0d --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionAuthType.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Authentication type of the connection target. + */ +public final class ConnectionAuthType extends ExpandableStringEnum { + /** + * Static value PAT for ConnectionAuthType. + */ + public static final ConnectionAuthType PAT = fromString("PAT"); + + /** + * Static value ManagedIdentity for ConnectionAuthType. + */ + public static final ConnectionAuthType MANAGED_IDENTITY = fromString("ManagedIdentity"); + + /** + * Static value UsernamePassword for ConnectionAuthType. + */ + public static final ConnectionAuthType USERNAME_PASSWORD = fromString("UsernamePassword"); + + /** + * Static value None for ConnectionAuthType. + */ + public static final ConnectionAuthType NONE = fromString("None"); + + /** + * Static value SAS for ConnectionAuthType. + */ + public static final ConnectionAuthType SAS = fromString("SAS"); + + /** + * Static value AccountKey for ConnectionAuthType. + */ + public static final ConnectionAuthType ACCOUNT_KEY = fromString("AccountKey"); + + /** + * Static value ServicePrincipal for ConnectionAuthType. + */ + public static final ConnectionAuthType SERVICE_PRINCIPAL = fromString("ServicePrincipal"); + + /** + * Static value AccessKey for ConnectionAuthType. + */ + public static final ConnectionAuthType ACCESS_KEY = fromString("AccessKey"); + + /** + * Static value ApiKey for ConnectionAuthType. + */ + public static final ConnectionAuthType API_KEY = fromString("ApiKey"); + + /** + * Static value CustomKeys for ConnectionAuthType. + */ + public static final ConnectionAuthType CUSTOM_KEYS = fromString("CustomKeys"); + + /** + * Static value OAuth2 for ConnectionAuthType. + */ + public static final ConnectionAuthType OAUTH2 = fromString("OAuth2"); + + /** + * Static value AAD for ConnectionAuthType. + */ + public static final ConnectionAuthType AAD = fromString("AAD"); + + /** + * Creates a new instance of ConnectionAuthType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConnectionAuthType() { + } + + /** + * Creates or finds a ConnectionAuthType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectionAuthType. + */ + public static ConnectionAuthType fromString(String name) { + return fromString(name, ConnectionAuthType.class); + } + + /** + * Gets known ConnectionAuthType values. + * + * @return known ConnectionAuthType values. + */ + public static Collection values() { + return values(ConnectionAuthType.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionCategory.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionCategory.java new file mode 100644 index 000000000000..6bdfae79bdd0 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionCategory.java @@ -0,0 +1,566 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Category of the connection. + */ +public final class ConnectionCategory extends ExpandableStringEnum { + /** + * Static value PythonFeed for ConnectionCategory. + */ + public static final ConnectionCategory PYTHON_FEED = fromString("PythonFeed"); + + /** + * Static value ContainerRegistry for ConnectionCategory. + */ + public static final ConnectionCategory CONTAINER_REGISTRY = fromString("ContainerRegistry"); + + /** + * Static value Git for ConnectionCategory. + */ + public static final ConnectionCategory GIT = fromString("Git"); + + /** + * Static value S3 for ConnectionCategory. + */ + public static final ConnectionCategory S3 = fromString("S3"); + + /** + * Static value Snowflake for ConnectionCategory. + */ + public static final ConnectionCategory SNOWFLAKE = fromString("Snowflake"); + + /** + * Static value AzureSqlDb for ConnectionCategory. + */ + public static final ConnectionCategory AZURE_SQL_DB = fromString("AzureSqlDb"); + + /** + * Static value AzureSynapseAnalytics for ConnectionCategory. + */ + public static final ConnectionCategory AZURE_SYNAPSE_ANALYTICS = fromString("AzureSynapseAnalytics"); + + /** + * Static value AzureMySqlDb for ConnectionCategory. + */ + public static final ConnectionCategory AZURE_MY_SQL_DB = fromString("AzureMySqlDb"); + + /** + * Static value AzurePostgresDb for ConnectionCategory. + */ + public static final ConnectionCategory AZURE_POSTGRES_DB = fromString("AzurePostgresDb"); + + /** + * Static value ADLSGen2 for ConnectionCategory. + */ + public static final ConnectionCategory ADLSGEN2 = fromString("ADLSGen2"); + + /** + * Static value Redis for ConnectionCategory. + */ + public static final ConnectionCategory REDIS = fromString("Redis"); + + /** + * Static value ApiKey for ConnectionCategory. + */ + public static final ConnectionCategory API_KEY = fromString("ApiKey"); + + /** + * Static value AzureOpenAI for ConnectionCategory. + */ + public static final ConnectionCategory AZURE_OPEN_AI = fromString("AzureOpenAI"); + + /** + * Static value AIServices for ConnectionCategory. + */ + public static final ConnectionCategory AISERVICES = fromString("AIServices"); + + /** + * Static value CognitiveSearch for ConnectionCategory. + */ + public static final ConnectionCategory COGNITIVE_SEARCH = fromString("CognitiveSearch"); + + /** + * Static value CognitiveService for ConnectionCategory. + */ + public static final ConnectionCategory COGNITIVE_SERVICE = fromString("CognitiveService"); + + /** + * Static value CustomKeys for ConnectionCategory. + */ + public static final ConnectionCategory CUSTOM_KEYS = fromString("CustomKeys"); + + /** + * Static value AzureBlob for ConnectionCategory. + */ + public static final ConnectionCategory AZURE_BLOB = fromString("AzureBlob"); + + /** + * Static value AzureOneLake for ConnectionCategory. + */ + public static final ConnectionCategory AZURE_ONE_LAKE = fromString("AzureOneLake"); + + /** + * Static value CosmosDb for ConnectionCategory. + */ + public static final ConnectionCategory COSMOS_DB = fromString("CosmosDb"); + + /** + * Static value CosmosDbMongoDbApi for ConnectionCategory. + */ + public static final ConnectionCategory COSMOS_DB_MONGO_DB_API = fromString("CosmosDbMongoDbApi"); + + /** + * Static value AzureDataExplorer for ConnectionCategory. + */ + public static final ConnectionCategory AZURE_DATA_EXPLORER = fromString("AzureDataExplorer"); + + /** + * Static value AzureMariaDb for ConnectionCategory. + */ + public static final ConnectionCategory AZURE_MARIA_DB = fromString("AzureMariaDb"); + + /** + * Static value AzureDatabricksDeltaLake for ConnectionCategory. + */ + public static final ConnectionCategory AZURE_DATABRICKS_DELTA_LAKE = fromString("AzureDatabricksDeltaLake"); + + /** + * Static value AzureSqlMi for ConnectionCategory. + */ + public static final ConnectionCategory AZURE_SQL_MI = fromString("AzureSqlMi"); + + /** + * Static value AzureTableStorage for ConnectionCategory. + */ + public static final ConnectionCategory AZURE_TABLE_STORAGE = fromString("AzureTableStorage"); + + /** + * Static value AmazonRdsForOracle for ConnectionCategory. + */ + public static final ConnectionCategory AMAZON_RDS_FOR_ORACLE = fromString("AmazonRdsForOracle"); + + /** + * Static value AmazonRdsForSqlServer for ConnectionCategory. + */ + public static final ConnectionCategory AMAZON_RDS_FOR_SQL_SERVER = fromString("AmazonRdsForSqlServer"); + + /** + * Static value AmazonRedshift for ConnectionCategory. + */ + public static final ConnectionCategory AMAZON_REDSHIFT = fromString("AmazonRedshift"); + + /** + * Static value Db2 for ConnectionCategory. + */ + public static final ConnectionCategory DB2 = fromString("Db2"); + + /** + * Static value Drill for ConnectionCategory. + */ + public static final ConnectionCategory DRILL = fromString("Drill"); + + /** + * Static value GoogleBigQuery for ConnectionCategory. + */ + public static final ConnectionCategory GOOGLE_BIG_QUERY = fromString("GoogleBigQuery"); + + /** + * Static value Greenplum for ConnectionCategory. + */ + public static final ConnectionCategory GREENPLUM = fromString("Greenplum"); + + /** + * Static value Hbase for ConnectionCategory. + */ + public static final ConnectionCategory HBASE = fromString("Hbase"); + + /** + * Static value Hive for ConnectionCategory. + */ + public static final ConnectionCategory HIVE = fromString("Hive"); + + /** + * Static value Impala for ConnectionCategory. + */ + public static final ConnectionCategory IMPALA = fromString("Impala"); + + /** + * Static value Informix for ConnectionCategory. + */ + public static final ConnectionCategory INFORMIX = fromString("Informix"); + + /** + * Static value MariaDb for ConnectionCategory. + */ + public static final ConnectionCategory MARIA_DB = fromString("MariaDb"); + + /** + * Static value MicrosoftAccess for ConnectionCategory. + */ + public static final ConnectionCategory MICROSOFT_ACCESS = fromString("MicrosoftAccess"); + + /** + * Static value MySql for ConnectionCategory. + */ + public static final ConnectionCategory MY_SQL = fromString("MySql"); + + /** + * Static value Netezza for ConnectionCategory. + */ + public static final ConnectionCategory NETEZZA = fromString("Netezza"); + + /** + * Static value Oracle for ConnectionCategory. + */ + public static final ConnectionCategory ORACLE = fromString("Oracle"); + + /** + * Static value Phoenix for ConnectionCategory. + */ + public static final ConnectionCategory PHOENIX = fromString("Phoenix"); + + /** + * Static value PostgreSql for ConnectionCategory. + */ + public static final ConnectionCategory POSTGRE_SQL = fromString("PostgreSql"); + + /** + * Static value Presto for ConnectionCategory. + */ + public static final ConnectionCategory PRESTO = fromString("Presto"); + + /** + * Static value SapOpenHub for ConnectionCategory. + */ + public static final ConnectionCategory SAP_OPEN_HUB = fromString("SapOpenHub"); + + /** + * Static value SapBw for ConnectionCategory. + */ + public static final ConnectionCategory SAP_BW = fromString("SapBw"); + + /** + * Static value SapHana for ConnectionCategory. + */ + public static final ConnectionCategory SAP_HANA = fromString("SapHana"); + + /** + * Static value SapTable for ConnectionCategory. + */ + public static final ConnectionCategory SAP_TABLE = fromString("SapTable"); + + /** + * Static value Spark for ConnectionCategory. + */ + public static final ConnectionCategory SPARK = fromString("Spark"); + + /** + * Static value SqlServer for ConnectionCategory. + */ + public static final ConnectionCategory SQL_SERVER = fromString("SqlServer"); + + /** + * Static value Sybase for ConnectionCategory. + */ + public static final ConnectionCategory SYBASE = fromString("Sybase"); + + /** + * Static value Teradata for ConnectionCategory. + */ + public static final ConnectionCategory TERADATA = fromString("Teradata"); + + /** + * Static value Vertica for ConnectionCategory. + */ + public static final ConnectionCategory VERTICA = fromString("Vertica"); + + /** + * Static value Pinecone for ConnectionCategory. + */ + public static final ConnectionCategory PINECONE = fromString("Pinecone"); + + /** + * Static value Cassandra for ConnectionCategory. + */ + public static final ConnectionCategory CASSANDRA = fromString("Cassandra"); + + /** + * Static value Couchbase for ConnectionCategory. + */ + public static final ConnectionCategory COUCHBASE = fromString("Couchbase"); + + /** + * Static value MongoDbV2 for ConnectionCategory. + */ + public static final ConnectionCategory MONGO_DB_V2 = fromString("MongoDbV2"); + + /** + * Static value MongoDbAtlas for ConnectionCategory. + */ + public static final ConnectionCategory MONGO_DB_ATLAS = fromString("MongoDbAtlas"); + + /** + * Static value AmazonS3Compatible for ConnectionCategory. + */ + public static final ConnectionCategory AMAZON_S3COMPATIBLE = fromString("AmazonS3Compatible"); + + /** + * Static value FileServer for ConnectionCategory. + */ + public static final ConnectionCategory FILE_SERVER = fromString("FileServer"); + + /** + * Static value FtpServer for ConnectionCategory. + */ + public static final ConnectionCategory FTP_SERVER = fromString("FtpServer"); + + /** + * Static value GoogleCloudStorage for ConnectionCategory. + */ + public static final ConnectionCategory GOOGLE_CLOUD_STORAGE = fromString("GoogleCloudStorage"); + + /** + * Static value Hdfs for ConnectionCategory. + */ + public static final ConnectionCategory HDFS = fromString("Hdfs"); + + /** + * Static value OracleCloudStorage for ConnectionCategory. + */ + public static final ConnectionCategory ORACLE_CLOUD_STORAGE = fromString("OracleCloudStorage"); + + /** + * Static value Sftp for ConnectionCategory. + */ + public static final ConnectionCategory SFTP = fromString("Sftp"); + + /** + * Static value GenericHttp for ConnectionCategory. + */ + public static final ConnectionCategory GENERIC_HTTP = fromString("GenericHttp"); + + /** + * Static value ODataRest for ConnectionCategory. + */ + public static final ConnectionCategory ODATA_REST = fromString("ODataRest"); + + /** + * Static value Odbc for ConnectionCategory. + */ + public static final ConnectionCategory ODBC = fromString("Odbc"); + + /** + * Static value GenericRest for ConnectionCategory. + */ + public static final ConnectionCategory GENERIC_REST = fromString("GenericRest"); + + /** + * Static value AmazonMws for ConnectionCategory. + */ + public static final ConnectionCategory AMAZON_MWS = fromString("AmazonMws"); + + /** + * Static value Concur for ConnectionCategory. + */ + public static final ConnectionCategory CONCUR = fromString("Concur"); + + /** + * Static value Dynamics for ConnectionCategory. + */ + public static final ConnectionCategory DYNAMICS = fromString("Dynamics"); + + /** + * Static value DynamicsAx for ConnectionCategory. + */ + public static final ConnectionCategory DYNAMICS_AX = fromString("DynamicsAx"); + + /** + * Static value DynamicsCrm for ConnectionCategory. + */ + public static final ConnectionCategory DYNAMICS_CRM = fromString("DynamicsCrm"); + + /** + * Static value GoogleAdWords for ConnectionCategory. + */ + public static final ConnectionCategory GOOGLE_AD_WORDS = fromString("GoogleAdWords"); + + /** + * Static value Hubspot for ConnectionCategory. + */ + public static final ConnectionCategory HUBSPOT = fromString("Hubspot"); + + /** + * Static value Jira for ConnectionCategory. + */ + public static final ConnectionCategory JIRA = fromString("Jira"); + + /** + * Static value Magento for ConnectionCategory. + */ + public static final ConnectionCategory MAGENTO = fromString("Magento"); + + /** + * Static value Marketo for ConnectionCategory. + */ + public static final ConnectionCategory MARKETO = fromString("Marketo"); + + /** + * Static value Office365 for ConnectionCategory. + */ + public static final ConnectionCategory OFFICE365 = fromString("Office365"); + + /** + * Static value Eloqua for ConnectionCategory. + */ + public static final ConnectionCategory ELOQUA = fromString("Eloqua"); + + /** + * Static value Responsys for ConnectionCategory. + */ + public static final ConnectionCategory RESPONSYS = fromString("Responsys"); + + /** + * Static value OracleServiceCloud for ConnectionCategory. + */ + public static final ConnectionCategory ORACLE_SERVICE_CLOUD = fromString("OracleServiceCloud"); + + /** + * Static value PayPal for ConnectionCategory. + */ + public static final ConnectionCategory PAY_PAL = fromString("PayPal"); + + /** + * Static value QuickBooks for ConnectionCategory. + */ + public static final ConnectionCategory QUICK_BOOKS = fromString("QuickBooks"); + + /** + * Static value Salesforce for ConnectionCategory. + */ + public static final ConnectionCategory SALESFORCE = fromString("Salesforce"); + + /** + * Static value SalesforceServiceCloud for ConnectionCategory. + */ + public static final ConnectionCategory SALESFORCE_SERVICE_CLOUD = fromString("SalesforceServiceCloud"); + + /** + * Static value SalesforceMarketingCloud for ConnectionCategory. + */ + public static final ConnectionCategory SALESFORCE_MARKETING_CLOUD = fromString("SalesforceMarketingCloud"); + + /** + * Static value SapCloudForCustomer for ConnectionCategory. + */ + public static final ConnectionCategory SAP_CLOUD_FOR_CUSTOMER = fromString("SapCloudForCustomer"); + + /** + * Static value SapEcc for ConnectionCategory. + */ + public static final ConnectionCategory SAP_ECC = fromString("SapEcc"); + + /** + * Static value ServiceNow for ConnectionCategory. + */ + public static final ConnectionCategory SERVICE_NOW = fromString("ServiceNow"); + + /** + * Static value SharePointOnlineList for ConnectionCategory. + */ + public static final ConnectionCategory SHARE_POINT_ONLINE_LIST = fromString("SharePointOnlineList"); + + /** + * Static value Shopify for ConnectionCategory. + */ + public static final ConnectionCategory SHOPIFY = fromString("Shopify"); + + /** + * Static value Square for ConnectionCategory. + */ + public static final ConnectionCategory SQUARE = fromString("Square"); + + /** + * Static value WebTable for ConnectionCategory. + */ + public static final ConnectionCategory WEB_TABLE = fromString("WebTable"); + + /** + * Static value Xero for ConnectionCategory. + */ + public static final ConnectionCategory XERO = fromString("Xero"); + + /** + * Static value Zoho for ConnectionCategory. + */ + public static final ConnectionCategory ZOHO = fromString("Zoho"); + + /** + * Static value GenericContainerRegistry for ConnectionCategory. + */ + public static final ConnectionCategory GENERIC_CONTAINER_REGISTRY = fromString("GenericContainerRegistry"); + + /** + * Static value Elasticsearch for ConnectionCategory. + */ + public static final ConnectionCategory ELASTICSEARCH = fromString("Elasticsearch"); + + /** + * Static value OpenAI for ConnectionCategory. + */ + public static final ConnectionCategory OPEN_AI = fromString("OpenAI"); + + /** + * Static value Serp for ConnectionCategory. + */ + public static final ConnectionCategory SERP = fromString("Serp"); + + /** + * Static value BingLLMSearch for ConnectionCategory. + */ + public static final ConnectionCategory BING_LLMSEARCH = fromString("BingLLMSearch"); + + /** + * Static value Serverless for ConnectionCategory. + */ + public static final ConnectionCategory SERVERLESS = fromString("Serverless"); + + /** + * Static value ManagedOnlineEndpoint for ConnectionCategory. + */ + public static final ConnectionCategory MANAGED_ONLINE_ENDPOINT = fromString("ManagedOnlineEndpoint"); + + /** + * Creates a new instance of ConnectionCategory value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConnectionCategory() { + } + + /** + * Creates or finds a ConnectionCategory from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectionCategory. + */ + public static ConnectionCategory fromString(String name) { + return fromString(name, ConnectionCategory.class); + } + + /** + * Gets known ConnectionCategory values. + * + * @return known ConnectionCategory values. + */ + public static Collection values() { + return values(ConnectionCategory.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionGroup.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionGroup.java new file mode 100644 index 000000000000..248816be5242 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionGroup.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Group based on connection category. + */ +public final class ConnectionGroup extends ExpandableStringEnum { + /** + * Static value Azure for ConnectionGroup. + */ + public static final ConnectionGroup AZURE = fromString("Azure"); + + /** + * Static value AzureAI for ConnectionGroup. + */ + public static final ConnectionGroup AZURE_AI = fromString("AzureAI"); + + /** + * Static value Database for ConnectionGroup. + */ + public static final ConnectionGroup DATABASE = fromString("Database"); + + /** + * Static value NoSQL for ConnectionGroup. + */ + public static final ConnectionGroup NO_SQL = fromString("NoSQL"); + + /** + * Static value File for ConnectionGroup. + */ + public static final ConnectionGroup FILE = fromString("File"); + + /** + * Static value GenericProtocol for ConnectionGroup. + */ + public static final ConnectionGroup GENERIC_PROTOCOL = fromString("GenericProtocol"); + + /** + * Static value ServicesAndApps for ConnectionGroup. + */ + public static final ConnectionGroup SERVICES_AND_APPS = fromString("ServicesAndApps"); + + /** + * Creates a new instance of ConnectionGroup value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConnectionGroup() { + } + + /** + * Creates or finds a ConnectionGroup from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectionGroup. + */ + public static ConnectionGroup fromString(String name) { + return fromString(name, ConnectionGroup.class); + } + + /** + * Gets known ConnectionGroup values. + * + * @return known ConnectionGroup values. + */ + public static Collection values() { + return values(ConnectionGroup.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionManagedIdentity.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionManagedIdentity.java new file mode 100644 index 000000000000..36358d32a6ab --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionManagedIdentity.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The ConnectionManagedIdentity model. + */ +@Fluent +public final class ConnectionManagedIdentity implements JsonSerializable { + /* + * The clientId property. + */ + private String clientId; + + /* + * The resourceId property. + */ + private String resourceId; + + /** + * Creates an instance of ConnectionManagedIdentity class. + */ + public ConnectionManagedIdentity() { + } + + /** + * Get the clientId property: The clientId property. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: The clientId property. + * + * @param clientId the clientId value to set. + * @return the ConnectionManagedIdentity object itself. + */ + public ConnectionManagedIdentity withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the resourceId property: The resourceId property. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The resourceId property. + * + * @param resourceId the resourceId value to set. + * @return the ConnectionManagedIdentity object itself. + */ + public ConnectionManagedIdentity withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("clientId", this.clientId); + jsonWriter.writeStringField("resourceId", this.resourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionManagedIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionManagedIdentity if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectionManagedIdentity. + */ + public static ConnectionManagedIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionManagedIdentity deserializedConnectionManagedIdentity = new ConnectionManagedIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clientId".equals(fieldName)) { + deserializedConnectionManagedIdentity.clientId = reader.getString(); + } else if ("resourceId".equals(fieldName)) { + deserializedConnectionManagedIdentity.resourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionManagedIdentity; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionOAuth2.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionOAuth2.java new file mode 100644 index 000000000000..e2a4506bf648 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionOAuth2.java @@ -0,0 +1,299 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Objects; +import java.util.UUID; + +/** + * ClientId and ClientSecret are required. Other properties are optional + * depending on each OAuth2 provider's implementation. + */ +@Fluent +public final class ConnectionOAuth2 implements JsonSerializable { + /* + * Required by Concur connection category + */ + private String authUrl; + + /* + * Client id in the format of UUID + */ + private UUID clientId; + + /* + * The clientSecret property. + */ + private String clientSecret; + + /* + * Required by GoogleAdWords connection category + */ + private String developerToken; + + /* + * The password property. + */ + private String password; + + /* + * Required by GoogleBigQuery, GoogleAdWords, Hubspot, QuickBooks, Square, Xero, Zoho + * where user needs to get RefreshToken offline + */ + private String refreshToken; + + /* + * Required by QuickBooks and Xero connection categories + */ + private String tenantId; + + /* + * Concur, ServiceNow auth server AccessToken grant type is 'Password' + * which requires UsernamePassword + */ + private String username; + + /** + * Creates an instance of ConnectionOAuth2 class. + */ + public ConnectionOAuth2() { + } + + /** + * Get the authUrl property: Required by Concur connection category. + * + * @return the authUrl value. + */ + public String authUrl() { + return this.authUrl; + } + + /** + * Set the authUrl property: Required by Concur connection category. + * + * @param authUrl the authUrl value to set. + * @return the ConnectionOAuth2 object itself. + */ + public ConnectionOAuth2 withAuthUrl(String authUrl) { + this.authUrl = authUrl; + return this; + } + + /** + * Get the clientId property: Client id in the format of UUID. + * + * @return the clientId value. + */ + public UUID clientId() { + return this.clientId; + } + + /** + * Set the clientId property: Client id in the format of UUID. + * + * @param clientId the clientId value to set. + * @return the ConnectionOAuth2 object itself. + */ + public ConnectionOAuth2 withClientId(UUID clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the clientSecret property: The clientSecret property. + * + * @return the clientSecret value. + */ + public String clientSecret() { + return this.clientSecret; + } + + /** + * Set the clientSecret property: The clientSecret property. + * + * @param clientSecret the clientSecret value to set. + * @return the ConnectionOAuth2 object itself. + */ + public ConnectionOAuth2 withClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Get the developerToken property: Required by GoogleAdWords connection category. + * + * @return the developerToken value. + */ + public String developerToken() { + return this.developerToken; + } + + /** + * Set the developerToken property: Required by GoogleAdWords connection category. + * + * @param developerToken the developerToken value to set. + * @return the ConnectionOAuth2 object itself. + */ + public ConnectionOAuth2 withDeveloperToken(String developerToken) { + this.developerToken = developerToken; + return this; + } + + /** + * Get the password property: The password property. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: The password property. + * + * @param password the password value to set. + * @return the ConnectionOAuth2 object itself. + */ + public ConnectionOAuth2 withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the refreshToken property: Required by GoogleBigQuery, GoogleAdWords, Hubspot, QuickBooks, Square, Xero, Zoho + * where user needs to get RefreshToken offline. + * + * @return the refreshToken value. + */ + public String refreshToken() { + return this.refreshToken; + } + + /** + * Set the refreshToken property: Required by GoogleBigQuery, GoogleAdWords, Hubspot, QuickBooks, Square, Xero, Zoho + * where user needs to get RefreshToken offline. + * + * @param refreshToken the refreshToken value to set. + * @return the ConnectionOAuth2 object itself. + */ + public ConnectionOAuth2 withRefreshToken(String refreshToken) { + this.refreshToken = refreshToken; + return this; + } + + /** + * Get the tenantId property: Required by QuickBooks and Xero connection categories. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: Required by QuickBooks and Xero connection categories. + * + * @param tenantId the tenantId value to set. + * @return the ConnectionOAuth2 object itself. + */ + public ConnectionOAuth2 withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the username property: Concur, ServiceNow auth server AccessToken grant type is 'Password' + * which requires UsernamePassword. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: Concur, ServiceNow auth server AccessToken grant type is 'Password' + * which requires UsernamePassword. + * + * @param username the username value to set. + * @return the ConnectionOAuth2 object itself. + */ + public ConnectionOAuth2 withUsername(String username) { + this.username = username; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("authUrl", this.authUrl); + jsonWriter.writeStringField("clientId", Objects.toString(this.clientId, null)); + jsonWriter.writeStringField("clientSecret", this.clientSecret); + jsonWriter.writeStringField("developerToken", this.developerToken); + jsonWriter.writeStringField("password", this.password); + jsonWriter.writeStringField("refreshToken", this.refreshToken); + jsonWriter.writeStringField("tenantId", this.tenantId); + jsonWriter.writeStringField("username", this.username); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionOAuth2 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionOAuth2 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectionOAuth2. + */ + public static ConnectionOAuth2 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionOAuth2 deserializedConnectionOAuth2 = new ConnectionOAuth2(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("authUrl".equals(fieldName)) { + deserializedConnectionOAuth2.authUrl = reader.getString(); + } else if ("clientId".equals(fieldName)) { + deserializedConnectionOAuth2.clientId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("clientSecret".equals(fieldName)) { + deserializedConnectionOAuth2.clientSecret = reader.getString(); + } else if ("developerToken".equals(fieldName)) { + deserializedConnectionOAuth2.developerToken = reader.getString(); + } else if ("password".equals(fieldName)) { + deserializedConnectionOAuth2.password = reader.getString(); + } else if ("refreshToken".equals(fieldName)) { + deserializedConnectionOAuth2.refreshToken = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedConnectionOAuth2.tenantId = reader.getString(); + } else if ("username".equals(fieldName)) { + deserializedConnectionOAuth2.username = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionOAuth2; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionPersonalAccessToken.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionPersonalAccessToken.java new file mode 100644 index 000000000000..d5b6ad6b6a52 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionPersonalAccessToken.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The ConnectionPersonalAccessToken model. + */ +@Fluent +public final class ConnectionPersonalAccessToken implements JsonSerializable { + /* + * The pat property. + */ + private String pat; + + /** + * Creates an instance of ConnectionPersonalAccessToken class. + */ + public ConnectionPersonalAccessToken() { + } + + /** + * Get the pat property: The pat property. + * + * @return the pat value. + */ + public String pat() { + return this.pat; + } + + /** + * Set the pat property: The pat property. + * + * @param pat the pat value to set. + * @return the ConnectionPersonalAccessToken object itself. + */ + public ConnectionPersonalAccessToken withPat(String pat) { + this.pat = pat; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("pat", this.pat); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionPersonalAccessToken from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionPersonalAccessToken if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectionPersonalAccessToken. + */ + public static ConnectionPersonalAccessToken fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionPersonalAccessToken deserializedConnectionPersonalAccessToken + = new ConnectionPersonalAccessToken(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("pat".equals(fieldName)) { + deserializedConnectionPersonalAccessToken.pat = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionPersonalAccessToken; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionPropertiesV2.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionPropertiesV2.java new file mode 100644 index 000000000000..7358dcd50e12 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionPropertiesV2.java @@ -0,0 +1,475 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Map; + +/** + * Connection property base schema. + */ +@Fluent +public class ConnectionPropertiesV2 implements JsonSerializable { + /* + * Authentication type of the connection target + */ + private ConnectionAuthType authType = ConnectionAuthType.fromString("ConnectionPropertiesV2"); + + /* + * Category of the connection + */ + private ConnectionCategory category; + + /* + * The createdByWorkspaceArmId property. + */ + private String createdByWorkspaceArmId; + + /* + * The error property. + */ + private String error; + + /* + * The expiryTime property. + */ + private OffsetDateTime expiryTime; + + /* + * Group based on connection category + */ + private ConnectionGroup group; + + /* + * The isSharedToAll property. + */ + private Boolean isSharedToAll; + + /* + * Store user metadata for this connection + */ + private Map metadata; + + /* + * The peRequirement property. + */ + private ManagedPERequirement peRequirement; + + /* + * The peStatus property. + */ + private ManagedPEStatus peStatus; + + /* + * The sharedUserList property. + */ + private List sharedUserList; + + /* + * The target property. + */ + private String target; + + /* + * The useWorkspaceManagedIdentity property. + */ + private Boolean useWorkspaceManagedIdentity; + + /** + * Creates an instance of ConnectionPropertiesV2 class. + */ + public ConnectionPropertiesV2() { + } + + /** + * Get the authType property: Authentication type of the connection target. + * + * @return the authType value. + */ + public ConnectionAuthType authType() { + return this.authType; + } + + /** + * Get the category property: Category of the connection. + * + * @return the category value. + */ + public ConnectionCategory category() { + return this.category; + } + + /** + * Set the category property: Category of the connection. + * + * @param category the category value to set. + * @return the ConnectionPropertiesV2 object itself. + */ + public ConnectionPropertiesV2 withCategory(ConnectionCategory category) { + this.category = category; + return this; + } + + /** + * Get the createdByWorkspaceArmId property: The createdByWorkspaceArmId property. + * + * @return the createdByWorkspaceArmId value. + */ + public String createdByWorkspaceArmId() { + return this.createdByWorkspaceArmId; + } + + /** + * Set the createdByWorkspaceArmId property: The createdByWorkspaceArmId property. + * + * @param createdByWorkspaceArmId the createdByWorkspaceArmId value to set. + * @return the ConnectionPropertiesV2 object itself. + */ + ConnectionPropertiesV2 withCreatedByWorkspaceArmId(String createdByWorkspaceArmId) { + this.createdByWorkspaceArmId = createdByWorkspaceArmId; + return this; + } + + /** + * Get the error property: The error property. + * + * @return the error value. + */ + public String error() { + return this.error; + } + + /** + * Set the error property: The error property. + * + * @param error the error value to set. + * @return the ConnectionPropertiesV2 object itself. + */ + public ConnectionPropertiesV2 withError(String error) { + this.error = error; + return this; + } + + /** + * Get the expiryTime property: The expiryTime property. + * + * @return the expiryTime value. + */ + public OffsetDateTime expiryTime() { + return this.expiryTime; + } + + /** + * Set the expiryTime property: The expiryTime property. + * + * @param expiryTime the expiryTime value to set. + * @return the ConnectionPropertiesV2 object itself. + */ + public ConnectionPropertiesV2 withExpiryTime(OffsetDateTime expiryTime) { + this.expiryTime = expiryTime; + return this; + } + + /** + * Get the group property: Group based on connection category. + * + * @return the group value. + */ + public ConnectionGroup group() { + return this.group; + } + + /** + * Set the group property: Group based on connection category. + * + * @param group the group value to set. + * @return the ConnectionPropertiesV2 object itself. + */ + ConnectionPropertiesV2 withGroup(ConnectionGroup group) { + this.group = group; + return this; + } + + /** + * Get the isSharedToAll property: The isSharedToAll property. + * + * @return the isSharedToAll value. + */ + public Boolean isSharedToAll() { + return this.isSharedToAll; + } + + /** + * Set the isSharedToAll property: The isSharedToAll property. + * + * @param isSharedToAll the isSharedToAll value to set. + * @return the ConnectionPropertiesV2 object itself. + */ + public ConnectionPropertiesV2 withIsSharedToAll(Boolean isSharedToAll) { + this.isSharedToAll = isSharedToAll; + return this; + } + + /** + * Get the metadata property: Store user metadata for this connection. + * + * @return the metadata value. + */ + public Map metadata() { + return this.metadata; + } + + /** + * Set the metadata property: Store user metadata for this connection. + * + * @param metadata the metadata value to set. + * @return the ConnectionPropertiesV2 object itself. + */ + public ConnectionPropertiesV2 withMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the peRequirement property: The peRequirement property. + * + * @return the peRequirement value. + */ + public ManagedPERequirement peRequirement() { + return this.peRequirement; + } + + /** + * Set the peRequirement property: The peRequirement property. + * + * @param peRequirement the peRequirement value to set. + * @return the ConnectionPropertiesV2 object itself. + */ + public ConnectionPropertiesV2 withPeRequirement(ManagedPERequirement peRequirement) { + this.peRequirement = peRequirement; + return this; + } + + /** + * Get the peStatus property: The peStatus property. + * + * @return the peStatus value. + */ + public ManagedPEStatus peStatus() { + return this.peStatus; + } + + /** + * Set the peStatus property: The peStatus property. + * + * @param peStatus the peStatus value to set. + * @return the ConnectionPropertiesV2 object itself. + */ + public ConnectionPropertiesV2 withPeStatus(ManagedPEStatus peStatus) { + this.peStatus = peStatus; + return this; + } + + /** + * Get the sharedUserList property: The sharedUserList property. + * + * @return the sharedUserList value. + */ + public List sharedUserList() { + return this.sharedUserList; + } + + /** + * Set the sharedUserList property: The sharedUserList property. + * + * @param sharedUserList the sharedUserList value to set. + * @return the ConnectionPropertiesV2 object itself. + */ + public ConnectionPropertiesV2 withSharedUserList(List sharedUserList) { + this.sharedUserList = sharedUserList; + return this; + } + + /** + * Get the target property: The target property. + * + * @return the target value. + */ + public String target() { + return this.target; + } + + /** + * Set the target property: The target property. + * + * @param target the target value to set. + * @return the ConnectionPropertiesV2 object itself. + */ + public ConnectionPropertiesV2 withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get the useWorkspaceManagedIdentity property: The useWorkspaceManagedIdentity property. + * + * @return the useWorkspaceManagedIdentity value. + */ + public Boolean useWorkspaceManagedIdentity() { + return this.useWorkspaceManagedIdentity; + } + + /** + * Set the useWorkspaceManagedIdentity property: The useWorkspaceManagedIdentity property. + * + * @param useWorkspaceManagedIdentity the useWorkspaceManagedIdentity value to set. + * @return the ConnectionPropertiesV2 object itself. + */ + public ConnectionPropertiesV2 withUseWorkspaceManagedIdentity(Boolean useWorkspaceManagedIdentity) { + this.useWorkspaceManagedIdentity = useWorkspaceManagedIdentity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); + jsonWriter.writeStringField("category", this.category == null ? null : this.category.toString()); + jsonWriter.writeStringField("error", this.error); + jsonWriter.writeStringField("expiryTime", + this.expiryTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expiryTime)); + jsonWriter.writeBooleanField("isSharedToAll", this.isSharedToAll); + jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("peRequirement", this.peRequirement == null ? null : this.peRequirement.toString()); + jsonWriter.writeStringField("peStatus", this.peStatus == null ? null : this.peStatus.toString()); + jsonWriter.writeArrayField("sharedUserList", this.sharedUserList, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("target", this.target); + jsonWriter.writeBooleanField("useWorkspaceManagedIdentity", this.useWorkspaceManagedIdentity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionPropertiesV2 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionPropertiesV2 if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectionPropertiesV2. + */ + public static ConnectionPropertiesV2 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("authType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("PAT".equals(discriminatorValue)) { + return PatAuthTypeConnectionProperties.fromJson(readerToUse.reset()); + } else if ("ManagedIdentity".equals(discriminatorValue)) { + return ManagedIdentityAuthTypeConnectionProperties.fromJson(readerToUse.reset()); + } else if ("UsernamePassword".equals(discriminatorValue)) { + return UsernamePasswordAuthTypeConnectionProperties.fromJson(readerToUse.reset()); + } else if ("None".equals(discriminatorValue)) { + return NoneAuthTypeConnectionProperties.fromJson(readerToUse.reset()); + } else if ("SAS".equals(discriminatorValue)) { + return SasAuthTypeConnectionProperties.fromJson(readerToUse.reset()); + } else if ("AccountKey".equals(discriminatorValue)) { + return AccountKeyAuthTypeConnectionProperties.fromJson(readerToUse.reset()); + } else if ("ServicePrincipal".equals(discriminatorValue)) { + return ServicePrincipalAuthTypeConnectionProperties.fromJson(readerToUse.reset()); + } else if ("AccessKey".equals(discriminatorValue)) { + return AccessKeyAuthTypeConnectionProperties.fromJson(readerToUse.reset()); + } else if ("ApiKey".equals(discriminatorValue)) { + return ApiKeyAuthConnectionProperties.fromJson(readerToUse.reset()); + } else if ("CustomKeys".equals(discriminatorValue)) { + return CustomKeysConnectionProperties.fromJson(readerToUse.reset()); + } else if ("OAuth2".equals(discriminatorValue)) { + return OAuth2AuthTypeConnectionProperties.fromJson(readerToUse.reset()); + } else if ("AAD".equals(discriminatorValue)) { + return AadAuthTypeConnectionProperties.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static ConnectionPropertiesV2 fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionPropertiesV2 deserializedConnectionPropertiesV2 = new ConnectionPropertiesV2(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("authType".equals(fieldName)) { + deserializedConnectionPropertiesV2.authType = ConnectionAuthType.fromString(reader.getString()); + } else if ("category".equals(fieldName)) { + deserializedConnectionPropertiesV2.category = ConnectionCategory.fromString(reader.getString()); + } else if ("createdByWorkspaceArmId".equals(fieldName)) { + deserializedConnectionPropertiesV2.createdByWorkspaceArmId = reader.getString(); + } else if ("error".equals(fieldName)) { + deserializedConnectionPropertiesV2.error = reader.getString(); + } else if ("expiryTime".equals(fieldName)) { + deserializedConnectionPropertiesV2.expiryTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("group".equals(fieldName)) { + deserializedConnectionPropertiesV2.group = ConnectionGroup.fromString(reader.getString()); + } else if ("isSharedToAll".equals(fieldName)) { + deserializedConnectionPropertiesV2.isSharedToAll = reader.getNullable(JsonReader::getBoolean); + } else if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedConnectionPropertiesV2.metadata = metadata; + } else if ("peRequirement".equals(fieldName)) { + deserializedConnectionPropertiesV2.peRequirement + = ManagedPERequirement.fromString(reader.getString()); + } else if ("peStatus".equals(fieldName)) { + deserializedConnectionPropertiesV2.peStatus = ManagedPEStatus.fromString(reader.getString()); + } else if ("sharedUserList".equals(fieldName)) { + List sharedUserList = reader.readArray(reader1 -> reader1.getString()); + deserializedConnectionPropertiesV2.sharedUserList = sharedUserList; + } else if ("target".equals(fieldName)) { + deserializedConnectionPropertiesV2.target = reader.getString(); + } else if ("useWorkspaceManagedIdentity".equals(fieldName)) { + deserializedConnectionPropertiesV2.useWorkspaceManagedIdentity + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionPropertiesV2; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionPropertiesV2BasicResource.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionPropertiesV2BasicResource.java new file mode 100644 index 000000000000..6be260a25453 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionPropertiesV2BasicResource.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ConnectionPropertiesV2BasicResourceInner; + +/** + * An immutable client-side representation of ConnectionPropertiesV2BasicResource. + */ +public interface ConnectionPropertiesV2BasicResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: Connection property base schema. + * + * @return the properties value. + */ + ConnectionPropertiesV2 properties(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.ConnectionPropertiesV2BasicResourceInner + * object. + * + * @return the inner object. + */ + ConnectionPropertiesV2BasicResourceInner innerModel(); + + /** + * The entirety of the ConnectionPropertiesV2BasicResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * The ConnectionPropertiesV2BasicResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the ConnectionPropertiesV2BasicResource definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the ConnectionPropertiesV2BasicResource definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @return the next definition stage. + */ + WithProperties withExistingAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the ConnectionPropertiesV2BasicResource definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Connection property base schema.. + * + * @param properties Connection property base schema. + * @return the next definition stage. + */ + WithCreate withProperties(ConnectionPropertiesV2 properties); + } + + /** + * The stage of the ConnectionPropertiesV2BasicResource definition which contains all the minimum required + * properties for the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate { + /** + * Executes the create request. + * + * @return the created resource. + */ + ConnectionPropertiesV2BasicResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ConnectionPropertiesV2BasicResource create(Context context); + } + } + + /** + * Begins update for the ConnectionPropertiesV2BasicResource resource. + * + * @return the stage of resource update. + */ + ConnectionPropertiesV2BasicResource.Update update(); + + /** + * The template for ConnectionPropertiesV2BasicResource update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ConnectionPropertiesV2BasicResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ConnectionPropertiesV2BasicResource apply(Context context); + } + + /** + * The ConnectionPropertiesV2BasicResource update stages. + */ + interface UpdateStages { + /** + * The stage of the ConnectionPropertiesV2BasicResource update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The properties that the Cognitive services connection will be updated + * with.. + * + * @param properties The properties that the Cognitive services connection will be updated with. + * @return the next definition stage. + */ + Update withProperties(ConnectionPropertiesV2 properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ConnectionPropertiesV2BasicResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ConnectionPropertiesV2BasicResource refresh(Context context); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionPropertiesV2BasicResourceArmPaginatedResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionPropertiesV2BasicResourceArmPaginatedResult.java new file mode 100644 index 000000000000..df180a616463 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionPropertiesV2BasicResourceArmPaginatedResult.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ConnectionPropertiesV2BasicResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * The ConnectionPropertiesV2BasicResourceArmPaginatedResult model. + */ +@Fluent +public final class ConnectionPropertiesV2BasicResourceArmPaginatedResult + implements JsonSerializable { + /* + * The nextLink property. + */ + private String nextLink; + + /* + * The value property. + */ + private List value; + + /** + * Creates an instance of ConnectionPropertiesV2BasicResourceArmPaginatedResult class. + */ + public ConnectionPropertiesV2BasicResourceArmPaginatedResult() { + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The nextLink property. + * + * @param nextLink the nextLink value to set. + * @return the ConnectionPropertiesV2BasicResourceArmPaginatedResult object itself. + */ + public ConnectionPropertiesV2BasicResourceArmPaginatedResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the ConnectionPropertiesV2BasicResourceArmPaginatedResult object itself. + */ + public ConnectionPropertiesV2BasicResourceArmPaginatedResult + withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionPropertiesV2BasicResourceArmPaginatedResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionPropertiesV2BasicResourceArmPaginatedResult if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectionPropertiesV2BasicResourceArmPaginatedResult. + */ + public static ConnectionPropertiesV2BasicResourceArmPaginatedResult fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ConnectionPropertiesV2BasicResourceArmPaginatedResult deserializedConnectionPropertiesV2BasicResourceArmPaginatedResult + = new ConnectionPropertiesV2BasicResourceArmPaginatedResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedConnectionPropertiesV2BasicResourceArmPaginatedResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ConnectionPropertiesV2BasicResourceInner.fromJson(reader1)); + deserializedConnectionPropertiesV2BasicResourceArmPaginatedResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionPropertiesV2BasicResourceArmPaginatedResult; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionServicePrincipal.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionServicePrincipal.java new file mode 100644 index 000000000000..8d4a1b99abda --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionServicePrincipal.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The ConnectionServicePrincipal model. + */ +@Fluent +public final class ConnectionServicePrincipal implements JsonSerializable { + /* + * The clientId property. + */ + private String clientId; + + /* + * The clientSecret property. + */ + private String clientSecret; + + /* + * The tenantId property. + */ + private String tenantId; + + /** + * Creates an instance of ConnectionServicePrincipal class. + */ + public ConnectionServicePrincipal() { + } + + /** + * Get the clientId property: The clientId property. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: The clientId property. + * + * @param clientId the clientId value to set. + * @return the ConnectionServicePrincipal object itself. + */ + public ConnectionServicePrincipal withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the clientSecret property: The clientSecret property. + * + * @return the clientSecret value. + */ + public String clientSecret() { + return this.clientSecret; + } + + /** + * Set the clientSecret property: The clientSecret property. + * + * @param clientSecret the clientSecret value to set. + * @return the ConnectionServicePrincipal object itself. + */ + public ConnectionServicePrincipal withClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Get the tenantId property: The tenantId property. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: The tenantId property. + * + * @param tenantId the tenantId value to set. + * @return the ConnectionServicePrincipal object itself. + */ + public ConnectionServicePrincipal withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("clientId", this.clientId); + jsonWriter.writeStringField("clientSecret", this.clientSecret); + jsonWriter.writeStringField("tenantId", this.tenantId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionServicePrincipal from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionServicePrincipal if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectionServicePrincipal. + */ + public static ConnectionServicePrincipal fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionServicePrincipal deserializedConnectionServicePrincipal = new ConnectionServicePrincipal(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clientId".equals(fieldName)) { + deserializedConnectionServicePrincipal.clientId = reader.getString(); + } else if ("clientSecret".equals(fieldName)) { + deserializedConnectionServicePrincipal.clientSecret = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedConnectionServicePrincipal.tenantId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionServicePrincipal; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionSharedAccessSignature.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionSharedAccessSignature.java new file mode 100644 index 000000000000..b8d4a648959e --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionSharedAccessSignature.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The ConnectionSharedAccessSignature model. + */ +@Fluent +public final class ConnectionSharedAccessSignature implements JsonSerializable { + /* + * The sas property. + */ + private String sas; + + /** + * Creates an instance of ConnectionSharedAccessSignature class. + */ + public ConnectionSharedAccessSignature() { + } + + /** + * Get the sas property: The sas property. + * + * @return the sas value. + */ + public String sas() { + return this.sas; + } + + /** + * Set the sas property: The sas property. + * + * @param sas the sas value to set. + * @return the ConnectionSharedAccessSignature object itself. + */ + public ConnectionSharedAccessSignature withSas(String sas) { + this.sas = sas; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sas", this.sas); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionSharedAccessSignature from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionSharedAccessSignature if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectionSharedAccessSignature. + */ + public static ConnectionSharedAccessSignature fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionSharedAccessSignature deserializedConnectionSharedAccessSignature + = new ConnectionSharedAccessSignature(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sas".equals(fieldName)) { + deserializedConnectionSharedAccessSignature.sas = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionSharedAccessSignature; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionUpdateContent.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionUpdateContent.java new file mode 100644 index 000000000000..6829a8345816 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionUpdateContent.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties that the Cognitive services connection will be updated with. + */ +@Fluent +public final class ConnectionUpdateContent implements JsonSerializable { + /* + * The properties that the Cognitive services connection will be updated with. + */ + private ConnectionPropertiesV2 properties; + + /** + * Creates an instance of ConnectionUpdateContent class. + */ + public ConnectionUpdateContent() { + } + + /** + * Get the properties property: The properties that the Cognitive services connection will be updated with. + * + * @return the properties value. + */ + public ConnectionPropertiesV2 properties() { + return this.properties; + } + + /** + * Set the properties property: The properties that the Cognitive services connection will be updated with. + * + * @param properties the properties value to set. + * @return the ConnectionUpdateContent object itself. + */ + public ConnectionUpdateContent withProperties(ConnectionPropertiesV2 properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionUpdateContent from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionUpdateContent if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectionUpdateContent. + */ + public static ConnectionUpdateContent fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionUpdateContent deserializedConnectionUpdateContent = new ConnectionUpdateContent(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedConnectionUpdateContent.properties = ConnectionPropertiesV2.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionUpdateContent; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionUsernamePassword.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionUsernamePassword.java new file mode 100644 index 000000000000..080749cd3d49 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionUsernamePassword.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The ConnectionUsernamePassword model. + */ +@Fluent +public final class ConnectionUsernamePassword implements JsonSerializable { + /* + * The password property. + */ + private String password; + + /* + * Optional, required by connections like SalesForce for extra security in addition to UsernamePassword + */ + private String securityToken; + + /* + * The username property. + */ + private String username; + + /** + * Creates an instance of ConnectionUsernamePassword class. + */ + public ConnectionUsernamePassword() { + } + + /** + * Get the password property: The password property. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: The password property. + * + * @param password the password value to set. + * @return the ConnectionUsernamePassword object itself. + */ + public ConnectionUsernamePassword withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the securityToken property: Optional, required by connections like SalesForce for extra security in addition + * to UsernamePassword. + * + * @return the securityToken value. + */ + public String securityToken() { + return this.securityToken; + } + + /** + * Set the securityToken property: Optional, required by connections like SalesForce for extra security in addition + * to UsernamePassword. + * + * @param securityToken the securityToken value to set. + * @return the ConnectionUsernamePassword object itself. + */ + public ConnectionUsernamePassword withSecurityToken(String securityToken) { + this.securityToken = securityToken; + return this; + } + + /** + * Get the username property: The username property. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: The username property. + * + * @param username the username value to set. + * @return the ConnectionUsernamePassword object itself. + */ + public ConnectionUsernamePassword withUsername(String username) { + this.username = username; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("password", this.password); + jsonWriter.writeStringField("securityToken", this.securityToken); + jsonWriter.writeStringField("username", this.username); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionUsernamePassword from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionUsernamePassword if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectionUsernamePassword. + */ + public static ConnectionUsernamePassword fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionUsernamePassword deserializedConnectionUsernamePassword = new ConnectionUsernamePassword(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("password".equals(fieldName)) { + deserializedConnectionUsernamePassword.password = reader.getString(); + } else if ("securityToken".equals(fieldName)) { + deserializedConnectionUsernamePassword.securityToken = reader.getString(); + } else if ("username".equals(fieldName)) { + deserializedConnectionUsernamePassword.username = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionUsernamePassword; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CustomKeys.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CustomKeys.java new file mode 100644 index 000000000000..bd9f48d71c82 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CustomKeys.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Custom Keys credential object. + */ +@Fluent +public final class CustomKeys implements JsonSerializable { + /* + * Dictionary of + */ + private Map keys; + + /** + * Creates an instance of CustomKeys class. + */ + public CustomKeys() { + } + + /** + * Get the keys property: Dictionary of <string>. + * + * @return the keys value. + */ + public Map keys() { + return this.keys; + } + + /** + * Set the keys property: Dictionary of <string>. + * + * @param keys the keys value to set. + * @return the CustomKeys object itself. + */ + public CustomKeys withKeys(Map keys) { + this.keys = keys; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("keys", this.keys, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomKeys from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomKeys if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the CustomKeys. + */ + public static CustomKeys fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomKeys deserializedCustomKeys = new CustomKeys(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keys".equals(fieldName)) { + Map keys = reader.readMap(reader1 -> reader1.getString()); + deserializedCustomKeys.keys = keys; + } else { + reader.skipChildren(); + } + } + + return deserializedCustomKeys; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CustomKeysConnectionProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CustomKeysConnectionProperties.java new file mode 100644 index 000000000000..9d8ce5d9d779 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CustomKeysConnectionProperties.java @@ -0,0 +1,260 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Map; + +/** + * Category:= CustomKeys + * AuthType:= CustomKeys (as type discriminator) + * Credentials:= {CustomKeys} as CustomKeys + * Target:= {any value} + * Use Metadata property bag for ApiVersion and other metadata fields. + */ +@Fluent +public final class CustomKeysConnectionProperties extends ConnectionPropertiesV2 { + /* + * Authentication type of the connection target + */ + private ConnectionAuthType authType = ConnectionAuthType.CUSTOM_KEYS; + + /* + * Custom Keys credential object + */ + private CustomKeys credentials; + + /** + * Creates an instance of CustomKeysConnectionProperties class. + */ + public CustomKeysConnectionProperties() { + } + + /** + * Get the authType property: Authentication type of the connection target. + * + * @return the authType value. + */ + @Override + public ConnectionAuthType authType() { + return this.authType; + } + + /** + * Get the credentials property: Custom Keys credential object. + * + * @return the credentials value. + */ + public CustomKeys credentials() { + return this.credentials; + } + + /** + * Set the credentials property: Custom Keys credential object. + * + * @param credentials the credentials value to set. + * @return the CustomKeysConnectionProperties object itself. + */ + public CustomKeysConnectionProperties withCredentials(CustomKeys credentials) { + this.credentials = credentials; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CustomKeysConnectionProperties withCategory(ConnectionCategory category) { + super.withCategory(category); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CustomKeysConnectionProperties withError(String error) { + super.withError(error); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CustomKeysConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { + super.withExpiryTime(expiryTime); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CustomKeysConnectionProperties withIsSharedToAll(Boolean isSharedToAll) { + super.withIsSharedToAll(isSharedToAll); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CustomKeysConnectionProperties withMetadata(Map metadata) { + super.withMetadata(metadata); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CustomKeysConnectionProperties withPeRequirement(ManagedPERequirement peRequirement) { + super.withPeRequirement(peRequirement); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CustomKeysConnectionProperties withPeStatus(ManagedPEStatus peStatus) { + super.withPeStatus(peStatus); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CustomKeysConnectionProperties withSharedUserList(List sharedUserList) { + super.withSharedUserList(sharedUserList); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CustomKeysConnectionProperties withTarget(String target) { + super.withTarget(target); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CustomKeysConnectionProperties withUseWorkspaceManagedIdentity(Boolean useWorkspaceManagedIdentity) { + super.withUseWorkspaceManagedIdentity(useWorkspaceManagedIdentity); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (credentials() != null) { + credentials().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", category() == null ? null : category().toString()); + jsonWriter.writeStringField("error", error()); + jsonWriter.writeStringField("expiryTime", + expiryTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expiryTime())); + jsonWriter.writeBooleanField("isSharedToAll", isSharedToAll()); + jsonWriter.writeMapField("metadata", metadata(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("peRequirement", peRequirement() == null ? null : peRequirement().toString()); + jsonWriter.writeStringField("peStatus", peStatus() == null ? null : peStatus().toString()); + jsonWriter.writeArrayField("sharedUserList", sharedUserList(), + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("target", target()); + jsonWriter.writeBooleanField("useWorkspaceManagedIdentity", useWorkspaceManagedIdentity()); + jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); + jsonWriter.writeJsonField("credentials", this.credentials); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomKeysConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomKeysConnectionProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CustomKeysConnectionProperties. + */ + public static CustomKeysConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomKeysConnectionProperties deserializedCustomKeysConnectionProperties + = new CustomKeysConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedCustomKeysConnectionProperties + .withCategory(ConnectionCategory.fromString(reader.getString())); + } else if ("createdByWorkspaceArmId".equals(fieldName)) { + deserializedCustomKeysConnectionProperties.withCreatedByWorkspaceArmId(reader.getString()); + } else if ("error".equals(fieldName)) { + deserializedCustomKeysConnectionProperties.withError(reader.getString()); + } else if ("expiryTime".equals(fieldName)) { + deserializedCustomKeysConnectionProperties.withExpiryTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("group".equals(fieldName)) { + deserializedCustomKeysConnectionProperties + .withGroup(ConnectionGroup.fromString(reader.getString())); + } else if ("isSharedToAll".equals(fieldName)) { + deserializedCustomKeysConnectionProperties + .withIsSharedToAll(reader.getNullable(JsonReader::getBoolean)); + } else if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedCustomKeysConnectionProperties.withMetadata(metadata); + } else if ("peRequirement".equals(fieldName)) { + deserializedCustomKeysConnectionProperties + .withPeRequirement(ManagedPERequirement.fromString(reader.getString())); + } else if ("peStatus".equals(fieldName)) { + deserializedCustomKeysConnectionProperties + .withPeStatus(ManagedPEStatus.fromString(reader.getString())); + } else if ("sharedUserList".equals(fieldName)) { + List sharedUserList = reader.readArray(reader1 -> reader1.getString()); + deserializedCustomKeysConnectionProperties.withSharedUserList(sharedUserList); + } else if ("target".equals(fieldName)) { + deserializedCustomKeysConnectionProperties.withTarget(reader.getString()); + } else if ("useWorkspaceManagedIdentity".equals(fieldName)) { + deserializedCustomKeysConnectionProperties + .withUseWorkspaceManagedIdentity(reader.getNullable(JsonReader::getBoolean)); + } else if ("authType".equals(fieldName)) { + deserializedCustomKeysConnectionProperties.authType + = ConnectionAuthType.fromString(reader.getString()); + } else if ("credentials".equals(fieldName)) { + deserializedCustomKeysConnectionProperties.credentials = CustomKeys.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomKeysConnectionProperties; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedIdentityAuthTypeConnectionProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedIdentityAuthTypeConnectionProperties.java new file mode 100644 index 000000000000..b69635d6b17f --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedIdentityAuthTypeConnectionProperties.java @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Map; + +/** + * The ManagedIdentityAuthTypeConnectionProperties model. + */ +@Fluent +public final class ManagedIdentityAuthTypeConnectionProperties extends ConnectionPropertiesV2 { + /* + * Authentication type of the connection target + */ + private ConnectionAuthType authType = ConnectionAuthType.MANAGED_IDENTITY; + + /* + * The credentials property. + */ + private ConnectionManagedIdentity credentials; + + /** + * Creates an instance of ManagedIdentityAuthTypeConnectionProperties class. + */ + public ManagedIdentityAuthTypeConnectionProperties() { + } + + /** + * Get the authType property: Authentication type of the connection target. + * + * @return the authType value. + */ + @Override + public ConnectionAuthType authType() { + return this.authType; + } + + /** + * Get the credentials property: The credentials property. + * + * @return the credentials value. + */ + public ConnectionManagedIdentity credentials() { + return this.credentials; + } + + /** + * Set the credentials property: The credentials property. + * + * @param credentials the credentials value to set. + * @return the ManagedIdentityAuthTypeConnectionProperties object itself. + */ + public ManagedIdentityAuthTypeConnectionProperties withCredentials(ConnectionManagedIdentity credentials) { + this.credentials = credentials; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedIdentityAuthTypeConnectionProperties withCategory(ConnectionCategory category) { + super.withCategory(category); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedIdentityAuthTypeConnectionProperties withError(String error) { + super.withError(error); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedIdentityAuthTypeConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { + super.withExpiryTime(expiryTime); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedIdentityAuthTypeConnectionProperties withIsSharedToAll(Boolean isSharedToAll) { + super.withIsSharedToAll(isSharedToAll); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedIdentityAuthTypeConnectionProperties withMetadata(Map metadata) { + super.withMetadata(metadata); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedIdentityAuthTypeConnectionProperties withPeRequirement(ManagedPERequirement peRequirement) { + super.withPeRequirement(peRequirement); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedIdentityAuthTypeConnectionProperties withPeStatus(ManagedPEStatus peStatus) { + super.withPeStatus(peStatus); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedIdentityAuthTypeConnectionProperties withSharedUserList(List sharedUserList) { + super.withSharedUserList(sharedUserList); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedIdentityAuthTypeConnectionProperties withTarget(String target) { + super.withTarget(target); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedIdentityAuthTypeConnectionProperties + withUseWorkspaceManagedIdentity(Boolean useWorkspaceManagedIdentity) { + super.withUseWorkspaceManagedIdentity(useWorkspaceManagedIdentity); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (credentials() != null) { + credentials().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", category() == null ? null : category().toString()); + jsonWriter.writeStringField("error", error()); + jsonWriter.writeStringField("expiryTime", + expiryTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expiryTime())); + jsonWriter.writeBooleanField("isSharedToAll", isSharedToAll()); + jsonWriter.writeMapField("metadata", metadata(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("peRequirement", peRequirement() == null ? null : peRequirement().toString()); + jsonWriter.writeStringField("peStatus", peStatus() == null ? null : peStatus().toString()); + jsonWriter.writeArrayField("sharedUserList", sharedUserList(), + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("target", target()); + jsonWriter.writeBooleanField("useWorkspaceManagedIdentity", useWorkspaceManagedIdentity()); + jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); + jsonWriter.writeJsonField("credentials", this.credentials); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedIdentityAuthTypeConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedIdentityAuthTypeConnectionProperties if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedIdentityAuthTypeConnectionProperties. + */ + public static ManagedIdentityAuthTypeConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedIdentityAuthTypeConnectionProperties deserializedManagedIdentityAuthTypeConnectionProperties + = new ManagedIdentityAuthTypeConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedManagedIdentityAuthTypeConnectionProperties + .withCategory(ConnectionCategory.fromString(reader.getString())); + } else if ("createdByWorkspaceArmId".equals(fieldName)) { + deserializedManagedIdentityAuthTypeConnectionProperties + .withCreatedByWorkspaceArmId(reader.getString()); + } else if ("error".equals(fieldName)) { + deserializedManagedIdentityAuthTypeConnectionProperties.withError(reader.getString()); + } else if ("expiryTime".equals(fieldName)) { + deserializedManagedIdentityAuthTypeConnectionProperties.withExpiryTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("group".equals(fieldName)) { + deserializedManagedIdentityAuthTypeConnectionProperties + .withGroup(ConnectionGroup.fromString(reader.getString())); + } else if ("isSharedToAll".equals(fieldName)) { + deserializedManagedIdentityAuthTypeConnectionProperties + .withIsSharedToAll(reader.getNullable(JsonReader::getBoolean)); + } else if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedManagedIdentityAuthTypeConnectionProperties.withMetadata(metadata); + } else if ("peRequirement".equals(fieldName)) { + deserializedManagedIdentityAuthTypeConnectionProperties + .withPeRequirement(ManagedPERequirement.fromString(reader.getString())); + } else if ("peStatus".equals(fieldName)) { + deserializedManagedIdentityAuthTypeConnectionProperties + .withPeStatus(ManagedPEStatus.fromString(reader.getString())); + } else if ("sharedUserList".equals(fieldName)) { + List sharedUserList = reader.readArray(reader1 -> reader1.getString()); + deserializedManagedIdentityAuthTypeConnectionProperties.withSharedUserList(sharedUserList); + } else if ("target".equals(fieldName)) { + deserializedManagedIdentityAuthTypeConnectionProperties.withTarget(reader.getString()); + } else if ("useWorkspaceManagedIdentity".equals(fieldName)) { + deserializedManagedIdentityAuthTypeConnectionProperties + .withUseWorkspaceManagedIdentity(reader.getNullable(JsonReader::getBoolean)); + } else if ("authType".equals(fieldName)) { + deserializedManagedIdentityAuthTypeConnectionProperties.authType + = ConnectionAuthType.fromString(reader.getString()); + } else if ("credentials".equals(fieldName)) { + deserializedManagedIdentityAuthTypeConnectionProperties.credentials + = ConnectionManagedIdentity.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedIdentityAuthTypeConnectionProperties; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedPERequirement.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedPERequirement.java new file mode 100644 index 000000000000..aa558bc5e20d --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedPERequirement.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for ManagedPERequirement. + */ +public final class ManagedPERequirement extends ExpandableStringEnum { + /** + * Static value Required for ManagedPERequirement. + */ + public static final ManagedPERequirement REQUIRED = fromString("Required"); + + /** + * Static value NotRequired for ManagedPERequirement. + */ + public static final ManagedPERequirement NOT_REQUIRED = fromString("NotRequired"); + + /** + * Static value NotApplicable for ManagedPERequirement. + */ + public static final ManagedPERequirement NOT_APPLICABLE = fromString("NotApplicable"); + + /** + * Creates a new instance of ManagedPERequirement value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedPERequirement() { + } + + /** + * Creates or finds a ManagedPERequirement from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedPERequirement. + */ + public static ManagedPERequirement fromString(String name) { + return fromString(name, ManagedPERequirement.class); + } + + /** + * Gets known ManagedPERequirement values. + * + * @return known ManagedPERequirement values. + */ + public static Collection values() { + return values(ManagedPERequirement.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedPEStatus.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedPEStatus.java new file mode 100644 index 000000000000..b200a2be3392 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedPEStatus.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for ManagedPEStatus. + */ +public final class ManagedPEStatus extends ExpandableStringEnum { + /** + * Static value Inactive for ManagedPEStatus. + */ + public static final ManagedPEStatus INACTIVE = fromString("Inactive"); + + /** + * Static value Active for ManagedPEStatus. + */ + public static final ManagedPEStatus ACTIVE = fromString("Active"); + + /** + * Static value NotApplicable for ManagedPEStatus. + */ + public static final ManagedPEStatus NOT_APPLICABLE = fromString("NotApplicable"); + + /** + * Creates a new instance of ManagedPEStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedPEStatus() { + } + + /** + * Creates or finds a ManagedPEStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedPEStatus. + */ + public static ManagedPEStatus fromString(String name) { + return fromString(name, ManagedPEStatus.class); + } + + /** + * Gets known ManagedPEStatus values. + * + * @return known ManagedPEStatus values. + */ + public static Collection values() { + return values(ManagedPEStatus.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkInjections.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkInjections.java new file mode 100644 index 000000000000..2e488e53e303 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkInjections.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Specifies in AI Foundry where virtual network injection occurs to secure scenarios like Agents entirely within the + * user's private network, eliminating public internet exposure while maintaining control over network configurations + * and resources. + */ +@Fluent +public final class NetworkInjections implements JsonSerializable { + /* + * Specifies what features in AI Foundry network injection applies to. Currently only supports 'agent' for agent + * scenarios. 'none' means no network injection. + */ + private ScenarioType scenario; + + /* + * Specify the subnet for which your Agent Client is injected into. + */ + private String subnetArmId; + + /* + * Boolean to enable Microsoft Managed Network for subnet delegation + */ + private Boolean useMicrosoftManagedNetwork; + + /** + * Creates an instance of NetworkInjections class. + */ + public NetworkInjections() { + } + + /** + * Get the scenario property: Specifies what features in AI Foundry network injection applies to. Currently only + * supports 'agent' for agent scenarios. 'none' means no network injection. + * + * @return the scenario value. + */ + public ScenarioType scenario() { + return this.scenario; + } + + /** + * Set the scenario property: Specifies what features in AI Foundry network injection applies to. Currently only + * supports 'agent' for agent scenarios. 'none' means no network injection. + * + * @param scenario the scenario value to set. + * @return the NetworkInjections object itself. + */ + public NetworkInjections withScenario(ScenarioType scenario) { + this.scenario = scenario; + return this; + } + + /** + * Get the subnetArmId property: Specify the subnet for which your Agent Client is injected into. + * + * @return the subnetArmId value. + */ + public String subnetArmId() { + return this.subnetArmId; + } + + /** + * Set the subnetArmId property: Specify the subnet for which your Agent Client is injected into. + * + * @param subnetArmId the subnetArmId value to set. + * @return the NetworkInjections object itself. + */ + public NetworkInjections withSubnetArmId(String subnetArmId) { + this.subnetArmId = subnetArmId; + return this; + } + + /** + * Get the useMicrosoftManagedNetwork property: Boolean to enable Microsoft Managed Network for subnet delegation. + * + * @return the useMicrosoftManagedNetwork value. + */ + public Boolean useMicrosoftManagedNetwork() { + return this.useMicrosoftManagedNetwork; + } + + /** + * Set the useMicrosoftManagedNetwork property: Boolean to enable Microsoft Managed Network for subnet delegation. + * + * @param useMicrosoftManagedNetwork the useMicrosoftManagedNetwork value to set. + * @return the NetworkInjections object itself. + */ + public NetworkInjections withUseMicrosoftManagedNetwork(Boolean useMicrosoftManagedNetwork) { + this.useMicrosoftManagedNetwork = useMicrosoftManagedNetwork; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("scenario", this.scenario == null ? null : this.scenario.toString()); + jsonWriter.writeStringField("subnetArmId", this.subnetArmId); + jsonWriter.writeBooleanField("useMicrosoftManagedNetwork", this.useMicrosoftManagedNetwork); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkInjections from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkInjections if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkInjections. + */ + public static NetworkInjections fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkInjections deserializedNetworkInjections = new NetworkInjections(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("scenario".equals(fieldName)) { + deserializedNetworkInjections.scenario = ScenarioType.fromString(reader.getString()); + } else if ("subnetArmId".equals(fieldName)) { + deserializedNetworkInjections.subnetArmId = reader.getString(); + } else if ("useMicrosoftManagedNetwork".equals(fieldName)) { + deserializedNetworkInjections.useMicrosoftManagedNetwork + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkInjections; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NoneAuthTypeConnectionProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NoneAuthTypeConnectionProperties.java new file mode 100644 index 000000000000..7a7f5b91aa72 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NoneAuthTypeConnectionProperties.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Map; + +/** + * The NoneAuthTypeConnectionProperties model. + */ +@Fluent +public final class NoneAuthTypeConnectionProperties extends ConnectionPropertiesV2 { + /* + * Authentication type of the connection target + */ + private ConnectionAuthType authType = ConnectionAuthType.NONE; + + /** + * Creates an instance of NoneAuthTypeConnectionProperties class. + */ + public NoneAuthTypeConnectionProperties() { + } + + /** + * Get the authType property: Authentication type of the connection target. + * + * @return the authType value. + */ + @Override + public ConnectionAuthType authType() { + return this.authType; + } + + /** + * {@inheritDoc} + */ + @Override + public NoneAuthTypeConnectionProperties withCategory(ConnectionCategory category) { + super.withCategory(category); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public NoneAuthTypeConnectionProperties withError(String error) { + super.withError(error); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public NoneAuthTypeConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { + super.withExpiryTime(expiryTime); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public NoneAuthTypeConnectionProperties withIsSharedToAll(Boolean isSharedToAll) { + super.withIsSharedToAll(isSharedToAll); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public NoneAuthTypeConnectionProperties withMetadata(Map metadata) { + super.withMetadata(metadata); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public NoneAuthTypeConnectionProperties withPeRequirement(ManagedPERequirement peRequirement) { + super.withPeRequirement(peRequirement); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public NoneAuthTypeConnectionProperties withPeStatus(ManagedPEStatus peStatus) { + super.withPeStatus(peStatus); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public NoneAuthTypeConnectionProperties withSharedUserList(List sharedUserList) { + super.withSharedUserList(sharedUserList); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public NoneAuthTypeConnectionProperties withTarget(String target) { + super.withTarget(target); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public NoneAuthTypeConnectionProperties withUseWorkspaceManagedIdentity(Boolean useWorkspaceManagedIdentity) { + super.withUseWorkspaceManagedIdentity(useWorkspaceManagedIdentity); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", category() == null ? null : category().toString()); + jsonWriter.writeStringField("error", error()); + jsonWriter.writeStringField("expiryTime", + expiryTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expiryTime())); + jsonWriter.writeBooleanField("isSharedToAll", isSharedToAll()); + jsonWriter.writeMapField("metadata", metadata(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("peRequirement", peRequirement() == null ? null : peRequirement().toString()); + jsonWriter.writeStringField("peStatus", peStatus() == null ? null : peStatus().toString()); + jsonWriter.writeArrayField("sharedUserList", sharedUserList(), + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("target", target()); + jsonWriter.writeBooleanField("useWorkspaceManagedIdentity", useWorkspaceManagedIdentity()); + jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NoneAuthTypeConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NoneAuthTypeConnectionProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NoneAuthTypeConnectionProperties. + */ + public static NoneAuthTypeConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NoneAuthTypeConnectionProperties deserializedNoneAuthTypeConnectionProperties + = new NoneAuthTypeConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedNoneAuthTypeConnectionProperties + .withCategory(ConnectionCategory.fromString(reader.getString())); + } else if ("createdByWorkspaceArmId".equals(fieldName)) { + deserializedNoneAuthTypeConnectionProperties.withCreatedByWorkspaceArmId(reader.getString()); + } else if ("error".equals(fieldName)) { + deserializedNoneAuthTypeConnectionProperties.withError(reader.getString()); + } else if ("expiryTime".equals(fieldName)) { + deserializedNoneAuthTypeConnectionProperties.withExpiryTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("group".equals(fieldName)) { + deserializedNoneAuthTypeConnectionProperties + .withGroup(ConnectionGroup.fromString(reader.getString())); + } else if ("isSharedToAll".equals(fieldName)) { + deserializedNoneAuthTypeConnectionProperties + .withIsSharedToAll(reader.getNullable(JsonReader::getBoolean)); + } else if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedNoneAuthTypeConnectionProperties.withMetadata(metadata); + } else if ("peRequirement".equals(fieldName)) { + deserializedNoneAuthTypeConnectionProperties + .withPeRequirement(ManagedPERequirement.fromString(reader.getString())); + } else if ("peStatus".equals(fieldName)) { + deserializedNoneAuthTypeConnectionProperties + .withPeStatus(ManagedPEStatus.fromString(reader.getString())); + } else if ("sharedUserList".equals(fieldName)) { + List sharedUserList = reader.readArray(reader1 -> reader1.getString()); + deserializedNoneAuthTypeConnectionProperties.withSharedUserList(sharedUserList); + } else if ("target".equals(fieldName)) { + deserializedNoneAuthTypeConnectionProperties.withTarget(reader.getString()); + } else if ("useWorkspaceManagedIdentity".equals(fieldName)) { + deserializedNoneAuthTypeConnectionProperties + .withUseWorkspaceManagedIdentity(reader.getNullable(JsonReader::getBoolean)); + } else if ("authType".equals(fieldName)) { + deserializedNoneAuthTypeConnectionProperties.authType + = ConnectionAuthType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedNoneAuthTypeConnectionProperties; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OAuth2AuthTypeConnectionProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OAuth2AuthTypeConnectionProperties.java new file mode 100644 index 000000000000..9f4452be4425 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OAuth2AuthTypeConnectionProperties.java @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Map; + +/** + * The OAuth2AuthTypeConnectionProperties model. + */ +@Fluent +public final class OAuth2AuthTypeConnectionProperties extends ConnectionPropertiesV2 { + /* + * Authentication type of the connection target + */ + private ConnectionAuthType authType = ConnectionAuthType.OAUTH2; + + /* + * ClientId and ClientSecret are required. Other properties are optional + * depending on each OAuth2 provider's implementation. + */ + private ConnectionOAuth2 credentials; + + /** + * Creates an instance of OAuth2AuthTypeConnectionProperties class. + */ + public OAuth2AuthTypeConnectionProperties() { + } + + /** + * Get the authType property: Authentication type of the connection target. + * + * @return the authType value. + */ + @Override + public ConnectionAuthType authType() { + return this.authType; + } + + /** + * Get the credentials property: ClientId and ClientSecret are required. Other properties are optional + * depending on each OAuth2 provider's implementation. + * + * @return the credentials value. + */ + public ConnectionOAuth2 credentials() { + return this.credentials; + } + + /** + * Set the credentials property: ClientId and ClientSecret are required. Other properties are optional + * depending on each OAuth2 provider's implementation. + * + * @param credentials the credentials value to set. + * @return the OAuth2AuthTypeConnectionProperties object itself. + */ + public OAuth2AuthTypeConnectionProperties withCredentials(ConnectionOAuth2 credentials) { + this.credentials = credentials; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OAuth2AuthTypeConnectionProperties withCategory(ConnectionCategory category) { + super.withCategory(category); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OAuth2AuthTypeConnectionProperties withError(String error) { + super.withError(error); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OAuth2AuthTypeConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { + super.withExpiryTime(expiryTime); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OAuth2AuthTypeConnectionProperties withIsSharedToAll(Boolean isSharedToAll) { + super.withIsSharedToAll(isSharedToAll); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OAuth2AuthTypeConnectionProperties withMetadata(Map metadata) { + super.withMetadata(metadata); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OAuth2AuthTypeConnectionProperties withPeRequirement(ManagedPERequirement peRequirement) { + super.withPeRequirement(peRequirement); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OAuth2AuthTypeConnectionProperties withPeStatus(ManagedPEStatus peStatus) { + super.withPeStatus(peStatus); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OAuth2AuthTypeConnectionProperties withSharedUserList(List sharedUserList) { + super.withSharedUserList(sharedUserList); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OAuth2AuthTypeConnectionProperties withTarget(String target) { + super.withTarget(target); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OAuth2AuthTypeConnectionProperties withUseWorkspaceManagedIdentity(Boolean useWorkspaceManagedIdentity) { + super.withUseWorkspaceManagedIdentity(useWorkspaceManagedIdentity); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (credentials() != null) { + credentials().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", category() == null ? null : category().toString()); + jsonWriter.writeStringField("error", error()); + jsonWriter.writeStringField("expiryTime", + expiryTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expiryTime())); + jsonWriter.writeBooleanField("isSharedToAll", isSharedToAll()); + jsonWriter.writeMapField("metadata", metadata(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("peRequirement", peRequirement() == null ? null : peRequirement().toString()); + jsonWriter.writeStringField("peStatus", peStatus() == null ? null : peStatus().toString()); + jsonWriter.writeArrayField("sharedUserList", sharedUserList(), + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("target", target()); + jsonWriter.writeBooleanField("useWorkspaceManagedIdentity", useWorkspaceManagedIdentity()); + jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); + jsonWriter.writeJsonField("credentials", this.credentials); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OAuth2AuthTypeConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OAuth2AuthTypeConnectionProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OAuth2AuthTypeConnectionProperties. + */ + public static OAuth2AuthTypeConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OAuth2AuthTypeConnectionProperties deserializedOAuth2AuthTypeConnectionProperties + = new OAuth2AuthTypeConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedOAuth2AuthTypeConnectionProperties + .withCategory(ConnectionCategory.fromString(reader.getString())); + } else if ("createdByWorkspaceArmId".equals(fieldName)) { + deserializedOAuth2AuthTypeConnectionProperties.withCreatedByWorkspaceArmId(reader.getString()); + } else if ("error".equals(fieldName)) { + deserializedOAuth2AuthTypeConnectionProperties.withError(reader.getString()); + } else if ("expiryTime".equals(fieldName)) { + deserializedOAuth2AuthTypeConnectionProperties.withExpiryTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("group".equals(fieldName)) { + deserializedOAuth2AuthTypeConnectionProperties + .withGroup(ConnectionGroup.fromString(reader.getString())); + } else if ("isSharedToAll".equals(fieldName)) { + deserializedOAuth2AuthTypeConnectionProperties + .withIsSharedToAll(reader.getNullable(JsonReader::getBoolean)); + } else if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedOAuth2AuthTypeConnectionProperties.withMetadata(metadata); + } else if ("peRequirement".equals(fieldName)) { + deserializedOAuth2AuthTypeConnectionProperties + .withPeRequirement(ManagedPERequirement.fromString(reader.getString())); + } else if ("peStatus".equals(fieldName)) { + deserializedOAuth2AuthTypeConnectionProperties + .withPeStatus(ManagedPEStatus.fromString(reader.getString())); + } else if ("sharedUserList".equals(fieldName)) { + List sharedUserList = reader.readArray(reader1 -> reader1.getString()); + deserializedOAuth2AuthTypeConnectionProperties.withSharedUserList(sharedUserList); + } else if ("target".equals(fieldName)) { + deserializedOAuth2AuthTypeConnectionProperties.withTarget(reader.getString()); + } else if ("useWorkspaceManagedIdentity".equals(fieldName)) { + deserializedOAuth2AuthTypeConnectionProperties + .withUseWorkspaceManagedIdentity(reader.getNullable(JsonReader::getBoolean)); + } else if ("authType".equals(fieldName)) { + deserializedOAuth2AuthTypeConnectionProperties.authType + = ConnectionAuthType.fromString(reader.getString()); + } else if ("credentials".equals(fieldName)) { + deserializedOAuth2AuthTypeConnectionProperties.credentials = ConnectionOAuth2.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOAuth2AuthTypeConnectionProperties; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PatAuthTypeConnectionProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PatAuthTypeConnectionProperties.java new file mode 100644 index 000000000000..15729e0dfc9c --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PatAuthTypeConnectionProperties.java @@ -0,0 +1,257 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Map; + +/** + * The PatAuthTypeConnectionProperties model. + */ +@Fluent +public final class PatAuthTypeConnectionProperties extends ConnectionPropertiesV2 { + /* + * Authentication type of the connection target + */ + private ConnectionAuthType authType = ConnectionAuthType.PAT; + + /* + * The credentials property. + */ + private ConnectionPersonalAccessToken credentials; + + /** + * Creates an instance of PatAuthTypeConnectionProperties class. + */ + public PatAuthTypeConnectionProperties() { + } + + /** + * Get the authType property: Authentication type of the connection target. + * + * @return the authType value. + */ + @Override + public ConnectionAuthType authType() { + return this.authType; + } + + /** + * Get the credentials property: The credentials property. + * + * @return the credentials value. + */ + public ConnectionPersonalAccessToken credentials() { + return this.credentials; + } + + /** + * Set the credentials property: The credentials property. + * + * @param credentials the credentials value to set. + * @return the PatAuthTypeConnectionProperties object itself. + */ + public PatAuthTypeConnectionProperties withCredentials(ConnectionPersonalAccessToken credentials) { + this.credentials = credentials; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PatAuthTypeConnectionProperties withCategory(ConnectionCategory category) { + super.withCategory(category); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PatAuthTypeConnectionProperties withError(String error) { + super.withError(error); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PatAuthTypeConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { + super.withExpiryTime(expiryTime); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PatAuthTypeConnectionProperties withIsSharedToAll(Boolean isSharedToAll) { + super.withIsSharedToAll(isSharedToAll); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PatAuthTypeConnectionProperties withMetadata(Map metadata) { + super.withMetadata(metadata); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PatAuthTypeConnectionProperties withPeRequirement(ManagedPERequirement peRequirement) { + super.withPeRequirement(peRequirement); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PatAuthTypeConnectionProperties withPeStatus(ManagedPEStatus peStatus) { + super.withPeStatus(peStatus); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PatAuthTypeConnectionProperties withSharedUserList(List sharedUserList) { + super.withSharedUserList(sharedUserList); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PatAuthTypeConnectionProperties withTarget(String target) { + super.withTarget(target); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PatAuthTypeConnectionProperties withUseWorkspaceManagedIdentity(Boolean useWorkspaceManagedIdentity) { + super.withUseWorkspaceManagedIdentity(useWorkspaceManagedIdentity); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (credentials() != null) { + credentials().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", category() == null ? null : category().toString()); + jsonWriter.writeStringField("error", error()); + jsonWriter.writeStringField("expiryTime", + expiryTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expiryTime())); + jsonWriter.writeBooleanField("isSharedToAll", isSharedToAll()); + jsonWriter.writeMapField("metadata", metadata(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("peRequirement", peRequirement() == null ? null : peRequirement().toString()); + jsonWriter.writeStringField("peStatus", peStatus() == null ? null : peStatus().toString()); + jsonWriter.writeArrayField("sharedUserList", sharedUserList(), + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("target", target()); + jsonWriter.writeBooleanField("useWorkspaceManagedIdentity", useWorkspaceManagedIdentity()); + jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); + jsonWriter.writeJsonField("credentials", this.credentials); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PatAuthTypeConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PatAuthTypeConnectionProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PatAuthTypeConnectionProperties. + */ + public static PatAuthTypeConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PatAuthTypeConnectionProperties deserializedPatAuthTypeConnectionProperties + = new PatAuthTypeConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedPatAuthTypeConnectionProperties + .withCategory(ConnectionCategory.fromString(reader.getString())); + } else if ("createdByWorkspaceArmId".equals(fieldName)) { + deserializedPatAuthTypeConnectionProperties.withCreatedByWorkspaceArmId(reader.getString()); + } else if ("error".equals(fieldName)) { + deserializedPatAuthTypeConnectionProperties.withError(reader.getString()); + } else if ("expiryTime".equals(fieldName)) { + deserializedPatAuthTypeConnectionProperties.withExpiryTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("group".equals(fieldName)) { + deserializedPatAuthTypeConnectionProperties + .withGroup(ConnectionGroup.fromString(reader.getString())); + } else if ("isSharedToAll".equals(fieldName)) { + deserializedPatAuthTypeConnectionProperties + .withIsSharedToAll(reader.getNullable(JsonReader::getBoolean)); + } else if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedPatAuthTypeConnectionProperties.withMetadata(metadata); + } else if ("peRequirement".equals(fieldName)) { + deserializedPatAuthTypeConnectionProperties + .withPeRequirement(ManagedPERequirement.fromString(reader.getString())); + } else if ("peStatus".equals(fieldName)) { + deserializedPatAuthTypeConnectionProperties + .withPeStatus(ManagedPEStatus.fromString(reader.getString())); + } else if ("sharedUserList".equals(fieldName)) { + List sharedUserList = reader.readArray(reader1 -> reader1.getString()); + deserializedPatAuthTypeConnectionProperties.withSharedUserList(sharedUserList); + } else if ("target".equals(fieldName)) { + deserializedPatAuthTypeConnectionProperties.withTarget(reader.getString()); + } else if ("useWorkspaceManagedIdentity".equals(fieldName)) { + deserializedPatAuthTypeConnectionProperties + .withUseWorkspaceManagedIdentity(reader.getNullable(JsonReader::getBoolean)); + } else if ("authType".equals(fieldName)) { + deserializedPatAuthTypeConnectionProperties.authType + = ConnectionAuthType.fromString(reader.getString()); + } else if ("credentials".equals(fieldName)) { + deserializedPatAuthTypeConnectionProperties.credentials + = ConnectionPersonalAccessToken.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPatAuthTypeConnectionProperties; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Project.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Project.java new file mode 100644 index 000000000000..93630cc08af5 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Project.java @@ -0,0 +1,307 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ProjectInner; +import java.util.Map; + +/** + * An immutable client-side representation of Project. + */ +public interface Project { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: Resource Etag. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the identity property: Identity for the resource. + * + * @return the identity value. + */ + Identity identity(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the properties property: Properties of Cognitive Services project. + * + * @return the properties value. + */ + ProjectProperties properties(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.ProjectInner object. + * + * @return the inner object. + */ + ProjectInner innerModel(); + + /** + * The entirety of the Project definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The Project definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Project definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the Project definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @return the next definition stage. + */ + WithCreate withExistingAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the Project definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithLocation, DefinitionStages.WithTags, + DefinitionStages.WithIdentity, DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + Project create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Project create(Context context); + } + + /** + * The stage of the Project definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + + /** + * The stage of the Project definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the Project definition allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: Identity for the resource.. + * + * @param identity Identity for the resource. + * @return the next definition stage. + */ + WithCreate withIdentity(Identity identity); + } + + /** + * The stage of the Project definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Properties of Cognitive Services project.. + * + * @param properties Properties of Cognitive Services project. + * @return the next definition stage. + */ + WithCreate withProperties(ProjectProperties properties); + } + } + + /** + * Begins update for the Project resource. + * + * @return the stage of resource update. + */ + Project.Update update(); + + /** + * The template for Project update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Project apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Project apply(Context context); + } + + /** + * The Project update stages. + */ + interface UpdateStages { + /** + * The stage of the Project update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** + * The stage of the Project update allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: Identity for the resource.. + * + * @param identity Identity for the resource. + * @return the next definition stage. + */ + Update withIdentity(Identity identity); + } + + /** + * The stage of the Project update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Properties of Cognitive Services project.. + * + * @param properties Properties of Cognitive Services project. + * @return the next definition stage. + */ + Update withProperties(ProjectProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Project refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Project refresh(Context context); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectCapabilityHosts.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectCapabilityHosts.java new file mode 100644 index 000000000000..21374eb2d77c --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectCapabilityHosts.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cognitiveservices.fluent.models.CapabilityHostInner; + +/** + * Resource collection API of ProjectCapabilityHosts. + */ +public interface ProjectCapabilityHosts { + /** + * Delete project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String projectName, String capabilityHostname); + + /** + * Delete project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String projectName, String capabilityHostname, + Context context); + + /** + * Get project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return project capabilityHost along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String accountName, String projectName, + String capabilityHostname, Context context); + + /** + * Get project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return project capabilityHost. + */ + CapabilityHost get(String resourceGroupName, String accountName, String projectName, String capabilityHostname); + + /** + * Create or update project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param body CapabilityHost definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + CapabilityHost createOrUpdate(String resourceGroupName, String accountName, String projectName, + String capabilityHostname, CapabilityHostInner body); + + /** + * Create or update project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param body CapabilityHost definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. + */ + CapabilityHost createOrUpdate(String resourceGroupName, String accountName, String projectName, + String capabilityHostname, CapabilityHostInner body, Context context); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectConnections.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectConnections.java new file mode 100644 index 000000000000..98a6044838eb --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectConnections.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ConnectionPropertiesV2BasicResourceInner; + +/** + * Resource collection API of ProjectConnections. + */ +public interface ProjectConnections { + /** + * Delete Cognitive Services project connection by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param connectionName Friendly name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String accountName, String projectName, + String connectionName, Context context); + + /** + * Delete Cognitive Services project connection by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param connectionName Friendly name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String projectName, String connectionName); + + /** + * Lists Cognitive Services project connection by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param connectionName Friendly name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String accountName, + String projectName, String connectionName, Context context); + + /** + * Lists Cognitive Services project connection by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param connectionName Friendly name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema. + */ + ConnectionPropertiesV2BasicResource get(String resourceGroupName, String accountName, String projectName, + String connectionName); + + /** + * Update Cognitive Services project connection under the specified project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param connectionName Friendly name of the connection. + * @param body Parameters for account connection update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema along with {@link Response}. + */ + Response updateWithResponse(String resourceGroupName, String accountName, + String projectName, String connectionName, ConnectionUpdateContent body, Context context); + + /** + * Update Cognitive Services project connection under the specified project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param connectionName Friendly name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema. + */ + ConnectionPropertiesV2BasicResource update(String resourceGroupName, String accountName, String projectName, + String connectionName); + + /** + * Create or update Cognitive Services project connection under the specified project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param connectionName Friendly name of the connection. + * @param body The object for creating or updating a new account connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema along with {@link Response}. + */ + Response createWithResponse(String resourceGroupName, String accountName, + String projectName, String connectionName, ConnectionPropertiesV2BasicResourceInner body, Context context); + + /** + * Create or update Cognitive Services project connection under the specified project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param connectionName Friendly name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema. + */ + ConnectionPropertiesV2BasicResource create(String resourceGroupName, String accountName, String projectName, + String connectionName); + + /** + * Lists all the available Cognitive Services project connections under the specified project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName, + String projectName); + + /** + * Lists all the available Cognitive Services project connections under the specified project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param target Target of the connection. + * @param category Category of the connection. + * @param includeAll query parameter that indicates if get connection call should return both connections and + * datastores. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName, + String projectName, String target, String category, Boolean includeAll, Context context); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectListResult.java new file mode 100644 index 000000000000..a2e929f31ac2 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectListResult.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ProjectInner; +import java.io.IOException; +import java.util.List; + +/** + * The list of cognitive services projects operation response. + */ +@Fluent +public final class ProjectListResult implements JsonSerializable { + /* + * The link used to get the next page of projects. + */ + private String nextLink; + + /* + * Gets the list of Cognitive Services projects and their properties. + */ + private List value; + + /** + * Creates an instance of ProjectListResult class. + */ + public ProjectListResult() { + } + + /** + * Get the nextLink property: The link used to get the next page of projects. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link used to get the next page of projects. + * + * @param nextLink the nextLink value to set. + * @return the ProjectListResult object itself. + */ + public ProjectListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: Gets the list of Cognitive Services projects and their properties. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProjectListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProjectListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ProjectListResult. + */ + public static ProjectListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProjectListResult deserializedProjectListResult = new ProjectListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedProjectListResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> ProjectInner.fromJson(reader1)); + deserializedProjectListResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedProjectListResult; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectProperties.java new file mode 100644 index 000000000000..062562ac1c6e --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectProperties.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Properties of Cognitive Services Project'. + */ +@Fluent +public final class ProjectProperties implements JsonSerializable { + /* + * Gets the status of the cognitive services project at the time the operation was called. + */ + private ProvisioningState provisioningState; + + /* + * The display name of the Cognitive Services Project. + */ + private String displayName; + + /* + * The description of the Cognitive Services Project. + */ + private String description; + + /* + * The list of endpoint for this Cognitive Services Project. + */ + private Map endpoints; + + /* + * Indicates whether the project is the default project for the account. + */ + private Boolean isDefault; + + /** + * Creates an instance of ProjectProperties class. + */ + public ProjectProperties() { + } + + /** + * Get the provisioningState property: Gets the status of the cognitive services project at the time the operation + * was called. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the displayName property: The display name of the Cognitive Services Project. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The display name of the Cognitive Services Project. + * + * @param displayName the displayName value to set. + * @return the ProjectProperties object itself. + */ + public ProjectProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the description property: The description of the Cognitive Services Project. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the Cognitive Services Project. + * + * @param description the description value to set. + * @return the ProjectProperties object itself. + */ + public ProjectProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the endpoints property: The list of endpoint for this Cognitive Services Project. + * + * @return the endpoints value. + */ + public Map endpoints() { + return this.endpoints; + } + + /** + * Get the isDefault property: Indicates whether the project is the default project for the account. + * + * @return the isDefault value. + */ + public Boolean isDefault() { + return this.isDefault; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProjectProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProjectProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ProjectProperties. + */ + public static ProjectProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProjectProperties deserializedProjectProperties = new ProjectProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedProjectProperties.provisioningState = ProvisioningState.fromString(reader.getString()); + } else if ("displayName".equals(fieldName)) { + deserializedProjectProperties.displayName = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedProjectProperties.description = reader.getString(); + } else if ("endpoints".equals(fieldName)) { + Map endpoints = reader.readMap(reader1 -> reader1.getString()); + deserializedProjectProperties.endpoints = endpoints; + } else if ("isDefault".equals(fieldName)) { + deserializedProjectProperties.isDefault = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedProjectProperties; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Projects.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Projects.java new file mode 100644 index 000000000000..42a83edf52c2 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Projects.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Projects. + */ +public interface Projects { + /** + * Deletes a Cognitive Services project from the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String projectName); + + /** + * Deletes a Cognitive Services project from the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String projectName, Context context); + + /** + * Returns a Cognitive Services project specified by the parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's + * type, location and SKU along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String accountName, String projectName, + Context context); + + /** + * Returns a Cognitive Services project specified by the parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's + * type, location and SKU. + */ + Project get(String resourceGroupName, String accountName, String projectName); + + /** + * Returns all the projects in a Cognitive Services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of cognitive services projects operation response as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Returns all the projects in a Cognitive Services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of cognitive services projects operation response as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName, Context context); + + /** + * Returns a Cognitive Services project specified by the parameters. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's + * type, location and SKU along with {@link Response}. + */ + Project getById(String id); + + /** + * Returns a Cognitive Services project specified by the parameters. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's + * type, location and SKU along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a Cognitive Services project from the resource group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a Cognitive Services project from the resource group. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Project resource. + * + * @param name resource name. + * @return the first stage of the new Project definition. + */ + Project.DefinitionStages.Blank define(String name); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProvisioningState.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProvisioningState.java index f9f9c950a862..ff0de17bad37 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProvisioningState.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProvisioningState.java @@ -46,6 +46,11 @@ public final class ProvisioningState extends ExpandableStringEnum { /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicyProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicyProperties.java index 07506b1a079e..767c42a0ba8b 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicyProperties.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicyProperties.java @@ -24,7 +24,7 @@ public final class RaiPolicyProperties implements JsonSerializable { + /* + * The asset description text. + */ + private String description; + + /* + * Tag dictionary. Tags can be added, removed, and updated. + */ + private Map tags; + + /** + * Creates an instance of ResourceBase class. + */ + public ResourceBase() { + } + + /** + * Get the description property: The asset description text. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The asset description text. + * + * @param description the description value to set. + * @return the ResourceBase object itself. + */ + public ResourceBase withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the tags property: Tag dictionary. Tags can be added, removed, and updated. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Tag dictionary. Tags can be added, removed, and updated. + * + * @param tags the tags value to set. + * @return the ResourceBase object itself. + */ + public ResourceBase withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceBase from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceBase if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceBase. + */ + public static ResourceBase fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceBase deserializedResourceBase = new ResourceBase(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedResourceBase.description = reader.getString(); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedResourceBase.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedResourceBase; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SasAuthTypeConnectionProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SasAuthTypeConnectionProperties.java new file mode 100644 index 000000000000..86ff330992d9 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SasAuthTypeConnectionProperties.java @@ -0,0 +1,257 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Map; + +/** + * The SasAuthTypeConnectionProperties model. + */ +@Fluent +public final class SasAuthTypeConnectionProperties extends ConnectionPropertiesV2 { + /* + * Authentication type of the connection target + */ + private ConnectionAuthType authType = ConnectionAuthType.SAS; + + /* + * The credentials property. + */ + private ConnectionSharedAccessSignature credentials; + + /** + * Creates an instance of SasAuthTypeConnectionProperties class. + */ + public SasAuthTypeConnectionProperties() { + } + + /** + * Get the authType property: Authentication type of the connection target. + * + * @return the authType value. + */ + @Override + public ConnectionAuthType authType() { + return this.authType; + } + + /** + * Get the credentials property: The credentials property. + * + * @return the credentials value. + */ + public ConnectionSharedAccessSignature credentials() { + return this.credentials; + } + + /** + * Set the credentials property: The credentials property. + * + * @param credentials the credentials value to set. + * @return the SasAuthTypeConnectionProperties object itself. + */ + public SasAuthTypeConnectionProperties withCredentials(ConnectionSharedAccessSignature credentials) { + this.credentials = credentials; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SasAuthTypeConnectionProperties withCategory(ConnectionCategory category) { + super.withCategory(category); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SasAuthTypeConnectionProperties withError(String error) { + super.withError(error); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SasAuthTypeConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { + super.withExpiryTime(expiryTime); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SasAuthTypeConnectionProperties withIsSharedToAll(Boolean isSharedToAll) { + super.withIsSharedToAll(isSharedToAll); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SasAuthTypeConnectionProperties withMetadata(Map metadata) { + super.withMetadata(metadata); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SasAuthTypeConnectionProperties withPeRequirement(ManagedPERequirement peRequirement) { + super.withPeRequirement(peRequirement); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SasAuthTypeConnectionProperties withPeStatus(ManagedPEStatus peStatus) { + super.withPeStatus(peStatus); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SasAuthTypeConnectionProperties withSharedUserList(List sharedUserList) { + super.withSharedUserList(sharedUserList); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SasAuthTypeConnectionProperties withTarget(String target) { + super.withTarget(target); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SasAuthTypeConnectionProperties withUseWorkspaceManagedIdentity(Boolean useWorkspaceManagedIdentity) { + super.withUseWorkspaceManagedIdentity(useWorkspaceManagedIdentity); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (credentials() != null) { + credentials().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", category() == null ? null : category().toString()); + jsonWriter.writeStringField("error", error()); + jsonWriter.writeStringField("expiryTime", + expiryTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expiryTime())); + jsonWriter.writeBooleanField("isSharedToAll", isSharedToAll()); + jsonWriter.writeMapField("metadata", metadata(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("peRequirement", peRequirement() == null ? null : peRequirement().toString()); + jsonWriter.writeStringField("peStatus", peStatus() == null ? null : peStatus().toString()); + jsonWriter.writeArrayField("sharedUserList", sharedUserList(), + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("target", target()); + jsonWriter.writeBooleanField("useWorkspaceManagedIdentity", useWorkspaceManagedIdentity()); + jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); + jsonWriter.writeJsonField("credentials", this.credentials); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SasAuthTypeConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SasAuthTypeConnectionProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SasAuthTypeConnectionProperties. + */ + public static SasAuthTypeConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SasAuthTypeConnectionProperties deserializedSasAuthTypeConnectionProperties + = new SasAuthTypeConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedSasAuthTypeConnectionProperties + .withCategory(ConnectionCategory.fromString(reader.getString())); + } else if ("createdByWorkspaceArmId".equals(fieldName)) { + deserializedSasAuthTypeConnectionProperties.withCreatedByWorkspaceArmId(reader.getString()); + } else if ("error".equals(fieldName)) { + deserializedSasAuthTypeConnectionProperties.withError(reader.getString()); + } else if ("expiryTime".equals(fieldName)) { + deserializedSasAuthTypeConnectionProperties.withExpiryTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("group".equals(fieldName)) { + deserializedSasAuthTypeConnectionProperties + .withGroup(ConnectionGroup.fromString(reader.getString())); + } else if ("isSharedToAll".equals(fieldName)) { + deserializedSasAuthTypeConnectionProperties + .withIsSharedToAll(reader.getNullable(JsonReader::getBoolean)); + } else if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedSasAuthTypeConnectionProperties.withMetadata(metadata); + } else if ("peRequirement".equals(fieldName)) { + deserializedSasAuthTypeConnectionProperties + .withPeRequirement(ManagedPERequirement.fromString(reader.getString())); + } else if ("peStatus".equals(fieldName)) { + deserializedSasAuthTypeConnectionProperties + .withPeStatus(ManagedPEStatus.fromString(reader.getString())); + } else if ("sharedUserList".equals(fieldName)) { + List sharedUserList = reader.readArray(reader1 -> reader1.getString()); + deserializedSasAuthTypeConnectionProperties.withSharedUserList(sharedUserList); + } else if ("target".equals(fieldName)) { + deserializedSasAuthTypeConnectionProperties.withTarget(reader.getString()); + } else if ("useWorkspaceManagedIdentity".equals(fieldName)) { + deserializedSasAuthTypeConnectionProperties + .withUseWorkspaceManagedIdentity(reader.getNullable(JsonReader::getBoolean)); + } else if ("authType".equals(fieldName)) { + deserializedSasAuthTypeConnectionProperties.authType + = ConnectionAuthType.fromString(reader.getString()); + } else if ("credentials".equals(fieldName)) { + deserializedSasAuthTypeConnectionProperties.credentials + = ConnectionSharedAccessSignature.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSasAuthTypeConnectionProperties; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ScenarioType.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ScenarioType.java new file mode 100644 index 000000000000..7c99f09da556 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ScenarioType.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specifies what features in AI Foundry network injection applies to. Currently only supports 'agent' for agent + * scenarios. 'none' means no network injection. + */ +public final class ScenarioType extends ExpandableStringEnum { + /** + * Static value none for ScenarioType. + */ + public static final ScenarioType NONE = fromString("none"); + + /** + * Static value agent for ScenarioType. + */ + public static final ScenarioType AGENT = fromString("agent"); + + /** + * Creates a new instance of ScenarioType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ScenarioType() { + } + + /** + * Creates or finds a ScenarioType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ScenarioType. + */ + public static ScenarioType fromString(String name) { + return fromString(name, ScenarioType.class); + } + + /** + * Gets known ScenarioType values. + * + * @return known ScenarioType values. + */ + public static Collection values() { + return values(ScenarioType.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ServicePrincipalAuthTypeConnectionProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ServicePrincipalAuthTypeConnectionProperties.java new file mode 100644 index 000000000000..c405a2f5b2e3 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ServicePrincipalAuthTypeConnectionProperties.java @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Map; + +/** + * The ServicePrincipalAuthTypeConnectionProperties model. + */ +@Fluent +public final class ServicePrincipalAuthTypeConnectionProperties extends ConnectionPropertiesV2 { + /* + * Authentication type of the connection target + */ + private ConnectionAuthType authType = ConnectionAuthType.SERVICE_PRINCIPAL; + + /* + * The credentials property. + */ + private ConnectionServicePrincipal credentials; + + /** + * Creates an instance of ServicePrincipalAuthTypeConnectionProperties class. + */ + public ServicePrincipalAuthTypeConnectionProperties() { + } + + /** + * Get the authType property: Authentication type of the connection target. + * + * @return the authType value. + */ + @Override + public ConnectionAuthType authType() { + return this.authType; + } + + /** + * Get the credentials property: The credentials property. + * + * @return the credentials value. + */ + public ConnectionServicePrincipal credentials() { + return this.credentials; + } + + /** + * Set the credentials property: The credentials property. + * + * @param credentials the credentials value to set. + * @return the ServicePrincipalAuthTypeConnectionProperties object itself. + */ + public ServicePrincipalAuthTypeConnectionProperties withCredentials(ConnectionServicePrincipal credentials) { + this.credentials = credentials; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ServicePrincipalAuthTypeConnectionProperties withCategory(ConnectionCategory category) { + super.withCategory(category); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ServicePrincipalAuthTypeConnectionProperties withError(String error) { + super.withError(error); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ServicePrincipalAuthTypeConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { + super.withExpiryTime(expiryTime); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ServicePrincipalAuthTypeConnectionProperties withIsSharedToAll(Boolean isSharedToAll) { + super.withIsSharedToAll(isSharedToAll); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ServicePrincipalAuthTypeConnectionProperties withMetadata(Map metadata) { + super.withMetadata(metadata); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ServicePrincipalAuthTypeConnectionProperties withPeRequirement(ManagedPERequirement peRequirement) { + super.withPeRequirement(peRequirement); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ServicePrincipalAuthTypeConnectionProperties withPeStatus(ManagedPEStatus peStatus) { + super.withPeStatus(peStatus); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ServicePrincipalAuthTypeConnectionProperties withSharedUserList(List sharedUserList) { + super.withSharedUserList(sharedUserList); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ServicePrincipalAuthTypeConnectionProperties withTarget(String target) { + super.withTarget(target); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ServicePrincipalAuthTypeConnectionProperties + withUseWorkspaceManagedIdentity(Boolean useWorkspaceManagedIdentity) { + super.withUseWorkspaceManagedIdentity(useWorkspaceManagedIdentity); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (credentials() != null) { + credentials().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", category() == null ? null : category().toString()); + jsonWriter.writeStringField("error", error()); + jsonWriter.writeStringField("expiryTime", + expiryTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expiryTime())); + jsonWriter.writeBooleanField("isSharedToAll", isSharedToAll()); + jsonWriter.writeMapField("metadata", metadata(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("peRequirement", peRequirement() == null ? null : peRequirement().toString()); + jsonWriter.writeStringField("peStatus", peStatus() == null ? null : peStatus().toString()); + jsonWriter.writeArrayField("sharedUserList", sharedUserList(), + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("target", target()); + jsonWriter.writeBooleanField("useWorkspaceManagedIdentity", useWorkspaceManagedIdentity()); + jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); + jsonWriter.writeJsonField("credentials", this.credentials); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServicePrincipalAuthTypeConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServicePrincipalAuthTypeConnectionProperties if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServicePrincipalAuthTypeConnectionProperties. + */ + public static ServicePrincipalAuthTypeConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServicePrincipalAuthTypeConnectionProperties deserializedServicePrincipalAuthTypeConnectionProperties + = new ServicePrincipalAuthTypeConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedServicePrincipalAuthTypeConnectionProperties + .withCategory(ConnectionCategory.fromString(reader.getString())); + } else if ("createdByWorkspaceArmId".equals(fieldName)) { + deserializedServicePrincipalAuthTypeConnectionProperties + .withCreatedByWorkspaceArmId(reader.getString()); + } else if ("error".equals(fieldName)) { + deserializedServicePrincipalAuthTypeConnectionProperties.withError(reader.getString()); + } else if ("expiryTime".equals(fieldName)) { + deserializedServicePrincipalAuthTypeConnectionProperties.withExpiryTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("group".equals(fieldName)) { + deserializedServicePrincipalAuthTypeConnectionProperties + .withGroup(ConnectionGroup.fromString(reader.getString())); + } else if ("isSharedToAll".equals(fieldName)) { + deserializedServicePrincipalAuthTypeConnectionProperties + .withIsSharedToAll(reader.getNullable(JsonReader::getBoolean)); + } else if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedServicePrincipalAuthTypeConnectionProperties.withMetadata(metadata); + } else if ("peRequirement".equals(fieldName)) { + deserializedServicePrincipalAuthTypeConnectionProperties + .withPeRequirement(ManagedPERequirement.fromString(reader.getString())); + } else if ("peStatus".equals(fieldName)) { + deserializedServicePrincipalAuthTypeConnectionProperties + .withPeStatus(ManagedPEStatus.fromString(reader.getString())); + } else if ("sharedUserList".equals(fieldName)) { + List sharedUserList = reader.readArray(reader1 -> reader1.getString()); + deserializedServicePrincipalAuthTypeConnectionProperties.withSharedUserList(sharedUserList); + } else if ("target".equals(fieldName)) { + deserializedServicePrincipalAuthTypeConnectionProperties.withTarget(reader.getString()); + } else if ("useWorkspaceManagedIdentity".equals(fieldName)) { + deserializedServicePrincipalAuthTypeConnectionProperties + .withUseWorkspaceManagedIdentity(reader.getNullable(JsonReader::getBoolean)); + } else if ("authType".equals(fieldName)) { + deserializedServicePrincipalAuthTypeConnectionProperties.authType + = ConnectionAuthType.fromString(reader.getString()); + } else if ("credentials".equals(fieldName)) { + deserializedServicePrincipalAuthTypeConnectionProperties.credentials + = ConnectionServicePrincipal.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedServicePrincipalAuthTypeConnectionProperties; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UserOwnedAmlWorkspace.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UserOwnedAmlWorkspace.java index 6f3f3a903bff..71785704a4ef 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UserOwnedAmlWorkspace.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UserOwnedAmlWorkspace.java @@ -12,17 +12,17 @@ import java.io.IOException; /** - * The user owned AML workspace for Cognitive Services account. + * The user owned AML account for Cognitive Services account. */ @Fluent public final class UserOwnedAmlWorkspace implements JsonSerializable { /* - * Full resource id of a AML workspace resource. + * Full resource id of a AML account resource. */ private String resourceId; /* - * Identity Client id of a AML workspace resource. + * Identity Client id of a AML account resource. */ private String identityClientId; @@ -33,7 +33,7 @@ public UserOwnedAmlWorkspace() { } /** - * Get the resourceId property: Full resource id of a AML workspace resource. + * Get the resourceId property: Full resource id of a AML account resource. * * @return the resourceId value. */ @@ -42,7 +42,7 @@ public String resourceId() { } /** - * Set the resourceId property: Full resource id of a AML workspace resource. + * Set the resourceId property: Full resource id of a AML account resource. * * @param resourceId the resourceId value to set. * @return the UserOwnedAmlWorkspace object itself. @@ -53,7 +53,7 @@ public UserOwnedAmlWorkspace withResourceId(String resourceId) { } /** - * Get the identityClientId property: Identity Client id of a AML workspace resource. + * Get the identityClientId property: Identity Client id of a AML account resource. * * @return the identityClientId value. */ @@ -62,7 +62,7 @@ public String identityClientId() { } /** - * Set the identityClientId property: Identity Client id of a AML workspace resource. + * Set the identityClientId property: Identity Client id of a AML account resource. * * @param identityClientId the identityClientId value to set. * @return the UserOwnedAmlWorkspace object itself. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UsernamePasswordAuthTypeConnectionProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UsernamePasswordAuthTypeConnectionProperties.java new file mode 100644 index 000000000000..cd0e468a7f26 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UsernamePasswordAuthTypeConnectionProperties.java @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Map; + +/** + * The UsernamePasswordAuthTypeConnectionProperties model. + */ +@Fluent +public final class UsernamePasswordAuthTypeConnectionProperties extends ConnectionPropertiesV2 { + /* + * Authentication type of the connection target + */ + private ConnectionAuthType authType = ConnectionAuthType.USERNAME_PASSWORD; + + /* + * The credentials property. + */ + private ConnectionUsernamePassword credentials; + + /** + * Creates an instance of UsernamePasswordAuthTypeConnectionProperties class. + */ + public UsernamePasswordAuthTypeConnectionProperties() { + } + + /** + * Get the authType property: Authentication type of the connection target. + * + * @return the authType value. + */ + @Override + public ConnectionAuthType authType() { + return this.authType; + } + + /** + * Get the credentials property: The credentials property. + * + * @return the credentials value. + */ + public ConnectionUsernamePassword credentials() { + return this.credentials; + } + + /** + * Set the credentials property: The credentials property. + * + * @param credentials the credentials value to set. + * @return the UsernamePasswordAuthTypeConnectionProperties object itself. + */ + public UsernamePasswordAuthTypeConnectionProperties withCredentials(ConnectionUsernamePassword credentials) { + this.credentials = credentials; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public UsernamePasswordAuthTypeConnectionProperties withCategory(ConnectionCategory category) { + super.withCategory(category); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public UsernamePasswordAuthTypeConnectionProperties withError(String error) { + super.withError(error); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public UsernamePasswordAuthTypeConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { + super.withExpiryTime(expiryTime); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public UsernamePasswordAuthTypeConnectionProperties withIsSharedToAll(Boolean isSharedToAll) { + super.withIsSharedToAll(isSharedToAll); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public UsernamePasswordAuthTypeConnectionProperties withMetadata(Map metadata) { + super.withMetadata(metadata); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public UsernamePasswordAuthTypeConnectionProperties withPeRequirement(ManagedPERequirement peRequirement) { + super.withPeRequirement(peRequirement); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public UsernamePasswordAuthTypeConnectionProperties withPeStatus(ManagedPEStatus peStatus) { + super.withPeStatus(peStatus); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public UsernamePasswordAuthTypeConnectionProperties withSharedUserList(List sharedUserList) { + super.withSharedUserList(sharedUserList); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public UsernamePasswordAuthTypeConnectionProperties withTarget(String target) { + super.withTarget(target); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public UsernamePasswordAuthTypeConnectionProperties + withUseWorkspaceManagedIdentity(Boolean useWorkspaceManagedIdentity) { + super.withUseWorkspaceManagedIdentity(useWorkspaceManagedIdentity); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (credentials() != null) { + credentials().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", category() == null ? null : category().toString()); + jsonWriter.writeStringField("error", error()); + jsonWriter.writeStringField("expiryTime", + expiryTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expiryTime())); + jsonWriter.writeBooleanField("isSharedToAll", isSharedToAll()); + jsonWriter.writeMapField("metadata", metadata(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("peRequirement", peRequirement() == null ? null : peRequirement().toString()); + jsonWriter.writeStringField("peStatus", peStatus() == null ? null : peStatus().toString()); + jsonWriter.writeArrayField("sharedUserList", sharedUserList(), + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("target", target()); + jsonWriter.writeBooleanField("useWorkspaceManagedIdentity", useWorkspaceManagedIdentity()); + jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); + jsonWriter.writeJsonField("credentials", this.credentials); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UsernamePasswordAuthTypeConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UsernamePasswordAuthTypeConnectionProperties if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the UsernamePasswordAuthTypeConnectionProperties. + */ + public static UsernamePasswordAuthTypeConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UsernamePasswordAuthTypeConnectionProperties deserializedUsernamePasswordAuthTypeConnectionProperties + = new UsernamePasswordAuthTypeConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedUsernamePasswordAuthTypeConnectionProperties + .withCategory(ConnectionCategory.fromString(reader.getString())); + } else if ("createdByWorkspaceArmId".equals(fieldName)) { + deserializedUsernamePasswordAuthTypeConnectionProperties + .withCreatedByWorkspaceArmId(reader.getString()); + } else if ("error".equals(fieldName)) { + deserializedUsernamePasswordAuthTypeConnectionProperties.withError(reader.getString()); + } else if ("expiryTime".equals(fieldName)) { + deserializedUsernamePasswordAuthTypeConnectionProperties.withExpiryTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("group".equals(fieldName)) { + deserializedUsernamePasswordAuthTypeConnectionProperties + .withGroup(ConnectionGroup.fromString(reader.getString())); + } else if ("isSharedToAll".equals(fieldName)) { + deserializedUsernamePasswordAuthTypeConnectionProperties + .withIsSharedToAll(reader.getNullable(JsonReader::getBoolean)); + } else if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedUsernamePasswordAuthTypeConnectionProperties.withMetadata(metadata); + } else if ("peRequirement".equals(fieldName)) { + deserializedUsernamePasswordAuthTypeConnectionProperties + .withPeRequirement(ManagedPERequirement.fromString(reader.getString())); + } else if ("peStatus".equals(fieldName)) { + deserializedUsernamePasswordAuthTypeConnectionProperties + .withPeStatus(ManagedPEStatus.fromString(reader.getString())); + } else if ("sharedUserList".equals(fieldName)) { + List sharedUserList = reader.readArray(reader1 -> reader1.getString()); + deserializedUsernamePasswordAuthTypeConnectionProperties.withSharedUserList(sharedUserList); + } else if ("target".equals(fieldName)) { + deserializedUsernamePasswordAuthTypeConnectionProperties.withTarget(reader.getString()); + } else if ("useWorkspaceManagedIdentity".equals(fieldName)) { + deserializedUsernamePasswordAuthTypeConnectionProperties + .withUseWorkspaceManagedIdentity(reader.getNullable(JsonReader::getBoolean)); + } else if ("authType".equals(fieldName)) { + deserializedUsernamePasswordAuthTypeConnectionProperties.authType + = ConnectionAuthType.fromString(reader.getString()); + } else if ("credentials".equals(fieldName)) { + deserializedUsernamePasswordAuthTypeConnectionProperties.credentials + = ConnectionUsernamePassword.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedUsernamePasswordAuthTypeConnectionProperties; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-cognitiveservices/proxy-config.json b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-cognitiveservices/proxy-config.json index e8b3fa164a68..721a6eef4f2d 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-cognitiveservices/proxy-config.json +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-cognitiveservices/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.cognitiveservices.implementation.AccountsClientImpl$AccountsService"],["com.azure.resourcemanager.cognitiveservices.implementation.CommitmentPlansClientImpl$CommitmentPlansService"],["com.azure.resourcemanager.cognitiveservices.implementation.CommitmentTiersClientImpl$CommitmentTiersService"],["com.azure.resourcemanager.cognitiveservices.implementation.DefenderForAISettingsClientImpl$DefenderForAISettingsService"],["com.azure.resourcemanager.cognitiveservices.implementation.DeletedAccountsClientImpl$DeletedAccountsService"],["com.azure.resourcemanager.cognitiveservices.implementation.DeploymentsClientImpl$DeploymentsService"],["com.azure.resourcemanager.cognitiveservices.implementation.EncryptionScopesClientImpl$EncryptionScopesService"],["com.azure.resourcemanager.cognitiveservices.implementation.LocationBasedModelCapacitiesClientImpl$LocationBasedModelCapacitiesService"],["com.azure.resourcemanager.cognitiveservices.implementation.ModelCapacitiesClientImpl$ModelCapacitiesService"],["com.azure.resourcemanager.cognitiveservices.implementation.ModelsClientImpl$ModelsService"],["com.azure.resourcemanager.cognitiveservices.implementation.NetworkSecurityPerimeterConfigurationsClientImpl$NetworkSecurityPerimeterConfigurationsService"],["com.azure.resourcemanager.cognitiveservices.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.cognitiveservices.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService"],["com.azure.resourcemanager.cognitiveservices.implementation.PrivateLinkResourcesClientImpl$PrivateLinkResourcesService"],["com.azure.resourcemanager.cognitiveservices.implementation.RaiBlocklistItemsClientImpl$RaiBlocklistItemsService"],["com.azure.resourcemanager.cognitiveservices.implementation.RaiBlocklistsClientImpl$RaiBlocklistsService"],["com.azure.resourcemanager.cognitiveservices.implementation.RaiContentFiltersClientImpl$RaiContentFiltersService"],["com.azure.resourcemanager.cognitiveservices.implementation.RaiPoliciesClientImpl$RaiPoliciesService"],["com.azure.resourcemanager.cognitiveservices.implementation.ResourceProvidersClientImpl$ResourceProvidersService"],["com.azure.resourcemanager.cognitiveservices.implementation.ResourceSkusClientImpl$ResourceSkusService"],["com.azure.resourcemanager.cognitiveservices.implementation.UsagesClientImpl$UsagesService"]] \ No newline at end of file +[["com.azure.resourcemanager.cognitiveservices.implementation.AccountCapabilityHostsClientImpl$AccountCapabilityHostsService"],["com.azure.resourcemanager.cognitiveservices.implementation.AccountConnectionsClientImpl$AccountConnectionsService"],["com.azure.resourcemanager.cognitiveservices.implementation.AccountsClientImpl$AccountsService"],["com.azure.resourcemanager.cognitiveservices.implementation.CommitmentPlansClientImpl$CommitmentPlansService"],["com.azure.resourcemanager.cognitiveservices.implementation.CommitmentTiersClientImpl$CommitmentTiersService"],["com.azure.resourcemanager.cognitiveservices.implementation.DefenderForAISettingsClientImpl$DefenderForAISettingsService"],["com.azure.resourcemanager.cognitiveservices.implementation.DeletedAccountsClientImpl$DeletedAccountsService"],["com.azure.resourcemanager.cognitiveservices.implementation.DeploymentsClientImpl$DeploymentsService"],["com.azure.resourcemanager.cognitiveservices.implementation.EncryptionScopesClientImpl$EncryptionScopesService"],["com.azure.resourcemanager.cognitiveservices.implementation.LocationBasedModelCapacitiesClientImpl$LocationBasedModelCapacitiesService"],["com.azure.resourcemanager.cognitiveservices.implementation.ModelCapacitiesClientImpl$ModelCapacitiesService"],["com.azure.resourcemanager.cognitiveservices.implementation.ModelsClientImpl$ModelsService"],["com.azure.resourcemanager.cognitiveservices.implementation.NetworkSecurityPerimeterConfigurationsClientImpl$NetworkSecurityPerimeterConfigurationsService"],["com.azure.resourcemanager.cognitiveservices.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.cognitiveservices.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService"],["com.azure.resourcemanager.cognitiveservices.implementation.PrivateLinkResourcesClientImpl$PrivateLinkResourcesService"],["com.azure.resourcemanager.cognitiveservices.implementation.ProjectCapabilityHostsClientImpl$ProjectCapabilityHostsService"],["com.azure.resourcemanager.cognitiveservices.implementation.ProjectConnectionsClientImpl$ProjectConnectionsService"],["com.azure.resourcemanager.cognitiveservices.implementation.ProjectsClientImpl$ProjectsService"],["com.azure.resourcemanager.cognitiveservices.implementation.RaiBlocklistItemsClientImpl$RaiBlocklistItemsService"],["com.azure.resourcemanager.cognitiveservices.implementation.RaiBlocklistsClientImpl$RaiBlocklistsService"],["com.azure.resourcemanager.cognitiveservices.implementation.RaiContentFiltersClientImpl$RaiContentFiltersService"],["com.azure.resourcemanager.cognitiveservices.implementation.RaiPoliciesClientImpl$RaiPoliciesService"],["com.azure.resourcemanager.cognitiveservices.implementation.ResourceProvidersClientImpl$ResourceProvidersService"],["com.azure.resourcemanager.cognitiveservices.implementation.ResourceSkusClientImpl$ResourceSkusService"],["com.azure.resourcemanager.cognitiveservices.implementation.UsagesClientImpl$UsagesService"]] \ No newline at end of file diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/resources/azure-resourcemanager-cognitiveservices.properties b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/resources/azure-resourcemanager-cognitiveservices.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/resources/azure-resourcemanager-cognitiveservices.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountCapabilityHostsCreateOrUpdateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountCapabilityHostsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..55e05df63e42 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountCapabilityHostsCreateOrUpdateSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.resourcemanager.cognitiveservices.models.CapabilityHostProperties; + +/** + * Samples for AccountCapabilityHosts CreateOrUpdate. + */ +public final class AccountCapabilityHostsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * AccountCapabilityHost/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Account CapabilityHost. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void createOrUpdateAccountCapabilityHost( + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.accountCapabilityHosts() + .define("capabilityHostName") + .withExistingAccount("test-rg", "account-1") + .withProperties(new CapabilityHostProperties().withCustomerSubnet( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroups/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet")) + .create(); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountCapabilityHostsDeleteSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountCapabilityHostsDeleteSamples.java new file mode 100644 index 000000000000..8f36d3e9857e --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountCapabilityHostsDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** + * Samples for AccountCapabilityHosts Delete. + */ +public final class AccountCapabilityHostsDeleteSamples { + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * AccountCapabilityHost/delete.json + */ + /** + * Sample code: Delete Account CapabilityHost. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + deleteAccountCapabilityHost(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.accountCapabilityHosts() + .delete("test-rg", "account-1", "capabilityHostName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountCapabilityHostsGetSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountCapabilityHostsGetSamples.java new file mode 100644 index 000000000000..d02915225700 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountCapabilityHostsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** + * Samples for AccountCapabilityHosts Get. + */ +public final class AccountCapabilityHostsGetSamples { + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * AccountCapabilityHost/get.json + */ + /** + * Sample code: Get Account CapabilityHost. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + getAccountCapabilityHost(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.accountCapabilityHosts() + .getWithResponse("test-rg", "account-1", "capabilityHostName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionCreateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionCreateSamples.java new file mode 100644 index 000000000000..bdc3c2eeaeb3 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionCreateSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.resourcemanager.cognitiveservices.models.ConnectionCategory; +import com.azure.resourcemanager.cognitiveservices.models.NoneAuthTypeConnectionProperties; +import java.time.OffsetDateTime; + +/** + * Samples for AccountConnection Create. + */ +public final class AccountConnectionCreateSamples { + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * AccountConnection/create.json + */ + /** + * Sample code: CreateAccountConnection. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + createAccountConnection(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.accountConnections() + .define("connection-1") + .withExistingAccount("resourceGroup-1", "account-1") + .withProperties(new NoneAuthTypeConnectionProperties().withCategory(ConnectionCategory.CONTAINER_REGISTRY) + .withExpiryTime(OffsetDateTime.parse("2024-03-15T14:30:00Z")) + .withTarget("[tartget url]")) + .create(); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionDeleteSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionDeleteSamples.java new file mode 100644 index 000000000000..4a1cd4c3daff --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** + * Samples for AccountConnection Delete. + */ +public final class AccountConnectionDeleteSamples { + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * AccountConnection/delete.json + */ + /** + * Sample code: DeleteAccountConnection. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + deleteAccountConnection(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.accountConnections() + .deleteWithResponse("resourceGroup-1", "account-1", "connection-1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionGetSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionGetSamples.java new file mode 100644 index 000000000000..867cf9297b2e --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** + * Samples for AccountConnection Get. + */ +public final class AccountConnectionGetSamples { + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * AccountConnection/get.json + */ + /** + * Sample code: GetAccountConnection. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + getAccountConnection(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.accountConnections() + .getWithResponse("resourceGroup-1", "account-1", "connection-1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionListSamples.java new file mode 100644 index 000000000000..f46369adb4ea --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionListSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** + * Samples for AccountConnection List. + */ +public final class AccountConnectionListSamples { + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * AccountConnection/list.json + */ + /** + * Sample code: ListAccountConnections. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + listAccountConnections(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.accountConnections() + .list("resourceGroup-1", "account-1", "[tartget url]", "ContainerRegistry", null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionUpdateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionUpdateSamples.java new file mode 100644 index 000000000000..28257e9173a9 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionUpdateSamples.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.resourcemanager.cognitiveservices.models.AccessKeyAuthTypeConnectionProperties; +import com.azure.resourcemanager.cognitiveservices.models.ConnectionAccessKey; +import com.azure.resourcemanager.cognitiveservices.models.ConnectionCategory; +import com.azure.resourcemanager.cognitiveservices.models.ConnectionPropertiesV2BasicResource; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for AccountConnection Update. + */ +public final class AccountConnectionUpdateSamples { + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * AccountConnection/update.json + */ + /** + * Sample code: UpdateAccountConnection. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + updateAccountConnection(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + ConnectionPropertiesV2BasicResource resource = manager.accountConnections() + .getWithResponse("test-rg", "account-1", "connection-1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new AccessKeyAuthTypeConnectionProperties().withCategory(ConnectionCategory.ADLSGEN2) + .withExpiryTime(OffsetDateTime.parse("2020-01-01T00:00:00Z")) + .withMetadata(mapOf()) + .withTarget("some_string") + .withCredentials(new ConnectionAccessKey().withAccessKeyId("fakeTokenPlaceholder") + .withSecretAccessKey("fakeTokenPlaceholder"))) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsCreateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsCreateSamples.java index 759b8e9c85ae..7c176f0b7db9 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsCreateSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsCreateSamples.java @@ -20,7 +20,7 @@ public final class AccountsCreateSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * CreateAccountMin.json */ /** @@ -42,7 +42,7 @@ public static void createAccountMin(com.azure.resourcemanager.cognitiveservices. /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * CreateAccount.json */ /** @@ -64,7 +64,7 @@ public static void createAccount(com.azure.resourcemanager.cognitiveservices.Cog .withKeyVersion("fakeTokenPlaceholder") .withKeyVaultUri("fakeTokenPlaceholder")).withKeySource(KeySource.MICROSOFT_KEY_VAULT)) .withUserOwnedStorage(Arrays.asList(new UserOwnedStorage().withResourceId( - "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount")))) + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount")))) .create(); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsDeleteSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsDeleteSamples.java index 66f1112a1b57..0a4bb8e6e648 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsDeleteSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsDeleteSamples.java @@ -10,7 +10,7 @@ public final class AccountsDeleteSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * DeleteAccount.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsGetByResourceGroupSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsGetByResourceGroupSamples.java index ad93a6a6d191..c59e8d9785d6 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsGetByResourceGroupSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsGetByResourceGroupSamples.java @@ -10,7 +10,7 @@ public final class AccountsGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * GetAccount.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListByResourceGroupSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListByResourceGroupSamples.java index c116d3bd7429..7234de434274 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListByResourceGroupSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListByResourceGroupSamples.java @@ -10,7 +10,7 @@ public final class AccountsListByResourceGroupSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * ListAccountsByResourceGroup.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListKeysSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListKeysSamples.java index 50bc157e4b55..8d631402d70b 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListKeysSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListKeysSamples.java @@ -10,7 +10,7 @@ public final class AccountsListKeysSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListKeys. + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ListKeys. * json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListModelsSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListModelsSamples.java index b7f847b51987..287243ff1eea 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListModelsSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListModelsSamples.java @@ -10,7 +10,7 @@ public final class AccountsListModelsSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * ListAccountModels.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListSamples.java index 0d8610446acc..6140af2894e0 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListSamples.java @@ -10,7 +10,7 @@ public final class AccountsListSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * ListAccountsBySubscription.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListSkusSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListSkusSamples.java index 80c2b04ac717..a560d217adad 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListSkusSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListSkusSamples.java @@ -10,7 +10,7 @@ public final class AccountsListSkusSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListSkus. + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ListSkus. * json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListUsagesSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListUsagesSamples.java index bb4e96308f52..cf13222f8d8b 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListUsagesSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListUsagesSamples.java @@ -10,7 +10,7 @@ public final class AccountsListUsagesSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetUsages + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetUsages * .json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsRegenerateKeySamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsRegenerateKeySamples.java index 743dbe15c62f..f48bf72612f3 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsRegenerateKeySamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsRegenerateKeySamples.java @@ -13,7 +13,7 @@ public final class AccountsRegenerateKeySamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * RegenerateKey.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsUpdateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsUpdateSamples.java index 4b95c12005df..37114298bcf0 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsUpdateSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsUpdateSamples.java @@ -13,7 +13,7 @@ public final class AccountsUpdateSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * UpdateAccount.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdateAssociationSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdateAssociationSamples.java index f5515f9c5a2a..b9d1ee2ab2d1 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdateAssociationSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdateAssociationSamples.java @@ -10,7 +10,7 @@ public final class CommitmentPlansCreateOrUpdateAssociationSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * CreateSharedCommitmentPlanAssociation.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdatePlanSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdatePlanSamples.java index 7c42f68afba6..069973dd6d92 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdatePlanSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdatePlanSamples.java @@ -15,7 +15,7 @@ public final class CommitmentPlansCreateOrUpdatePlanSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * CreateSharedCommitmentPlan.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdateSamples.java index c6a2e81d890a..a3dac3db730b 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdateSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdateSamples.java @@ -15,7 +15,7 @@ public final class CommitmentPlansCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * PutCommitmentPlan.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeleteAssociationSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeleteAssociationSamples.java index a6ba53502bac..3459eea1a9b3 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeleteAssociationSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeleteAssociationSamples.java @@ -10,7 +10,7 @@ public final class CommitmentPlansDeleteAssociationSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * DeleteSharedCommitmentPlanAssociation.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeletePlanSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeletePlanSamples.java index 2ac18a6d2628..01ea3234ae1a 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeletePlanSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeletePlanSamples.java @@ -10,7 +10,7 @@ public final class CommitmentPlansDeletePlanSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * DeleteSharedCommitmentPlan.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeleteSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeleteSamples.java index d043370bddbb..5a0ff65a375b 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeleteSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeleteSamples.java @@ -10,7 +10,7 @@ public final class CommitmentPlansDeleteSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * DeleteCommitmentPlan.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetAssociationSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetAssociationSamples.java index dcd70eb4b083..5e4d095ce245 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetAssociationSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetAssociationSamples.java @@ -10,7 +10,7 @@ public final class CommitmentPlansGetAssociationSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * GetSharedCommitmentPlanAssociation.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetByResourceGroupSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetByResourceGroupSamples.java index aeacf8a93c38..9175449bfc93 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetByResourceGroupSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetByResourceGroupSamples.java @@ -10,7 +10,7 @@ public final class CommitmentPlansGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * GetSharedCommitmentPlan.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetSamples.java index 5c086ac7da2a..3c1714cc7eb0 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetSamples.java @@ -10,7 +10,7 @@ public final class CommitmentPlansGetSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * GetCommitmentPlan.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListAssociationsSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListAssociationsSamples.java index a538bad85eca..44b7aca6063c 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListAssociationsSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListAssociationsSamples.java @@ -10,7 +10,7 @@ public final class CommitmentPlansListAssociationsSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * ListSharedCommitmentPlanAssociations.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListByResourceGroupSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListByResourceGroupSamples.java index 90c2b5055825..8f015e2c2583 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListByResourceGroupSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListByResourceGroupSamples.java @@ -10,7 +10,7 @@ public final class CommitmentPlansListByResourceGroupSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * ListSharedCommitmentPlansByResourceGroup.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListPlansBySubscriptionSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListPlansBySubscriptionSamples.java index c02016bc5c02..f8e0ab54edbd 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListPlansBySubscriptionSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListPlansBySubscriptionSamples.java @@ -10,7 +10,7 @@ public final class CommitmentPlansListPlansBySubscriptionSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * ListSharedCommitmentPlansBySubscription.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListSamples.java index e817cc4ad0b9..48ec4b83091d 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListSamples.java @@ -10,7 +10,7 @@ public final class CommitmentPlansListSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * ListCommitmentPlans.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansUpdatePlanSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansUpdatePlanSamples.java index 107fc77ced55..d37e12b60378 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansUpdatePlanSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansUpdatePlanSamples.java @@ -14,7 +14,7 @@ public final class CommitmentPlansUpdatePlanSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * UpdateSharedCommitmentPlan.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentTiersListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentTiersListSamples.java index a90ec916b4e7..94880c5919a9 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentTiersListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentTiersListSamples.java @@ -10,7 +10,7 @@ public final class CommitmentTiersListSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * ListCommitmentTiers.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsCreateOrUpdateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsCreateOrUpdateSamples.java index 06d5f87c999f..cbd8cd4cc3b8 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsCreateOrUpdateSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsCreateOrUpdateSamples.java @@ -12,7 +12,7 @@ public final class DefenderForAISettingsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * PutDefenderForAISetting.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsGetSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsGetSamples.java index 0f1c13d2585e..12995bf067d8 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsGetSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsGetSamples.java @@ -10,7 +10,7 @@ public final class DefenderForAISettingsGetSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * GetDefenderForAISetting.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsListSamples.java index 1a133175b2ef..2f6b126b5b00 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsListSamples.java @@ -10,7 +10,7 @@ public final class DefenderForAISettingsListSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * ListDefenderForAISetting.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsUpdateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsUpdateSamples.java index a88e5e0824c5..507fc3ab17a1 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsUpdateSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsUpdateSamples.java @@ -13,7 +13,7 @@ public final class DefenderForAISettingsUpdateSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * UpdateDefenderForAISetting.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeletedAccountsGetSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeletedAccountsGetSamples.java index 0802dfd8dc4f..df1958260f2a 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeletedAccountsGetSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeletedAccountsGetSamples.java @@ -10,7 +10,7 @@ public final class DeletedAccountsGetSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * GetDeletedAccount.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeletedAccountsListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeletedAccountsListSamples.java index cd2cd0a14cac..d2dd8a7dcbf6 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeletedAccountsListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeletedAccountsListSamples.java @@ -10,7 +10,7 @@ public final class DeletedAccountsListSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * ListDeletedAccountsBySubscription.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeletedAccountsPurgeSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeletedAccountsPurgeSamples.java index 70d8bdc13ddb..043cd38f8bc3 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeletedAccountsPurgeSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeletedAccountsPurgeSamples.java @@ -10,7 +10,7 @@ public final class DeletedAccountsPurgeSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * PurgeDeletedAccount.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsCreateOrUpdateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsCreateOrUpdateSamples.java index 4486e66c22ae..8f0a896bfc0f 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsCreateOrUpdateSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsCreateOrUpdateSamples.java @@ -14,7 +14,7 @@ public final class DeploymentsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * PutDeployment.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsDeleteSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsDeleteSamples.java index f0e0e17e5057..b724b41f4525 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsDeleteSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsDeleteSamples.java @@ -10,7 +10,7 @@ public final class DeploymentsDeleteSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * DeleteDeployment.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsGetSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsGetSamples.java index 552f432507f0..6ce6b6e01685 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsGetSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsGetSamples.java @@ -10,7 +10,7 @@ public final class DeploymentsGetSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * GetDeployment.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsListSamples.java index d447d5deae73..32e7a6b8450d 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsListSamples.java @@ -10,7 +10,7 @@ public final class DeploymentsListSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * ListDeployments.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsListSkusSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsListSkusSamples.java index 28142faf76fe..e483e3080a8c 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsListSkusSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsListSkusSamples.java @@ -10,7 +10,7 @@ public final class DeploymentsListSkusSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * ListDeploymentSkus.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsUpdateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsUpdateSamples.java index a19d69a912a5..654070a3fba4 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsUpdateSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsUpdateSamples.java @@ -13,7 +13,7 @@ public final class DeploymentsUpdateSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * UpdateDeployment.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/EncryptionScopesCreateOrUpdateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/EncryptionScopesCreateOrUpdateSamples.java index 5c3b5da8a5de..8611564e959a 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/EncryptionScopesCreateOrUpdateSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/EncryptionScopesCreateOrUpdateSamples.java @@ -15,7 +15,7 @@ public final class EncryptionScopesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * PutEncryptionScope.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/EncryptionScopesDeleteSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/EncryptionScopesDeleteSamples.java index eb4b7a303659..04dc11bd7357 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/EncryptionScopesDeleteSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/EncryptionScopesDeleteSamples.java @@ -10,7 +10,7 @@ public final class EncryptionScopesDeleteSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * DeleteEncryptionScope.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/EncryptionScopesGetSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/EncryptionScopesGetSamples.java index 214a3c8b08f7..e64bb35ebe37 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/EncryptionScopesGetSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/EncryptionScopesGetSamples.java @@ -10,7 +10,7 @@ public final class EncryptionScopesGetSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * GetEncryptionScope.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/EncryptionScopesListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/EncryptionScopesListSamples.java index 1e245ea7466b..0e2c944b3e29 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/EncryptionScopesListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/EncryptionScopesListSamples.java @@ -10,7 +10,7 @@ public final class EncryptionScopesListSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * ListEncryptionScopes.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/LocationBasedModelCapacitiesListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/LocationBasedModelCapacitiesListSamples.java index ef62aa20d79d..83bc31d8f685 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/LocationBasedModelCapacitiesListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/LocationBasedModelCapacitiesListSamples.java @@ -10,7 +10,7 @@ public final class LocationBasedModelCapacitiesListSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * ListLocationBasedModelCapacities.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ModelCapacitiesListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ModelCapacitiesListSamples.java index 27e6baef7987..73bc4c35e7fc 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ModelCapacitiesListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ModelCapacitiesListSamples.java @@ -10,7 +10,7 @@ public final class ModelCapacitiesListSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * ListModelCapacities.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ModelsListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ModelsListSamples.java index 4faf3d74d40b..24e36b4ee417 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ModelsListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ModelsListSamples.java @@ -10,7 +10,7 @@ public final class ModelsListSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * ListLocationModels.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsGetSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsGetSamples.java index 74de929727f2..74763e7407a5 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsGetSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsGetSamples.java @@ -10,7 +10,7 @@ public final class NetworkSecurityPerimeterConfigurationsGetSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * GetNetworkSecurityPerimeterConfigurations.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsListSamples.java index 84d13031923c..06f765bd6a2c 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsListSamples.java @@ -10,7 +10,7 @@ public final class NetworkSecurityPerimeterConfigurationsListSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * ListNetworkSecurityPerimeterConfigurations.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsReconcileSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsReconcileSamples.java index 7767d08906bd..c440bb768899 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsReconcileSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsReconcileSamples.java @@ -10,7 +10,7 @@ public final class NetworkSecurityPerimeterConfigurationsReconcileSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * ReconcileNetworkSecurityPerimeterConfigurations.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/OperationsListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/OperationsListSamples.java index b2a5dd3ed396..053223141369 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/OperationsListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/OperationsListSamples.java @@ -10,7 +10,7 @@ public final class OperationsListSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * GetOperations.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java index d4f618a35681..46a6e91183e7 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java @@ -14,7 +14,7 @@ public final class PrivateEndpointConnectionsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * PutPrivateEndpointConnection.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsDeleteSamples.java index 00da774309f4..1370bf857678 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsDeleteSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsDeleteSamples.java @@ -10,7 +10,7 @@ public final class PrivateEndpointConnectionsDeleteSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * DeletePrivateEndpointConnection.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsGetSamples.java index 3597154ba6dd..2f30a51496b1 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsGetSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsGetSamples.java @@ -10,7 +10,7 @@ public final class PrivateEndpointConnectionsGetSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * GetPrivateEndpointConnection.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsListSamples.java index 84fd649e9533..3756e1879169 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsListSamples.java @@ -10,7 +10,7 @@ public final class PrivateEndpointConnectionsListSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * ListPrivateEndpointConnections.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourcesListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourcesListSamples.java index 621e504b93d5..b15667e7f5a2 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourcesListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourcesListSamples.java @@ -10,7 +10,7 @@ public final class PrivateLinkResourcesListSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * ListPrivateLinkResources.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostsCreateOrUpdateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..89a6bdf6e47b --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostsCreateOrUpdateSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.resourcemanager.cognitiveservices.fluent.models.CapabilityHostInner; +import com.azure.resourcemanager.cognitiveservices.models.CapabilityHostProperties; + +/** + * Samples for ProjectCapabilityHosts CreateOrUpdate. + */ +public final class ProjectCapabilityHostsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * ProjectCapabilityHost/createOrUpdate.json + */ + /** + * Sample code: CreateOrUpdate Project CapabilityHost. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void createOrUpdateProjectCapabilityHost( + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.projectCapabilityHosts() + .createOrUpdate("test-rg", "account-1", "project-1", "capabilityHostName", + new CapabilityHostInner().withProperties(new CapabilityHostProperties().withCustomerSubnet( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroups/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostsDeleteSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostsDeleteSamples.java new file mode 100644 index 000000000000..7f7c855f7717 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostsDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** + * Samples for ProjectCapabilityHosts Delete. + */ +public final class ProjectCapabilityHostsDeleteSamples { + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * ProjectCapabilityHost/delete.json + */ + /** + * Sample code: Delete Project CapabilityHost. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + deleteProjectCapabilityHost(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.projectCapabilityHosts() + .delete("test-rg", "account-1", "project-1", "capabilityHostName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostsGetSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostsGetSamples.java new file mode 100644 index 000000000000..88ac0ff7057f --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostsGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** + * Samples for ProjectCapabilityHosts Get. + */ +public final class ProjectCapabilityHostsGetSamples { + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * ProjectCapabilityHost/get.json + */ + /** + * Sample code: Get Project CapabilityHost. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + getProjectCapabilityHost(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.projectCapabilityHosts() + .getWithResponse("test-rg", "account-1", "project-1", "capabilityHostName", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionCreateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionCreateSamples.java new file mode 100644 index 000000000000..cd649b345808 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionCreateSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.resourcemanager.cognitiveservices.fluent.models.ConnectionPropertiesV2BasicResourceInner; +import com.azure.resourcemanager.cognitiveservices.models.ConnectionCategory; +import com.azure.resourcemanager.cognitiveservices.models.NoneAuthTypeConnectionProperties; +import java.time.OffsetDateTime; + +/** + * Samples for ProjectConnection Create. + */ +public final class ProjectConnectionCreateSamples { + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * ProjectConnection/create.json + */ + /** + * Sample code: CreateProjectConnection. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + createProjectConnection(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.projectConnections() + .createWithResponse("resourceGroup-1", "account-1", "project-1", "connection-1", + new ConnectionPropertiesV2BasicResourceInner().withProperties( + new NoneAuthTypeConnectionProperties().withCategory(ConnectionCategory.CONTAINER_REGISTRY) + .withExpiryTime(OffsetDateTime.parse("2024-03-15T14:30:00Z")) + .withTarget("[tartget url]")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionDeleteSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionDeleteSamples.java new file mode 100644 index 000000000000..18f137e326ed --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** + * Samples for ProjectConnection Delete. + */ +public final class ProjectConnectionDeleteSamples { + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * ProjectConnection/delete.json + */ + /** + * Sample code: DeleteProjectConnection. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + deleteProjectConnection(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.projectConnections() + .deleteWithResponse("resourceGroup-1", "account-1", "project-1", "connection-1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionGetSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionGetSamples.java new file mode 100644 index 000000000000..38d344570351 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** + * Samples for ProjectConnection Get. + */ +public final class ProjectConnectionGetSamples { + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * ProjectConnection/get.json + */ + /** + * Sample code: GetProjectConnection. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + getProjectConnection(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.projectConnections() + .getWithResponse("resourceGroup-1", "account-1", "project-1", "connection-1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionListSamples.java new file mode 100644 index 000000000000..8ec70d8bc47f --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionListSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** + * Samples for ProjectConnection List. + */ +public final class ProjectConnectionListSamples { + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * ProjectConnection/list.json + */ + /** + * Sample code: ListProjectConnection. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + listProjectConnection(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.projectConnections() + .list("resourceGroup-1", "account-1", "project-1", "[tartget url]", "ContainerRegistry", null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionUpdateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionUpdateSamples.java new file mode 100644 index 000000000000..e9b2fdfb3e84 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionUpdateSamples.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.resourcemanager.cognitiveservices.models.AccessKeyAuthTypeConnectionProperties; +import com.azure.resourcemanager.cognitiveservices.models.ConnectionAccessKey; +import com.azure.resourcemanager.cognitiveservices.models.ConnectionCategory; +import com.azure.resourcemanager.cognitiveservices.models.ConnectionUpdateContent; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ProjectConnection Update. + */ +public final class ProjectConnectionUpdateSamples { + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * ProjectConnection/update.json + */ + /** + * Sample code: UpdateProjectConnection. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + updateProjectConnection(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.projectConnections() + .updateWithResponse("test-rg", "account-1", "project-1", "connection-1", + new ConnectionUpdateContent().withProperties( + new AccessKeyAuthTypeConnectionProperties().withCategory(ConnectionCategory.ADLSGEN2) + .withExpiryTime(OffsetDateTime.parse("2020-01-01T00:00:00Z")) + .withMetadata(mapOf()) + .withTarget("some_string") + .withCredentials(new ConnectionAccessKey().withAccessKeyId("fakeTokenPlaceholder") + .withSecretAccessKey("fakeTokenPlaceholder"))), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsCreateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsCreateSamples.java new file mode 100644 index 000000000000..9fae70a27c4d --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsCreateSamples.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.resourcemanager.cognitiveservices.models.Identity; +import com.azure.resourcemanager.cognitiveservices.models.ProjectProperties; +import com.azure.resourcemanager.cognitiveservices.models.ResourceIdentityType; + +/** + * Samples for Projects Create. + */ +public final class ProjectsCreateSamples { + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * CreateProjectMin.json + */ + /** + * Sample code: Create Project Min. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void createProjectMin(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.projects() + .define("testProject1") + .withExistingAccount("myResourceGroup", "testCreate1") + .withRegion("West US") + .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) + .withProperties(new ProjectProperties()) + .create(); + } + + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * CreateProject.json + */ + /** + * Sample code: Create Project. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void createProject(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.projects() + .define("testProject1") + .withExistingAccount("myResourceGroup", "testCreate1") + .withRegion("West US") + .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) + .withProperties( + new ProjectProperties().withDisplayName("p1").withDescription("Description of this project")) + .create(); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsDeleteSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsDeleteSamples.java new file mode 100644 index 000000000000..20e27159489b --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** + * Samples for Projects Delete. + */ +public final class ProjectsDeleteSamples { + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * DeleteProject.json + */ + /** + * Sample code: Delete Project. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void deleteProject(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.projects().delete("myResourceGroup", "PropTest01", "myProject", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsGetSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsGetSamples.java new file mode 100644 index 000000000000..cbe49fb5bf57 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** + * Samples for Projects Get. + */ +public final class ProjectsGetSamples { + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * GetProject.json + */ + /** + * Sample code: Get Project. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void getProject(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.projects() + .getWithResponse("myResourceGroup", "myAccount", "myProject", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsListSamples.java new file mode 100644 index 000000000000..6c879f8c3452 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** + * Samples for Projects List. + */ +public final class ProjectsListSamples { + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * ListProjects.json + */ + /** + * Sample code: List Project. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void listProject(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.projects().list("myResourceGroup", "myAccount", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsUpdateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsUpdateSamples.java new file mode 100644 index 000000000000..f022b288939a --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsUpdateSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.resourcemanager.cognitiveservices.models.Project; +import com.azure.resourcemanager.cognitiveservices.models.ProjectProperties; + +/** + * Samples for Projects Update. + */ +public final class ProjectsUpdateSamples { + /* + * x-ms-original-file: + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ + * UpdateProjects.json + */ + /** + * Sample code: Update Project. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void updateProject(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + Project resource = manager.projects() + .getWithResponse("bvttest", "bingSearch", "projectName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withProperties(new ProjectProperties().withDescription("new description.")).apply(); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsBatchAddSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsBatchAddSamples.java index 001985230680..cce98de44bf3 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsBatchAddSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsBatchAddSamples.java @@ -14,7 +14,7 @@ public final class RaiBlocklistItemsBatchAddSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * AddRaiBlocklistItems.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsBatchDeleteSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsBatchDeleteSamples.java index 0aa52f8d8246..2bf26c3b9c07 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsBatchDeleteSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsBatchDeleteSamples.java @@ -14,7 +14,7 @@ public final class RaiBlocklistItemsBatchDeleteSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * DeleteRaiBlocklistItems.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsCreateOrUpdateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsCreateOrUpdateSamples.java index 6a7d1c61b93a..676abd8d465e 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsCreateOrUpdateSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsCreateOrUpdateSamples.java @@ -12,7 +12,7 @@ public final class RaiBlocklistItemsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * PutRaiBlocklistItem.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsDeleteSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsDeleteSamples.java index 673291634655..8a2b2c8f078b 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsDeleteSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsDeleteSamples.java @@ -10,7 +10,7 @@ public final class RaiBlocklistItemsDeleteSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * DeleteRaiBlocklistItem.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsGetSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsGetSamples.java index 01ed662a6236..069d6c30dd32 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsGetSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsGetSamples.java @@ -10,7 +10,7 @@ public final class RaiBlocklistItemsGetSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * GetRaiBlocklistItem.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsListSamples.java index 2e70812420ad..261d355a4afb 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsListSamples.java @@ -10,7 +10,7 @@ public final class RaiBlocklistItemsListSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * ListBlocklistItems.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsCreateOrUpdateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsCreateOrUpdateSamples.java index 464d21c4423c..65bac15ec631 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsCreateOrUpdateSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsCreateOrUpdateSamples.java @@ -12,7 +12,7 @@ public final class RaiBlocklistsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * PutRaiBlocklist.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsDeleteSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsDeleteSamples.java index c6d0e961f5a4..15cf9fc888aa 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsDeleteSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsDeleteSamples.java @@ -10,7 +10,7 @@ public final class RaiBlocklistsDeleteSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * DeleteRaiBlocklist.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsGetSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsGetSamples.java index 6ea1eb7ca95f..b05cdc8f77a4 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsGetSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsGetSamples.java @@ -10,7 +10,7 @@ public final class RaiBlocklistsGetSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * GetRaiBlocklist.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsListSamples.java index 23f8dd992b70..f31df5651507 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsListSamples.java @@ -10,7 +10,7 @@ public final class RaiBlocklistsListSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * ListBlocklists.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFiltersGetSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFiltersGetSamples.java index 6c937b1099c9..9a102ef2339e 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFiltersGetSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFiltersGetSamples.java @@ -10,7 +10,7 @@ public final class RaiContentFiltersGetSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * GetRaiContentFilter.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFiltersListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFiltersListSamples.java index 48fb8ffbe90c..252ece444936 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFiltersListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFiltersListSamples.java @@ -10,7 +10,7 @@ public final class RaiContentFiltersListSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * ListRaiContentFilters.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesCreateOrUpdateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesCreateOrUpdateSamples.java index 5c500f926b5e..c9730caf3b73 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesCreateOrUpdateSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesCreateOrUpdateSamples.java @@ -17,7 +17,7 @@ public final class RaiPoliciesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * PutRaiPolicy.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesDeleteSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesDeleteSamples.java index a2d89161b53d..d988c89e96d9 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesDeleteSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesDeleteSamples.java @@ -10,7 +10,7 @@ public final class RaiPoliciesDeleteSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * DeleteRaiPolicy.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesGetSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesGetSamples.java index 841c29a91c0a..d8264daa735d 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesGetSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesGetSamples.java @@ -10,7 +10,7 @@ public final class RaiPoliciesGetSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * GetRaiPolicy.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesListSamples.java index a41dbec1dc5b..08f0a6867b2b 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesListSamples.java @@ -10,7 +10,7 @@ public final class RaiPoliciesListSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * ListRaiPolicies.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProviderCalculateModelCapacitySamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProviderCalculateModelCapacitySamples.java index 511c87a7cb8c..f04d8ac66fc6 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProviderCalculateModelCapacitySamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProviderCalculateModelCapacitySamples.java @@ -16,7 +16,7 @@ public final class ResourceProviderCalculateModelCapacitySamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * CalculateModelCapacity.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProviderCheckDomainAvailabilitySamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProviderCheckDomainAvailabilitySamples.java index 1b2844c408ca..599f5a01ddb9 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProviderCheckDomainAvailabilitySamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProviderCheckDomainAvailabilitySamples.java @@ -12,7 +12,7 @@ public final class ResourceProviderCheckDomainAvailabilitySamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * CheckDomainAvailability.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProviderCheckSkuAvailabilitySamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProviderCheckSkuAvailabilitySamples.java index d5e8808746aa..7e38ab2b458f 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProviderCheckSkuAvailabilitySamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProviderCheckSkuAvailabilitySamples.java @@ -13,7 +13,7 @@ public final class ResourceProviderCheckSkuAvailabilitySamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * CheckSkuAvailability.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceSkusListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceSkusListSamples.java index 7a441d798848..572db73d6ab5 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceSkusListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceSkusListSamples.java @@ -10,7 +10,7 @@ public final class ResourceSkusListSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetSkus. + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetSkus. * json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/UsagesListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/UsagesListSamples.java index 9f7bc0eace2c..24caa74ec644 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/UsagesListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/UsagesListSamples.java @@ -10,7 +10,7 @@ public final class UsagesListSamples { /* * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ + * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ * ListUsages.json */ /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AbusePenaltyTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AbusePenaltyTests.java deleted file mode 100644 index cbc4dbf1a0dc..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AbusePenaltyTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.AbusePenalty; -import com.azure.resourcemanager.cognitiveservices.models.AbusePenaltyAction; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class AbusePenaltyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AbusePenalty model = BinaryData - .fromString( - "{\"action\":\"Block\",\"rateLimitPercentage\":99.249115,\"expiration\":\"2021-01-11T19:42:09Z\"}") - .toObject(AbusePenalty.class); - Assertions.assertEquals(AbusePenaltyAction.BLOCK, model.action()); - Assertions.assertEquals(99.249115F, model.rateLimitPercentage()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-11T19:42:09Z"), model.expiration()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AbusePenalty model = new AbusePenalty().withAction(AbusePenaltyAction.BLOCK) - .withRateLimitPercentage(99.249115F) - .withExpiration(OffsetDateTime.parse("2021-01-11T19:42:09Z")); - model = BinaryData.fromObject(model).toObject(AbusePenalty.class); - Assertions.assertEquals(AbusePenaltyAction.BLOCK, model.action()); - Assertions.assertEquals(99.249115F, model.rateLimitPercentage()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-11T19:42:09Z"), model.expiration()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountSkuListResultInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountSkuListResultInnerTests.java deleted file mode 100644 index 3ad3f7d02c56..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountSkuListResultInnerTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.AccountSkuListResultInner; -import com.azure.resourcemanager.cognitiveservices.models.AccountSku; -import com.azure.resourcemanager.cognitiveservices.models.Sku; -import com.azure.resourcemanager.cognitiveservices.models.SkuTier; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AccountSkuListResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AccountSkuListResultInner model = BinaryData.fromString( - "{\"value\":[{\"resourceType\":\"bdlwtgrhpdjpj\",\"sku\":{\"name\":\"asxazjpqyegualhb\",\"tier\":\"Free\",\"size\":\"jj\",\"family\":\"v\",\"capacity\":303390013}}]}") - .toObject(AccountSkuListResultInner.class); - Assertions.assertEquals("bdlwtgrhpdjpj", model.value().get(0).resourceType()); - Assertions.assertEquals("asxazjpqyegualhb", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.FREE, model.value().get(0).sku().tier()); - Assertions.assertEquals("jj", model.value().get(0).sku().size()); - Assertions.assertEquals("v", model.value().get(0).sku().family()); - Assertions.assertEquals(303390013, model.value().get(0).sku().capacity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AccountSkuListResultInner model - = new AccountSkuListResultInner().withValue(Arrays.asList(new AccountSku().withResourceType("bdlwtgrhpdjpj") - .withSku(new Sku().withName("asxazjpqyegualhb") - .withTier(SkuTier.FREE) - .withSize("jj") - .withFamily("v") - .withCapacity(303390013)))); - model = BinaryData.fromObject(model).toObject(AccountSkuListResultInner.class); - Assertions.assertEquals("bdlwtgrhpdjpj", model.value().get(0).resourceType()); - Assertions.assertEquals("asxazjpqyegualhb", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.FREE, model.value().get(0).sku().tier()); - Assertions.assertEquals("jj", model.value().get(0).sku().size()); - Assertions.assertEquals("v", model.value().get(0).sku().family()); - Assertions.assertEquals(303390013, model.value().get(0).sku().capacity()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountSkuTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountSkuTests.java deleted file mode 100644 index d5e1850e3d13..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountSkuTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.AccountSku; -import com.azure.resourcemanager.cognitiveservices.models.Sku; -import com.azure.resourcemanager.cognitiveservices.models.SkuTier; -import org.junit.jupiter.api.Assertions; - -public final class AccountSkuTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AccountSku model = BinaryData.fromString( - "{\"resourceType\":\"wdslfhotwmcy\",\"sku\":{\"name\":\"wlbjnpgacftade\",\"tier\":\"Basic\",\"size\":\"tyfsoppusuesn\",\"family\":\"dejbavo\",\"capacity\":669466066}}") - .toObject(AccountSku.class); - Assertions.assertEquals("wdslfhotwmcy", model.resourceType()); - Assertions.assertEquals("wlbjnpgacftade", model.sku().name()); - Assertions.assertEquals(SkuTier.BASIC, model.sku().tier()); - Assertions.assertEquals("tyfsoppusuesn", model.sku().size()); - Assertions.assertEquals("dejbavo", model.sku().family()); - Assertions.assertEquals(669466066, model.sku().capacity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AccountSku model = new AccountSku().withResourceType("wdslfhotwmcy") - .withSku(new Sku().withName("wlbjnpgacftade") - .withTier(SkuTier.BASIC) - .withSize("tyfsoppusuesn") - .withFamily("dejbavo") - .withCapacity(669466066)); - model = BinaryData.fromObject(model).toObject(AccountSku.class); - Assertions.assertEquals("wdslfhotwmcy", model.resourceType()); - Assertions.assertEquals("wlbjnpgacftade", model.sku().name()); - Assertions.assertEquals(SkuTier.BASIC, model.sku().tier()); - Assertions.assertEquals("tyfsoppusuesn", model.sku().size()); - Assertions.assertEquals("dejbavo", model.sku().family()); - Assertions.assertEquals(669466066, model.sku().capacity()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsDeleteMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsDeleteMockTests.java deleted file mode 100644 index 3ec05d022a49..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsDeleteMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AccountsDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.accounts().delete("lxqzvn", "rsbycucrwn", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListSkusWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListSkusWithResponseMockTests.java deleted file mode 100644 index 8f36823b6aea..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListSkusWithResponseMockTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.AccountSkuListResult; -import com.azure.resourcemanager.cognitiveservices.models.SkuTier; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AccountsListSkusWithResponseMockTests { - @Test - public void testListSkusWithResponse() throws Exception { - String responseStr - = "{\"value\":[{\"resourceType\":\"lgg\",\"sku\":{\"name\":\"bemzqkzszuwi\",\"tier\":\"Free\",\"size\":\"xxhljfpgpic\",\"family\":\"nzhrgmqgjsxvpqcb\",\"capacity\":1162167874}}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AccountSkuListResult response = manager.accounts() - .listSkusWithResponse("kfvxcnq", "xqpswok", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("lgg", response.value().get(0).resourceType()); - Assertions.assertEquals("bemzqkzszuwi", response.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.FREE, response.value().get(0).sku().tier()); - Assertions.assertEquals("xxhljfpgpic", response.value().get(0).sku().size()); - Assertions.assertEquals("nzhrgmqgjsxvpqcb", response.value().get(0).sku().family()); - Assertions.assertEquals(1162167874, response.value().get(0).sku().capacity()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListUsagesWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListUsagesWithResponseMockTests.java deleted file mode 100644 index f6dfa28d423a..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListUsagesWithResponseMockTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.QuotaUsageStatus; -import com.azure.resourcemanager.cognitiveservices.models.UnitType; -import com.azure.resourcemanager.cognitiveservices.models.UsageListResult; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AccountsListUsagesWithResponseMockTests { - @Test - public void testListUsagesWithResponse() throws Exception { - String responseStr - = "{\"nextLink\":\"wvsgmwohqfzizvu\",\"value\":[{\"unit\":\"BytesPerSecond\",\"name\":{\"value\":\"thnwpzte\",\"localizedValue\":\"vmribiat\"},\"quotaPeriod\":\"plucfotangcfhnyk\",\"limit\":34.811432195394524,\"currentValue\":74.0119738169162,\"nextResetTime\":\"wlmzqwmvtxnjmxmc\",\"status\":\"Included\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - UsageListResult response = manager.accounts() - .listUsagesWithResponse("bodthsqqgvri", "bakclacjfrnxous", "au", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("wvsgmwohqfzizvu", response.nextLink()); - Assertions.assertEquals(UnitType.BYTES_PER_SECOND, response.value().get(0).unit()); - Assertions.assertEquals("thnwpzte", response.value().get(0).name().value()); - Assertions.assertEquals("vmribiat", response.value().get(0).name().localizedValue()); - Assertions.assertEquals("plucfotangcfhnyk", response.value().get(0).quotaPeriod()); - Assertions.assertEquals(34.811432195394524D, response.value().get(0).limit()); - Assertions.assertEquals(74.0119738169162D, response.value().get(0).currentValue()); - Assertions.assertEquals("wlmzqwmvtxnjmxmc", response.value().get(0).nextResetTime()); - Assertions.assertEquals(QuotaUsageStatus.INCLUDED, response.value().get(0).status()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AzureEntityResourceTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AzureEntityResourceTests.java deleted file mode 100644 index 5c2924ba23db..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AzureEntityResourceTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.AzureEntityResource; - -public final class AzureEntityResourceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzureEntityResource model = BinaryData.fromString( - "{\"etag\":\"kvwrwjfeu\",\"id\":\"nhutjeltmrldhugj\",\"name\":\"zdatqxhocdg\",\"type\":\"ablgphuticndvk\"}") - .toObject(AzureEntityResource.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureEntityResource model = new AzureEntityResource(); - model = BinaryData.fromObject(model).toObject(AzureEntityResource.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/BillingMeterInfoTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/BillingMeterInfoTests.java deleted file mode 100644 index 9be6f8262825..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/BillingMeterInfoTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.BillingMeterInfo; -import org.junit.jupiter.api.Assertions; - -public final class BillingMeterInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingMeterInfo model - = BinaryData.fromString("{\"name\":\"skpbhenbtkcxywn\",\"meterId\":\"nrs\",\"unit\":\"lqidyby\"}") - .toObject(BillingMeterInfo.class); - Assertions.assertEquals("skpbhenbtkcxywn", model.name()); - Assertions.assertEquals("nrs", model.meterId()); - Assertions.assertEquals("lqidyby", model.unit()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingMeterInfo model - = new BillingMeterInfo().withName("skpbhenbtkcxywn").withMeterId("nrs").withUnit("lqidyby"); - model = BinaryData.fromObject(model).toObject(BillingMeterInfo.class); - Assertions.assertEquals("skpbhenbtkcxywn", model.name()); - Assertions.assertEquals("nrs", model.meterId()); - Assertions.assertEquals("lqidyby", model.unit()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CalculateModelCapacityResultEstimatedCapacityTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CalculateModelCapacityResultEstimatedCapacityTests.java deleted file mode 100644 index 33eb5ae9e8f8..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CalculateModelCapacityResultEstimatedCapacityTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.CalculateModelCapacityResultEstimatedCapacity; -import org.junit.jupiter.api.Assertions; - -public final class CalculateModelCapacityResultEstimatedCapacityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CalculateModelCapacityResultEstimatedCapacity model - = BinaryData.fromString("{\"value\":1929078891,\"deployableValue\":766917495}") - .toObject(CalculateModelCapacityResultEstimatedCapacity.class); - Assertions.assertEquals(1929078891, model.value()); - Assertions.assertEquals(766917495, model.deployableValue()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CalculateModelCapacityResultEstimatedCapacity model - = new CalculateModelCapacityResultEstimatedCapacity().withValue(1929078891).withDeployableValue(766917495); - model = BinaryData.fromObject(model).toObject(CalculateModelCapacityResultEstimatedCapacity.class); - Assertions.assertEquals(1929078891, model.value()); - Assertions.assertEquals(766917495, model.deployableValue()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CapacityConfigTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CapacityConfigTests.java deleted file mode 100644 index d06ee5a79d2f..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CapacityConfigTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.CapacityConfig; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class CapacityConfigTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CapacityConfig model = BinaryData.fromString( - "{\"minimum\":18555434,\"maximum\":480744947,\"step\":1333512274,\"default\":826548714,\"allowedValues\":[1771770705,307935551,1373205517,1850668583]}") - .toObject(CapacityConfig.class); - Assertions.assertEquals(18555434, model.minimum()); - Assertions.assertEquals(480744947, model.maximum()); - Assertions.assertEquals(1333512274, model.step()); - Assertions.assertEquals(826548714, model.defaultProperty()); - Assertions.assertEquals(1771770705, model.allowedValues().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CapacityConfig model = new CapacityConfig().withMinimum(18555434) - .withMaximum(480744947) - .withStep(1333512274) - .withDefaultProperty(826548714) - .withAllowedValues(Arrays.asList(1771770705, 307935551, 1373205517, 1850668583)); - model = BinaryData.fromObject(model).toObject(CapacityConfig.class); - Assertions.assertEquals(18555434, model.minimum()); - Assertions.assertEquals(480744947, model.maximum()); - Assertions.assertEquals(1333512274, model.step()); - Assertions.assertEquals(826548714, model.defaultProperty()); - Assertions.assertEquals(1771770705, model.allowedValues().get(0)); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CheckDomainAvailabilityParameterTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CheckDomainAvailabilityParameterTests.java deleted file mode 100644 index c5610c7bb4f0..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CheckDomainAvailabilityParameterTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.CheckDomainAvailabilityParameter; -import org.junit.jupiter.api.Assertions; - -public final class CheckDomainAvailabilityParameterTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CheckDomainAvailabilityParameter model = BinaryData - .fromString("{\"subdomainName\":\"fpubjibwwi\",\"type\":\"tohqkvpuvksgp\",\"kind\":\"aknynfsynljphuop\"}") - .toObject(CheckDomainAvailabilityParameter.class); - Assertions.assertEquals("fpubjibwwi", model.subdomainName()); - Assertions.assertEquals("tohqkvpuvksgp", model.type()); - Assertions.assertEquals("aknynfsynljphuop", model.kind()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CheckDomainAvailabilityParameter model = new CheckDomainAvailabilityParameter().withSubdomainName("fpubjibwwi") - .withType("tohqkvpuvksgp") - .withKind("aknynfsynljphuop"); - model = BinaryData.fromObject(model).toObject(CheckDomainAvailabilityParameter.class); - Assertions.assertEquals("fpubjibwwi", model.subdomainName()); - Assertions.assertEquals("tohqkvpuvksgp", model.type()); - Assertions.assertEquals("aknynfsynljphuop", model.kind()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CheckSkuAvailabilityParameterTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CheckSkuAvailabilityParameterTests.java deleted file mode 100644 index e17074ff336a..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CheckSkuAvailabilityParameterTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.CheckSkuAvailabilityParameter; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class CheckSkuAvailabilityParameterTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CheckSkuAvailabilityParameter model = BinaryData - .fromString( - "{\"skus\":[\"notyfjfcnjbkcn\",\"dhbt\",\"kphywpnvjto\"],\"kind\":\"nermcl\",\"type\":\"plpho\"}") - .toObject(CheckSkuAvailabilityParameter.class); - Assertions.assertEquals("notyfjfcnjbkcn", model.skus().get(0)); - Assertions.assertEquals("nermcl", model.kind()); - Assertions.assertEquals("plpho", model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CheckSkuAvailabilityParameter model - = new CheckSkuAvailabilityParameter().withSkus(Arrays.asList("notyfjfcnjbkcn", "dhbt", "kphywpnvjto")) - .withKind("nermcl") - .withType("plpho"); - model = BinaryData.fromObject(model).toObject(CheckSkuAvailabilityParameter.class); - Assertions.assertEquals("notyfjfcnjbkcn", model.skus().get(0)); - Assertions.assertEquals("nermcl", model.kind()); - Assertions.assertEquals("plpho", model.type()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentCostTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentCostTests.java deleted file mode 100644 index e315b77ca189..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentCostTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentCost; -import org.junit.jupiter.api.Assertions; - -public final class CommitmentCostTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CommitmentCost model - = BinaryData.fromString("{\"commitmentMeterId\":\"zuaejxd\",\"overageMeterId\":\"tskzbbtdzumveek\"}") - .toObject(CommitmentCost.class); - Assertions.assertEquals("zuaejxd", model.commitmentMeterId()); - Assertions.assertEquals("tskzbbtdzumveek", model.overageMeterId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CommitmentCost model - = new CommitmentCost().withCommitmentMeterId("zuaejxd").withOverageMeterId("tskzbbtdzumveek"); - model = BinaryData.fromObject(model).toObject(CommitmentCost.class); - Assertions.assertEquals("zuaejxd", model.commitmentMeterId()); - Assertions.assertEquals("tskzbbtdzumveek", model.overageMeterId()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPeriodTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPeriodTests.java deleted file mode 100644 index d948a29ab922..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPeriodTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPeriod; -import org.junit.jupiter.api.Assertions; - -public final class CommitmentPeriodTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CommitmentPeriod model = BinaryData.fromString( - "{\"tier\":\"eqphchqnrnr\",\"count\":2099945195,\"quota\":{\"quantity\":8201387664447869413,\"unit\":\"k\"},\"startDate\":\"aifmvikl\",\"endDate\":\"dvk\"}") - .toObject(CommitmentPeriod.class); - Assertions.assertEquals("eqphchqnrnr", model.tier()); - Assertions.assertEquals(2099945195, model.count()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CommitmentPeriod model = new CommitmentPeriod().withTier("eqphchqnrnr").withCount(2099945195); - model = BinaryData.fromObject(model).toObject(CommitmentPeriod.class); - Assertions.assertEquals("eqphchqnrnr", model.tier()); - Assertions.assertEquals(2099945195, model.count()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanAccountAssociationInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanAccountAssociationInnerTests.java deleted file mode 100644 index a634d3636aef..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanAccountAssociationInnerTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentPlanAccountAssociationInner; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class CommitmentPlanAccountAssociationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CommitmentPlanAccountAssociationInner model = BinaryData.fromString( - "{\"etag\":\"gxdbeesmie\",\"tags\":{\"iaa\":\"ra\",\"agt\":\"iuagydwqfbylyrfg\",\"zjvusfzldmo\":\"ojocqwogf\"},\"properties\":{\"accountId\":\"ylfsbtk\"},\"id\":\"dp\",\"name\":\"s\",\"type\":\"wn\"}") - .toObject(CommitmentPlanAccountAssociationInner.class); - Assertions.assertEquals("ra", model.tags().get("iaa")); - Assertions.assertEquals("ylfsbtk", model.accountId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CommitmentPlanAccountAssociationInner model = new CommitmentPlanAccountAssociationInner() - .withTags(mapOf("iaa", "ra", "agt", "iuagydwqfbylyrfg", "zjvusfzldmo", "ojocqwogf")) - .withAccountId("ylfsbtk"); - model = BinaryData.fromObject(model).toObject(CommitmentPlanAccountAssociationInner.class); - Assertions.assertEquals("ra", model.tags().get("iaa")); - Assertions.assertEquals("ylfsbtk", model.accountId()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanAccountAssociationListResultTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanAccountAssociationListResultTests.java deleted file mode 100644 index da0339a3b2dd..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanAccountAssociationListResultTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlanAccountAssociationListResult; -import org.junit.jupiter.api.Assertions; - -public final class CommitmentPlanAccountAssociationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CommitmentPlanAccountAssociationListResult model = BinaryData.fromString( - "{\"nextLink\":\"omtkub\",\"value\":[{\"etag\":\"vdxzxhihfrbbc\",\"tags\":{\"ykvgtrdcnifmz\":\"agtltdhlfkqoj\"},\"properties\":{\"accountId\":\"ymbrnysuxmpraf\"},\"id\":\"g\",\"name\":\"khocxvdfffwaf\",\"type\":\"roud\"},{\"etag\":\"avehhrvkbunzo\",\"tags\":{\"dyuib\":\"hcxgkmoyx\",\"zydvfvf\":\"mfdn\",\"vhmgorffukis\":\"jnaeois\"},\"properties\":{\"accountId\":\"mzhwplefaxvxi\"},\"id\":\"cbtgnhnz\",\"name\":\"yqxtjjfzql\",\"type\":\"hycav\"}]}") - .toObject(CommitmentPlanAccountAssociationListResult.class); - Assertions.assertEquals("omtkub", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CommitmentPlanAccountAssociationListResult model - = new CommitmentPlanAccountAssociationListResult().withNextLink("omtkub"); - model = BinaryData.fromObject(model).toObject(CommitmentPlanAccountAssociationListResult.class); - Assertions.assertEquals("omtkub", model.nextLink()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanAccountAssociationPropertiesTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanAccountAssociationPropertiesTests.java deleted file mode 100644 index c0e3bcc5117e..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanAccountAssociationPropertiesTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentPlanAccountAssociationProperties; -import org.junit.jupiter.api.Assertions; - -public final class CommitmentPlanAccountAssociationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CommitmentPlanAccountAssociationProperties model = BinaryData.fromString("{\"accountId\":\"gkbugrjqct\"}") - .toObject(CommitmentPlanAccountAssociationProperties.class); - Assertions.assertEquals("gkbugrjqct", model.accountId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CommitmentPlanAccountAssociationProperties model - = new CommitmentPlanAccountAssociationProperties().withAccountId("gkbugrjqct"); - model = BinaryData.fromObject(model).toObject(CommitmentPlanAccountAssociationProperties.class); - Assertions.assertEquals("gkbugrjqct", model.accountId()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanAssociationTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanAssociationTests.java deleted file mode 100644 index 9de2d4dee248..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanAssociationTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlanAssociation; -import org.junit.jupiter.api.Assertions; - -public final class CommitmentPlanAssociationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CommitmentPlanAssociation model - = BinaryData.fromString("{\"commitmentPlanId\":\"l\",\"commitmentPlanLocation\":\"uvfqawrlyxwj\"}") - .toObject(CommitmentPlanAssociation.class); - Assertions.assertEquals("l", model.commitmentPlanId()); - Assertions.assertEquals("uvfqawrlyxwj", model.commitmentPlanLocation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CommitmentPlanAssociation model - = new CommitmentPlanAssociation().withCommitmentPlanId("l").withCommitmentPlanLocation("uvfqawrlyxwj"); - model = BinaryData.fromObject(model).toObject(CommitmentPlanAssociation.class); - Assertions.assertEquals("l", model.commitmentPlanId()); - Assertions.assertEquals("uvfqawrlyxwj", model.commitmentPlanLocation()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanInnerTests.java deleted file mode 100644 index 7df7159a3c8b..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanInnerTests.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentPlanInner; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPeriod; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlanProperties; -import com.azure.resourcemanager.cognitiveservices.models.HostingModel; -import com.azure.resourcemanager.cognitiveservices.models.Sku; -import com.azure.resourcemanager.cognitiveservices.models.SkuTier; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class CommitmentPlanInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CommitmentPlanInner model = BinaryData.fromString( - "{\"etag\":\"ithtywu\",\"kind\":\"cbihwqk\",\"sku\":{\"name\":\"dntwjchrdgo\",\"tier\":\"Premium\",\"size\":\"mwctondzjluudfd\",\"family\":\"gg\",\"capacity\":407564287},\"tags\":{\"tgseinqfiufxqkn\":\"tov\",\"ttwqmsni\":\"irgne\",\"rxfrddhc\":\"fcdmqnrojlpijn\"},\"location\":\"tizzronasxif\",\"properties\":{\"provisioningState\":\"Creating\",\"commitmentPlanGuid\":\"zh\",\"hostingModel\":\"DisconnectedContainer\",\"planType\":\"sgogczhonnxk\",\"current\":{\"tier\":\"nyhmossxkkgthr\",\"count\":486654365,\"quota\":{\"quantity\":1163156563773473643,\"unit\":\"qxvcxgfrpdsofb\"},\"startDate\":\"rnsvbuswd\",\"endDate\":\"yybyc\"},\"autoRenew\":true,\"next\":{\"tier\":\"srtkfa\",\"count\":1955812770,\"quota\":{\"quantity\":877559643182004257,\"unit\":\"yzirtxdyuxzejn\"},\"startDate\":\"sewgioilqukr\",\"endDate\":\"xtqmieoxor\"},\"last\":{\"tier\":\"f\",\"count\":1933548472,\"quota\":{\"quantity\":4267907797964395511,\"unit\":\"hhavgrvkffovjz\"},\"startDate\":\"jbibg\",\"endDate\":\"fxumv\"},\"provisioningIssues\":[\"uyovw\",\"nbkfezzxscy\",\"wzdgirujbzbo\",\"vzzbtdcq\"]},\"id\":\"pniyujviyl\",\"name\":\"dshf\",\"type\":\"snrbgyefrymsgao\"}") - .toObject(CommitmentPlanInner.class); - Assertions.assertEquals("cbihwqk", model.kind()); - Assertions.assertEquals("dntwjchrdgo", model.sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.sku().tier()); - Assertions.assertEquals("mwctondzjluudfd", model.sku().size()); - Assertions.assertEquals("gg", model.sku().family()); - Assertions.assertEquals(407564287, model.sku().capacity()); - Assertions.assertEquals("tov", model.tags().get("tgseinqfiufxqkn")); - Assertions.assertEquals("tizzronasxif", model.location()); - Assertions.assertEquals("zh", model.properties().commitmentPlanGuid()); - Assertions.assertEquals(HostingModel.DISCONNECTED_CONTAINER, model.properties().hostingModel()); - Assertions.assertEquals("sgogczhonnxk", model.properties().planType()); - Assertions.assertEquals("nyhmossxkkgthr", model.properties().current().tier()); - Assertions.assertEquals(486654365, model.properties().current().count()); - Assertions.assertEquals(true, model.properties().autoRenew()); - Assertions.assertEquals("srtkfa", model.properties().next().tier()); - Assertions.assertEquals(1955812770, model.properties().next().count()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CommitmentPlanInner model = new CommitmentPlanInner().withKind("cbihwqk") - .withSku(new Sku().withName("dntwjchrdgo") - .withTier(SkuTier.PREMIUM) - .withSize("mwctondzjluudfd") - .withFamily("gg") - .withCapacity(407564287)) - .withTags(mapOf("tgseinqfiufxqkn", "tov", "ttwqmsni", "irgne", "rxfrddhc", "fcdmqnrojlpijn")) - .withLocation("tizzronasxif") - .withProperties(new CommitmentPlanProperties().withCommitmentPlanGuid("zh") - .withHostingModel(HostingModel.DISCONNECTED_CONTAINER) - .withPlanType("sgogczhonnxk") - .withCurrent(new CommitmentPeriod().withTier("nyhmossxkkgthr").withCount(486654365)) - .withAutoRenew(true) - .withNext(new CommitmentPeriod().withTier("srtkfa").withCount(1955812770))); - model = BinaryData.fromObject(model).toObject(CommitmentPlanInner.class); - Assertions.assertEquals("cbihwqk", model.kind()); - Assertions.assertEquals("dntwjchrdgo", model.sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.sku().tier()); - Assertions.assertEquals("mwctondzjluudfd", model.sku().size()); - Assertions.assertEquals("gg", model.sku().family()); - Assertions.assertEquals(407564287, model.sku().capacity()); - Assertions.assertEquals("tov", model.tags().get("tgseinqfiufxqkn")); - Assertions.assertEquals("tizzronasxif", model.location()); - Assertions.assertEquals("zh", model.properties().commitmentPlanGuid()); - Assertions.assertEquals(HostingModel.DISCONNECTED_CONTAINER, model.properties().hostingModel()); - Assertions.assertEquals("sgogczhonnxk", model.properties().planType()); - Assertions.assertEquals("nyhmossxkkgthr", model.properties().current().tier()); - Assertions.assertEquals(486654365, model.properties().current().count()); - Assertions.assertEquals(true, model.properties().autoRenew()); - Assertions.assertEquals("srtkfa", model.properties().next().tier()); - Assertions.assertEquals(1955812770, model.properties().next().count()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanListResultTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanListResultTests.java deleted file mode 100644 index c4c41aa169b2..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanListResultTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlanListResult; -import org.junit.jupiter.api.Assertions; - -public final class CommitmentPlanListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CommitmentPlanListResult model = BinaryData.fromString( - "{\"nextLink\":\"sdjpvkvp\",\"value\":[{\"etag\":\"zbzkdvncjabudurg\",\"kind\":\"kmokz\",\"sku\":{\"name\":\"jk\",\"tier\":\"Enterprise\",\"size\":\"mouwqlgzrfzeey\",\"family\":\"izikayuhq\",\"capacity\":2014142159},\"tags\":{\"ldgmfpgvmpip\":\"ybbqwrv\",\"x\":\"slthaq\"},\"location\":\"mwutwbdsre\",\"properties\":{\"provisioningState\":\"Succeeded\",\"commitmentPlanGuid\":\"neuyow\",\"hostingModel\":\"Web\",\"planType\":\"ytisibir\",\"current\":{\"tier\":\"ikpzimejza\",\"count\":108512766,\"quota\":{\"quantity\":5666619485240381449,\"unit\":\"rmbzo\"},\"startDate\":\"kixrj\",\"endDate\":\"irgzp\"},\"autoRenew\":false,\"next\":{\"tier\":\"szrnwo\",\"count\":1723984044,\"quota\":{\"quantity\":2655439268574784215,\"unit\":\"jylwbtlhflsj\"},\"startDate\":\"hszfjvfb\",\"endDate\":\"feljagrqm\"},\"last\":{\"tier\":\"dvriiiojnal\",\"count\":524245347,\"quota\":{\"quantity\":3278506032102071495,\"unit\":\"ex\"},\"startDate\":\"wueluqhhahhxv\",\"endDate\":\"mzkwpjg\"},\"provisioningIssues\":[\"pughftqsxh\",\"xujxuknd\",\"digrjguufzdmsyqt\"]},\"id\":\"ihwhbotzingamvpp\",\"name\":\"o\",\"type\":\"zqzudph\"},{\"etag\":\"vdkfwynwcvtbvk\",\"kind\":\"hmtnvy\",\"sku\":{\"name\":\"atkzwpcnpw\",\"tier\":\"Basic\",\"size\":\"esgvvsccyaj\",\"family\":\"qfhwyg\",\"capacity\":376601626},\"tags\":{\"emdwzrmuhapfc\":\"kfxu\"},\"location\":\"psqxq\",\"properties\":{\"provisioningState\":\"Moving\",\"commitmentPlanGuid\":\"oymgccelvezr\",\"hostingModel\":\"DisconnectedContainer\",\"planType\":\"mfe\",\"current\":{\"tier\":\"rqwky\",\"count\":359384916,\"quota\":{\"quantity\":2163259137534860371,\"unit\":\"edkowepbqpcrfk\"},\"startDate\":\"ccsnjvcdwxlpq\",\"endDate\":\"ftnkhtj\"},\"autoRenew\":false,\"next\":{\"tier\":\"wfqatmtd\",\"count\":866000446,\"quota\":{\"quantity\":5714337485006383517,\"unit\":\"ikdgszywkbir\"},\"startDate\":\"uzhlhkjoqrv\",\"endDate\":\"aatjinrvgoupmfi\"},\"last\":{\"tier\":\"ggjioolvr\",\"count\":1483667739,\"quota\":{\"quantity\":4652937384056066741,\"unit\":\"llqwjygvjayvblmh\"},\"startDate\":\"zuhbxvvyhgsopb\",\"endDate\":\"qufegxuvwzfbn\"},\"provisioningIssues\":[\"ctlpdngitvgb\",\"hrixkwmy\",\"jejveg\"]},\"id\":\"hbpnaixexccbd\",\"name\":\"eaxhcexdrrvqahqk\",\"type\":\"htpwij\"},{\"etag\":\"jsvfycxzbfvoowv\",\"kind\":\"mtg\",\"sku\":{\"name\":\"ppyostronzmyhgf\",\"tier\":\"Basic\",\"size\":\"xkmcwaekrrjre\",\"family\":\"xt\",\"capacity\":747215260},\"tags\":{\"pvuzlmv\":\"jglikkxwslolb\",\"gplcrpwjxeznoigb\":\"elfk\"},\"location\":\"jwmwkpnbs\",\"properties\":{\"provisioningState\":\"Failed\",\"commitmentPlanGuid\":\"oqkag\",\"hostingModel\":\"ConnectedContainer\",\"planType\":\"ttaugzxnfaazp\",\"current\":{\"tier\":\"n\",\"count\":1270256319,\"quota\":{\"quantity\":818520490272243455,\"unit\":\"wuenvr\"},\"startDate\":\"yo\",\"endDate\":\"ibreb\"},\"autoRenew\":true,\"next\":{\"tier\":\"j\",\"count\":1330578772,\"quota\":{\"quantity\":7129303737344697098,\"unit\":\"tezlwff\"},\"startDate\":\"akpjpqqmtedlt\",\"endDate\":\"jihy\"},\"last\":{\"tier\":\"phvwauyqncygu\",\"count\":2143760681,\"quota\":{\"quantity\":2524662615582469653,\"unit\":\"cwxqu\"},\"startDate\":\"vzhfstotxhoj\",\"endDate\":\"bypel\"},\"provisioningIssues\":[\"vhixbjxy\",\"w\",\"yl\"]},\"id\":\"coolsttpkiwkkb\",\"name\":\"ujrywvtyl\",\"type\":\"fpncurdo\"}]}") - .toObject(CommitmentPlanListResult.class); - Assertions.assertEquals("sdjpvkvp", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CommitmentPlanListResult model = new CommitmentPlanListResult().withNextLink("sdjpvkvp"); - model = BinaryData.fromObject(model).toObject(CommitmentPlanListResult.class); - Assertions.assertEquals("sdjpvkvp", model.nextLink()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanPropertiesTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanPropertiesTests.java deleted file mode 100644 index fce50366504b..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanPropertiesTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPeriod; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlanProperties; -import com.azure.resourcemanager.cognitiveservices.models.HostingModel; -import org.junit.jupiter.api.Assertions; - -public final class CommitmentPlanPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CommitmentPlanProperties model = BinaryData.fromString( - "{\"provisioningState\":\"Moving\",\"commitmentPlanGuid\":\"nc\",\"hostingModel\":\"DisconnectedContainer\",\"planType\":\"fhir\",\"current\":{\"tier\":\"moxoftpi\",\"count\":828485961,\"quota\":{\"quantity\":3781366448513204027,\"unit\":\"xacpqjli\"},\"startDate\":\"yuspskas\",\"endDate\":\"lmfwdgzx\"},\"autoRenew\":false,\"next\":{\"tier\":\"pamrsr\",\"count\":866301348,\"quota\":{\"quantity\":7194736434377402357,\"unit\":\"sjnhn\"},\"startDate\":\"xifqjzgxm\",\"endDate\":\"ublwpcesutrg\"},\"last\":{\"tier\":\"auutpwoqhihe\",\"count\":89548348,\"quota\":{\"quantity\":742897891377561430,\"unit\":\"qntcypsxjvfoimwk\"},\"startDate\":\"ircizjxvy\",\"endDate\":\"ceacvlhvygdy\"},\"provisioningIssues\":[\"mrtwna\",\"jslb\",\"wkojgcyztsfmzn\"]}") - .toObject(CommitmentPlanProperties.class); - Assertions.assertEquals("nc", model.commitmentPlanGuid()); - Assertions.assertEquals(HostingModel.DISCONNECTED_CONTAINER, model.hostingModel()); - Assertions.assertEquals("fhir", model.planType()); - Assertions.assertEquals("moxoftpi", model.current().tier()); - Assertions.assertEquals(828485961, model.current().count()); - Assertions.assertEquals(false, model.autoRenew()); - Assertions.assertEquals("pamrsr", model.next().tier()); - Assertions.assertEquals(866301348, model.next().count()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CommitmentPlanProperties model = new CommitmentPlanProperties().withCommitmentPlanGuid("nc") - .withHostingModel(HostingModel.DISCONNECTED_CONTAINER) - .withPlanType("fhir") - .withCurrent(new CommitmentPeriod().withTier("moxoftpi").withCount(828485961)) - .withAutoRenew(false) - .withNext(new CommitmentPeriod().withTier("pamrsr").withCount(866301348)); - model = BinaryData.fromObject(model).toObject(CommitmentPlanProperties.class); - Assertions.assertEquals("nc", model.commitmentPlanGuid()); - Assertions.assertEquals(HostingModel.DISCONNECTED_CONTAINER, model.hostingModel()); - Assertions.assertEquals("fhir", model.planType()); - Assertions.assertEquals("moxoftpi", model.current().tier()); - Assertions.assertEquals(828485961, model.current().count()); - Assertions.assertEquals(false, model.autoRenew()); - Assertions.assertEquals("pamrsr", model.next().tier()); - Assertions.assertEquals(866301348, model.next().count()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdateAssociationMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdateAssociationMockTests.java deleted file mode 100644 index ce924999bcc2..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdateAssociationMockTests.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlanAccountAssociation; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class CommitmentPlansCreateOrUpdateAssociationMockTests { - @Test - public void testCreateOrUpdateAssociation() throws Exception { - String responseStr - = "{\"etag\":\"aafrqulhmzyqbhd\",\"tags\":{\"wmzwdfkbnrzorpdl\":\"jrqpjiyrqjcrga\",\"qjf\":\"bqc\",\"gvpyigdaqqilzdc\":\"xxsaetgz\"},\"properties\":{\"accountId\":\"joedx\"},\"id\":\"gucaif\",\"name\":\"aurwwgilfjq\",\"type\":\"a\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CommitmentPlanAccountAssociation response = manager.commitmentPlans() - .defineAssociation("wlwxlboncqbazqic") - .withExistingCommitmentPlan("ykmxcpwzvm", "oksqdt") - .withTags(mapOf("i", "xyqvg", "tvo", "od", "s", "kxdxuwsaifmcwn", "y", "zlehgcvkbcknjolg")) - .withAccountId("velsz") - .create(); - - Assertions.assertEquals("jrqpjiyrqjcrga", response.tags().get("wmzwdfkbnrzorpdl")); - Assertions.assertEquals("joedx", response.accountId()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdatePlanMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdatePlanMockTests.java deleted file mode 100644 index d3e7179f991d..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdatePlanMockTests.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPeriod; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlan; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlanProperties; -import com.azure.resourcemanager.cognitiveservices.models.HostingModel; -import com.azure.resourcemanager.cognitiveservices.models.Sku; -import com.azure.resourcemanager.cognitiveservices.models.SkuTier; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class CommitmentPlansCreateOrUpdatePlanMockTests { - @Test - public void testCreateOrUpdatePlan() throws Exception { - String responseStr - = "{\"etag\":\"zyqu\",\"kind\":\"sqxutr\",\"sku\":{\"name\":\"rruyuu\",\"tier\":\"Basic\",\"size\":\"mbjwcolbmxlb\",\"family\":\"tpc\",\"capacity\":1170743993},\"tags\":{\"vxhmtfhocnxzcmj\":\"z\"},\"location\":\"gxnoqrxtdis\",\"properties\":{\"provisioningState\":\"Succeeded\",\"commitmentPlanGuid\":\"d\",\"hostingModel\":\"ProvisionedWeb\",\"planType\":\"idwhepfw\",\"current\":{\"tier\":\"f\",\"count\":1851489333,\"quota\":{\"quantity\":4067085103583687450,\"unit\":\"wcdbckyoik\"},\"startDate\":\"xhn\",\"endDate\":\"knjz\"},\"autoRenew\":false,\"next\":{\"tier\":\"e\",\"count\":1365496443,\"quota\":{\"quantity\":7662967851751345556,\"unit\":\"rlbpgsnbagnc\"},\"startDate\":\"hg\",\"endDate\":\"uowakyw\"},\"last\":{\"tier\":\"jymxcgqt\",\"count\":886667485,\"quota\":{\"quantity\":2572709377842820950,\"unit\":\"ol\"},\"startDate\":\"mevtfycnlbvgjc\",\"endDate\":\"kk\"},\"provisioningIssues\":[\"iytssikizbc\"]},\"id\":\"fqb\",\"name\":\"ntnrgmqsorh\",\"type\":\"ekxgn\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CommitmentPlan response = manager.commitmentPlans() - .definePlan("jodqhykincn") - .withExistingResourceGroup("ijpodtblxpkkwj") - .withRegion("jbfqzdk") - .withTags(mapOf("ouvblgmo", "lowuowhlxlnwyr", "ih", "zkltrfowtdvrfmv", "hdxlw", "vjdrqcrjidhftuk")) - .withKind("odkadppyibngq") - .withSku(new Sku().withName("d") - .withTier(SkuTier.ENTERPRISE) - .withSize("whydt") - .withFamily("vvadswzs") - .withCapacity(1437535025)) - .withProperties(new CommitmentPlanProperties().withCommitmentPlanGuid("xhafratqx") - .withHostingModel(HostingModel.CONNECTED_CONTAINER) - .withPlanType("oum") - .withCurrent(new CommitmentPeriod().withTier("valqjrhuzgfxo").withCount(256650103)) - .withAutoRenew(true) - .withNext(new CommitmentPeriod().withTier("socnequygdjboq").withCount(1174525778))) - .create(); - - Assertions.assertEquals("sqxutr", response.kind()); - Assertions.assertEquals("rruyuu", response.sku().name()); - Assertions.assertEquals(SkuTier.BASIC, response.sku().tier()); - Assertions.assertEquals("mbjwcolbmxlb", response.sku().size()); - Assertions.assertEquals("tpc", response.sku().family()); - Assertions.assertEquals(1170743993, response.sku().capacity()); - Assertions.assertEquals("z", response.tags().get("vxhmtfhocnxzcmj")); - Assertions.assertEquals("gxnoqrxtdis", response.location()); - Assertions.assertEquals("d", response.properties().commitmentPlanGuid()); - Assertions.assertEquals(HostingModel.PROVISIONED_WEB, response.properties().hostingModel()); - Assertions.assertEquals("idwhepfw", response.properties().planType()); - Assertions.assertEquals("f", response.properties().current().tier()); - Assertions.assertEquals(1851489333, response.properties().current().count()); - Assertions.assertEquals(false, response.properties().autoRenew()); - Assertions.assertEquals("e", response.properties().next().tier()); - Assertions.assertEquals(1365496443, response.properties().next().count()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdateWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 788a1054cb22..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentPlanInner; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPeriod; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlan; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlanProperties; -import com.azure.resourcemanager.cognitiveservices.models.HostingModel; -import com.azure.resourcemanager.cognitiveservices.models.Sku; -import com.azure.resourcemanager.cognitiveservices.models.SkuTier; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class CommitmentPlansCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - String responseStr - = "{\"etag\":\"iknaqlnuwig\",\"kind\":\"xly\",\"sku\":{\"name\":\"phvxz\",\"tier\":\"Basic\",\"size\":\"mpe\",\"family\":\"lkexaonwivkcqh\",\"capacity\":1725747422},\"tags\":{\"kyupijubyqj\":\"nlccrm\",\"em\":\"kakfqfr\",\"udxjascowv\":\"il\"},\"location\":\"jkpdxphlkksnm\",\"properties\":{\"provisioningState\":\"Canceled\",\"commitmentPlanGuid\":\"ij\",\"hostingModel\":\"DisconnectedContainer\",\"planType\":\"qnwsithuqolyah\",\"current\":{\"tier\":\"wqulsutrjbhxykf\",\"count\":897956797,\"quota\":{\"quantity\":4363100729700765974,\"unit\":\"ugdrftbc\"},\"startDate\":\"xreuquowtlj\",\"endDate\":\"whreagkhyxvrq\"},\"autoRenew\":true,\"next\":{\"tier\":\"sulmd\",\"count\":1680139409,\"quota\":{\"quantity\":1327937751806855474,\"unit\":\"fs\"},\"startDate\":\"kgsangpszng\",\"endDate\":\"p\"},\"last\":{\"tier\":\"kvec\",\"count\":467125688,\"quota\":{\"quantity\":1685834102590271868,\"unit\":\"dyedmzrgjfo\"},\"startDate\":\"ubn\",\"endDate\":\"tp\"},\"provisioningIssues\":[\"trgdgxvc\",\"qraswugyxpqitwei\",\"l\"]},\"id\":\"vskbuhzacaq\",\"name\":\"yltcoqcuj\",\"type\":\"dsxzakuejkmvb\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CommitmentPlan response = manager.commitmentPlans() - .createOrUpdateWithResponse("yklxe", "lkhhu", "tcpoqma", - new CommitmentPlanInner().withKind("kxybwfdbkj") - .withSku(new Sku().withName("tensvkzykj") - .withTier(SkuTier.STANDARD) - .withSize("sxfwushcdp") - .withFamily("pn") - .withCapacity(1578351643)) - .withTags(mapOf("eoiojfizfavkjzw", "fbpkuw")) - .withLocation("cyayk") - .withProperties(new CommitmentPlanProperties().withCommitmentPlanGuid("bfw") - .withHostingModel(HostingModel.CONNECTED_CONTAINER) - .withPlanType("mdew") - .withCurrent(new CommitmentPeriod().withTier("xkrplbjaz").withCount(1392015942)) - .withAutoRenew(true) - .withNext(new CommitmentPeriod().withTier("ozycy").withCount(1170994153))), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("xly", response.kind()); - Assertions.assertEquals("phvxz", response.sku().name()); - Assertions.assertEquals(SkuTier.BASIC, response.sku().tier()); - Assertions.assertEquals("mpe", response.sku().size()); - Assertions.assertEquals("lkexaonwivkcqh", response.sku().family()); - Assertions.assertEquals(1725747422, response.sku().capacity()); - Assertions.assertEquals("nlccrm", response.tags().get("kyupijubyqj")); - Assertions.assertEquals("jkpdxphlkksnm", response.location()); - Assertions.assertEquals("ij", response.properties().commitmentPlanGuid()); - Assertions.assertEquals(HostingModel.DISCONNECTED_CONTAINER, response.properties().hostingModel()); - Assertions.assertEquals("qnwsithuqolyah", response.properties().planType()); - Assertions.assertEquals("wqulsutrjbhxykf", response.properties().current().tier()); - Assertions.assertEquals(897956797, response.properties().current().count()); - Assertions.assertEquals(true, response.properties().autoRenew()); - Assertions.assertEquals("sulmd", response.properties().next().tier()); - Assertions.assertEquals(1680139409, response.properties().next().count()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeleteAssociationMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeleteAssociationMockTests.java deleted file mode 100644 index bc5096335f7b..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeleteAssociationMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class CommitmentPlansDeleteAssociationMockTests { - @Test - public void testDeleteAssociation() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.commitmentPlans() - .deleteAssociation("skieca", "ygzmxieqvdsmak", "ixqcahyhxalybxaw", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeleteMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeleteMockTests.java deleted file mode 100644 index 7516a1ae3d21..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeleteMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class CommitmentPlansDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.commitmentPlans() - .delete("ztjofqcvovjufyc", "jmlbemyejiriux", "gthortudaw", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeletePlanMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeletePlanMockTests.java deleted file mode 100644 index 8740ccac36bf..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeletePlanMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class CommitmentPlansDeletePlanMockTests { - @Test - public void testDeletePlan() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.commitmentPlans().deletePlan("pjfe", "qerpptcbgqnzm", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetAssociationWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetAssociationWithResponseMockTests.java deleted file mode 100644 index d7fbf1b4ce63..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetAssociationWithResponseMockTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlanAccountAssociation; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class CommitmentPlansGetAssociationWithResponseMockTests { - @Test - public void testGetAssociationWithResponse() throws Exception { - String responseStr - = "{\"etag\":\"ruqnm\",\"tags\":{\"qswbqerzwx\":\"azcvjyt\",\"vlbpktgdstyou\":\"ytxtdgu\",\"egmmuteyxe\":\"mbewreswmo\",\"xlzdesygrijwa\":\"guqigijiitns\"},\"properties\":{\"accountId\":\"anra\"},\"id\":\"bfu\",\"name\":\"qfrojsydgrhyd\",\"type\":\"ygywe\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CommitmentPlanAccountAssociation response = manager.commitmentPlans() - .getAssociationWithResponse("hpzfngqj", "lidftujwjj", "fwbeqrkuorh", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("azcvjyt", response.tags().get("qswbqerzwx")); - Assertions.assertEquals("anra", response.accountId()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetByResourceGroupWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index c6eadf8ae64f..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlan; -import com.azure.resourcemanager.cognitiveservices.models.HostingModel; -import com.azure.resourcemanager.cognitiveservices.models.SkuTier; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class CommitmentPlansGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - String responseStr - = "{\"etag\":\"cccg\",\"kind\":\"raoxnyuff\",\"sku\":{\"name\":\"sgftipwc\",\"tier\":\"Standard\",\"size\":\"bh\",\"family\":\"dxyurnpnuhza\",\"capacity\":1652198165},\"tags\":{\"bui\":\"hiigby\",\"vcrk\":\"vxva\"},\"location\":\"b\",\"properties\":{\"provisioningState\":\"Deleting\",\"commitmentPlanGuid\":\"h\",\"hostingModel\":\"ProvisionedWeb\",\"planType\":\"zlwxaeaovur\",\"current\":{\"tier\":\"ndsbdw\",\"count\":187101645,\"quota\":{\"quantity\":2166976077432391171,\"unit\":\"ntopa\"},\"startDate\":\"tmvmmagoaqylkjz\",\"endDate\":\"iua\"},\"autoRenew\":false,\"next\":{\"tier\":\"xitp\",\"count\":232494385,\"quota\":{\"quantity\":8242856293645817754,\"unit\":\"tkrlgjmtbd\"},\"startDate\":\"cqguef\",\"endDate\":\"ompheqdur\"},\"last\":{\"tier\":\"ujlfyoumpcky\",\"count\":902015093,\"quota\":{\"quantity\":8255014735676328345,\"unit\":\"tajbrz\"},\"startDate\":\"xucycijoclxi\",\"endDate\":\"gjcyzyzjdnrq\"},\"provisioningIssues\":[\"xjeaoqaqbzgyh\",\"w\",\"v\",\"atbwbqam\"]},\"id\":\"e\",\"name\":\"liys\",\"type\":\"pkcvmwf\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CommitmentPlan response = manager.commitmentPlans() - .getByResourceGroupWithResponse("h", "ilialwcjgc", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("raoxnyuff", response.kind()); - Assertions.assertEquals("sgftipwc", response.sku().name()); - Assertions.assertEquals(SkuTier.STANDARD, response.sku().tier()); - Assertions.assertEquals("bh", response.sku().size()); - Assertions.assertEquals("dxyurnpnuhza", response.sku().family()); - Assertions.assertEquals(1652198165, response.sku().capacity()); - Assertions.assertEquals("hiigby", response.tags().get("bui")); - Assertions.assertEquals("b", response.location()); - Assertions.assertEquals("h", response.properties().commitmentPlanGuid()); - Assertions.assertEquals(HostingModel.PROVISIONED_WEB, response.properties().hostingModel()); - Assertions.assertEquals("zlwxaeaovur", response.properties().planType()); - Assertions.assertEquals("ndsbdw", response.properties().current().tier()); - Assertions.assertEquals(187101645, response.properties().current().count()); - Assertions.assertEquals(false, response.properties().autoRenew()); - Assertions.assertEquals("xitp", response.properties().next().tier()); - Assertions.assertEquals(232494385, response.properties().next().count()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetWithResponseMockTests.java deleted file mode 100644 index 640dcb105186..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetWithResponseMockTests.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlan; -import com.azure.resourcemanager.cognitiveservices.models.HostingModel; -import com.azure.resourcemanager.cognitiveservices.models.SkuTier; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class CommitmentPlansGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"etag\":\"tehqpuvjmvq\",\"kind\":\"dwckygroe\",\"sku\":{\"name\":\"ndljdjuskbr\",\"tier\":\"Premium\",\"size\":\"n\",\"family\":\"eysfaqegplw\",\"capacity\":614396820},\"tags\":{\"ybwptda\":\"ddkvbxgkqu\"},\"location\":\"rvv\",\"properties\":{\"provisioningState\":\"Deleting\",\"commitmentPlanGuid\":\"mt\",\"hostingModel\":\"DisconnectedContainer\",\"planType\":\"enazerohzrsqals\",\"current\":{\"tier\":\"nwqapfgsdpcvess\",\"count\":1784953351,\"quota\":{\"quantity\":7757305945865204885,\"unit\":\"pldqqct\"},\"startDate\":\"valblhtjqv\",\"endDate\":\"vweht\"},\"autoRenew\":true,\"next\":{\"tier\":\"zzy\",\"count\":1487299849,\"quota\":{\"quantity\":9100193198940952535,\"unit\":\"zrrryv\"},\"startDate\":\"mipskdyzatv\",\"endDate\":\"zkaftjvvrux\"},\"last\":{\"tier\":\"syeipqd\",\"count\":2098179357,\"quota\":{\"quantity\":934467491416540675,\"unit\":\"dgkkile\"},\"startDate\":\"kcsmk\",\"endDate\":\"wtbbaedorvvmqf\"},\"provisioningIssues\":[\"gbdg\",\"umgxdgdhpab\",\"dexjddvjs\",\"qwotmmwllcol\"]},\"id\":\"rsxaptefh\",\"name\":\"xcgjokjljnhvlq\",\"type\":\"bekpeeksnbksdqhj\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CommitmentPlan response = manager.commitmentPlans() - .getWithResponse("qaqkuea", "groeshoyg", "cbyfqxkf", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("dwckygroe", response.kind()); - Assertions.assertEquals("ndljdjuskbr", response.sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, response.sku().tier()); - Assertions.assertEquals("n", response.sku().size()); - Assertions.assertEquals("eysfaqegplw", response.sku().family()); - Assertions.assertEquals(614396820, response.sku().capacity()); - Assertions.assertEquals("ddkvbxgkqu", response.tags().get("ybwptda")); - Assertions.assertEquals("rvv", response.location()); - Assertions.assertEquals("mt", response.properties().commitmentPlanGuid()); - Assertions.assertEquals(HostingModel.DISCONNECTED_CONTAINER, response.properties().hostingModel()); - Assertions.assertEquals("enazerohzrsqals", response.properties().planType()); - Assertions.assertEquals("nwqapfgsdpcvess", response.properties().current().tier()); - Assertions.assertEquals(1784953351, response.properties().current().count()); - Assertions.assertEquals(true, response.properties().autoRenew()); - Assertions.assertEquals("zzy", response.properties().next().tier()); - Assertions.assertEquals(1487299849, response.properties().next().count()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListAssociationsMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListAssociationsMockTests.java deleted file mode 100644 index 688113feed1b..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListAssociationsMockTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlanAccountAssociation; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class CommitmentPlansListAssociationsMockTests { - @Test - public void testListAssociations() throws Exception { - String responseStr - = "{\"value\":[{\"etag\":\"kdvezc\",\"tags\":{\"ub\":\"sbzhd\",\"ugiqjtiogqg\":\"nqfblhkalehpava\",\"eajohiyg\":\"minict\",\"kmktpvwxqcseh\":\"pnbonhpcz\"},\"properties\":{\"accountId\":\"hufmpq\"},\"id\":\"mqyjgy\",\"name\":\"zulo\",\"type\":\"saeuzanhsfnhsenw\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.commitmentPlans().listAssociations("fwmyymv", "dbpb", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("sbzhd", response.iterator().next().tags().get("ub")); - Assertions.assertEquals("hufmpq", response.iterator().next().accountId()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListByResourceGroupMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListByResourceGroupMockTests.java deleted file mode 100644 index 459a8b4bc20c..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListByResourceGroupMockTests.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlan; -import com.azure.resourcemanager.cognitiveservices.models.HostingModel; -import com.azure.resourcemanager.cognitiveservices.models.SkuTier; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class CommitmentPlansListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - String responseStr - = "{\"value\":[{\"etag\":\"ywbo\",\"kind\":\"c\",\"sku\":{\"name\":\"iciijqpkzfbojx\",\"tier\":\"Premium\",\"size\":\"myqwixvcpwnkwywz\",\"family\":\"falickduoiqtamty\",\"capacity\":468149432},\"tags\":{\"cfhzagxnvhycv\":\"rwzawnvs\",\"rw\":\"imwrzregzgyufu\",\"hmeott\":\"weryekzk\"},\"location\":\"jyosxwwh\",\"properties\":{\"provisioningState\":\"Succeeded\",\"commitmentPlanGuid\":\"vpndp\",\"hostingModel\":\"DisconnectedContainer\",\"planType\":\"pnwy\",\"current\":{\"tier\":\"qllzsauzpjlxeehu\",\"count\":1834453313,\"quota\":{\"quantity\":5516168452931555191,\"unit\":\"yme\"},\"startDate\":\"lskihmxrfdsajred\",\"endDate\":\"yyshtuwgmevua\"},\"autoRenew\":false,\"next\":{\"tier\":\"ifrkgwltxeqipx\",\"count\":1931684247,\"quota\":{\"quantity\":3749646104554834648,\"unit\":\"ayorprav\"},\"startDate\":\"oge\",\"endDate\":\"abnsmj\"},\"last\":{\"tier\":\"nqxaekqsyk\",\"count\":2046181872,\"quota\":{\"quantity\":9008251062718128315,\"unit\":\"vmyltjcrspx\"},\"startDate\":\"urcclfgxannn\",\"endDate\":\"t\"},\"provisioningIssues\":[\"sewxigpxvkqm\",\"upxvpifd\"]},\"id\":\"aifyzyzeyuubeids\",\"name\":\"l\",\"type\":\"ytoithgygvfl\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.commitmentPlans().listByResourceGroup("uxx", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("c", response.iterator().next().kind()); - Assertions.assertEquals("iciijqpkzfbojx", response.iterator().next().sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, response.iterator().next().sku().tier()); - Assertions.assertEquals("myqwixvcpwnkwywz", response.iterator().next().sku().size()); - Assertions.assertEquals("falickduoiqtamty", response.iterator().next().sku().family()); - Assertions.assertEquals(468149432, response.iterator().next().sku().capacity()); - Assertions.assertEquals("rwzawnvs", response.iterator().next().tags().get("cfhzagxnvhycv")); - Assertions.assertEquals("jyosxwwh", response.iterator().next().location()); - Assertions.assertEquals("vpndp", response.iterator().next().properties().commitmentPlanGuid()); - Assertions.assertEquals(HostingModel.DISCONNECTED_CONTAINER, - response.iterator().next().properties().hostingModel()); - Assertions.assertEquals("pnwy", response.iterator().next().properties().planType()); - Assertions.assertEquals("qllzsauzpjlxeehu", response.iterator().next().properties().current().tier()); - Assertions.assertEquals(1834453313, response.iterator().next().properties().current().count()); - Assertions.assertEquals(false, response.iterator().next().properties().autoRenew()); - Assertions.assertEquals("ifrkgwltxeqipx", response.iterator().next().properties().next().tier()); - Assertions.assertEquals(1931684247, response.iterator().next().properties().next().count()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListMockTests.java deleted file mode 100644 index bb12e54641a0..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListMockTests.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlan; -import com.azure.resourcemanager.cognitiveservices.models.HostingModel; -import com.azure.resourcemanager.cognitiveservices.models.SkuTier; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class CommitmentPlansListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"etag\":\"gqztwhghmupgx\",\"kind\":\"tcdxabbujftaben\",\"sku\":{\"name\":\"klqpx\",\"tier\":\"Enterprise\",\"size\":\"feddwwnlza\",\"family\":\"xud\",\"capacity\":1909698338},\"tags\":{\"gpbemeluclvdjju\":\"okrtalvnb\",\"ahhxhqfaqnvzoqg\":\"yrdnqod\",\"ejdtxptl\":\"ipemchgavscz\"},\"location\":\"wzhomewjjstl\",\"properties\":{\"provisioningState\":\"Failed\",\"commitmentPlanGuid\":\"wmoaiancznvodrrs\",\"hostingModel\":\"DisconnectedContainer\",\"planType\":\"ydkxr\",\"current\":{\"tier\":\"bxiwkgfbqljn\",\"count\":1056190404,\"quota\":{\"quantity\":93268107041015915,\"unit\":\"okulehurqlrqf\"},\"startDate\":\"weyurkphyjd\",\"endDate\":\"av\"},\"autoRenew\":true,\"next\":{\"tier\":\"rxmrgchbapx\",\"count\":257643221,\"quota\":{\"quantity\":316638403801617867,\"unit\":\"ajb\"},\"startDate\":\"cgduusio\",\"endDate\":\"blevpmcluj\"},\"last\":{\"tier\":\"yxlzgs\",\"count\":733092764,\"quota\":{\"quantity\":2104792511194971954,\"unit\":\"fhbzffovwmbjlzq\"},\"startDate\":\"zpgvdwnapfd\",\"endDate\":\"owftptnuwjtks\"},\"provisioningIssues\":[\"cgqyhleseyq\",\"hvyeldotj\",\"dkwisw\",\"kukjtasb\"]},\"id\":\"wispkxk\",\"name\":\"txfkndlqvt\",\"type\":\"knvgmmbugtywat\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.commitmentPlans().list("v", "kxrerlniylylyfwx", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("tcdxabbujftaben", response.iterator().next().kind()); - Assertions.assertEquals("klqpx", response.iterator().next().sku().name()); - Assertions.assertEquals(SkuTier.ENTERPRISE, response.iterator().next().sku().tier()); - Assertions.assertEquals("feddwwnlza", response.iterator().next().sku().size()); - Assertions.assertEquals("xud", response.iterator().next().sku().family()); - Assertions.assertEquals(1909698338, response.iterator().next().sku().capacity()); - Assertions.assertEquals("okrtalvnb", response.iterator().next().tags().get("gpbemeluclvdjju")); - Assertions.assertEquals("wzhomewjjstl", response.iterator().next().location()); - Assertions.assertEquals("wmoaiancznvodrrs", response.iterator().next().properties().commitmentPlanGuid()); - Assertions.assertEquals(HostingModel.DISCONNECTED_CONTAINER, - response.iterator().next().properties().hostingModel()); - Assertions.assertEquals("ydkxr", response.iterator().next().properties().planType()); - Assertions.assertEquals("bxiwkgfbqljn", response.iterator().next().properties().current().tier()); - Assertions.assertEquals(1056190404, response.iterator().next().properties().current().count()); - Assertions.assertEquals(true, response.iterator().next().properties().autoRenew()); - Assertions.assertEquals("rxmrgchbapx", response.iterator().next().properties().next().tier()); - Assertions.assertEquals(257643221, response.iterator().next().properties().next().count()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListPlansBySubscriptionMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListPlansBySubscriptionMockTests.java deleted file mode 100644 index 76b37b1e1bb1..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListPlansBySubscriptionMockTests.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlan; -import com.azure.resourcemanager.cognitiveservices.models.HostingModel; -import com.azure.resourcemanager.cognitiveservices.models.SkuTier; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class CommitmentPlansListPlansBySubscriptionMockTests { - @Test - public void testListPlansBySubscription() throws Exception { - String responseStr - = "{\"value\":[{\"etag\":\"dihoyn\",\"kind\":\"xwetwkdrcyrucpc\",\"sku\":{\"name\":\"nuzdqumo\",\"tier\":\"Basic\",\"size\":\"naie\",\"family\":\"qh\",\"capacity\":1421414952},\"tags\":{\"foanniyopetx\":\"elqkaadlkn\",\"nucaephblkwqpat\":\"vcnrly\",\"uzqymtuowog\":\"bqsdtcjbctvi\"},\"location\":\"it\",\"properties\":{\"provisioningState\":\"Accepted\",\"commitmentPlanGuid\":\"b\",\"hostingModel\":\"Web\",\"planType\":\"banf\",\"current\":{\"tier\":\"scxmxeat\",\"count\":932659658,\"quota\":{\"quantity\":2580805120871115843,\"unit\":\"jyibqbna\"},\"startDate\":\"hjrmkuhmaxl\",\"endDate\":\"lfihcj\"},\"autoRenew\":false,\"next\":{\"tier\":\"nc\",\"count\":152401377,\"quota\":{\"quantity\":2348526307879631032,\"unit\":\"a\"},\"startDate\":\"gvaknokzwjjzrl\",\"endDate\":\"xldzyyfytpqsix\"},\"last\":{\"tier\":\"puj\",\"count\":1424381442,\"quota\":{\"quantity\":4999753329886050204,\"unit\":\"vsmb\"},\"startDate\":\"lzoy\",\"endDate\":\"wzdbpqvybefgv\"},\"provisioningIssues\":[\"okcvtlubses\",\"vcuartrhun\"]},\"id\":\"pirykycndzfqiv\",\"name\":\"reuykbbmnwagl\",\"type\":\"bxoeeonql\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.commitmentPlans().listPlansBySubscription(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("xwetwkdrcyrucpc", response.iterator().next().kind()); - Assertions.assertEquals("nuzdqumo", response.iterator().next().sku().name()); - Assertions.assertEquals(SkuTier.BASIC, response.iterator().next().sku().tier()); - Assertions.assertEquals("naie", response.iterator().next().sku().size()); - Assertions.assertEquals("qh", response.iterator().next().sku().family()); - Assertions.assertEquals(1421414952, response.iterator().next().sku().capacity()); - Assertions.assertEquals("elqkaadlkn", response.iterator().next().tags().get("foanniyopetx")); - Assertions.assertEquals("it", response.iterator().next().location()); - Assertions.assertEquals("b", response.iterator().next().properties().commitmentPlanGuid()); - Assertions.assertEquals(HostingModel.WEB, response.iterator().next().properties().hostingModel()); - Assertions.assertEquals("banf", response.iterator().next().properties().planType()); - Assertions.assertEquals("scxmxeat", response.iterator().next().properties().current().tier()); - Assertions.assertEquals(932659658, response.iterator().next().properties().current().count()); - Assertions.assertEquals(false, response.iterator().next().properties().autoRenew()); - Assertions.assertEquals("nc", response.iterator().next().properties().next().tier()); - Assertions.assertEquals(152401377, response.iterator().next().properties().next().count()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentQuotaTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentQuotaTests.java deleted file mode 100644 index 049cc7bf4b3a..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentQuotaTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentQuota; -import org.junit.jupiter.api.Assertions; - -public final class CommitmentQuotaTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CommitmentQuota model = BinaryData.fromString("{\"quantity\":193130563963832642,\"unit\":\"nxipeil\"}") - .toObject(CommitmentQuota.class); - Assertions.assertEquals(193130563963832642L, model.quantity()); - Assertions.assertEquals("nxipeil", model.unit()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CommitmentQuota model = new CommitmentQuota().withQuantity(193130563963832642L).withUnit("nxipeil"); - model = BinaryData.fromObject(model).toObject(CommitmentQuota.class); - Assertions.assertEquals(193130563963832642L, model.quantity()); - Assertions.assertEquals("nxipeil", model.unit()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentTierInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentTierInnerTests.java deleted file mode 100644 index c6b9c3be1f98..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentTierInnerTests.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentTierInner; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentCost; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentQuota; -import com.azure.resourcemanager.cognitiveservices.models.HostingModel; -import org.junit.jupiter.api.Assertions; - -public final class CommitmentTierInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CommitmentTierInner model = BinaryData.fromString( - "{\"kind\":\"wmdyvxqtay\",\"skuName\":\"ww\",\"hostingModel\":\"ProvisionedWeb\",\"planType\":\"bexrmcq\",\"tier\":\"ycnojvknmefqsg\",\"maxCount\":488274582,\"quota\":{\"quantity\":7076429131580364634,\"unit\":\"zhpvgqzcjrvxd\"},\"cost\":{\"commitmentMeterId\":\"mwlxk\",\"overageMeterId\":\"gfhzovawjvzunlut\"}}") - .toObject(CommitmentTierInner.class); - Assertions.assertEquals("wmdyvxqtay", model.kind()); - Assertions.assertEquals("ww", model.skuName()); - Assertions.assertEquals(HostingModel.PROVISIONED_WEB, model.hostingModel()); - Assertions.assertEquals("bexrmcq", model.planType()); - Assertions.assertEquals("ycnojvknmefqsg", model.tier()); - Assertions.assertEquals(488274582, model.maxCount()); - Assertions.assertEquals(7076429131580364634L, model.quota().quantity()); - Assertions.assertEquals("zhpvgqzcjrvxd", model.quota().unit()); - Assertions.assertEquals("mwlxk", model.cost().commitmentMeterId()); - Assertions.assertEquals("gfhzovawjvzunlut", model.cost().overageMeterId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CommitmentTierInner model = new CommitmentTierInner().withKind("wmdyvxqtay") - .withSkuName("ww") - .withHostingModel(HostingModel.PROVISIONED_WEB) - .withPlanType("bexrmcq") - .withTier("ycnojvknmefqsg") - .withMaxCount(488274582) - .withQuota(new CommitmentQuota().withQuantity(7076429131580364634L).withUnit("zhpvgqzcjrvxd")) - .withCost(new CommitmentCost().withCommitmentMeterId("mwlxk").withOverageMeterId("gfhzovawjvzunlut")); - model = BinaryData.fromObject(model).toObject(CommitmentTierInner.class); - Assertions.assertEquals("wmdyvxqtay", model.kind()); - Assertions.assertEquals("ww", model.skuName()); - Assertions.assertEquals(HostingModel.PROVISIONED_WEB, model.hostingModel()); - Assertions.assertEquals("bexrmcq", model.planType()); - Assertions.assertEquals("ycnojvknmefqsg", model.tier()); - Assertions.assertEquals(488274582, model.maxCount()); - Assertions.assertEquals(7076429131580364634L, model.quota().quantity()); - Assertions.assertEquals("zhpvgqzcjrvxd", model.quota().unit()); - Assertions.assertEquals("mwlxk", model.cost().commitmentMeterId()); - Assertions.assertEquals("gfhzovawjvzunlut", model.cost().overageMeterId()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentTierListResultTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentTierListResultTests.java deleted file mode 100644 index ea5a56b67beb..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentTierListResultTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentTierListResult; -import org.junit.jupiter.api.Assertions; - -public final class CommitmentTierListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CommitmentTierListResult model = BinaryData.fromString( - "{\"nextLink\":\"ugicjooxdjebw\",\"value\":[{\"kind\":\"wfvovbv\",\"skuName\":\"uecivyhz\",\"hostingModel\":\"ConnectedContainer\",\"planType\":\"jgjrwjueiotwm\",\"tier\":\"ytdxwit\",\"maxCount\":1070997174,\"quota\":{\"quantity\":8610191053119914796,\"unit\":\"wgxhn\"},\"cost\":{\"commitmentMeterId\":\"x\",\"overageMeterId\":\"kpycgklwndnhjd\"}},{\"kind\":\"whvylw\",\"skuName\":\"tdhxujznbmpowuwp\",\"hostingModel\":\"ProvisionedWeb\",\"planType\":\"veual\",\"tier\":\"j\",\"maxCount\":1318602789,\"quota\":{\"quantity\":4407430111323762488,\"unit\":\"cswsrtjri\"},\"cost\":{\"commitmentMeterId\":\"bpbewtghfgb\",\"overageMeterId\":\"gw\"}},{\"kind\":\"vlvqhjkbegi\",\"skuName\":\"nmxiebwwaloayqc\",\"hostingModel\":\"ConnectedContainer\",\"planType\":\"zjuzgwyz\",\"tier\":\"txon\",\"maxCount\":351214213,\"quota\":{\"quantity\":5974631066556953199,\"unit\":\"bp\"},\"cost\":{\"commitmentMeterId\":\"p\",\"overageMeterId\":\"knftguvriuh\"}}]}") - .toObject(CommitmentTierListResult.class); - Assertions.assertEquals("ugicjooxdjebw", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CommitmentTierListResult model = new CommitmentTierListResult().withNextLink("ugicjooxdjebw"); - model = BinaryData.fromObject(model).toObject(CommitmentTierListResult.class); - Assertions.assertEquals("ugicjooxdjebw", model.nextLink()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentTiersListMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentTiersListMockTests.java deleted file mode 100644 index 44b43e1d0daf..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentTiersListMockTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentTier; -import com.azure.resourcemanager.cognitiveservices.models.HostingModel; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class CommitmentTiersListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"kind\":\"jucejikzoeovvtz\",\"skuName\":\"et\",\"hostingModel\":\"Web\",\"planType\":\"tikyj\",\"tier\":\"k\",\"maxCount\":1015093902,\"quota\":{\"quantity\":3276001010985311867,\"unit\":\"zvhqjwtrhtgvg\"},\"cost\":{\"commitmentMeterId\":\"rrkolawjmjs\",\"overageMeterId\":\"rokcdxfzzzwyjaf\"}}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.commitmentTiers().list("jpu", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("jucejikzoeovvtz", response.iterator().next().kind()); - Assertions.assertEquals("et", response.iterator().next().skuName()); - Assertions.assertEquals(HostingModel.WEB, response.iterator().next().hostingModel()); - Assertions.assertEquals("tikyj", response.iterator().next().planType()); - Assertions.assertEquals("k", response.iterator().next().tier()); - Assertions.assertEquals(1015093902, response.iterator().next().maxCount()); - Assertions.assertEquals(3276001010985311867L, response.iterator().next().quota().quantity()); - Assertions.assertEquals("zvhqjwtrhtgvg", response.iterator().next().quota().unit()); - Assertions.assertEquals("rrkolawjmjs", response.iterator().next().cost().commitmentMeterId()); - Assertions.assertEquals("rokcdxfzzzwyjaf", response.iterator().next().cost().overageMeterId()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CustomBlocklistConfigTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CustomBlocklistConfigTests.java deleted file mode 100644 index 5ef41de5f992..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CustomBlocklistConfigTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.CustomBlocklistConfig; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentSource; -import org.junit.jupiter.api.Assertions; - -public final class CustomBlocklistConfigTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomBlocklistConfig model - = BinaryData.fromString("{\"source\":\"Prompt\",\"blocklistName\":\"cje\",\"blocking\":false}") - .toObject(CustomBlocklistConfig.class); - Assertions.assertEquals("cje", model.blocklistName()); - Assertions.assertEquals(false, model.blocking()); - Assertions.assertEquals(RaiPolicyContentSource.PROMPT, model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomBlocklistConfig model = new CustomBlocklistConfig().withBlocklistName("cje") - .withBlocking(false) - .withSource(RaiPolicyContentSource.PROMPT); - model = BinaryData.fromObject(model).toObject(CustomBlocklistConfig.class); - Assertions.assertEquals("cje", model.blocklistName()); - Assertions.assertEquals(false, model.blocking()); - Assertions.assertEquals(RaiPolicyContentSource.PROMPT, model.source()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingInnerTests.java deleted file mode 100644 index 9e179f387353..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingInnerTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.DefenderForAISettingInner; -import com.azure.resourcemanager.cognitiveservices.models.DefenderForAISettingState; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForAISettingInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForAISettingInner model = BinaryData.fromString( - "{\"etag\":\"rtixokff\",\"tags\":{\"shiy\":\"nljqepqwhixmons\",\"du\":\"gvelfc\",\"rds\":\"cb\",\"b\":\"uwc\"},\"properties\":{\"state\":\"Enabled\"},\"id\":\"tmninw\",\"name\":\"izcil\",\"type\":\"ghgshejjtbxqmu\"}") - .toObject(DefenderForAISettingInner.class); - Assertions.assertEquals("nljqepqwhixmons", model.tags().get("shiy")); - Assertions.assertEquals(DefenderForAISettingState.ENABLED, model.state()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForAISettingInner model = new DefenderForAISettingInner() - .withTags(mapOf("shiy", "nljqepqwhixmons", "du", "gvelfc", "rds", "cb", "b", "uwc")) - .withState(DefenderForAISettingState.ENABLED); - model = BinaryData.fromObject(model).toObject(DefenderForAISettingInner.class); - Assertions.assertEquals("nljqepqwhixmons", model.tags().get("shiy")); - Assertions.assertEquals(DefenderForAISettingState.ENABLED, model.state()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingPropertiesTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingPropertiesTests.java deleted file mode 100644 index 3d8c274cd459..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingPropertiesTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.DefenderForAISettingProperties; -import com.azure.resourcemanager.cognitiveservices.models.DefenderForAISettingState; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForAISettingPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForAISettingProperties model - = BinaryData.fromString("{\"state\":\"Disabled\"}").toObject(DefenderForAISettingProperties.class); - Assertions.assertEquals(DefenderForAISettingState.DISABLED, model.state()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForAISettingProperties model - = new DefenderForAISettingProperties().withState(DefenderForAISettingState.DISABLED); - model = BinaryData.fromObject(model).toObject(DefenderForAISettingProperties.class); - Assertions.assertEquals(DefenderForAISettingState.DISABLED, model.state()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingResultTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingResultTests.java deleted file mode 100644 index c47e42511452..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingResultTests.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.DefenderForAISettingInner; -import com.azure.resourcemanager.cognitiveservices.models.DefenderForAISettingResult; -import com.azure.resourcemanager.cognitiveservices.models.DefenderForAISettingState; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForAISettingResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForAISettingResult model = BinaryData.fromString( - "{\"nextLink\":\"ibmikostbzb\",\"value\":[{\"etag\":\"qnyophzfyls\",\"tags\":{\"lfwyfwlwxjwetn\":\"pfbcunezzcez\",\"rsqqwztcm\":\"sihclafzvaylp\",\"cxwaxfewz\":\"qkc\"},\"properties\":{\"state\":\"Enabled\"},\"id\":\"xfdeqvhpsyl\",\"name\":\"ksh\",\"type\":\"bffmbmxz\"},{\"etag\":\"ywwpgjxsnptfuj\",\"tags\":{\"pttaqutd\":\"gaao\"},\"properties\":{\"state\":\"Enabled\"},\"id\":\"xswvru\",\"name\":\"nz\",\"type\":\"jgehkf\"}]}") - .toObject(DefenderForAISettingResult.class); - Assertions.assertEquals("ibmikostbzb", model.nextLink()); - Assertions.assertEquals("pfbcunezzcez", model.value().get(0).tags().get("lfwyfwlwxjwetn")); - Assertions.assertEquals(DefenderForAISettingState.ENABLED, model.value().get(0).state()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForAISettingResult model - = new DefenderForAISettingResult().withNextLink("ibmikostbzb") - .withValue( - Arrays.asList( - new DefenderForAISettingInner() - .withTags(mapOf("lfwyfwlwxjwetn", "pfbcunezzcez", "rsqqwztcm", "sihclafzvaylp", "cxwaxfewz", - "qkc")) - .withState(DefenderForAISettingState.ENABLED), - new DefenderForAISettingInner().withTags(mapOf("pttaqutd", "gaao")) - .withState(DefenderForAISettingState.ENABLED))); - model = BinaryData.fromObject(model).toObject(DefenderForAISettingResult.class); - Assertions.assertEquals("ibmikostbzb", model.nextLink()); - Assertions.assertEquals("pfbcunezzcez", model.value().get(0).tags().get("lfwyfwlwxjwetn")); - Assertions.assertEquals(DefenderForAISettingState.ENABLED, model.value().get(0).state()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsCreateOrUpdateWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index b5c7a6bb2f40..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.DefenderForAISetting; -import com.azure.resourcemanager.cognitiveservices.models.DefenderForAISettingState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DefenderForAISettingsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - String responseStr - = "{\"etag\":\"snxoc\",\"tags\":{\"j\":\"l\",\"g\":\"poy\",\"cvuq\":\"wdjuxdbdljzgdy\",\"nq\":\"sgzlrqhb\"},\"properties\":{\"state\":\"Enabled\"},\"id\":\"wbsfpyxxtjlfl\",\"name\":\"cominxojjluxx\",\"type\":\"hilzzdzzq\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DefenderForAISetting response = manager.defenderForAISettings() - .define("lssan") - .withExistingAccount("xbibanbaupw", "zvpaklozkxbzrpej") - .withTags(mapOf("bhuhk", "yik", "okhu", "lgw", "jy", "o")) - .withState(DefenderForAISettingState.ENABLED) - .create(); - - Assertions.assertEquals("l", response.tags().get("j")); - Assertions.assertEquals(DefenderForAISettingState.ENABLED, response.state()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsGetWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsGetWithResponseMockTests.java deleted file mode 100644 index fda14b8d821e..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsGetWithResponseMockTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.DefenderForAISetting; -import com.azure.resourcemanager.cognitiveservices.models.DefenderForAISettingState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DefenderForAISettingsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"etag\":\"mskxknp\",\"tags\":{\"odkwwnbafocto\":\"igjsugswhgs\",\"nvkervq\":\"zhaquvwsxb\",\"pabdsrg\":\"hoadhrsxqvzv\",\"hjnlt\":\"ajglzrsubklr\"},\"properties\":{\"state\":\"Disabled\"},\"id\":\"dvqydie\",\"name\":\"qkwaruwd\",\"type\":\"vqzxoebwg\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DefenderForAISetting response = manager.defenderForAISettings() - .getWithResponse("bv", "ipbwxgooo", "zp", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("igjsugswhgs", response.tags().get("odkwwnbafocto")); - Assertions.assertEquals(DefenderForAISettingState.DISABLED, response.state()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsListMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsListMockTests.java deleted file mode 100644 index 174c0e40cc67..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsListMockTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.DefenderForAISetting; -import com.azure.resourcemanager.cognitiveservices.models.DefenderForAISettingState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DefenderForAISettingsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"etag\":\"sdrmmttjxophgerh\",\"tags\":{\"qilrixysfn\":\"gohtwz\",\"rympmlq\":\"msqywwwmhkruwae\"},\"properties\":{\"state\":\"Disabled\"},\"id\":\"zduewihapfjii\",\"name\":\"njdiqfliejhpcl\",\"type\":\"iedfsbwcei\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.defenderForAISettings().list("kpsimsfeypofqp", "bh", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("gohtwz", response.iterator().next().tags().get("qilrixysfn")); - Assertions.assertEquals(DefenderForAISettingState.DISABLED, response.iterator().next().state()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeletedAccountsPurgeMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeletedAccountsPurgeMockTests.java deleted file mode 100644 index fcdcf877cc69..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeletedAccountsPurgeMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DeletedAccountsPurgeMockTests { - @Test - public void testPurge() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.deletedAccounts().purge("gtuwkff", "jk", "sysidfvclglxnf", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentCapacitySettingsTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentCapacitySettingsTests.java deleted file mode 100644 index 00b72cae1bdd..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentCapacitySettingsTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.DeploymentCapacitySettings; -import org.junit.jupiter.api.Assertions; - -public final class DeploymentCapacitySettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeploymentCapacitySettings model - = BinaryData.fromString("{\"designatedCapacity\":98596504,\"priority\":111258164}") - .toObject(DeploymentCapacitySettings.class); - Assertions.assertEquals(98596504, model.designatedCapacity()); - Assertions.assertEquals(111258164, model.priority()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeploymentCapacitySettings model - = new DeploymentCapacitySettings().withDesignatedCapacity(98596504).withPriority(111258164); - model = BinaryData.fromObject(model).toObject(DeploymentCapacitySettings.class); - Assertions.assertEquals(98596504, model.designatedCapacity()); - Assertions.assertEquals(111258164, model.priority()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentScaleSettingsTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentScaleSettingsTests.java deleted file mode 100644 index 31fb61375199..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentScaleSettingsTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.DeploymentScaleSettings; -import com.azure.resourcemanager.cognitiveservices.models.DeploymentScaleType; -import org.junit.jupiter.api.Assertions; - -public final class DeploymentScaleSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeploymentScaleSettings model - = BinaryData.fromString("{\"scaleType\":\"Manual\",\"capacity\":840450646,\"activeCapacity\":1308163389}") - .toObject(DeploymentScaleSettings.class); - Assertions.assertEquals(DeploymentScaleType.MANUAL, model.scaleType()); - Assertions.assertEquals(840450646, model.capacity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeploymentScaleSettings model - = new DeploymentScaleSettings().withScaleType(DeploymentScaleType.MANUAL).withCapacity(840450646); - model = BinaryData.fromObject(model).toObject(DeploymentScaleSettings.class); - Assertions.assertEquals(DeploymentScaleType.MANUAL, model.scaleType()); - Assertions.assertEquals(840450646, model.capacity()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentSkuListResultTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentSkuListResultTests.java deleted file mode 100644 index 94a311b1a7f9..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentSkuListResultTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.DeploymentSkuListResult; -import org.junit.jupiter.api.Assertions; - -public final class DeploymentSkuListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeploymentSkuListResult model = BinaryData.fromString( - "{\"nextLink\":\"hlt\",\"value\":[{\"resourceType\":\"xnavvwxq\",\"sku\":{\"name\":\"y\",\"tier\":\"Enterprise\",\"size\":\"owx\",\"family\":\"mdjrkvfgbvfvp\",\"capacity\":1723513014},\"capacity\":{\"minimum\":2095776205,\"maximum\":1592823352,\"step\":218756340,\"default\":1933405509,\"allowedValues\":[1143947813,218475539,1696606842]}}]}") - .toObject(DeploymentSkuListResult.class); - Assertions.assertEquals("hlt", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeploymentSkuListResult model = new DeploymentSkuListResult().withNextLink("hlt"); - model = BinaryData.fromObject(model).toObject(DeploymentSkuListResult.class); - Assertions.assertEquals("hlt", model.nextLink()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsDeleteMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsDeleteMockTests.java deleted file mode 100644 index 2ec9e27aba3d..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsDeleteMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DeploymentsDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.deployments().delete("ids", "yskbruff", "l", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsListSkusMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsListSkusMockTests.java deleted file mode 100644 index 5c9f3613c403..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsListSkusMockTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.SkuResource; -import com.azure.resourcemanager.cognitiveservices.models.SkuTier; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DeploymentsListSkusMockTests { - @Test - public void testListSkus() throws Exception { - String responseStr - = "{\"value\":[{\"resourceType\":\"randoypmb\",\"sku\":{\"name\":\"oormkfqlwxldyka\",\"tier\":\"Free\",\"size\":\"aolnjpnnbmjk\",\"family\":\"bjgsjjxxahmrn\",\"capacity\":177973727},\"capacity\":{\"minimum\":1916460685,\"maximum\":156378653,\"step\":319427729,\"default\":1974200246,\"allowedValues\":[739994606]}}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.deployments().listSkus("ukkutvl", "hrpqhv", "blcouqehbhbcdszi", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("randoypmb", response.iterator().next().resourceType()); - Assertions.assertEquals("oormkfqlwxldyka", response.iterator().next().sku().name()); - Assertions.assertEquals(SkuTier.FREE, response.iterator().next().sku().tier()); - Assertions.assertEquals("aolnjpnnbmjk", response.iterator().next().sku().size()); - Assertions.assertEquals("bjgsjjxxahmrn", response.iterator().next().sku().family()); - Assertions.assertEquals(177973727, response.iterator().next().sku().capacity()); - Assertions.assertEquals(1916460685, response.iterator().next().capacity().minimum()); - Assertions.assertEquals(156378653, response.iterator().next().capacity().maximum()); - Assertions.assertEquals(319427729, response.iterator().next().capacity().step()); - Assertions.assertEquals(1974200246, response.iterator().next().capacity().defaultProperty()); - Assertions.assertEquals(739994606, response.iterator().next().capacity().allowedValues().get(0)); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DomainAvailabilityInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DomainAvailabilityInnerTests.java deleted file mode 100644 index 149db760ddc1..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DomainAvailabilityInnerTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.DomainAvailabilityInner; -import org.junit.jupiter.api.Assertions; - -public final class DomainAvailabilityInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DomainAvailabilityInner model = BinaryData.fromString( - "{\"isSubdomainAvailable\":true,\"reason\":\"qiy\",\"subdomainName\":\"orzihle\",\"type\":\"jswsrmslyz\",\"kind\":\"zbchckqqzqioxiy\"}") - .toObject(DomainAvailabilityInner.class); - Assertions.assertEquals(true, model.isSubdomainAvailable()); - Assertions.assertEquals("qiy", model.reason()); - Assertions.assertEquals("orzihle", model.subdomainName()); - Assertions.assertEquals("jswsrmslyz", model.type()); - Assertions.assertEquals("zbchckqqzqioxiy", model.kind()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DomainAvailabilityInner model = new DomainAvailabilityInner().withIsSubdomainAvailable(true) - .withReason("qiy") - .withSubdomainName("orzihle") - .withType("jswsrmslyz") - .withKind("zbchckqqzqioxiy"); - model = BinaryData.fromObject(model).toObject(DomainAvailabilityInner.class); - Assertions.assertEquals(true, model.isSubdomainAvailable()); - Assertions.assertEquals("qiy", model.reason()); - Assertions.assertEquals("orzihle", model.subdomainName()); - Assertions.assertEquals("jswsrmslyz", model.type()); - Assertions.assertEquals("zbchckqqzqioxiy", model.kind()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/IdentityTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/IdentityTests.java deleted file mode 100644 index 9b355a918155..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/IdentityTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.Identity; -import com.azure.resourcemanager.cognitiveservices.models.ResourceIdentityType; -import com.azure.resourcemanager.cognitiveservices.models.UserAssignedIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class IdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Identity model = BinaryData.fromString( - "{\"type\":\"SystemAssigned, UserAssigned\",\"tenantId\":\"kohdbiha\",\"principalId\":\"fhfcb\",\"userAssignedIdentities\":{\"yscnpqxu\":{\"principalId\":\"git\",\"clientId\":\"qhabifpikxwcz\"}}}") - .toObject(Identity.class); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Identity model = new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("yscnpqxu", new UserAssignedIdentity())); - model = BinaryData.fromObject(model).toObject(Identity.class); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.type()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/IpRuleTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/IpRuleTests.java deleted file mode 100644 index 3ea8b0ef656d..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/IpRuleTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.IpRule; -import org.junit.jupiter.api.Assertions; - -public final class IpRuleTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpRule model = BinaryData.fromString("{\"value\":\"fdfdosygexpa\"}").toObject(IpRule.class); - Assertions.assertEquals("fdfdosygexpa", model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpRule model = new IpRule().withValue("fdfdosygexpa"); - model = BinaryData.fromObject(model).toObject(IpRule.class); - Assertions.assertEquals("fdfdosygexpa", model.value()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/LocationBasedModelCapacitiesListMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/LocationBasedModelCapacitiesListMockTests.java deleted file mode 100644 index 96ad19900386..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/LocationBasedModelCapacitiesListMockTests.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.ModelCapacityListResultValueItem; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class LocationBasedModelCapacitiesListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"location\":\"ycsxzu\",\"properties\":{\"model\":{\"publisher\":\"lsmdesqplpvmjc\",\"format\":\"ewbidyvteowxv\",\"name\":\"iudeu\",\"version\":\"sxze\",\"source\":\"axwk\",\"sourceAccount\":\"ykhv\",\"callRateLimit\":{\"count\":36.75517,\"renewalPeriod\":93.7912,\"rules\":[{},{},{}]}},\"skuName\":\"znabaobns\",\"availableCapacity\":77.23243,\"availableFinetuneCapacity\":76.454056},\"id\":\"ltymkmvguihywart\",\"name\":\"pphkixkykxds\",\"type\":\"j\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.locationBasedModelCapacities() - .list("hdroznnh", "rlktgjcsggu", "hemlwywaee", "zgfbukklelssx", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ycsxzu", response.iterator().next().location()); - Assertions.assertEquals("lsmdesqplpvmjc", response.iterator().next().properties().model().publisher()); - Assertions.assertEquals("ewbidyvteowxv", response.iterator().next().properties().model().format()); - Assertions.assertEquals("iudeu", response.iterator().next().properties().model().name()); - Assertions.assertEquals("sxze", response.iterator().next().properties().model().version()); - Assertions.assertEquals("axwk", response.iterator().next().properties().model().source()); - Assertions.assertEquals("ykhv", response.iterator().next().properties().model().sourceAccount()); - Assertions.assertEquals("znabaobns", response.iterator().next().properties().skuName()); - Assertions.assertEquals(77.23243F, response.iterator().next().properties().availableCapacity()); - Assertions.assertEquals(76.454056F, response.iterator().next().properties().availableFinetuneCapacity()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/MetricNameTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/MetricNameTests.java deleted file mode 100644 index 528247229845..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/MetricNameTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.MetricName; -import org.junit.jupiter.api.Assertions; - -public final class MetricNameTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MetricName model - = BinaryData.fromString("{\"value\":\"ys\",\"localizedValue\":\"i\"}").toObject(MetricName.class); - Assertions.assertEquals("ys", model.value()); - Assertions.assertEquals("i", model.localizedValue()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MetricName model = new MetricName().withValue("ys").withLocalizedValue("i"); - model = BinaryData.fromObject(model).toObject(MetricName.class); - Assertions.assertEquals("ys", model.value()); - Assertions.assertEquals("i", model.localizedValue()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ModelCapacitiesListMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ModelCapacitiesListMockTests.java deleted file mode 100644 index 3cecce225361..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ModelCapacitiesListMockTests.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.ModelCapacityListResultValueItem; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ModelCapacitiesListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"location\":\"lmiiiovg\",\"properties\":{\"model\":{\"publisher\":\"uugqk\",\"format\":\"otiowlxteqd\",\"name\":\"jgwdtgukranbl\",\"version\":\"hqlkccuzgygqwaho\",\"source\":\"lwgniiprglvawu\",\"sourceAccount\":\"d\",\"callRateLimit\":{\"count\":57.923836,\"renewalPeriod\":98.87216,\"rules\":[{},{}]}},\"skuName\":\"bjpmcubk\",\"availableCapacity\":22.810863,\"availableFinetuneCapacity\":64.41416},\"id\":\"xkubvphavpmhbrbq\",\"name\":\"vgovpbbttefjokn\",\"type\":\"sqyzqedikdfr\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.modelCapacities().list("emmucfxh", "kkflrmymyincqlhr", "s", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("lmiiiovg", response.iterator().next().location()); - Assertions.assertEquals("uugqk", response.iterator().next().properties().model().publisher()); - Assertions.assertEquals("otiowlxteqd", response.iterator().next().properties().model().format()); - Assertions.assertEquals("jgwdtgukranbl", response.iterator().next().properties().model().name()); - Assertions.assertEquals("hqlkccuzgygqwaho", response.iterator().next().properties().model().version()); - Assertions.assertEquals("lwgniiprglvawu", response.iterator().next().properties().model().source()); - Assertions.assertEquals("d", response.iterator().next().properties().model().sourceAccount()); - Assertions.assertEquals("bjpmcubk", response.iterator().next().properties().skuName()); - Assertions.assertEquals(22.810863F, response.iterator().next().properties().availableCapacity()); - Assertions.assertEquals(64.41416F, response.iterator().next().properties().availableFinetuneCapacity()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ModelCapacityListResultTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ModelCapacityListResultTests.java deleted file mode 100644 index 5dc7940f58a4..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ModelCapacityListResultTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ModelCapacityListResultValueItemInner; -import com.azure.resourcemanager.cognitiveservices.models.DeploymentModel; -import com.azure.resourcemanager.cognitiveservices.models.ModelCapacityListResult; -import com.azure.resourcemanager.cognitiveservices.models.ModelSkuCapacityProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ModelCapacityListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ModelCapacityListResult model = BinaryData.fromString( - "{\"nextLink\":\"cvdrhvoodsot\",\"value\":[{\"location\":\"dopcjwvnh\",\"properties\":{\"model\":{\"publisher\":\"mgxcxrslpm\",\"format\":\"wuoegrpk\",\"name\":\"wniyqsluicpd\",\"version\":\"kzzlvmbmpaxmodf\",\"source\":\"efyw\",\"sourceAccount\":\"pfvmwyhrfou\",\"callRateLimit\":{\"count\":20.784086,\"renewalPeriod\":32.10248,\"rules\":[{},{},{}]}},\"skuName\":\"iyzvqtmnub\",\"availableCapacity\":71.15051,\"availableFinetuneCapacity\":46.320225},\"id\":\"ksmond\",\"name\":\"mquxvypo\",\"type\":\"gkopkwhojvpajqgx\"},{\"location\":\"mocmbqfqvmk\",\"properties\":{\"model\":{\"publisher\":\"apvhelxprgly\",\"format\":\"dd\",\"name\":\"cbcuejrjxgciqi\",\"version\":\"hos\",\"source\":\"dqrhzoymib\",\"sourceAccount\":\"qyib\",\"callRateLimit\":{\"count\":48.058273,\"renewalPeriod\":70.92327,\"rules\":[{},{},{}]}},\"skuName\":\"tmhrkwofyyvoqacp\",\"availableCapacity\":57.89401,\"availableFinetuneCapacity\":79.0544},\"id\":\"tg\",\"name\":\"wbwo\",\"type\":\"nwashrtd\"}]}") - .toObject(ModelCapacityListResult.class); - Assertions.assertEquals("cvdrhvoodsot", model.nextLink()); - Assertions.assertEquals("dopcjwvnh", model.value().get(0).location()); - Assertions.assertEquals("mgxcxrslpm", model.value().get(0).properties().model().publisher()); - Assertions.assertEquals("wuoegrpk", model.value().get(0).properties().model().format()); - Assertions.assertEquals("wniyqsluicpd", model.value().get(0).properties().model().name()); - Assertions.assertEquals("kzzlvmbmpaxmodf", model.value().get(0).properties().model().version()); - Assertions.assertEquals("efyw", model.value().get(0).properties().model().source()); - Assertions.assertEquals("pfvmwyhrfou", model.value().get(0).properties().model().sourceAccount()); - Assertions.assertEquals("iyzvqtmnub", model.value().get(0).properties().skuName()); - Assertions.assertEquals(71.15051F, model.value().get(0).properties().availableCapacity()); - Assertions.assertEquals(46.320225F, model.value().get(0).properties().availableFinetuneCapacity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ModelCapacityListResult model = new ModelCapacityListResult().withNextLink("cvdrhvoodsot") - .withValue(Arrays.asList( - new ModelCapacityListResultValueItemInner().withLocation("dopcjwvnh") - .withProperties(new ModelSkuCapacityProperties() - .withModel(new DeploymentModel().withPublisher("mgxcxrslpm") - .withFormat("wuoegrpk") - .withName("wniyqsluicpd") - .withVersion("kzzlvmbmpaxmodf") - .withSource("efyw") - .withSourceAccount("pfvmwyhrfou")) - .withSkuName("iyzvqtmnub") - .withAvailableCapacity(71.15051F) - .withAvailableFinetuneCapacity(46.320225F)), - new ModelCapacityListResultValueItemInner().withLocation("mocmbqfqvmk") - .withProperties(new ModelSkuCapacityProperties() - .withModel(new DeploymentModel().withPublisher("apvhelxprgly") - .withFormat("dd") - .withName("cbcuejrjxgciqi") - .withVersion("hos") - .withSource("dqrhzoymib") - .withSourceAccount("qyib")) - .withSkuName("tmhrkwofyyvoqacp") - .withAvailableCapacity(57.89401F) - .withAvailableFinetuneCapacity(79.0544F)))); - model = BinaryData.fromObject(model).toObject(ModelCapacityListResult.class); - Assertions.assertEquals("cvdrhvoodsot", model.nextLink()); - Assertions.assertEquals("dopcjwvnh", model.value().get(0).location()); - Assertions.assertEquals("mgxcxrslpm", model.value().get(0).properties().model().publisher()); - Assertions.assertEquals("wuoegrpk", model.value().get(0).properties().model().format()); - Assertions.assertEquals("wniyqsluicpd", model.value().get(0).properties().model().name()); - Assertions.assertEquals("kzzlvmbmpaxmodf", model.value().get(0).properties().model().version()); - Assertions.assertEquals("efyw", model.value().get(0).properties().model().source()); - Assertions.assertEquals("pfvmwyhrfou", model.value().get(0).properties().model().sourceAccount()); - Assertions.assertEquals("iyzvqtmnub", model.value().get(0).properties().skuName()); - Assertions.assertEquals(71.15051F, model.value().get(0).properties().availableCapacity()); - Assertions.assertEquals(46.320225F, model.value().get(0).properties().availableFinetuneCapacity()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ModelDeprecationInfoTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ModelDeprecationInfoTests.java deleted file mode 100644 index c25ec6cc5824..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ModelDeprecationInfoTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.ModelDeprecationInfo; -import org.junit.jupiter.api.Assertions; - -public final class ModelDeprecationInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ModelDeprecationInfo model = BinaryData.fromString("{\"fineTune\":\"zfcl\",\"inference\":\"axdbabph\"}") - .toObject(ModelDeprecationInfo.class); - Assertions.assertEquals("zfcl", model.fineTune()); - Assertions.assertEquals("axdbabph", model.inference()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ModelDeprecationInfo model = new ModelDeprecationInfo().withFineTune("zfcl").withInference("axdbabph"); - model = BinaryData.fromObject(model).toObject(ModelDeprecationInfo.class); - Assertions.assertEquals("zfcl", model.fineTune()); - Assertions.assertEquals("axdbabph", model.inference()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ModelListResultTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ModelListResultTests.java deleted file mode 100644 index b4b7072600bf..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ModelListResultTests.java +++ /dev/null @@ -1,224 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.AccountModelInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ModelInner; -import com.azure.resourcemanager.cognitiveservices.models.BillingMeterInfo; -import com.azure.resourcemanager.cognitiveservices.models.CallRateLimit; -import com.azure.resourcemanager.cognitiveservices.models.CapacityConfig; -import com.azure.resourcemanager.cognitiveservices.models.DeploymentModel; -import com.azure.resourcemanager.cognitiveservices.models.ModelDeprecationInfo; -import com.azure.resourcemanager.cognitiveservices.models.ModelLifecycleStatus; -import com.azure.resourcemanager.cognitiveservices.models.ModelListResult; -import com.azure.resourcemanager.cognitiveservices.models.ModelSku; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ModelListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ModelListResult model = BinaryData.fromString( - "{\"nextLink\":\"wozuhkf\",\"value\":[{\"model\":{\"baseModel\":{\"publisher\":\"f\",\"format\":\"luu\",\"name\":\"ttouwaboekqvkel\",\"version\":\"mvb\",\"source\":\"yjsflhhcaalnji\",\"sourceAccount\":\"sxyawjoyaqcs\",\"callRateLimit\":{\"count\":24.450993,\"renewalPeriod\":58.93525,\"rules\":[{},{},{}]}},\"isDefaultVersion\":false,\"skus\":[{\"name\":\"nelixhnrztfo\",\"usageName\":\"bnxknalaulppg\",\"deprecationDate\":\"2021-03-08T22:58:09Z\",\"capacity\":{},\"rateLimits\":[{},{},{},{}],\"cost\":[{},{},{}]},{\"name\":\"iropuhpigvpgylg\",\"usageName\":\"itxmedjvcslynqww\",\"deprecationDate\":\"2021-09-17T17:00:46Z\",\"capacity\":{},\"rateLimits\":[{}],\"cost\":[{},{},{},{}]},{\"name\":\"trmgucnapkte\",\"usageName\":\"llwptfdy\",\"deprecationDate\":\"2020-12-31T02:22:45Z\",\"capacity\":{},\"rateLimits\":[{},{},{},{}],\"cost\":[{},{},{},{}]},{\"name\":\"op\",\"usageName\":\"qrhhu\",\"deprecationDate\":\"2021-05-07T00:48:34Z\",\"capacity\":{},\"rateLimits\":[{}],\"cost\":[{}]}],\"maxCapacity\":108593741,\"capabilities\":{\"ahzxctobgbk\":\"z\",\"mgrcfbu\":\"moizpos\",\"mjh\":\"rmfqjhhkxbpvj\",\"tswb\":\"xjyngudivk\"},\"finetuneCapabilities\":{\"e\":\"vszjfauvjfdxxi\",\"mcbxvwvxysl\":\"vtcqaqtdo\"},\"deprecation\":{\"fineTune\":\"sfxobl\",\"inference\":\"k\"},\"lifecycleStatus\":\"GenerallyAvailable\",\"publisher\":\"wwwfbkr\",\"format\":\"nsvs\",\"name\":\"johxcrsb\",\"version\":\"vasrruvwb\",\"source\":\"qfsubcgjbirx\",\"sourceAccount\":\"ybsrfbjfdtwss\",\"callRateLimit\":{\"count\":98.93621,\"renewalPeriod\":17.965126,\"rules\":[{},{},{},{}]}},\"kind\":\"exilzznfqqnvwpmq\",\"skuName\":\"ruoujmk\",\"description\":\"hwqytj\"},{\"model\":{\"baseModel\":{\"publisher\":\"wj\",\"format\":\"gdrjervnaenqpe\",\"name\":\"ndoygmifthnzdnd\",\"version\":\"gnayqigynduh\",\"source\":\"hqlkthumaqo\",\"sourceAccount\":\"gycdu\",\"callRateLimit\":{\"count\":75.81883,\"renewalPeriod\":82.43766,\"rules\":[{}]}},\"isDefaultVersion\":true,\"skus\":[{\"name\":\"psslqlfmm\",\"usageName\":\"bbglzpswiydmc\",\"deprecationDate\":\"2021-03-06T05:36:52Z\",\"capacity\":{},\"rateLimits\":[{},{},{}],\"cost\":[{},{}]},{\"name\":\"dbzm\",\"usageName\":\"dfznudaodv\",\"deprecationDate\":\"2021-05-29T13:49:41Z\",\"capacity\":{},\"rateLimits\":[{},{},{}],\"cost\":[{},{},{},{}]},{\"name\":\"pstdbhhxsrzd\",\"usageName\":\"cers\",\"deprecationDate\":\"2021-04-29T11:57:05Z\",\"capacity\":{},\"rateLimits\":[{},{},{}],\"cost\":[{},{},{},{}]}],\"maxCapacity\":931979220,\"capabilities\":{\"weriofzpyqsem\":\"ygtdsslswt\",\"zhedplvwiw\":\"abnetshh\",\"tppjflcx\":\"bmwmbesldnkw\"},\"finetuneCapabilities\":{\"qqkdltfzxmhhvhgu\":\"okonzmnsikvmkqz\",\"xtibqdxbxwakbog\":\"eodkwobda\",\"iplbpodxunkbebxm\":\"xndlkzgxhu\"},\"deprecation\":{\"fineTune\":\"yntwlrbq\",\"inference\":\"oievseotgqrlltm\"},\"lifecycleStatus\":\"Deprecated\",\"publisher\":\"wzizxbmpgcjefuzm\",\"format\":\"pbttdum\",\"name\":\"p\",\"version\":\"ebmnzbtbhjpglk\",\"source\":\"ohdneuel\",\"sourceAccount\":\"hsd\",\"callRateLimit\":{\"count\":59.737354,\"renewalPeriod\":55.207397,\"rules\":[{}]}},\"kind\":\"owwquuvxz\",\"skuName\":\"lvithhqzonosgg\",\"description\":\"c\"}]}") - .toObject(ModelListResult.class); - Assertions.assertEquals("wozuhkf", model.nextLink()); - Assertions.assertEquals("wwwfbkr", model.value().get(0).model().publisher()); - Assertions.assertEquals("nsvs", model.value().get(0).model().format()); - Assertions.assertEquals("johxcrsb", model.value().get(0).model().name()); - Assertions.assertEquals("vasrruvwb", model.value().get(0).model().version()); - Assertions.assertEquals("qfsubcgjbirx", model.value().get(0).model().source()); - Assertions.assertEquals("ybsrfbjfdtwss", model.value().get(0).model().sourceAccount()); - Assertions.assertEquals("f", model.value().get(0).model().baseModel().publisher()); - Assertions.assertEquals("luu", model.value().get(0).model().baseModel().format()); - Assertions.assertEquals("ttouwaboekqvkel", model.value().get(0).model().baseModel().name()); - Assertions.assertEquals("mvb", model.value().get(0).model().baseModel().version()); - Assertions.assertEquals("yjsflhhcaalnji", model.value().get(0).model().baseModel().source()); - Assertions.assertEquals("sxyawjoyaqcs", model.value().get(0).model().baseModel().sourceAccount()); - Assertions.assertEquals(false, model.value().get(0).model().isDefaultVersion()); - Assertions.assertEquals("nelixhnrztfo", model.value().get(0).model().skus().get(0).name()); - Assertions.assertEquals("bnxknalaulppg", model.value().get(0).model().skus().get(0).usageName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-08T22:58:09Z"), - model.value().get(0).model().skus().get(0).deprecationDate()); - Assertions.assertEquals(108593741, model.value().get(0).model().maxCapacity()); - Assertions.assertEquals("z", model.value().get(0).model().capabilities().get("ahzxctobgbk")); - Assertions.assertEquals("vszjfauvjfdxxi", model.value().get(0).model().finetuneCapabilities().get("e")); - Assertions.assertEquals("sfxobl", model.value().get(0).model().deprecation().fineTune()); - Assertions.assertEquals("k", model.value().get(0).model().deprecation().inference()); - Assertions.assertEquals(ModelLifecycleStatus.GENERALLY_AVAILABLE, - model.value().get(0).model().lifecycleStatus()); - Assertions.assertEquals("exilzznfqqnvwpmq", model.value().get(0).kind()); - Assertions.assertEquals("ruoujmk", model.value().get(0).skuName()); - Assertions.assertEquals("hwqytj", model.value().get(0).description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ModelListResult model - = new ModelListResult().withNextLink("wozuhkf") - .withValue( - Arrays - .asList( - new ModelInner() - .withModel( - new AccountModelInner().withPublisher("wwwfbkr") - .withFormat("nsvs") - .withName("johxcrsb") - .withVersion("vasrruvwb") - .withSource("qfsubcgjbirx") - .withSourceAccount("ybsrfbjfdtwss") - .withBaseModel(new DeploymentModel().withPublisher("f") - .withFormat("luu") - .withName("ttouwaboekqvkel") - .withVersion("mvb") - .withSource("yjsflhhcaalnji") - .withSourceAccount("sxyawjoyaqcs")) - .withIsDefaultVersion(false) - .withSkus(Arrays.asList( - new ModelSku().withName("nelixhnrztfo") - .withUsageName("bnxknalaulppg") - .withDeprecationDate(OffsetDateTime.parse("2021-03-08T22:58:09Z")) - .withCapacity(new CapacityConfig()) - .withRateLimits(Arrays.asList(new CallRateLimit(), new CallRateLimit(), - new CallRateLimit(), new CallRateLimit())) - .withCost(Arrays.asList(new BillingMeterInfo(), new BillingMeterInfo(), - new BillingMeterInfo())), - new ModelSku().withName("iropuhpigvpgylg") - .withUsageName("itxmedjvcslynqww") - .withDeprecationDate(OffsetDateTime.parse("2021-09-17T17:00:46Z")) - .withCapacity(new CapacityConfig()) - .withRateLimits(Arrays.asList(new CallRateLimit())) - .withCost(Arrays.asList(new BillingMeterInfo(), new BillingMeterInfo(), - new BillingMeterInfo(), new BillingMeterInfo())), - new ModelSku().withName("trmgucnapkte") - .withUsageName("llwptfdy") - .withDeprecationDate(OffsetDateTime.parse("2020-12-31T02:22:45Z")) - .withCapacity(new CapacityConfig()) - .withRateLimits(Arrays.asList(new CallRateLimit(), new CallRateLimit(), - new CallRateLimit(), new CallRateLimit())) - .withCost(Arrays.asList(new BillingMeterInfo(), new BillingMeterInfo(), - new BillingMeterInfo(), new BillingMeterInfo())), - new ModelSku().withName("op") - .withUsageName("qrhhu") - .withDeprecationDate(OffsetDateTime.parse("2021-05-07T00:48:34Z")) - .withCapacity(new CapacityConfig()) - .withRateLimits(Arrays.asList(new CallRateLimit())) - .withCost(Arrays.asList(new BillingMeterInfo())))) - .withMaxCapacity(108593741) - .withCapabilities(mapOf("ahzxctobgbk", "z", "mgrcfbu", "moizpos", "mjh", - "rmfqjhhkxbpvj", "tswb", "xjyngudivk")) - .withFinetuneCapabilities( - mapOf("e", "vszjfauvjfdxxi", "mcbxvwvxysl", "vtcqaqtdo")) - .withDeprecation( - new ModelDeprecationInfo().withFineTune("sfxobl").withInference("k")) - .withLifecycleStatus(ModelLifecycleStatus.GENERALLY_AVAILABLE)) - .withKind("exilzznfqqnvwpmq") - .withSkuName("ruoujmk") - .withDescription("hwqytj"), - new ModelInner() - .withModel( - new AccountModelInner().withPublisher("wzizxbmpgcjefuzm") - .withFormat("pbttdum") - .withName("p") - .withVersion("ebmnzbtbhjpglk") - .withSource("ohdneuel") - .withSourceAccount("hsd") - .withBaseModel(new DeploymentModel().withPublisher("wj") - .withFormat("gdrjervnaenqpe") - .withName("ndoygmifthnzdnd") - .withVersion("gnayqigynduh") - .withSource("hqlkthumaqo") - .withSourceAccount("gycdu")) - .withIsDefaultVersion(true) - .withSkus( - Arrays - .asList( - new ModelSku().withName("psslqlfmm") - .withUsageName("bbglzpswiydmc") - .withDeprecationDate( - OffsetDateTime.parse("2021-03-06T05:36:52Z")) - .withCapacity(new CapacityConfig()) - .withRateLimits(Arrays.asList(new CallRateLimit(), - new CallRateLimit(), new CallRateLimit())) - .withCost(Arrays.asList(new BillingMeterInfo(), - new BillingMeterInfo())), - new ModelSku().withName("dbzm") - .withUsageName("dfznudaodv") - .withDeprecationDate( - OffsetDateTime.parse("2021-05-29T13:49:41Z")) - .withCapacity(new CapacityConfig()) - .withRateLimits(Arrays.asList(new CallRateLimit(), - new CallRateLimit(), new CallRateLimit())) - .withCost( - Arrays.asList( - new BillingMeterInfo(), new BillingMeterInfo(), - new BillingMeterInfo(), new BillingMeterInfo())), - new ModelSku().withName("pstdbhhxsrzd") - .withUsageName("cers") - .withDeprecationDate( - OffsetDateTime.parse("2021-04-29T11:57:05Z")) - .withCapacity(new CapacityConfig()) - .withRateLimits(Arrays.asList(new CallRateLimit(), - new CallRateLimit(), new CallRateLimit())) - .withCost(Arrays.asList(new BillingMeterInfo(), - new BillingMeterInfo(), new BillingMeterInfo(), - new BillingMeterInfo())))) - .withMaxCapacity(931979220) - .withCapabilities(mapOf("weriofzpyqsem", "ygtdsslswt", "zhedplvwiw", "abnetshh", - "tppjflcx", "bmwmbesldnkw")) - .withFinetuneCapabilities(mapOf("qqkdltfzxmhhvhgu", "okonzmnsikvmkqz", - "xtibqdxbxwakbog", "eodkwobda", "iplbpodxunkbebxm", "xndlkzgxhu")) - .withDeprecation(new ModelDeprecationInfo().withFineTune("yntwlrbq") - .withInference("oievseotgqrlltm")) - .withLifecycleStatus(ModelLifecycleStatus.DEPRECATED)) - .withKind("owwquuvxz") - .withSkuName("lvithhqzonosgg") - .withDescription("c"))); - model = BinaryData.fromObject(model).toObject(ModelListResult.class); - Assertions.assertEquals("wozuhkf", model.nextLink()); - Assertions.assertEquals("wwwfbkr", model.value().get(0).model().publisher()); - Assertions.assertEquals("nsvs", model.value().get(0).model().format()); - Assertions.assertEquals("johxcrsb", model.value().get(0).model().name()); - Assertions.assertEquals("vasrruvwb", model.value().get(0).model().version()); - Assertions.assertEquals("qfsubcgjbirx", model.value().get(0).model().source()); - Assertions.assertEquals("ybsrfbjfdtwss", model.value().get(0).model().sourceAccount()); - Assertions.assertEquals("f", model.value().get(0).model().baseModel().publisher()); - Assertions.assertEquals("luu", model.value().get(0).model().baseModel().format()); - Assertions.assertEquals("ttouwaboekqvkel", model.value().get(0).model().baseModel().name()); - Assertions.assertEquals("mvb", model.value().get(0).model().baseModel().version()); - Assertions.assertEquals("yjsflhhcaalnji", model.value().get(0).model().baseModel().source()); - Assertions.assertEquals("sxyawjoyaqcs", model.value().get(0).model().baseModel().sourceAccount()); - Assertions.assertEquals(false, model.value().get(0).model().isDefaultVersion()); - Assertions.assertEquals("nelixhnrztfo", model.value().get(0).model().skus().get(0).name()); - Assertions.assertEquals("bnxknalaulppg", model.value().get(0).model().skus().get(0).usageName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-08T22:58:09Z"), - model.value().get(0).model().skus().get(0).deprecationDate()); - Assertions.assertEquals(108593741, model.value().get(0).model().maxCapacity()); - Assertions.assertEquals("z", model.value().get(0).model().capabilities().get("ahzxctobgbk")); - Assertions.assertEquals("vszjfauvjfdxxi", model.value().get(0).model().finetuneCapabilities().get("e")); - Assertions.assertEquals("sfxobl", model.value().get(0).model().deprecation().fineTune()); - Assertions.assertEquals("k", model.value().get(0).model().deprecation().inference()); - Assertions.assertEquals(ModelLifecycleStatus.GENERALLY_AVAILABLE, - model.value().get(0).model().lifecycleStatus()); - Assertions.assertEquals("exilzznfqqnvwpmq", model.value().get(0).kind()); - Assertions.assertEquals("ruoujmk", model.value().get(0).skuName()); - Assertions.assertEquals("hwqytj", model.value().get(0).description()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/MultiRegionSettingsTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/MultiRegionSettingsTests.java deleted file mode 100644 index 15e56c8b11ea..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/MultiRegionSettingsTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.MultiRegionSettings; -import com.azure.resourcemanager.cognitiveservices.models.RegionSetting; -import com.azure.resourcemanager.cognitiveservices.models.RoutingMethods; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class MultiRegionSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MultiRegionSettings model = BinaryData.fromString( - "{\"routingMethod\":\"Performance\",\"regions\":[{\"name\":\"qqedqytbciqfou\",\"value\":68.96301,\"customsubdomain\":\"nkzsmodmglou\"},{\"name\":\"b\",\"value\":18.99814,\"customsubdomain\":\"utduqktapspwgcu\"},{\"name\":\"tumkdosvqwhbm\",\"value\":84.869194,\"customsubdomain\":\"jfddgmbmbe\"},{\"name\":\"pbhtqqrolfpfpsa\",\"value\":49.90956,\"customsubdomain\":\"uxig\"}]}") - .toObject(MultiRegionSettings.class); - Assertions.assertEquals(RoutingMethods.PERFORMANCE, model.routingMethod()); - Assertions.assertEquals("qqedqytbciqfou", model.regions().get(0).name()); - Assertions.assertEquals(68.96301F, model.regions().get(0).value()); - Assertions.assertEquals("nkzsmodmglou", model.regions().get(0).customsubdomain()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MultiRegionSettings model = new MultiRegionSettings().withRoutingMethod(RoutingMethods.PERFORMANCE) - .withRegions(Arrays.asList( - new RegionSetting().withName("qqedqytbciqfou").withValue(68.96301F).withCustomsubdomain("nkzsmodmglou"), - new RegionSetting().withName("b").withValue(18.99814F).withCustomsubdomain("utduqktapspwgcu"), - new RegionSetting().withName("tumkdosvqwhbm").withValue(84.869194F).withCustomsubdomain("jfddgmbmbe"), - new RegionSetting().withName("pbhtqqrolfpfpsa").withValue(49.90956F).withCustomsubdomain("uxig"))); - model = BinaryData.fromObject(model).toObject(MultiRegionSettings.class); - Assertions.assertEquals(RoutingMethods.PERFORMANCE, model.routingMethod()); - Assertions.assertEquals("qqedqytbciqfou", model.regions().get(0).name()); - Assertions.assertEquals(68.96301F, model.regions().get(0).value()); - Assertions.assertEquals("nkzsmodmglou", model.regions().get(0).customsubdomain()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkRuleSetTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkRuleSetTests.java deleted file mode 100644 index 012085f47876..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkRuleSetTests.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.ByPassSelection; -import com.azure.resourcemanager.cognitiveservices.models.IpRule; -import com.azure.resourcemanager.cognitiveservices.models.NetworkRuleAction; -import com.azure.resourcemanager.cognitiveservices.models.NetworkRuleSet; -import com.azure.resourcemanager.cognitiveservices.models.VirtualNetworkRule; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NetworkRuleSetTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkRuleSet model = BinaryData.fromString( - "{\"defaultAction\":\"Deny\",\"bypass\":\"None\",\"ipRules\":[{\"value\":\"uuvmkjozkrwfnd\"}],\"virtualNetworkRules\":[{\"id\":\"jpslwejd\",\"state\":\"wryoqpsoacc\",\"ignoreMissingVnetServiceEndpoint\":true},{\"id\":\"akl\",\"state\":\"ahbc\",\"ignoreMissingVnetServiceEndpoint\":true}]}") - .toObject(NetworkRuleSet.class); - Assertions.assertEquals(NetworkRuleAction.DENY, model.defaultAction()); - Assertions.assertEquals(ByPassSelection.NONE, model.bypass()); - Assertions.assertEquals("uuvmkjozkrwfnd", model.ipRules().get(0).value()); - Assertions.assertEquals("jpslwejd", model.virtualNetworkRules().get(0).id()); - Assertions.assertEquals("wryoqpsoacc", model.virtualNetworkRules().get(0).state()); - Assertions.assertEquals(true, model.virtualNetworkRules().get(0).ignoreMissingVnetServiceEndpoint()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkRuleSet model = new NetworkRuleSet().withDefaultAction(NetworkRuleAction.DENY) - .withBypass(ByPassSelection.NONE) - .withIpRules(Arrays.asList(new IpRule().withValue("uuvmkjozkrwfnd"))) - .withVirtualNetworkRules(Arrays.asList( - new VirtualNetworkRule().withId("jpslwejd") - .withState("wryoqpsoacc") - .withIgnoreMissingVnetServiceEndpoint(true), - new VirtualNetworkRule().withId("akl").withState("ahbc").withIgnoreMissingVnetServiceEndpoint(true))); - model = BinaryData.fromObject(model).toObject(NetworkRuleSet.class); - Assertions.assertEquals(NetworkRuleAction.DENY, model.defaultAction()); - Assertions.assertEquals(ByPassSelection.NONE, model.bypass()); - Assertions.assertEquals("uuvmkjozkrwfnd", model.ipRules().get(0).value()); - Assertions.assertEquals("jpslwejd", model.virtualNetworkRules().get(0).id()); - Assertions.assertEquals("wryoqpsoacc", model.virtualNetworkRules().get(0).state()); - Assertions.assertEquals(true, model.virtualNetworkRules().get(0).ignoreMissingVnetServiceEndpoint()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItemTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItemTests.java deleted file mode 100644 index a4088bc6a97e..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItemTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem; -import org.junit.jupiter.api.Assertions; - -public final class NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItemTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem model - = BinaryData.fromString("{\"id\":\"bowxe\"}") - .toObject(NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem.class); - Assertions.assertEquals("bowxe", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem model - = new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem().withId("bowxe"); - model = BinaryData.fromObject(model) - .toObject(NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem.class); - Assertions.assertEquals("bowxe", model.id()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterAccessRulePropertiesTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterAccessRulePropertiesTests.java deleted file mode 100644 index a6592cbf4357..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterAccessRulePropertiesTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeter; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRuleProperties; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem; -import com.azure.resourcemanager.cognitiveservices.models.NspAccessRuleDirection; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NetworkSecurityPerimeterAccessRulePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkSecurityPerimeterAccessRuleProperties model = BinaryData.fromString( - "{\"direction\":\"Outbound\",\"addressPrefixes\":[\"oudorhcgyyp\",\"otwypundmb\"],\"subscriptions\":[{\"id\":\"cmjkavlgorbmftpm\"},{\"id\":\"zfjltfvnzcyjto\"},{\"id\":\"vopvp\"},{\"id\":\"bzqgqqi\"}],\"networkSecurityPerimeters\":[{\"id\":\"vqwt\",\"perimeterGuid\":\"ky\",\"location\":\"cysihs\"},{\"id\":\"cw\",\"perimeterGuid\":\"ohsdtmcd\",\"location\":\"ufcohdxbz\"}],\"fullyQualifiedDomainNames\":[\"muapcvhdbevw\",\"qxeysko\",\"qzinkfkbg\"]}") - .toObject(NetworkSecurityPerimeterAccessRuleProperties.class); - Assertions.assertEquals(NspAccessRuleDirection.OUTBOUND, model.direction()); - Assertions.assertEquals("oudorhcgyyp", model.addressPrefixes().get(0)); - Assertions.assertEquals("cmjkavlgorbmftpm", model.subscriptions().get(0).id()); - Assertions.assertEquals("vqwt", model.networkSecurityPerimeters().get(0).id()); - Assertions.assertEquals("ky", model.networkSecurityPerimeters().get(0).perimeterGuid()); - Assertions.assertEquals("cysihs", model.networkSecurityPerimeters().get(0).location()); - Assertions.assertEquals("muapcvhdbevw", model.fullyQualifiedDomainNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkSecurityPerimeterAccessRuleProperties model - = new NetworkSecurityPerimeterAccessRuleProperties().withDirection(NspAccessRuleDirection.OUTBOUND) - .withAddressPrefixes(Arrays.asList("oudorhcgyyp", "otwypundmb")) - .withSubscriptions(Arrays.asList( - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem().withId("cmjkavlgorbmftpm"), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem().withId("zfjltfvnzcyjto"), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem().withId("vopvp"), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem().withId("bzqgqqi"))) - .withNetworkSecurityPerimeters(Arrays.asList( - new NetworkSecurityPerimeter().withId("vqwt").withPerimeterGuid("ky").withLocation("cysihs"), - new NetworkSecurityPerimeter().withId("cw") - .withPerimeterGuid("ohsdtmcd") - .withLocation("ufcohdxbz"))) - .withFullyQualifiedDomainNames(Arrays.asList("muapcvhdbevw", "qxeysko", "qzinkfkbg")); - model = BinaryData.fromObject(model).toObject(NetworkSecurityPerimeterAccessRuleProperties.class); - Assertions.assertEquals(NspAccessRuleDirection.OUTBOUND, model.direction()); - Assertions.assertEquals("oudorhcgyyp", model.addressPrefixes().get(0)); - Assertions.assertEquals("cmjkavlgorbmftpm", model.subscriptions().get(0).id()); - Assertions.assertEquals("vqwt", model.networkSecurityPerimeters().get(0).id()); - Assertions.assertEquals("ky", model.networkSecurityPerimeters().get(0).perimeterGuid()); - Assertions.assertEquals("cysihs", model.networkSecurityPerimeters().get(0).location()); - Assertions.assertEquals("muapcvhdbevw", model.fullyQualifiedDomainNames().get(0)); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterAccessRuleTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterAccessRuleTests.java deleted file mode 100644 index e48cef2a9244..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterAccessRuleTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeter; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRule; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRuleProperties; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem; -import com.azure.resourcemanager.cognitiveservices.models.NspAccessRuleDirection; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NetworkSecurityPerimeterAccessRuleTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkSecurityPerimeterAccessRule model = BinaryData.fromString( - "{\"name\":\"qzbqqxlajrnwxa\",\"properties\":{\"direction\":\"Inbound\",\"addressPrefixes\":[\"kuyxoafg\",\"oqltfae\",\"linmfgv\"],\"subscriptions\":[{\"id\":\"gh\"}],\"networkSecurityPerimeters\":[{\"id\":\"oqeyhlqhykprl\",\"perimeterGuid\":\"znuciqdsm\",\"location\":\"iitdfuxt\"}],\"fullyQualifiedDomainNames\":[\"iibmi\",\"bnn\",\"stgnl\",\"hnmgixhcm\"]}}") - .toObject(NetworkSecurityPerimeterAccessRule.class); - Assertions.assertEquals("qzbqqxlajrnwxa", model.name()); - Assertions.assertEquals(NspAccessRuleDirection.INBOUND, model.properties().direction()); - Assertions.assertEquals("kuyxoafg", model.properties().addressPrefixes().get(0)); - Assertions.assertEquals("gh", model.properties().subscriptions().get(0).id()); - Assertions.assertEquals("oqeyhlqhykprl", model.properties().networkSecurityPerimeters().get(0).id()); - Assertions.assertEquals("znuciqdsm", model.properties().networkSecurityPerimeters().get(0).perimeterGuid()); - Assertions.assertEquals("iitdfuxt", model.properties().networkSecurityPerimeters().get(0).location()); - Assertions.assertEquals("iibmi", model.properties().fullyQualifiedDomainNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkSecurityPerimeterAccessRule model - = new NetworkSecurityPerimeterAccessRule().withName("qzbqqxlajrnwxa") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties() - .withDirection(NspAccessRuleDirection.INBOUND) - .withAddressPrefixes(Arrays.asList("kuyxoafg", "oqltfae", "linmfgv")) - .withSubscriptions( - Arrays.asList(new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem().withId("gh"))) - .withNetworkSecurityPerimeters(Arrays.asList(new NetworkSecurityPerimeter().withId("oqeyhlqhykprl") - .withPerimeterGuid("znuciqdsm") - .withLocation("iitdfuxt"))) - .withFullyQualifiedDomainNames(Arrays.asList("iibmi", "bnn", "stgnl", "hnmgixhcm"))); - model = BinaryData.fromObject(model).toObject(NetworkSecurityPerimeterAccessRule.class); - Assertions.assertEquals("qzbqqxlajrnwxa", model.name()); - Assertions.assertEquals(NspAccessRuleDirection.INBOUND, model.properties().direction()); - Assertions.assertEquals("kuyxoafg", model.properties().addressPrefixes().get(0)); - Assertions.assertEquals("gh", model.properties().subscriptions().get(0).id()); - Assertions.assertEquals("oqeyhlqhykprl", model.properties().networkSecurityPerimeters().get(0).id()); - Assertions.assertEquals("znuciqdsm", model.properties().networkSecurityPerimeters().get(0).perimeterGuid()); - Assertions.assertEquals("iitdfuxt", model.properties().networkSecurityPerimeters().get(0).location()); - Assertions.assertEquals("iibmi", model.properties().fullyQualifiedDomainNames().get(0)); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationAssociationInfoTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationAssociationInfoTests.java deleted file mode 100644 index b366d0d1edaf..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationAssociationInfoTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterConfigurationAssociationInfo; -import org.junit.jupiter.api.Assertions; - -public final class NetworkSecurityPerimeterConfigurationAssociationInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkSecurityPerimeterConfigurationAssociationInfo model - = BinaryData.fromString("{\"name\":\"ipqxbkwvzgnzv\",\"accessMode\":\"bzdixzmq\"}") - .toObject(NetworkSecurityPerimeterConfigurationAssociationInfo.class); - Assertions.assertEquals("ipqxbkwvzgnzv", model.name()); - Assertions.assertEquals("bzdixzmq", model.accessMode()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkSecurityPerimeterConfigurationAssociationInfo model - = new NetworkSecurityPerimeterConfigurationAssociationInfo().withName("ipqxbkwvzgnzv") - .withAccessMode("bzdixzmq"); - model = BinaryData.fromObject(model).toObject(NetworkSecurityPerimeterConfigurationAssociationInfo.class); - Assertions.assertEquals("ipqxbkwvzgnzv", model.name()); - Assertions.assertEquals("bzdixzmq", model.accessMode()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationInnerTests.java deleted file mode 100644 index 4b934a5a1c47..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationInnerTests.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.NetworkSecurityPerimeterConfigurationInner; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeter; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRule; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRuleProperties; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterConfigurationAssociationInfo; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterConfigurationProperties; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterProfileInfo; -import com.azure.resourcemanager.cognitiveservices.models.NspAccessRuleDirection; -import com.azure.resourcemanager.cognitiveservices.models.ProvisioningIssue; -import com.azure.resourcemanager.cognitiveservices.models.ProvisioningIssueProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NetworkSecurityPerimeterConfigurationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkSecurityPerimeterConfigurationInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"omylwea\",\"provisioningIssues\":[{\"name\":\"sethwwn\",\"properties\":{\"issueType\":\"l\",\"severity\":\"swpchwahfbousn\",\"description\":\"pgfewetwlyx\",\"suggestedResourceIds\":[\"xykxhdj\"],\"suggestedAccessRules\":[{},{}]}},{\"name\":\"mbcxfhbcp\",\"properties\":{\"issueType\":\"vxcjzhqizxfpxtgq\",\"severity\":\"javftjuhdqa\",\"description\":\"mtggu\",\"suggestedResourceIds\":[\"jrajcivm\"],\"suggestedAccessRules\":[{}]}},{\"name\":\"cf\",\"properties\":{\"issueType\":\"xgkn\",\"severity\":\"vyi\",\"description\":\"qodfvp\",\"suggestedResourceIds\":[\"oxgsgbpfgzdjtx\",\"zflbqvg\",\"qvlgafcqusrdvetn\"],\"suggestedAccessRules\":[{},{},{}]}}],\"networkSecurityPerimeter\":{\"id\":\"tnwlduycv\",\"perimeterGuid\":\"hyrmewipmvekdx\",\"location\":\"uqgsj\"},\"resourceAssociation\":{\"name\":\"n\",\"accessMode\":\"gketwzhhzjhf\"},\"profile\":{\"name\":\"vvmu\",\"accessRulesVersion\":9183951659456928206,\"accessRules\":[{\"name\":\"qsxvmhf\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"hsasbhu\",\"ypoh\"],\"subscriptions\":[{},{},{}],\"networkSecurityPerimeters\":[{},{},{}],\"fullyQualifiedDomainNames\":[\"nsqyrpfoobrltt\",\"msjnygqdnfw\",\"zdzgtilaxhnfhqly\"]}},{\"name\":\"jouw\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"zunbixx\",\"ti\",\"vcpwpgclrc\",\"vtsoxf\"],\"subscriptions\":[{},{},{}],\"networkSecurityPerimeters\":[{},{},{},{}],\"fullyQualifiedDomainNames\":[\"yyefrpmpdnqqs\"]}}],\"diagnosticSettingsVersion\":9156957823967073009,\"enabledLogCategories\":[\"vmm\",\"npqfrtqlkzmeg\"]}},\"id\":\"itgvkx\",\"name\":\"zyqdrfegcealzx\",\"type\":\"hcans\"}") - .toObject(NetworkSecurityPerimeterConfigurationInner.class); - Assertions.assertEquals("sethwwn", model.properties().provisioningIssues().get(0).name()); - Assertions.assertEquals("l", model.properties().provisioningIssues().get(0).properties().issueType()); - Assertions.assertEquals("swpchwahfbousn", - model.properties().provisioningIssues().get(0).properties().severity()); - Assertions.assertEquals("pgfewetwlyx", - model.properties().provisioningIssues().get(0).properties().description()); - Assertions.assertEquals("xykxhdj", - model.properties().provisioningIssues().get(0).properties().suggestedResourceIds().get(0)); - Assertions.assertEquals("tnwlduycv", model.properties().networkSecurityPerimeter().id()); - Assertions.assertEquals("hyrmewipmvekdx", model.properties().networkSecurityPerimeter().perimeterGuid()); - Assertions.assertEquals("uqgsj", model.properties().networkSecurityPerimeter().location()); - Assertions.assertEquals("n", model.properties().resourceAssociation().name()); - Assertions.assertEquals("gketwzhhzjhf", model.properties().resourceAssociation().accessMode()); - Assertions.assertEquals("vvmu", model.properties().profile().name()); - Assertions.assertEquals(9183951659456928206L, model.properties().profile().accessRulesVersion()); - Assertions.assertEquals("qsxvmhf", model.properties().profile().accessRules().get(0).name()); - Assertions.assertEquals(NspAccessRuleDirection.OUTBOUND, - model.properties().profile().accessRules().get(0).properties().direction()); - Assertions.assertEquals("hsasbhu", - model.properties().profile().accessRules().get(0).properties().addressPrefixes().get(0)); - Assertions.assertEquals("nsqyrpfoobrltt", - model.properties().profile().accessRules().get(0).properties().fullyQualifiedDomainNames().get(0)); - Assertions.assertEquals(9156957823967073009L, model.properties().profile().diagnosticSettingsVersion()); - Assertions.assertEquals("vmm", model.properties().profile().enabledLogCategories().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkSecurityPerimeterConfigurationInner model - = new NetworkSecurityPerimeterConfigurationInner() - .withProperties(new NetworkSecurityPerimeterConfigurationProperties() - .withProvisioningIssues(Arrays.asList( - new ProvisioningIssue() - .withName("sethwwn") - .withProperties(new ProvisioningIssueProperties().withIssueType("l") - .withSeverity("swpchwahfbousn") - .withDescription("pgfewetwlyx") - .withSuggestedResourceIds(Arrays.asList("xykxhdj")) - .withSuggestedAccessRules(Arrays.asList(new NetworkSecurityPerimeterAccessRule(), - new NetworkSecurityPerimeterAccessRule()))), - new ProvisioningIssue().withName("mbcxfhbcp") - .withProperties(new ProvisioningIssueProperties() - .withIssueType("vxcjzhqizxfpxtgq") - .withSeverity("javftjuhdqa") - .withDescription("mtggu") - .withSuggestedResourceIds(Arrays.asList("jrajcivm")) - .withSuggestedAccessRules(Arrays.asList(new NetworkSecurityPerimeterAccessRule()))), - new ProvisioningIssue().withName("cf") - .withProperties(new ProvisioningIssueProperties().withIssueType("xgkn") - .withSeverity("vyi") - .withDescription("qodfvp") - .withSuggestedResourceIds( - Arrays.asList("oxgsgbpfgzdjtx", "zflbqvg", "qvlgafcqusrdvetn")) - .withSuggestedAccessRules(Arrays.asList(new NetworkSecurityPerimeterAccessRule(), - new NetworkSecurityPerimeterAccessRule(), - new NetworkSecurityPerimeterAccessRule()))))) - .withNetworkSecurityPerimeter(new NetworkSecurityPerimeter().withId("tnwlduycv") - .withPerimeterGuid("hyrmewipmvekdx") - .withLocation("uqgsj")) - .withResourceAssociation(new NetworkSecurityPerimeterConfigurationAssociationInfo().withName("n") - .withAccessMode("gketwzhhzjhf")) - .withProfile( - new NetworkSecurityPerimeterProfileInfo().withName("vvmu") - .withAccessRulesVersion(9183951659456928206L) - .withAccessRules(Arrays.asList( - new NetworkSecurityPerimeterAccessRule().withName("qsxvmhf") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties() - .withDirection(NspAccessRuleDirection.OUTBOUND) - .withAddressPrefixes(Arrays.asList("hsasbhu", "ypoh")) - .withSubscriptions(Arrays.asList( - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem(), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem(), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem())) - .withNetworkSecurityPerimeters(Arrays.asList(new NetworkSecurityPerimeter(), - new NetworkSecurityPerimeter(), new NetworkSecurityPerimeter())) - .withFullyQualifiedDomainNames( - Arrays.asList("nsqyrpfoobrltt", "msjnygqdnfw", "zdzgtilaxhnfhqly"))), - new NetworkSecurityPerimeterAccessRule().withName("jouw") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties() - .withDirection(NspAccessRuleDirection.OUTBOUND) - .withAddressPrefixes(Arrays.asList("zunbixx", "ti", "vcpwpgclrc", "vtsoxf")) - .withSubscriptions(Arrays.asList( - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem(), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem(), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem())) - .withNetworkSecurityPerimeters(Arrays.asList(new NetworkSecurityPerimeter(), - new NetworkSecurityPerimeter(), new NetworkSecurityPerimeter(), - new NetworkSecurityPerimeter())) - .withFullyQualifiedDomainNames(Arrays.asList("yyefrpmpdnqqs"))))) - .withDiagnosticSettingsVersion(9156957823967073009L) - .withEnabledLogCategories(Arrays.asList("vmm", "npqfrtqlkzmeg")))); - model = BinaryData.fromObject(model).toObject(NetworkSecurityPerimeterConfigurationInner.class); - Assertions.assertEquals("sethwwn", model.properties().provisioningIssues().get(0).name()); - Assertions.assertEquals("l", model.properties().provisioningIssues().get(0).properties().issueType()); - Assertions.assertEquals("swpchwahfbousn", - model.properties().provisioningIssues().get(0).properties().severity()); - Assertions.assertEquals("pgfewetwlyx", - model.properties().provisioningIssues().get(0).properties().description()); - Assertions.assertEquals("xykxhdj", - model.properties().provisioningIssues().get(0).properties().suggestedResourceIds().get(0)); - Assertions.assertEquals("tnwlduycv", model.properties().networkSecurityPerimeter().id()); - Assertions.assertEquals("hyrmewipmvekdx", model.properties().networkSecurityPerimeter().perimeterGuid()); - Assertions.assertEquals("uqgsj", model.properties().networkSecurityPerimeter().location()); - Assertions.assertEquals("n", model.properties().resourceAssociation().name()); - Assertions.assertEquals("gketwzhhzjhf", model.properties().resourceAssociation().accessMode()); - Assertions.assertEquals("vvmu", model.properties().profile().name()); - Assertions.assertEquals(9183951659456928206L, model.properties().profile().accessRulesVersion()); - Assertions.assertEquals("qsxvmhf", model.properties().profile().accessRules().get(0).name()); - Assertions.assertEquals(NspAccessRuleDirection.OUTBOUND, - model.properties().profile().accessRules().get(0).properties().direction()); - Assertions.assertEquals("hsasbhu", - model.properties().profile().accessRules().get(0).properties().addressPrefixes().get(0)); - Assertions.assertEquals("nsqyrpfoobrltt", - model.properties().profile().accessRules().get(0).properties().fullyQualifiedDomainNames().get(0)); - Assertions.assertEquals(9156957823967073009L, model.properties().profile().diagnosticSettingsVersion()); - Assertions.assertEquals("vmm", model.properties().profile().enabledLogCategories().get(0)); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationListTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationListTests.java deleted file mode 100644 index 956487cd53f4..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationListTests.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.NetworkSecurityPerimeterConfigurationInner; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeter; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRule; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterConfigurationAssociationInfo; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterConfigurationList; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterConfigurationProperties; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterProfileInfo; -import com.azure.resourcemanager.cognitiveservices.models.ProvisioningIssue; -import com.azure.resourcemanager.cognitiveservices.models.ProvisioningIssueProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NetworkSecurityPerimeterConfigurationListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkSecurityPerimeterConfigurationList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"sofieypefojyqd\",\"provisioningIssues\":[{\"name\":\"lcplc\",\"properties\":{}}],\"networkSecurityPerimeter\":{\"id\":\"hihlhzdsqtzbs\",\"perimeterGuid\":\"nowc\",\"location\":\"fgmvecactxmwo\"},\"resourceAssociation\":{\"name\":\"owcluqo\",\"accessMode\":\"kqvgqouw\"},\"profile\":{\"name\":\"mpjw\",\"accessRulesVersion\":7600818262729980675,\"accessRules\":[{},{},{}],\"diagnosticSettingsVersion\":7788041719620322166,\"enabledLogCategories\":[\"rfsphuagrt\",\"ikteusqczkvyk\",\"xubyjaffmmfblcqc\",\"ubgq\"]}},\"id\":\"brta\",\"name\":\"metttwgd\",\"type\":\"lqxihhrmooiz\"},{\"properties\":{\"provisioningState\":\"ypxiutcxap\",\"provisioningIssues\":[{\"name\":\"petogebjox\",\"properties\":{}}],\"networkSecurityPerimeter\":{\"id\":\"nhl\",\"perimeterGuid\":\"rqnkkzjcjbtr\",\"location\":\"ehvvib\"},\"resourceAssociation\":{\"name\":\"jsto\",\"accessMode\":\"eitpkxztmo\"},\"profile\":{\"name\":\"lftidgfcwqmpim\",\"accessRulesVersion\":8470531276404867506,\"accessRules\":[{}],\"diagnosticSettingsVersion\":6375317048909912503,\"enabledLogCategories\":[\"hujswtwkozzwcul\"]}},\"id\":\"bawpfajnjwltlwt\",\"name\":\"j\",\"type\":\"uktalhsnvkcdmxz\"}],\"nextLink\":\"oaimlnw\"}") - .toObject(NetworkSecurityPerimeterConfigurationList.class); - Assertions.assertEquals("lcplc", model.value().get(0).properties().provisioningIssues().get(0).name()); - Assertions.assertEquals("hihlhzdsqtzbs", model.value().get(0).properties().networkSecurityPerimeter().id()); - Assertions.assertEquals("nowc", model.value().get(0).properties().networkSecurityPerimeter().perimeterGuid()); - Assertions.assertEquals("fgmvecactxmwo", - model.value().get(0).properties().networkSecurityPerimeter().location()); - Assertions.assertEquals("owcluqo", model.value().get(0).properties().resourceAssociation().name()); - Assertions.assertEquals("kqvgqouw", model.value().get(0).properties().resourceAssociation().accessMode()); - Assertions.assertEquals("mpjw", model.value().get(0).properties().profile().name()); - Assertions.assertEquals(7600818262729980675L, model.value().get(0).properties().profile().accessRulesVersion()); - Assertions.assertEquals(7788041719620322166L, - model.value().get(0).properties().profile().diagnosticSettingsVersion()); - Assertions.assertEquals("rfsphuagrt", - model.value().get(0).properties().profile().enabledLogCategories().get(0)); - Assertions.assertEquals("oaimlnw", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkSecurityPerimeterConfigurationList model - = new NetworkSecurityPerimeterConfigurationList().withValue(Arrays.asList( - new NetworkSecurityPerimeterConfigurationInner() - .withProperties(new NetworkSecurityPerimeterConfigurationProperties() - .withProvisioningIssues(Arrays.asList(new ProvisioningIssue().withName("lcplc") - .withProperties(new ProvisioningIssueProperties()))) - .withNetworkSecurityPerimeter(new NetworkSecurityPerimeter().withId("hihlhzdsqtzbs") - .withPerimeterGuid("nowc") - .withLocation("fgmvecactxmwo")) - .withResourceAssociation( - new NetworkSecurityPerimeterConfigurationAssociationInfo().withName("owcluqo") - .withAccessMode("kqvgqouw")) - .withProfile(new NetworkSecurityPerimeterProfileInfo().withName("mpjw") - .withAccessRulesVersion(7600818262729980675L) - .withAccessRules(Arrays.asList(new NetworkSecurityPerimeterAccessRule(), - new NetworkSecurityPerimeterAccessRule(), new NetworkSecurityPerimeterAccessRule())) - .withDiagnosticSettingsVersion(7788041719620322166L) - .withEnabledLogCategories( - Arrays.asList("rfsphuagrt", "ikteusqczkvyk", "xubyjaffmmfblcqc", "ubgq")))), - new NetworkSecurityPerimeterConfigurationInner() - .withProperties(new NetworkSecurityPerimeterConfigurationProperties() - .withProvisioningIssues(Arrays.asList(new ProvisioningIssue().withName("petogebjox") - .withProperties(new ProvisioningIssueProperties()))) - .withNetworkSecurityPerimeter(new NetworkSecurityPerimeter().withId("nhl") - .withPerimeterGuid("rqnkkzjcjbtr") - .withLocation("ehvvib")) - .withResourceAssociation( - new NetworkSecurityPerimeterConfigurationAssociationInfo().withName("jsto") - .withAccessMode("eitpkxztmo")) - .withProfile(new NetworkSecurityPerimeterProfileInfo().withName("lftidgfcwqmpim") - .withAccessRulesVersion(8470531276404867506L) - .withAccessRules(Arrays.asList(new NetworkSecurityPerimeterAccessRule())) - .withDiagnosticSettingsVersion(6375317048909912503L) - .withEnabledLogCategories(Arrays.asList("hujswtwkozzwcul")))))) - .withNextLink("oaimlnw"); - model = BinaryData.fromObject(model).toObject(NetworkSecurityPerimeterConfigurationList.class); - Assertions.assertEquals("lcplc", model.value().get(0).properties().provisioningIssues().get(0).name()); - Assertions.assertEquals("hihlhzdsqtzbs", model.value().get(0).properties().networkSecurityPerimeter().id()); - Assertions.assertEquals("nowc", model.value().get(0).properties().networkSecurityPerimeter().perimeterGuid()); - Assertions.assertEquals("fgmvecactxmwo", - model.value().get(0).properties().networkSecurityPerimeter().location()); - Assertions.assertEquals("owcluqo", model.value().get(0).properties().resourceAssociation().name()); - Assertions.assertEquals("kqvgqouw", model.value().get(0).properties().resourceAssociation().accessMode()); - Assertions.assertEquals("mpjw", model.value().get(0).properties().profile().name()); - Assertions.assertEquals(7600818262729980675L, model.value().get(0).properties().profile().accessRulesVersion()); - Assertions.assertEquals(7788041719620322166L, - model.value().get(0).properties().profile().diagnosticSettingsVersion()); - Assertions.assertEquals("rfsphuagrt", - model.value().get(0).properties().profile().enabledLogCategories().get(0)); - Assertions.assertEquals("oaimlnw", model.nextLink()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationPropertiesTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationPropertiesTests.java deleted file mode 100644 index be2ad9dcd741..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationPropertiesTests.java +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeter; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRule; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRuleProperties; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterConfigurationAssociationInfo; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterConfigurationProperties; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterProfileInfo; -import com.azure.resourcemanager.cognitiveservices.models.NspAccessRuleDirection; -import com.azure.resourcemanager.cognitiveservices.models.ProvisioningIssue; -import com.azure.resourcemanager.cognitiveservices.models.ProvisioningIssueProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NetworkSecurityPerimeterConfigurationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkSecurityPerimeterConfigurationProperties model = BinaryData.fromString( - "{\"provisioningState\":\"oyqhlwig\",\"provisioningIssues\":[{\"name\":\"kbxgom\",\"properties\":{\"issueType\":\"uwasqvd\",\"severity\":\"y\",\"description\":\"uxakjsqzhzbezk\",\"suggestedResourceIds\":[\"sidxasicdd\",\"vvjskgfmocwahp\",\"gat\",\"eaahhvjhhn\"],\"suggestedAccessRules\":[{\"name\":\"bbjjidjksyxk\",\"properties\":{}},{\"name\":\"xevbl\",\"properties\":{}}]}},{\"name\":\"dnlj\",\"properties\":{\"issueType\":\"euaulxu\",\"severity\":\"mjbnk\",\"description\":\"xynenl\",\"suggestedResourceIds\":[\"eizzgwk\",\"nsrmffeycx\"],\"suggestedAccessRules\":[{\"name\":\"iymerteeammxqi\",\"properties\":{}},{\"name\":\"kzddrtkgdojbmxva\",\"properties\":{}},{\"name\":\"fdeesvecuijpxtx\",\"properties\":{}}]}},{\"name\":\"prtujwsawdd\",\"properties\":{\"issueType\":\"abxvi\",\"severity\":\"tvtzeexavoxtfg\",\"description\":\"cd\",\"suggestedResourceIds\":[\"bwpypqtgsfjacb\"],\"suggestedAccessRules\":[{\"name\":\"xudb\",\"properties\":{}},{\"name\":\"d\",\"properties\":{}}]}}],\"networkSecurityPerimeter\":{\"id\":\"irudh\",\"perimeterGuid\":\"mes\",\"location\":\"dlpagzrcxfail\"},\"resourceAssociation\":{\"name\":\"wmdboxdfgsftuf\",\"accessMode\":\"brjlnacgcckknhxk\"},\"profile\":{\"name\":\"ytnrzvuljraae\",\"accessRulesVersion\":2313343690952034235,\"accessRules\":[{\"name\":\"ukkjqnvbroyla\",\"properties\":{\"direction\":\"Inbound\",\"addressPrefixes\":[\"isdos\",\"jbjsvgjrwh\",\"yvycytdclxgcckn\",\"nwm\"],\"subscriptions\":[{},{},{},{}],\"networkSecurityPerimeters\":[{},{},{},{}],\"fullyQualifiedDomainNames\":[\"jdhttzaefedxi\",\"ch\",\"phkmcrjdqnsdfz\",\"bg\"]}},{\"name\":\"kylkdghrj\",\"properties\":{\"direction\":\"Inbound\",\"addressPrefixes\":[\"xezw\",\"hokvbwnh\",\"tqlgehgppi\"],\"subscriptions\":[{},{},{},{}],\"networkSecurityPerimeters\":[{},{},{},{}],\"fullyQualifiedDomainNames\":[\"oajvgcxtxjcs\"]}},{\"name\":\"afidltugsres\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"oiftxfkfwegprh\"],\"subscriptions\":[{}],\"networkSecurityPerimeters\":[{},{},{},{}],\"fullyQualifiedDomainNames\":[\"biqtgdq\",\"hm\",\"wsldrizetpwbr\"]}}],\"diagnosticSettingsVersion\":6856794884105870110,\"enabledLogCategories\":[\"phbqz\",\"izakak\",\"nkjpdnjzha\",\"oylhjlmuoyxprimr\"]}}") - .toObject(NetworkSecurityPerimeterConfigurationProperties.class); - Assertions.assertEquals("kbxgom", model.provisioningIssues().get(0).name()); - Assertions.assertEquals("uwasqvd", model.provisioningIssues().get(0).properties().issueType()); - Assertions.assertEquals("y", model.provisioningIssues().get(0).properties().severity()); - Assertions.assertEquals("uxakjsqzhzbezk", model.provisioningIssues().get(0).properties().description()); - Assertions.assertEquals("sidxasicdd", - model.provisioningIssues().get(0).properties().suggestedResourceIds().get(0)); - Assertions.assertEquals("bbjjidjksyxk", - model.provisioningIssues().get(0).properties().suggestedAccessRules().get(0).name()); - Assertions.assertEquals("irudh", model.networkSecurityPerimeter().id()); - Assertions.assertEquals("mes", model.networkSecurityPerimeter().perimeterGuid()); - Assertions.assertEquals("dlpagzrcxfail", model.networkSecurityPerimeter().location()); - Assertions.assertEquals("wmdboxdfgsftuf", model.resourceAssociation().name()); - Assertions.assertEquals("brjlnacgcckknhxk", model.resourceAssociation().accessMode()); - Assertions.assertEquals("ytnrzvuljraae", model.profile().name()); - Assertions.assertEquals(2313343690952034235L, model.profile().accessRulesVersion()); - Assertions.assertEquals("ukkjqnvbroyla", model.profile().accessRules().get(0).name()); - Assertions.assertEquals(NspAccessRuleDirection.INBOUND, - model.profile().accessRules().get(0).properties().direction()); - Assertions.assertEquals("isdos", model.profile().accessRules().get(0).properties().addressPrefixes().get(0)); - Assertions.assertEquals("jdhttzaefedxi", - model.profile().accessRules().get(0).properties().fullyQualifiedDomainNames().get(0)); - Assertions.assertEquals(6856794884105870110L, model.profile().diagnosticSettingsVersion()); - Assertions.assertEquals("phbqz", model.profile().enabledLogCategories().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkSecurityPerimeterConfigurationProperties model = new NetworkSecurityPerimeterConfigurationProperties() - .withProvisioningIssues(Arrays.asList( - new ProvisioningIssue().withName("kbxgom") - .withProperties(new ProvisioningIssueProperties().withIssueType("uwasqvd") - .withSeverity("y") - .withDescription("uxakjsqzhzbezk") - .withSuggestedResourceIds(Arrays.asList("sidxasicdd", "vvjskgfmocwahp", "gat", "eaahhvjhhn")) - .withSuggestedAccessRules(Arrays.asList( - new NetworkSecurityPerimeterAccessRule().withName("bbjjidjksyxk") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties()), - new NetworkSecurityPerimeterAccessRule().withName("xevbl") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties())))), - new ProvisioningIssue().withName("dnlj") - .withProperties(new ProvisioningIssueProperties().withIssueType("euaulxu") - .withSeverity("mjbnk") - .withDescription("xynenl") - .withSuggestedResourceIds(Arrays.asList("eizzgwk", "nsrmffeycx")) - .withSuggestedAccessRules(Arrays.asList( - new NetworkSecurityPerimeterAccessRule().withName("iymerteeammxqi") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties()), - new NetworkSecurityPerimeterAccessRule().withName("kzddrtkgdojbmxva") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties()), - new NetworkSecurityPerimeterAccessRule().withName("fdeesvecuijpxtx") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties())))), - new ProvisioningIssue().withName("prtujwsawdd") - .withProperties(new ProvisioningIssueProperties().withIssueType("abxvi") - .withSeverity("tvtzeexavoxtfg") - .withDescription("cd") - .withSuggestedResourceIds(Arrays.asList("bwpypqtgsfjacb")) - .withSuggestedAccessRules(Arrays.asList( - new NetworkSecurityPerimeterAccessRule().withName("xudb") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties()), - new NetworkSecurityPerimeterAccessRule().withName("d") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties())))))) - .withNetworkSecurityPerimeter(new NetworkSecurityPerimeter().withId("irudh") - .withPerimeterGuid("mes") - .withLocation("dlpagzrcxfail")) - .withResourceAssociation( - new NetworkSecurityPerimeterConfigurationAssociationInfo() - .withName("wmdboxdfgsftuf") - .withAccessMode("brjlnacgcckknhxk")) - .withProfile( - new NetworkSecurityPerimeterProfileInfo().withName("ytnrzvuljraae") - .withAccessRulesVersion(2313343690952034235L) - .withAccessRules( - Arrays.asList( - new NetworkSecurityPerimeterAccessRule().withName("ukkjqnvbroyla") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties() - .withDirection(NspAccessRuleDirection.INBOUND) - .withAddressPrefixes(Arrays.asList("isdos", "jbjsvgjrwh", "yvycytdclxgcckn", "nwm")) - .withSubscriptions(Arrays.asList( - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem(), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem(), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem(), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem())) - .withNetworkSecurityPerimeters( - Arrays.asList(new NetworkSecurityPerimeter(), new NetworkSecurityPerimeter(), - new NetworkSecurityPerimeter(), new NetworkSecurityPerimeter())) - .withFullyQualifiedDomainNames( - Arrays.asList("jdhttzaefedxi", "ch", "phkmcrjdqnsdfz", "bg"))), - new NetworkSecurityPerimeterAccessRule().withName("kylkdghrj") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties() - .withDirection(NspAccessRuleDirection.INBOUND) - .withAddressPrefixes(Arrays.asList("xezw", "hokvbwnh", "tqlgehgppi")) - .withSubscriptions(Arrays.asList( - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem(), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem(), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem(), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem())) - .withNetworkSecurityPerimeters( - Arrays.asList(new NetworkSecurityPerimeter(), new NetworkSecurityPerimeter(), - new NetworkSecurityPerimeter(), new NetworkSecurityPerimeter())) - .withFullyQualifiedDomainNames(Arrays.asList("oajvgcxtxjcs"))), - new NetworkSecurityPerimeterAccessRule().withName("afidltugsres") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties() - .withDirection(NspAccessRuleDirection.OUTBOUND) - .withAddressPrefixes(Arrays.asList("oiftxfkfwegprh")) - .withSubscriptions(Arrays - .asList(new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem())) - .withNetworkSecurityPerimeters( - Arrays.asList(new NetworkSecurityPerimeter(), new NetworkSecurityPerimeter(), - new NetworkSecurityPerimeter(), new NetworkSecurityPerimeter())) - .withFullyQualifiedDomainNames(Arrays.asList("biqtgdq", "hm", "wsldrizetpwbr"))))) - .withDiagnosticSettingsVersion(6856794884105870110L) - .withEnabledLogCategories(Arrays.asList("phbqz", "izakak", "nkjpdnjzha", "oylhjlmuoyxprimr"))); - model = BinaryData.fromObject(model).toObject(NetworkSecurityPerimeterConfigurationProperties.class); - Assertions.assertEquals("kbxgom", model.provisioningIssues().get(0).name()); - Assertions.assertEquals("uwasqvd", model.provisioningIssues().get(0).properties().issueType()); - Assertions.assertEquals("y", model.provisioningIssues().get(0).properties().severity()); - Assertions.assertEquals("uxakjsqzhzbezk", model.provisioningIssues().get(0).properties().description()); - Assertions.assertEquals("sidxasicdd", - model.provisioningIssues().get(0).properties().suggestedResourceIds().get(0)); - Assertions.assertEquals("bbjjidjksyxk", - model.provisioningIssues().get(0).properties().suggestedAccessRules().get(0).name()); - Assertions.assertEquals("irudh", model.networkSecurityPerimeter().id()); - Assertions.assertEquals("mes", model.networkSecurityPerimeter().perimeterGuid()); - Assertions.assertEquals("dlpagzrcxfail", model.networkSecurityPerimeter().location()); - Assertions.assertEquals("wmdboxdfgsftuf", model.resourceAssociation().name()); - Assertions.assertEquals("brjlnacgcckknhxk", model.resourceAssociation().accessMode()); - Assertions.assertEquals("ytnrzvuljraae", model.profile().name()); - Assertions.assertEquals(2313343690952034235L, model.profile().accessRulesVersion()); - Assertions.assertEquals("ukkjqnvbroyla", model.profile().accessRules().get(0).name()); - Assertions.assertEquals(NspAccessRuleDirection.INBOUND, - model.profile().accessRules().get(0).properties().direction()); - Assertions.assertEquals("isdos", model.profile().accessRules().get(0).properties().addressPrefixes().get(0)); - Assertions.assertEquals("jdhttzaefedxi", - model.profile().accessRules().get(0).properties().fullyQualifiedDomainNames().get(0)); - Assertions.assertEquals(6856794884105870110L, model.profile().diagnosticSettingsVersion()); - Assertions.assertEquals("phbqz", model.profile().enabledLogCategories().get(0)); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsGetWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsGetWithResponseMockTests.java deleted file mode 100644 index 481e7a8f9418..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsGetWithResponseMockTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterConfiguration; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class NetworkSecurityPerimeterConfigurationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"provisioningState\":\"vmaxgnuyea\",\"provisioningIssues\":[{\"name\":\"udf\",\"properties\":{\"issueType\":\"ehok\",\"severity\":\"pqtwloesqrggvrb\",\"description\":\"rukoi\",\"suggestedResourceIds\":[\"iduw\",\"leipjl\"],\"suggestedAccessRules\":[{},{},{}]}},{\"name\":\"p\",\"properties\":{\"issueType\":\"z\",\"severity\":\"hqkkwhbgxvellvul\",\"description\":\"d\",\"suggestedResourceIds\":[\"tmujdtvmc\",\"yymffhmjp\",\"dnyxfzuvrz\"],\"suggestedAccessRules\":[{},{},{},{}]}},{\"name\":\"zjqr\",\"properties\":{\"issueType\":\"vnmdyfoeboj\",\"severity\":\"pp\",\"description\":\"aohoqkpjtnq\",\"suggestedResourceIds\":[\"aywkdcwmqsyril\"],\"suggestedAccessRules\":[{},{},{},{}]}},{\"name\":\"qaolfylnkkbjpjv\",\"properties\":{\"issueType\":\"ltm\",\"severity\":\"obbjwhlwy\",\"description\":\"nqzocrdzg\",\"suggestedResourceIds\":[\"untgxdn\",\"aqttiek\",\"i\",\"uvny\"],\"suggestedAccessRules\":[{},{},{},{}]}}],\"networkSecurityPerimeter\":{\"id\":\"xgyrihlgmgbehlqt\",\"perimeterGuid\":\"rflknd\",\"location\":\"dpg\"},\"resourceAssociation\":{\"name\":\"dhdaqotwfhipx\",\"accessMode\":\"sabvcip\"},\"profile\":{\"name\":\"afcz\",\"accessRulesVersion\":2476059658162124344,\"accessRules\":[{\"name\":\"rvpe\",\"properties\":{}},{\"name\":\"dvei\",\"properties\":{}},{\"name\":\"jnsxzajlnsjhwjuy\",\"properties\":{}},{\"name\":\"xqvmvuay\",\"properties\":{}}],\"diagnosticSettingsVersion\":2506282520754540951,\"enabledLogCategories\":[\"eqbw\",\"ntghyksarcdr\"]}},\"id\":\"xsl\",\"name\":\"vlzladl\",\"type\":\"x\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NetworkSecurityPerimeterConfiguration response = manager.networkSecurityPerimeterConfigurations() - .getWithResponse("wjiyewhfjsrwq", "xet", "gcwvrrmdqntycna", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("udf", response.properties().provisioningIssues().get(0).name()); - Assertions.assertEquals("ehok", response.properties().provisioningIssues().get(0).properties().issueType()); - Assertions.assertEquals("pqtwloesqrggvrb", - response.properties().provisioningIssues().get(0).properties().severity()); - Assertions.assertEquals("rukoi", response.properties().provisioningIssues().get(0).properties().description()); - Assertions.assertEquals("iduw", - response.properties().provisioningIssues().get(0).properties().suggestedResourceIds().get(0)); - Assertions.assertEquals("xgyrihlgmgbehlqt", response.properties().networkSecurityPerimeter().id()); - Assertions.assertEquals("rflknd", response.properties().networkSecurityPerimeter().perimeterGuid()); - Assertions.assertEquals("dpg", response.properties().networkSecurityPerimeter().location()); - Assertions.assertEquals("dhdaqotwfhipx", response.properties().resourceAssociation().name()); - Assertions.assertEquals("sabvcip", response.properties().resourceAssociation().accessMode()); - Assertions.assertEquals("afcz", response.properties().profile().name()); - Assertions.assertEquals(2476059658162124344L, response.properties().profile().accessRulesVersion()); - Assertions.assertEquals("rvpe", response.properties().profile().accessRules().get(0).name()); - Assertions.assertEquals(2506282520754540951L, response.properties().profile().diagnosticSettingsVersion()); - Assertions.assertEquals("eqbw", response.properties().profile().enabledLogCategories().get(0)); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsListMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsListMockTests.java deleted file mode 100644 index 96d2d1e35ad8..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsListMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterConfiguration; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class NetworkSecurityPerimeterConfigurationsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"iuxqggvqr\",\"provisioningIssues\":[{\"name\":\"lwcjsqggjhffb\",\"properties\":{\"issueType\":\"rkijpeuqlsdxeqz\",\"severity\":\"x\",\"description\":\"wwmjs\",\"suggestedResourceIds\":[\"awwamecleqiouln\"],\"suggestedAccessRules\":[{},{}]}},{\"name\":\"oeojhto\",\"properties\":{\"issueType\":\"svidmytzlnglx\",\"severity\":\"ovyoanf\",\"description\":\"swqagywvtxigvjrk\",\"suggestedResourceIds\":[\"aeukyawohpm\",\"hqnucs\",\"lhsidsjtdl\"],\"suggestedAccessRules\":[{},{},{}]}},{\"name\":\"njg\",\"properties\":{\"issueType\":\"sv\",\"severity\":\"fcpu\",\"description\":\"e\",\"suggestedResourceIds\":[\"cciklhs\",\"ekrdr\",\"nxolriyehqb\"],\"suggestedAccessRules\":[{},{},{},{}]}}],\"networkSecurityPerimeter\":{\"id\":\"hydwbdbfgrlp\",\"perimeterGuid\":\"ytjlkesmmpath\",\"location\":\"ta\"},\"resourceAssociation\":{\"name\":\"an\",\"accessMode\":\"wllbv\"},\"profile\":{\"name\":\"sfftedousnktjtgr\",\"accessRulesVersion\":2376986574027159113,\"accessRules\":[{\"name\":\"kbeba\",\"properties\":{}},{\"name\":\"qbtxxwpf\",\"properties\":{}},{\"name\":\"zudrtpzk\",\"properties\":{}},{\"name\":\"boy\",\"properties\":{}}],\"diagnosticSettingsVersion\":5573114607045046591,\"enabledLogCategories\":[\"hmngqb\",\"dygisrzwnykd\",\"djchlr\"]}},\"id\":\"pwctofl\",\"name\":\"seac\",\"type\":\"hztxkbrfgd\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.networkSecurityPerimeterConfigurations() - .list("aqktkrumzu", "dkyzbfvxov", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("lwcjsqggjhffb", - response.iterator().next().properties().provisioningIssues().get(0).name()); - Assertions.assertEquals("rkijpeuqlsdxeqz", - response.iterator().next().properties().provisioningIssues().get(0).properties().issueType()); - Assertions.assertEquals("x", - response.iterator().next().properties().provisioningIssues().get(0).properties().severity()); - Assertions.assertEquals("wwmjs", - response.iterator().next().properties().provisioningIssues().get(0).properties().description()); - Assertions.assertEquals("awwamecleqiouln", - response.iterator() - .next() - .properties() - .provisioningIssues() - .get(0) - .properties() - .suggestedResourceIds() - .get(0)); - Assertions.assertEquals("hydwbdbfgrlp", - response.iterator().next().properties().networkSecurityPerimeter().id()); - Assertions.assertEquals("ytjlkesmmpath", - response.iterator().next().properties().networkSecurityPerimeter().perimeterGuid()); - Assertions.assertEquals("ta", response.iterator().next().properties().networkSecurityPerimeter().location()); - Assertions.assertEquals("an", response.iterator().next().properties().resourceAssociation().name()); - Assertions.assertEquals("wllbv", response.iterator().next().properties().resourceAssociation().accessMode()); - Assertions.assertEquals("sfftedousnktjtgr", response.iterator().next().properties().profile().name()); - Assertions.assertEquals(2376986574027159113L, - response.iterator().next().properties().profile().accessRulesVersion()); - Assertions.assertEquals("kbeba", response.iterator().next().properties().profile().accessRules().get(0).name()); - Assertions.assertEquals(5573114607045046591L, - response.iterator().next().properties().profile().diagnosticSettingsVersion()); - Assertions.assertEquals("hmngqb", - response.iterator().next().properties().profile().enabledLogCategories().get(0)); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsReconcileMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsReconcileMockTests.java deleted file mode 100644 index 82d5241b2f25..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsReconcileMockTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterConfiguration; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class NetworkSecurityPerimeterConfigurationsReconcileMockTests { - @Test - public void testReconcile() throws Exception { - String responseStr - = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"provisioningIssues\":[{\"name\":\"dfwakwseivmak\",\"properties\":{\"issueType\":\"so\",\"severity\":\"juxlkbectvtfjm\",\"description\":\"dchmaiubavlz\",\"suggestedResourceIds\":[\"gmfalkzazmgoked\",\"jqafkmkro\",\"zrthqet\",\"pqrtvaoznqni\"],\"suggestedAccessRules\":[{},{},{},{}]}},{\"name\":\"eagmceituug\",\"properties\":{\"issueType\":\"fpjstlzmb\",\"severity\":\"yjdeolctaebfs\",\"description\":\"ledjcustbvtqigd\",\"suggestedResourceIds\":[\"sgeafgfosehx\",\"zsxezppkkwaae\"],\"suggestedAccessRules\":[{},{},{}]}},{\"name\":\"jlpzeqtoyrp\",\"properties\":{\"issueType\":\"lajmllp\",\"severity\":\"evhamfowg\",\"description\":\"tmk\",\"suggestedResourceIds\":[\"pkzwa\"],\"suggestedAccessRules\":[{},{},{},{}]}}],\"networkSecurityPerimeter\":{\"id\":\"ovchiqbplvfid\",\"perimeterGuid\":\"ztekxbyjgmsfep\",\"location\":\"ihpq\"},\"resourceAssociation\":{\"name\":\"grhrdic\",\"accessMode\":\"wyjfowxwyovcxjs\"},\"profile\":{\"name\":\"pcukd\",\"accessRulesVersion\":6478476939633501020,\"accessRules\":[{\"name\":\"oduchvlscr\",\"properties\":{}},{\"name\":\"bfdyjduss\",\"properties\":{}},{\"name\":\"zekbhwlkaagg\",\"properties\":{}},{\"name\":\"hbfrnuybfflj\",\"properties\":{}}],\"diagnosticSettingsVersion\":3504021996381944964,\"enabledLogCategories\":[\"agsqta\"]}},\"id\":\"dusr\",\"name\":\"xxfavsqwudohzilf\",\"type\":\"nl\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NetworkSecurityPerimeterConfiguration response = manager.networkSecurityPerimeterConfigurations() - .reconcile("pbqhvfdqqjwkr", "wzdanojisgglmvo", "atuztjct", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("dfwakwseivmak", response.properties().provisioningIssues().get(0).name()); - Assertions.assertEquals("so", response.properties().provisioningIssues().get(0).properties().issueType()); - Assertions.assertEquals("juxlkbectvtfjm", - response.properties().provisioningIssues().get(0).properties().severity()); - Assertions.assertEquals("dchmaiubavlz", - response.properties().provisioningIssues().get(0).properties().description()); - Assertions.assertEquals("gmfalkzazmgoked", - response.properties().provisioningIssues().get(0).properties().suggestedResourceIds().get(0)); - Assertions.assertEquals("ovchiqbplvfid", response.properties().networkSecurityPerimeter().id()); - Assertions.assertEquals("ztekxbyjgmsfep", response.properties().networkSecurityPerimeter().perimeterGuid()); - Assertions.assertEquals("ihpq", response.properties().networkSecurityPerimeter().location()); - Assertions.assertEquals("grhrdic", response.properties().resourceAssociation().name()); - Assertions.assertEquals("wyjfowxwyovcxjs", response.properties().resourceAssociation().accessMode()); - Assertions.assertEquals("pcukd", response.properties().profile().name()); - Assertions.assertEquals(6478476939633501020L, response.properties().profile().accessRulesVersion()); - Assertions.assertEquals("oduchvlscr", response.properties().profile().accessRules().get(0).name()); - Assertions.assertEquals(3504021996381944964L, response.properties().profile().diagnosticSettingsVersion()); - Assertions.assertEquals("agsqta", response.properties().profile().enabledLogCategories().get(0)); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterProfileInfoTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterProfileInfoTests.java deleted file mode 100644 index 9751a115c25c..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterProfileInfoTests.java +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeter; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRule; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRuleProperties; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterProfileInfo; -import com.azure.resourcemanager.cognitiveservices.models.NspAccessRuleDirection; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NetworkSecurityPerimeterProfileInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkSecurityPerimeterProfileInfo model = BinaryData.fromString( - "{\"name\":\"odawopqhewjptmcg\",\"accessRulesVersion\":3816404991942855012,\"accessRules\":[{\"name\":\"lnd\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"zlbiojlvfhrbbpn\",\"qvcww\",\"yurmochpprprs\",\"mo\"],\"subscriptions\":[{\"id\":\"ejnhlbkpb\"},{\"id\":\"cpilj\"},{\"id\":\"hzvechndbnwieho\"}],\"networkSecurityPerimeters\":[{\"id\":\"wiuub\",\"perimeterGuid\":\"fqsfa\",\"location\":\"qtferrqwexjkmf\"},{\"id\":\"pjwogqqno\",\"perimeterGuid\":\"udcdabtqwpwyawb\",\"location\":\"sqbuc\"}],\"fullyQualifiedDomainNames\":[\"kyexaoguyaipi\",\"sdaultxij\",\"um\"]}},{\"name\":\"waz\",\"properties\":{\"direction\":\"Inbound\",\"addressPrefixes\":[\"jng\",\"qdqx\",\"bjwgnyfus\",\"zsvtuikzhajqgl\"],\"subscriptions\":[{\"id\":\"l\"}],\"networkSecurityPerimeters\":[{\"id\":\"xynqnz\",\"perimeterGuid\":\"p\",\"location\":\"vwxzn\"},{\"id\":\"goeiybbabpfhvfsl\",\"perimeterGuid\":\"ntjlr\",\"location\":\"jkskyr\"},{\"id\":\"ovzidsx\",\"perimeterGuid\":\"abzmifrygznmmaxr\",\"location\":\"kzobgopxlhsln\"}],\"fullyQualifiedDomainNames\":[\"ieixynllxe\",\"wcrojphslhcaw\",\"u\"]}},{\"name\":\"fdwfmvigorqj\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"aglkafhon\",\"juj\"],\"subscriptions\":[{\"id\":\"pzvcpopmxelnwc\"},{\"id\":\"yjede\"},{\"id\":\"mlfmkqs\"},{\"id\":\"zuawxtzxpuamwa\"}],\"networkSecurityPerimeters\":[{\"id\":\"vxcushsphaivmx\",\"perimeterGuid\":\"sflvgsgzwywakoih\",\"location\":\"smjblmljhlnym\"},{\"id\":\"tqyryuzcbmqqv\",\"perimeterGuid\":\"vwf\",\"location\":\"ayxonsupeujl\"},{\"id\":\"nh\",\"perimeterGuid\":\"sqltnzo\",\"location\":\"gsxgnxfyqon\"},{\"id\":\"qoxwd\",\"perimeterGuid\":\"dbxiqx\",\"location\":\"iqbi\"}],\"fullyQualifiedDomainNames\":[\"mwwinhehfqpofv\",\"bcblemb\"]}},{\"name\":\"bwvqvxkdi\",\"properties\":{\"direction\":\"Inbound\",\"addressPrefixes\":[\"wtswbzuwfmdur\"],\"subscriptions\":[{\"id\":\"izvcjfe\"},{\"id\":\"sdjubggbqigkxkbs\"}],\"networkSecurityPerimeters\":[{\"id\":\"kga\",\"perimeterGuid\":\"rcmjdmspofapvuh\",\"location\":\"lniofrzgbzje\"}],\"fullyQualifiedDomainNames\":[\"tkvnlvxbcuiiznkt\"]}}],\"diagnosticSettingsVersion\":6615229551245613232,\"enabledLogCategories\":[\"v\"]}") - .toObject(NetworkSecurityPerimeterProfileInfo.class); - Assertions.assertEquals("odawopqhewjptmcg", model.name()); - Assertions.assertEquals(3816404991942855012L, model.accessRulesVersion()); - Assertions.assertEquals("lnd", model.accessRules().get(0).name()); - Assertions.assertEquals(NspAccessRuleDirection.OUTBOUND, model.accessRules().get(0).properties().direction()); - Assertions.assertEquals("zlbiojlvfhrbbpn", model.accessRules().get(0).properties().addressPrefixes().get(0)); - Assertions.assertEquals("ejnhlbkpb", model.accessRules().get(0).properties().subscriptions().get(0).id()); - Assertions.assertEquals("wiuub", - model.accessRules().get(0).properties().networkSecurityPerimeters().get(0).id()); - Assertions.assertEquals("fqsfa", - model.accessRules().get(0).properties().networkSecurityPerimeters().get(0).perimeterGuid()); - Assertions.assertEquals("qtferrqwexjkmf", - model.accessRules().get(0).properties().networkSecurityPerimeters().get(0).location()); - Assertions.assertEquals("kyexaoguyaipi", - model.accessRules().get(0).properties().fullyQualifiedDomainNames().get(0)); - Assertions.assertEquals(6615229551245613232L, model.diagnosticSettingsVersion()); - Assertions.assertEquals("v", model.enabledLogCategories().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkSecurityPerimeterProfileInfo model - = new NetworkSecurityPerimeterProfileInfo().withName("odawopqhewjptmcg") - .withAccessRulesVersion(3816404991942855012L) - .withAccessRules(Arrays.asList( - new NetworkSecurityPerimeterAccessRule().withName("lnd") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties() - .withDirection(NspAccessRuleDirection.OUTBOUND) - .withAddressPrefixes(Arrays.asList("zlbiojlvfhrbbpn", "qvcww", "yurmochpprprs", "mo")) - .withSubscriptions(Arrays.asList( - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem().withId("ejnhlbkpb"), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem().withId("cpilj"), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem() - .withId("hzvechndbnwieho"))) - .withNetworkSecurityPerimeters(Arrays.asList( - new NetworkSecurityPerimeter().withId("wiuub") - .withPerimeterGuid("fqsfa") - .withLocation("qtferrqwexjkmf"), - new NetworkSecurityPerimeter().withId("pjwogqqno") - .withPerimeterGuid("udcdabtqwpwyawb") - .withLocation("sqbuc"))) - .withFullyQualifiedDomainNames(Arrays.asList("kyexaoguyaipi", "sdaultxij", "um"))), - new NetworkSecurityPerimeterAccessRule().withName("waz") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties() - .withDirection(NspAccessRuleDirection.INBOUND) - .withAddressPrefixes(Arrays.asList("jng", "qdqx", "bjwgnyfus", "zsvtuikzhajqgl")) - .withSubscriptions(Arrays.asList( - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem().withId("l"))) - .withNetworkSecurityPerimeters(Arrays.asList( - new NetworkSecurityPerimeter().withId("xynqnz") - .withPerimeterGuid("p") - .withLocation("vwxzn"), - new NetworkSecurityPerimeter().withId("goeiybbabpfhvfsl") - .withPerimeterGuid("ntjlr") - .withLocation("jkskyr"), - new NetworkSecurityPerimeter().withId("ovzidsx") - .withPerimeterGuid("abzmifrygznmmaxr") - .withLocation("kzobgopxlhsln"))) - .withFullyQualifiedDomainNames(Arrays.asList("ieixynllxe", "wcrojphslhcaw", "u"))), - new NetworkSecurityPerimeterAccessRule().withName("fdwfmvigorqj") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties() - .withDirection(NspAccessRuleDirection.OUTBOUND) - .withAddressPrefixes(Arrays.asList("aglkafhon", "juj")) - .withSubscriptions(Arrays.asList( - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem() - .withId("pzvcpopmxelnwc"), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem().withId("yjede"), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem().withId("mlfmkqs"), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem() - .withId("zuawxtzxpuamwa"))) - .withNetworkSecurityPerimeters(Arrays.asList( - new NetworkSecurityPerimeter().withId("vxcushsphaivmx") - .withPerimeterGuid("sflvgsgzwywakoih") - .withLocation("smjblmljhlnym"), - new NetworkSecurityPerimeter().withId("tqyryuzcbmqqv") - .withPerimeterGuid("vwf") - .withLocation("ayxonsupeujl"), - new NetworkSecurityPerimeter().withId("nh") - .withPerimeterGuid("sqltnzo") - .withLocation("gsxgnxfyqon"), - new NetworkSecurityPerimeter().withId("qoxwd") - .withPerimeterGuid("dbxiqx") - .withLocation("iqbi"))) - .withFullyQualifiedDomainNames(Arrays.asList("mwwinhehfqpofv", "bcblemb"))), - new NetworkSecurityPerimeterAccessRule().withName("bwvqvxkdi") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties() - .withDirection(NspAccessRuleDirection.INBOUND) - .withAddressPrefixes(Arrays.asList("wtswbzuwfmdur")) - .withSubscriptions(Arrays.asList( - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem().withId("izvcjfe"), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem() - .withId("sdjubggbqigkxkbs"))) - .withNetworkSecurityPerimeters(Arrays.asList(new NetworkSecurityPerimeter().withId("kga") - .withPerimeterGuid("rcmjdmspofapvuh") - .withLocation("lniofrzgbzje"))) - .withFullyQualifiedDomainNames(Arrays.asList("tkvnlvxbcuiiznkt"))))) - .withDiagnosticSettingsVersion(6615229551245613232L) - .withEnabledLogCategories(Arrays.asList("v")); - model = BinaryData.fromObject(model).toObject(NetworkSecurityPerimeterProfileInfo.class); - Assertions.assertEquals("odawopqhewjptmcg", model.name()); - Assertions.assertEquals(3816404991942855012L, model.accessRulesVersion()); - Assertions.assertEquals("lnd", model.accessRules().get(0).name()); - Assertions.assertEquals(NspAccessRuleDirection.OUTBOUND, model.accessRules().get(0).properties().direction()); - Assertions.assertEquals("zlbiojlvfhrbbpn", model.accessRules().get(0).properties().addressPrefixes().get(0)); - Assertions.assertEquals("ejnhlbkpb", model.accessRules().get(0).properties().subscriptions().get(0).id()); - Assertions.assertEquals("wiuub", - model.accessRules().get(0).properties().networkSecurityPerimeters().get(0).id()); - Assertions.assertEquals("fqsfa", - model.accessRules().get(0).properties().networkSecurityPerimeters().get(0).perimeterGuid()); - Assertions.assertEquals("qtferrqwexjkmf", - model.accessRules().get(0).properties().networkSecurityPerimeters().get(0).location()); - Assertions.assertEquals("kyexaoguyaipi", - model.accessRules().get(0).properties().fullyQualifiedDomainNames().get(0)); - Assertions.assertEquals(6615229551245613232L, model.diagnosticSettingsVersion()); - Assertions.assertEquals("v", model.enabledLogCategories().get(0)); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterTests.java deleted file mode 100644 index 8d957267df80..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeter; -import org.junit.jupiter.api.Assertions; - -public final class NetworkSecurityPerimeterTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkSecurityPerimeter model - = BinaryData.fromString("{\"id\":\"clj\",\"perimeterGuid\":\"gvkzqkjjeokbze\",\"location\":\"zrxcczurt\"}") - .toObject(NetworkSecurityPerimeter.class); - Assertions.assertEquals("clj", model.id()); - Assertions.assertEquals("gvkzqkjjeokbze", model.perimeterGuid()); - Assertions.assertEquals("zrxcczurt", model.location()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkSecurityPerimeter model = new NetworkSecurityPerimeter().withId("clj") - .withPerimeterGuid("gvkzqkjjeokbze") - .withLocation("zrxcczurt"); - model = BinaryData.fromObject(model).toObject(NetworkSecurityPerimeter.class); - Assertions.assertEquals("clj", model.id()); - Assertions.assertEquals("gvkzqkjjeokbze", model.perimeterGuid()); - Assertions.assertEquals("zrxcczurt", model.location()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OperationDisplayTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OperationDisplayTests.java deleted file mode 100644 index 3419e4830f0d..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OperationDisplayTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.OperationDisplay; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = BinaryData - .fromString( - "{\"provider\":\"otogtwrupqs\",\"resource\":\"nmic\",\"operation\":\"vce\",\"description\":\"eil\"}") - .toObject(OperationDisplay.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay(); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OperationInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OperationInnerTests.java deleted file mode 100644 index 16a720ee88c9..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OperationInnerTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.OperationInner; -import com.azure.resourcemanager.cognitiveservices.models.OperationDisplay; - -public final class OperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInner model = BinaryData.fromString( - "{\"name\":\"nyqupedeojnabck\",\"isDataAction\":true,\"display\":{\"provider\":\"psiebtfhvpes\",\"resource\":\"skrdqmhjj\",\"operation\":\"tldwkyzxuutk\",\"description\":\"ws\"},\"origin\":\"user\",\"actionType\":\"Internal\"}") - .toObject(OperationInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withDisplay(new OperationDisplay()); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OperationListResultTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OperationListResultTests.java deleted file mode 100644 index 6aa662197a36..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OperationListResultTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.OperationListResult; - -public final class OperationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationListResult model = BinaryData.fromString( - "{\"value\":[{\"name\":\"lfktsths\",\"isDataAction\":true,\"display\":{\"provider\":\"nyyazttbtwwrqpue\",\"resource\":\"kzywbiex\",\"operation\":\"eyueaxibxujwb\",\"description\":\"walm\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"epdkzja\",\"isDataAction\":false,\"display\":{\"provider\":\"hdwbavxbniwdjs\",\"resource\":\"tsdbpgn\",\"operation\":\"txhp\",\"description\":\"bzpfzab\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"wtctyqi\",\"isDataAction\":true,\"display\":{\"provider\":\"vplwzbhv\",\"resource\":\"u\",\"operation\":\"osvmk\",\"description\":\"sxqu\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"mg\",\"isDataAction\":true,\"display\":{\"provider\":\"zkd\",\"resource\":\"lpvlopw\",\"operation\":\"ighxpk\",\"description\":\"zb\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}],\"nextLink\":\"a\"}") - .toObject(OperationListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model = new OperationListResult(); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OperationsListMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OperationsListMockTests.java deleted file mode 100644 index dcb86ba90ece..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OperationsListMockTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.Operation; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class OperationsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"name\":\"yukphaimmoiroq\",\"isDataAction\":false,\"display\":{\"provider\":\"ragapyyrmfsvbp\",\"resource\":\"bopfppdbwnup\",\"operation\":\"hxkumasjcaacfdmm\",\"description\":\"ugmehqepvufhbze\"},\"origin\":\"user\",\"actionType\":\"Internal\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PatchResourceTagsAndSkuTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PatchResourceTagsAndSkuTests.java deleted file mode 100644 index a8cd22ef8208..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PatchResourceTagsAndSkuTests.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.PatchResourceTagsAndSku; -import com.azure.resourcemanager.cognitiveservices.models.Sku; -import com.azure.resourcemanager.cognitiveservices.models.SkuTier; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class PatchResourceTagsAndSkuTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PatchResourceTagsAndSku model = BinaryData.fromString( - "{\"sku\":{\"name\":\"qhuexm\",\"tier\":\"Standard\",\"size\":\"stvlzywemhzrnc\",\"family\":\"tclusiypbsfgy\",\"capacity\":1825081348},\"tags\":{\"kyhejhzisxgf\":\"feadcygq\",\"raehtwdwrft\":\"elolppvksrpqvuj\",\"rcdlbhshfwpr\":\"wib\"}}") - .toObject(PatchResourceTagsAndSku.class); - Assertions.assertEquals("feadcygq", model.tags().get("kyhejhzisxgf")); - Assertions.assertEquals("qhuexm", model.sku().name()); - Assertions.assertEquals(SkuTier.STANDARD, model.sku().tier()); - Assertions.assertEquals("stvlzywemhzrnc", model.sku().size()); - Assertions.assertEquals("tclusiypbsfgy", model.sku().family()); - Assertions.assertEquals(1825081348, model.sku().capacity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PatchResourceTagsAndSku model = new PatchResourceTagsAndSku() - .withTags(mapOf("kyhejhzisxgf", "feadcygq", "raehtwdwrft", "elolppvksrpqvuj", "rcdlbhshfwpr", "wib")) - .withSku(new Sku().withName("qhuexm") - .withTier(SkuTier.STANDARD) - .withSize("stvlzywemhzrnc") - .withFamily("tclusiypbsfgy") - .withCapacity(1825081348)); - model = BinaryData.fromObject(model).toObject(PatchResourceTagsAndSku.class); - Assertions.assertEquals("feadcygq", model.tags().get("kyhejhzisxgf")); - Assertions.assertEquals("qhuexm", model.sku().name()); - Assertions.assertEquals(SkuTier.STANDARD, model.sku().tier()); - Assertions.assertEquals("stvlzywemhzrnc", model.sku().size()); - Assertions.assertEquals("tclusiypbsfgy", model.sku().family()); - Assertions.assertEquals(1825081348, model.sku().capacity()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PatchResourceTagsTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PatchResourceTagsTests.java deleted file mode 100644 index 4d6e649ed10b..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PatchResourceTagsTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.PatchResourceTags; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class PatchResourceTagsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PatchResourceTags model = BinaryData.fromString("{\"tags\":{\"c\":\"twitykhev\",\"jc\":\"edcpnmdyodnwzxl\"}}") - .toObject(PatchResourceTags.class); - Assertions.assertEquals("twitykhev", model.tags().get("c")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PatchResourceTags model = new PatchResourceTags().withTags(mapOf("c", "twitykhev", "jc", "edcpnmdyodnwzxl")); - model = BinaryData.fromObject(model).toObject(PatchResourceTags.class); - Assertions.assertEquals("twitykhev", model.tags().get("c")); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionInnerTests.java deleted file mode 100644 index e3443708a01e..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionInnerTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpoint; -import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointConnectionProperties; -import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.cognitiveservices.models.PrivateLinkServiceConnectionState; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionInner model = BinaryData.fromString( - "{\"properties\":{\"privateEndpoint\":{\"id\":\"iheogna\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"theotusiv\",\"actionsRequired\":\"v\"},\"provisioningState\":\"Creating\",\"groupIds\":[\"hn\",\"un\"]},\"location\":\"jzrnf\",\"etag\":\"xgispemvtzfkufu\",\"id\":\"ljofxqeofjaeqjh\",\"name\":\"jbasvmsmjqulngs\",\"type\":\"tnb\"}") - .toObject(PrivateEndpointConnectionInner.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, - model.properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("theotusiv", model.properties().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("v", model.properties().privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("hn", model.properties().groupIds().get(0)); - Assertions.assertEquals("jzrnf", model.location()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionInner model - = new PrivateEndpointConnectionInner() - .withProperties(new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) - .withDescription("theotusiv") - .withActionsRequired("v")) - .withGroupIds(Arrays.asList("hn", "un"))) - .withLocation("jzrnf"); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionInner.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, - model.properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("theotusiv", model.properties().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("v", model.properties().privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("hn", model.properties().groupIds().get(0)); - Assertions.assertEquals("jzrnf", model.location()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionListResultInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionListResultInnerTests.java deleted file mode 100644 index 5a2d25db19b6..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionListResultInnerTests.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.PrivateEndpointConnectionListResultInner; -import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpoint; -import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointConnectionProperties; -import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.cognitiveservices.models.PrivateLinkServiceConnectionState; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionListResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionListResultInner model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"privateEndpoint\":{\"id\":\"y\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"nxxmueedndrdv\",\"actionsRequired\":\"kwqqtchealmf\"},\"provisioningState\":\"Succeeded\",\"groupIds\":[\"ygdvwv\",\"piohgwxrtfu\",\"xepxgyqagvrvmn\"]},\"location\":\"kghimdblxgwimfnj\",\"etag\":\"j\",\"id\":\"wmszkk\",\"name\":\"oqreyfkzikfjawn\",\"type\":\"a\"}]}") - .toObject(PrivateEndpointConnectionListResultInner.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, - model.value().get(0).properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("nxxmueedndrdv", - model.value().get(0).properties().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("kwqqtchealmf", - model.value().get(0).properties().privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("ygdvwv", model.value().get(0).properties().groupIds().get(0)); - Assertions.assertEquals("kghimdblxgwimfnj", model.value().get(0).location()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionListResultInner model = new PrivateEndpointConnectionListResultInner() - .withValue(Arrays.asList(new PrivateEndpointConnectionInner() - .withProperties(new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("nxxmueedndrdv") - .withActionsRequired("kwqqtchealmf")) - .withGroupIds(Arrays.asList("ygdvwv", "piohgwxrtfu", "xepxgyqagvrvmn"))) - .withLocation("kghimdblxgwimfnj"))); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionListResultInner.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, - model.value().get(0).properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("nxxmueedndrdv", - model.value().get(0).properties().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("kwqqtchealmf", - model.value().get(0).properties().privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("ygdvwv", model.value().get(0).properties().groupIds().get(0)); - Assertions.assertEquals("kghimdblxgwimfnj", model.value().get(0).location()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionPropertiesTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionPropertiesTests.java deleted file mode 100644 index ea90ca12b840..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionPropertiesTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpoint; -import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointConnectionProperties; -import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.cognitiveservices.models.PrivateLinkServiceConnectionState; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionProperties model = BinaryData.fromString( - "{\"privateEndpoint\":{\"id\":\"zgcwrw\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"wrljdouskc\",\"actionsRequired\":\"kocrcjdkwtnhx\"},\"provisioningState\":\"Failed\",\"groupIds\":[\"ksqrglssai\",\"qpjwnzlljfm\"]}") - .toObject(PrivateEndpointConnectionProperties.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, - model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("wrljdouskc", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("kocrcjdkwtnhx", model.privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("ksqrglssai", model.groupIds().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionProperties model - = new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("wrljdouskc") - .withActionsRequired("kocrcjdkwtnhx")) - .withGroupIds(Arrays.asList("ksqrglssai", "qpjwnzlljfm")); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionProperties.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, - model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("wrljdouskc", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("kocrcjdkwtnhx", model.privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("ksqrglssai", model.groupIds().get(0)); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsCreateOrUpdateMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsCreateOrUpdateMockTests.java deleted file mode 100644 index cb8c13353bd7..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpoint; -import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointConnection; -import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointConnectionProperties; -import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.cognitiveservices.models.PrivateLinkServiceConnectionState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - String responseStr - = "{\"properties\":{\"privateEndpoint\":{\"id\":\"dlfp\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"cygvoavyunssx\",\"actionsRequired\":\"hi\"},\"provisioningState\":\"Succeeded\",\"groupIds\":[\"gvvpasek\",\"gbuxantuygdh\",\"aq\",\"pirpiwrqof\"]},\"location\":\"pmjnlexwhcb\",\"etag\":\"ibkeph\",\"id\":\"uuerctatoyi\",\"name\":\"tqpbrlcy\",\"type\":\"duczkgof\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateEndpointConnection response - = manager.privateEndpointConnections() - .define("z") - .withExistingAccount("jwfljhznamtua", "mzwcjjncqt") - .withRegion("r") - .withProperties(new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.PENDING) - .withDescription("wggahttzlswvaj") - .withActionsRequired("utlxjoqzasunwqrj")) - .withGroupIds(Arrays.asList("haohcmbuo"))) - .create(); - - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, - response.properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("cygvoavyunssx", - response.properties().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("hi", response.properties().privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("gvvpasek", response.properties().groupIds().get(0)); - Assertions.assertEquals("pmjnlexwhcb", response.location()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsDeleteMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsDeleteMockTests.java deleted file mode 100644 index 0980d09e44e9..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsDeleteMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.privateEndpointConnections() - .delete("jxcx", "rzdcgdzbenribcaw", "tzqdd", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java deleted file mode 100644 index 70a0e5fd2634..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointConnection; -import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointServiceConnectionStatus; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"privateEndpoint\":{\"id\":\"eakxcptsoqfyi\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"chkrttzr\",\"actionsRequired\":\"isgykiuemvanbwz\"},\"provisioningState\":\"Deleting\",\"groupIds\":[\"xxbsojklinhmd\"]},\"location\":\"sprqsgnzxojpslsv\",\"etag\":\"pli\",\"id\":\"fiqwoy\",\"name\":\"qvapcohhoucq\",\"type\":\"q\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateEndpointConnection response = manager.privateEndpointConnections() - .getWithResponse("laqacigele", "hdbvqvwzkjop", "beonrlkwzdq", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, - response.properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("chkrttzr", response.properties().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("isgykiuemvanbwz", - response.properties().privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("xxbsojklinhmd", response.properties().groupIds().get(0)); - Assertions.assertEquals("sprqsgnzxojpslsv", response.location()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsListWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsListWithResponseMockTests.java deleted file mode 100644 index 83ae78fb5f56..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsListWithResponseMockTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointConnectionListResult; -import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointServiceConnectionStatus; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsListWithResponseMockTests { - @Test - public void testListWithResponse() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"privateEndpoint\":{\"id\":\"mjpb\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"mgtvlj\",\"actionsRequired\":\"cmyfqipgxhnpo\"},\"provisioningState\":\"Deleting\",\"groupIds\":[\"abvn\",\"ilee\"]},\"location\":\"wlpaugmrmfjlrxwt\",\"etag\":\"ukhfkvc\",\"id\":\"sizmoae\",\"name\":\"sx\",\"type\":\"wuived\"},{\"properties\":{\"privateEndpoint\":{\"id\":\"eewxeiqbpsmg\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"amljdlrgmsplzgau\",\"actionsRequired\":\"shhvnewgnxky\"},\"provisioningState\":\"Succeeded\",\"groupIds\":[\"xrjkixtwb\",\"aoypny\",\"hshxcylhkgmnsghp\",\"ycphdrwjjkhvyo\"]},\"location\":\"luzvxnq\",\"etag\":\"rpqpd\",\"id\":\"wmkoisq\",\"name\":\"ssffxuifmc\",\"type\":\"ypobkdqzr\"},{\"properties\":{\"privateEndpoint\":{\"id\":\"lo\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"rc\",\"actionsRequired\":\"ydmxzj\"},\"provisioningState\":\"Succeeded\",\"groupIds\":[\"aurkihcirlde\",\"xrdcoxnbkkja\",\"urnnqbnqbpiz\"]},\"location\":\"tgrdogypx\",\"etag\":\"vbfihwuhvctafsr\",\"id\":\"xrblmliowxihs\",\"name\":\"nxw\",\"type\":\"agnepzwaklsb\"},{\"properties\":{\"privateEndpoint\":{\"id\":\"qagwwrxaomz\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"rrczezkhhltnj\",\"actionsRequired\":\"hqo\"},\"provisioningState\":\"Failed\",\"groupIds\":[\"yueayfbpcmsp\",\"byrrueqth\",\"mg\",\"mbscbbx\"]},\"location\":\"hxiidlopedb\",\"etag\":\"pyqy\",\"id\":\"bxubmdna\",\"name\":\"cbq\",\"type\":\"remj\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateEndpointConnectionListResult response = manager.privateEndpointConnections() - .listWithResponse("biqmrjgei", "fqlggw", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, - response.value().get(0).properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("mgtvlj", - response.value().get(0).properties().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("cmyfqipgxhnpo", - response.value().get(0).properties().privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("abvn", response.value().get(0).properties().groupIds().get(0)); - Assertions.assertEquals("wlpaugmrmfjlrxwt", response.value().get(0).location()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointTests.java deleted file mode 100644 index 56ca4d255d50..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointTests.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpoint; - -public final class PrivateEndpointTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpoint model = BinaryData.fromString("{\"id\":\"eebvmgxsab\"}").toObject(PrivateEndpoint.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpoint model = new PrivateEndpoint(); - model = BinaryData.fromObject(model).toObject(PrivateEndpoint.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourceListResultInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourceListResultInnerTests.java deleted file mode 100644 index b627d855ffed..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourceListResultInnerTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.PrivateLinkResourceListResultInner; -import com.azure.resourcemanager.cognitiveservices.models.PrivateLinkResource; -import com.azure.resourcemanager.cognitiveservices.models.PrivateLinkResourceProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkResourceListResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceListResultInner model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"groupId\":\"zel\",\"requiredMembers\":[\"r\",\"lsfeaenwabfatkld\"],\"requiredZoneNames\":[\"jhwuaanozjos\",\"hyoulpjr\"],\"displayName\":\"ag\"},\"id\":\"rvimjwosytxitcsk\",\"name\":\"cktqumiekkezzi\",\"type\":\"hlyfjhdgqgg\"},{\"properties\":{\"groupId\":\"unygaeqid\",\"requiredMembers\":[\"atpxl\",\"rxcyjmoad\",\"uvarmywdmjsjq\",\"jhhyxxrwlycoduhp\"],\"requiredZoneNames\":[\"gymare\",\"n\",\"jxqugjhky\",\"ubeddg\"],\"displayName\":\"ofwq\"},\"id\":\"zqalkrmnjijpx\",\"name\":\"cqqudf\",\"type\":\"byxbaaabjy\"},{\"properties\":{\"groupId\":\"ffimrzrtuzqogsex\",\"requiredMembers\":[\"fdnw\",\"wmewzsyy\",\"euzsoi\",\"judpfrxt\"],\"requiredZoneNames\":[\"zvaytdwkqbr\"],\"displayName\":\"bpaxhexiilivpdt\"},\"id\":\"irqtdqoa\",\"name\":\"oruzfgsquyfxrxx\",\"type\":\"eptra\"}]}") - .toObject(PrivateLinkResourceListResultInner.class); - Assertions.assertEquals("jhwuaanozjos", model.value().get(0).properties().requiredZoneNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceListResultInner model = new PrivateLinkResourceListResultInner().withValue(Arrays.asList( - new PrivateLinkResource().withProperties( - new PrivateLinkResourceProperties().withRequiredZoneNames(Arrays.asList("jhwuaanozjos", "hyoulpjr"))), - new PrivateLinkResource().withProperties(new PrivateLinkResourceProperties() - .withRequiredZoneNames(Arrays.asList("gymare", "n", "jxqugjhky", "ubeddg"))), - new PrivateLinkResource().withProperties( - new PrivateLinkResourceProperties().withRequiredZoneNames(Arrays.asList("zvaytdwkqbr"))))); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceListResultInner.class); - Assertions.assertEquals("jhwuaanozjos", model.value().get(0).properties().requiredZoneNames().get(0)); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourcePropertiesTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourcePropertiesTests.java deleted file mode 100644 index 3e4ff50c734b..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourcePropertiesTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.PrivateLinkResourceProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkResourcePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceProperties model = BinaryData.fromString( - "{\"groupId\":\"xsdszuempsb\",\"requiredMembers\":[\"z\"],\"requiredZoneNames\":[\"v\",\"nqicvinvkjjxdxrb\",\"ukzclewyhmlwpaz\",\"zpof\"],\"displayName\":\"ckw\"}") - .toObject(PrivateLinkResourceProperties.class); - Assertions.assertEquals("v", model.requiredZoneNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceProperties model = new PrivateLinkResourceProperties() - .withRequiredZoneNames(Arrays.asList("v", "nqicvinvkjjxdxrb", "ukzclewyhmlwpaz", "zpof")); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceProperties.class); - Assertions.assertEquals("v", model.requiredZoneNames().get(0)); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourceTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourceTests.java deleted file mode 100644 index 9337ab311dee..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourceTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.PrivateLinkResource; -import com.azure.resourcemanager.cognitiveservices.models.PrivateLinkResourceProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkResourceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResource model = BinaryData.fromString( - "{\"properties\":{\"groupId\":\"ezw\",\"requiredMembers\":[\"wxuqlcvydypatdoo\",\"ojknio\",\"kooebwnu\"],\"requiredZoneNames\":[\"mmsbvdkcrodtjin\",\"wj\",\"fltkacjv\"],\"displayName\":\"kdlfoa\"},\"id\":\"ggkfpagaowpul\",\"name\":\"qblylsyxkqj\",\"type\":\"sjervti\"}") - .toObject(PrivateLinkResource.class); - Assertions.assertEquals("mmsbvdkcrodtjin", model.properties().requiredZoneNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResource model = new PrivateLinkResource().withProperties(new PrivateLinkResourceProperties() - .withRequiredZoneNames(Arrays.asList("mmsbvdkcrodtjin", "wj", "fltkacjv"))); - model = BinaryData.fromObject(model).toObject(PrivateLinkResource.class); - Assertions.assertEquals("mmsbvdkcrodtjin", model.properties().requiredZoneNames().get(0)); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourcesListWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourcesListWithResponseMockTests.java deleted file mode 100644 index ebece20b0fa5..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourcesListWithResponseMockTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.PrivateLinkResourceListResult; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateLinkResourcesListWithResponseMockTests { - @Test - public void testListWithResponse() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"groupId\":\"eaqnrmvvfkoxm\",\"requiredMembers\":[\"ktuidvrm\",\"zlpdwwex\",\"mzvlazipbh\"],\"requiredZoneNames\":[\"qsg\"],\"displayName\":\"yuuzivens\"},\"id\":\"pmeyyvpkpatlbijp\",\"name\":\"gsksrfhf\",\"type\":\"olmk\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateLinkResourceListResult response = manager.privateLinkResources() - .listWithResponse("y", "srucvcrrpcjtt", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("qsg", response.value().get(0).properties().requiredZoneNames().get(0)); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkServiceConnectionStateTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkServiceConnectionStateTests.java deleted file mode 100644 index 16f0480c427d..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkServiceConnectionStateTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.cognitiveservices.models.PrivateLinkServiceConnectionState; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkServiceConnectionStateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkServiceConnectionState model = BinaryData - .fromString( - "{\"status\":\"Rejected\",\"description\":\"uujitcjc\",\"actionsRequired\":\"zevndhkrwpdappds\"}") - .toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, model.status()); - Assertions.assertEquals("uujitcjc", model.description()); - Assertions.assertEquals("zevndhkrwpdappds", model.actionsRequired()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkServiceConnectionState model - = new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) - .withDescription("uujitcjc") - .withActionsRequired("zevndhkrwpdappds"); - model = BinaryData.fromObject(model).toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, model.status()); - Assertions.assertEquals("uujitcjc", model.description()); - Assertions.assertEquals("zevndhkrwpdappds", model.actionsRequired()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProvisioningIssuePropertiesTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProvisioningIssuePropertiesTests.java deleted file mode 100644 index c87bb7e89cce..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProvisioningIssuePropertiesTests.java +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeter; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRule; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRuleProperties; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem; -import com.azure.resourcemanager.cognitiveservices.models.NspAccessRuleDirection; -import com.azure.resourcemanager.cognitiveservices.models.ProvisioningIssueProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ProvisioningIssuePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProvisioningIssueProperties model = BinaryData.fromString( - "{\"issueType\":\"wncvjtszcofiz\",\"severity\":\"tdhgbjkvrelj\",\"description\":\"murvzm\",\"suggestedResourceIds\":[\"uanashcxlp\",\"jerbdkelvidizozs\",\"bccxjmonfdgn\"],\"suggestedAccessRules\":[{\"name\":\"puuw\",\"properties\":{\"direction\":\"Inbound\",\"addressPrefixes\":[\"jctzenkei\",\"zzhmkd\",\"svflyhbxcudch\"],\"subscriptions\":[{\"id\":\"boldforobwj\"},{\"id\":\"izbfhfovvacq\"},{\"id\":\"tuodxeszabbelaw\"}],\"networkSecurityPerimeters\":[{\"id\":\"slzkwrrwoycqu\",\"perimeterGuid\":\"yhahnomdrkyw\",\"location\":\"psvfuurutlwexxwl\"}],\"fullyQualifiedDomainNames\":[\"iexzsrzpge\",\"q\",\"yb\",\"wwpgdakchzyvlixq\"]}},{\"name\":\"kcxk\",\"properties\":{\"direction\":\"Inbound\",\"addressPrefixes\":[\"ysux\"],\"subscriptions\":[{\"id\":\"ntvlwijpsttexo\"},{\"id\":\"pwcyyufmhr\"}],\"networkSecurityPerimeters\":[{\"id\":\"wmqs\",\"perimeterGuid\":\"cdqzhlctddu\",\"location\":\"ndy\"},{\"id\":\"chrqb\",\"perimeterGuid\":\"jrcg\",\"location\":\"ydcwboxjumv\"}],\"fullyQualifiedDomainNames\":[\"lihrraiouaubr\",\"tloqxfuojrn\"]}},{\"name\":\"flrzpas\",\"properties\":{\"direction\":\"Inbound\",\"addressPrefixes\":[\"mzdlyjdfqwmkyo\",\"ufdvruz\"],\"subscriptions\":[{\"id\":\"j\"},{\"id\":\"ctfnmdxotng\"},{\"id\":\"gugey\"}],\"networkSecurityPerimeters\":[{\"id\":\"rkyui\",\"perimeterGuid\":\"bsnmfpph\",\"location\":\"eevy\"},{\"id\":\"hsgz\",\"perimeterGuid\":\"zbgomfgbeg\",\"location\":\"gleohi\"}],\"fullyQualifiedDomainNames\":[\"nlu\",\"nkrrf\",\"eeebtijvacv\"]}}]}") - .toObject(ProvisioningIssueProperties.class); - Assertions.assertEquals("wncvjtszcofiz", model.issueType()); - Assertions.assertEquals("tdhgbjkvrelj", model.severity()); - Assertions.assertEquals("murvzm", model.description()); - Assertions.assertEquals("uanashcxlp", model.suggestedResourceIds().get(0)); - Assertions.assertEquals("puuw", model.suggestedAccessRules().get(0).name()); - Assertions.assertEquals(NspAccessRuleDirection.INBOUND, - model.suggestedAccessRules().get(0).properties().direction()); - Assertions.assertEquals("jctzenkei", model.suggestedAccessRules().get(0).properties().addressPrefixes().get(0)); - Assertions.assertEquals("boldforobwj", - model.suggestedAccessRules().get(0).properties().subscriptions().get(0).id()); - Assertions.assertEquals("slzkwrrwoycqu", - model.suggestedAccessRules().get(0).properties().networkSecurityPerimeters().get(0).id()); - Assertions.assertEquals("yhahnomdrkyw", - model.suggestedAccessRules().get(0).properties().networkSecurityPerimeters().get(0).perimeterGuid()); - Assertions.assertEquals("psvfuurutlwexxwl", - model.suggestedAccessRules().get(0).properties().networkSecurityPerimeters().get(0).location()); - Assertions.assertEquals("iexzsrzpge", - model.suggestedAccessRules().get(0).properties().fullyQualifiedDomainNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProvisioningIssueProperties model = new ProvisioningIssueProperties().withIssueType("wncvjtszcofiz") - .withSeverity("tdhgbjkvrelj") - .withDescription("murvzm") - .withSuggestedResourceIds(Arrays.asList("uanashcxlp", "jerbdkelvidizozs", "bccxjmonfdgn")) - .withSuggestedAccessRules(Arrays.asList( - new NetworkSecurityPerimeterAccessRule().withName("puuw") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties() - .withDirection(NspAccessRuleDirection.INBOUND) - .withAddressPrefixes(Arrays.asList("jctzenkei", "zzhmkd", "svflyhbxcudch")) - .withSubscriptions(Arrays.asList( - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem().withId("boldforobwj"), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem().withId("izbfhfovvacq"), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem() - .withId("tuodxeszabbelaw"))) - .withNetworkSecurityPerimeters( - Arrays.asList(new NetworkSecurityPerimeter().withId("slzkwrrwoycqu") - .withPerimeterGuid("yhahnomdrkyw") - .withLocation("psvfuurutlwexxwl"))) - .withFullyQualifiedDomainNames(Arrays.asList("iexzsrzpge", "q", "yb", "wwpgdakchzyvlixq"))), - new NetworkSecurityPerimeterAccessRule().withName("kcxk") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties() - .withDirection(NspAccessRuleDirection.INBOUND) - .withAddressPrefixes(Arrays.asList("ysux")) - .withSubscriptions(Arrays.asList( - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem() - .withId("ntvlwijpsttexo"), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem().withId("pwcyyufmhr"))) - .withNetworkSecurityPerimeters(Arrays.asList( - new NetworkSecurityPerimeter().withId("wmqs") - .withPerimeterGuid("cdqzhlctddu") - .withLocation("ndy"), - new NetworkSecurityPerimeter().withId("chrqb") - .withPerimeterGuid("jrcg") - .withLocation("ydcwboxjumv"))) - .withFullyQualifiedDomainNames(Arrays.asList("lihrraiouaubr", "tloqxfuojrn"))), - new NetworkSecurityPerimeterAccessRule().withName("flrzpas") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties() - .withDirection(NspAccessRuleDirection.INBOUND) - .withAddressPrefixes(Arrays.asList("mzdlyjdfqwmkyo", "ufdvruz")) - .withSubscriptions(Arrays.asList( - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem().withId("j"), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem().withId("ctfnmdxotng"), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem().withId("gugey"))) - .withNetworkSecurityPerimeters(Arrays.asList( - new NetworkSecurityPerimeter().withId("rkyui") - .withPerimeterGuid("bsnmfpph") - .withLocation("eevy"), - new NetworkSecurityPerimeter().withId("hsgz") - .withPerimeterGuid("zbgomfgbeg") - .withLocation("gleohi"))) - .withFullyQualifiedDomainNames(Arrays.asList("nlu", "nkrrf", "eeebtijvacv"))))); - model = BinaryData.fromObject(model).toObject(ProvisioningIssueProperties.class); - Assertions.assertEquals("wncvjtszcofiz", model.issueType()); - Assertions.assertEquals("tdhgbjkvrelj", model.severity()); - Assertions.assertEquals("murvzm", model.description()); - Assertions.assertEquals("uanashcxlp", model.suggestedResourceIds().get(0)); - Assertions.assertEquals("puuw", model.suggestedAccessRules().get(0).name()); - Assertions.assertEquals(NspAccessRuleDirection.INBOUND, - model.suggestedAccessRules().get(0).properties().direction()); - Assertions.assertEquals("jctzenkei", model.suggestedAccessRules().get(0).properties().addressPrefixes().get(0)); - Assertions.assertEquals("boldforobwj", - model.suggestedAccessRules().get(0).properties().subscriptions().get(0).id()); - Assertions.assertEquals("slzkwrrwoycqu", - model.suggestedAccessRules().get(0).properties().networkSecurityPerimeters().get(0).id()); - Assertions.assertEquals("yhahnomdrkyw", - model.suggestedAccessRules().get(0).properties().networkSecurityPerimeters().get(0).perimeterGuid()); - Assertions.assertEquals("psvfuurutlwexxwl", - model.suggestedAccessRules().get(0).properties().networkSecurityPerimeters().get(0).location()); - Assertions.assertEquals("iexzsrzpge", - model.suggestedAccessRules().get(0).properties().fullyQualifiedDomainNames().get(0)); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProvisioningIssueTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProvisioningIssueTests.java deleted file mode 100644 index 1506862d0da5..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProvisioningIssueTests.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeter; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRule; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRuleProperties; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem; -import com.azure.resourcemanager.cognitiveservices.models.NspAccessRuleDirection; -import com.azure.resourcemanager.cognitiveservices.models.ProvisioningIssue; -import com.azure.resourcemanager.cognitiveservices.models.ProvisioningIssueProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ProvisioningIssueTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProvisioningIssue model = BinaryData.fromString( - "{\"name\":\"pteecjme\",\"properties\":{\"issueType\":\"stvasylwxdzaumw\",\"severity\":\"ohguuf\",\"description\":\"boyjathwt\",\"suggestedResourceIds\":[\"b\",\"emwmdxmebwjs\",\"jpahlxvea\"],\"suggestedAccessRules\":[{\"name\":\"nmwmqtibx\",\"properties\":{\"direction\":\"Inbound\",\"addressPrefixes\":[\"vqcttadija\",\"ukm\",\"sieekpndzaapm\",\"dqmeqwigpibudq\"],\"subscriptions\":[{},{},{}],\"networkSecurityPerimeters\":[{},{},{},{}],\"fullyQualifiedDomainNames\":[\"bpmzzn\",\"tffyaqit\",\"hheioqaqhvseuf\",\"qyrxp\"]}},{\"name\":\"cgq\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"qfrddgam\",\"uhiosrsju\",\"vfcdisyirn\"],\"subscriptions\":[{}],\"networkSecurityPerimeters\":[{},{},{}],\"fullyQualifiedDomainNames\":[\"rxzbujr\",\"rhqvwrevkh\",\"nlnzonzlrpi\"]}}]}}") - .toObject(ProvisioningIssue.class); - Assertions.assertEquals("pteecjme", model.name()); - Assertions.assertEquals("stvasylwxdzaumw", model.properties().issueType()); - Assertions.assertEquals("ohguuf", model.properties().severity()); - Assertions.assertEquals("boyjathwt", model.properties().description()); - Assertions.assertEquals("b", model.properties().suggestedResourceIds().get(0)); - Assertions.assertEquals("nmwmqtibx", model.properties().suggestedAccessRules().get(0).name()); - Assertions.assertEquals(NspAccessRuleDirection.INBOUND, - model.properties().suggestedAccessRules().get(0).properties().direction()); - Assertions.assertEquals("vqcttadija", - model.properties().suggestedAccessRules().get(0).properties().addressPrefixes().get(0)); - Assertions.assertEquals("bpmzzn", - model.properties().suggestedAccessRules().get(0).properties().fullyQualifiedDomainNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProvisioningIssue model = new ProvisioningIssue().withName("pteecjme") - .withProperties(new ProvisioningIssueProperties().withIssueType("stvasylwxdzaumw") - .withSeverity("ohguuf") - .withDescription("boyjathwt") - .withSuggestedResourceIds(Arrays.asList("b", "emwmdxmebwjs", "jpahlxvea")) - .withSuggestedAccessRules(Arrays.asList( - new NetworkSecurityPerimeterAccessRule().withName("nmwmqtibx") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties() - .withDirection(NspAccessRuleDirection.INBOUND) - .withAddressPrefixes(Arrays.asList("vqcttadija", "ukm", "sieekpndzaapm", "dqmeqwigpibudq")) - .withSubscriptions( - Arrays.asList(new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem(), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem(), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem())) - .withNetworkSecurityPerimeters( - Arrays.asList(new NetworkSecurityPerimeter(), new NetworkSecurityPerimeter(), - new NetworkSecurityPerimeter(), new NetworkSecurityPerimeter())) - .withFullyQualifiedDomainNames( - Arrays.asList("bpmzzn", "tffyaqit", "hheioqaqhvseuf", "qyrxp"))), - new NetworkSecurityPerimeterAccessRule().withName("cgq") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties() - .withDirection(NspAccessRuleDirection.OUTBOUND) - .withAddressPrefixes(Arrays.asList("qfrddgam", "uhiosrsju", "vfcdisyirn")) - .withSubscriptions( - Arrays.asList(new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem())) - .withNetworkSecurityPerimeters(Arrays.asList(new NetworkSecurityPerimeter(), - new NetworkSecurityPerimeter(), new NetworkSecurityPerimeter())) - .withFullyQualifiedDomainNames(Arrays.asList("rxzbujr", "rhqvwrevkh", "nlnzonzlrpi")))))); - model = BinaryData.fromObject(model).toObject(ProvisioningIssue.class); - Assertions.assertEquals("pteecjme", model.name()); - Assertions.assertEquals("stvasylwxdzaumw", model.properties().issueType()); - Assertions.assertEquals("ohguuf", model.properties().severity()); - Assertions.assertEquals("boyjathwt", model.properties().description()); - Assertions.assertEquals("b", model.properties().suggestedResourceIds().get(0)); - Assertions.assertEquals("nmwmqtibx", model.properties().suggestedAccessRules().get(0).name()); - Assertions.assertEquals(NspAccessRuleDirection.INBOUND, - model.properties().suggestedAccessRules().get(0).properties().direction()); - Assertions.assertEquals("vqcttadija", - model.properties().suggestedAccessRules().get(0).properties().addressPrefixes().get(0)); - Assertions.assertEquals("bpmzzn", - model.properties().suggestedAccessRules().get(0).properties().fullyQualifiedDomainNames().get(0)); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlockListItemsResultTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlockListItemsResultTests.java deleted file mode 100644 index ee4d405516a0..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlockListItemsResultTests.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiBlocklistItemInner; -import com.azure.resourcemanager.cognitiveservices.models.RaiBlockListItemsResult; -import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistItemProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class RaiBlockListItemsResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RaiBlockListItemsResult model = BinaryData.fromString( - "{\"nextLink\":\"lmywwtkgkxnyed\",\"value\":[{\"etag\":\"udtjuewbc\",\"tags\":{\"bvpa\":\"uuwhcjyxcc\",\"px\":\"akkud\"},\"properties\":{\"pattern\":\"plmag\",\"isRegex\":true},\"id\":\"yohpfkyrkdbdgiog\",\"name\":\"jkmnwq\",\"type\":\"nobaiyhddviacegf\"},{\"etag\":\"tfpmvmemfnczdw\",\"tags\":{\"db\":\"alxlllchp\"},\"properties\":{\"pattern\":\"wrd\",\"isRegex\":true},\"id\":\"ukuv\",\"name\":\"jcswsmys\",\"type\":\"uluqypfc\"},{\"etag\":\"rchpqbmfpjbabwid\",\"tags\":{\"qddrihpfhoqcaae\":\"sspuunnoxyhkx\",\"djvlpj\":\"dao\",\"msgeivsiykzk\":\"xkzb\",\"xonbzoggculapz\":\"ncj\"},\"properties\":{\"pattern\":\"pgogtqxepny\",\"isRegex\":false},\"id\":\"uajlyj\",\"name\":\"lvofqzhvfcibyfmo\",\"type\":\"uxrkjp\"}]}") - .toObject(RaiBlockListItemsResult.class); - Assertions.assertEquals("lmywwtkgkxnyed", model.nextLink()); - Assertions.assertEquals("uuwhcjyxcc", model.value().get(0).tags().get("bvpa")); - Assertions.assertEquals("plmag", model.value().get(0).properties().pattern()); - Assertions.assertEquals(true, model.value().get(0).properties().isRegex()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RaiBlockListItemsResult model = new RaiBlockListItemsResult().withNextLink("lmywwtkgkxnyed") - .withValue(Arrays.asList( - new RaiBlocklistItemInner().withTags(mapOf("bvpa", "uuwhcjyxcc", "px", "akkud")) - .withProperties(new RaiBlocklistItemProperties().withPattern("plmag").withIsRegex(true)), - new RaiBlocklistItemInner().withTags(mapOf("db", "alxlllchp")) - .withProperties(new RaiBlocklistItemProperties().withPattern("wrd").withIsRegex(true)), - new RaiBlocklistItemInner() - .withTags(mapOf("qddrihpfhoqcaae", "sspuunnoxyhkx", "djvlpj", "dao", "msgeivsiykzk", "xkzb", - "xonbzoggculapz", "ncj")) - .withProperties(new RaiBlocklistItemProperties().withPattern("pgogtqxepny").withIsRegex(false)))); - model = BinaryData.fromObject(model).toObject(RaiBlockListItemsResult.class); - Assertions.assertEquals("lmywwtkgkxnyed", model.nextLink()); - Assertions.assertEquals("uuwhcjyxcc", model.value().get(0).tags().get("bvpa")); - Assertions.assertEquals("plmag", model.value().get(0).properties().pattern()); - Assertions.assertEquals(true, model.value().get(0).properties().isRegex()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlockListResultTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlockListResultTests.java deleted file mode 100644 index a5ba32d528e5..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlockListResultTests.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiBlocklistInner; -import com.azure.resourcemanager.cognitiveservices.models.RaiBlockListResult; -import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class RaiBlockListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RaiBlockListResult model = BinaryData.fromString( - "{\"nextLink\":\"lrri\",\"value\":[{\"etag\":\"xsmiccwrwfscjf\",\"tags\":{\"tiby\":\"szqujizdvoq\",\"lgy\":\"wb\"},\"properties\":{\"description\":\"tp\"},\"id\":\"hjoxo\",\"name\":\"smsks\",\"type\":\"pi\"},{\"etag\":\"oljxkcgx\",\"tags\":{\"l\":\"sffgcvizqzd\",\"youpfgfbkj\":\"w\",\"ttsttktlahbqact\":\"bdyhgkfminsgowz\"},\"properties\":{\"description\":\"zukxitmmqtgqq\"},\"id\":\"x\",\"name\":\"rnxrxcpj\",\"type\":\"isavok\"}]}") - .toObject(RaiBlockListResult.class); - Assertions.assertEquals("lrri", model.nextLink()); - Assertions.assertEquals("szqujizdvoq", model.value().get(0).tags().get("tiby")); - Assertions.assertEquals("tp", model.value().get(0).properties().description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RaiBlockListResult model = new RaiBlockListResult().withNextLink("lrri") - .withValue(Arrays.asList( - new RaiBlocklistInner().withTags(mapOf("tiby", "szqujizdvoq", "lgy", "wb")) - .withProperties(new RaiBlocklistProperties().withDescription("tp")), - new RaiBlocklistInner() - .withTags(mapOf("l", "sffgcvizqzd", "youpfgfbkj", "w", "ttsttktlahbqact", "bdyhgkfminsgowz")) - .withProperties(new RaiBlocklistProperties().withDescription("zukxitmmqtgqq")))); - model = BinaryData.fromObject(model).toObject(RaiBlockListResult.class); - Assertions.assertEquals("lrri", model.nextLink()); - Assertions.assertEquals("szqujizdvoq", model.value().get(0).tags().get("tiby")); - Assertions.assertEquals("tp", model.value().get(0).properties().description()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistConfigTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistConfigTests.java deleted file mode 100644 index acfa447d4e56..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistConfigTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistConfig; -import org.junit.jupiter.api.Assertions; - -public final class RaiBlocklistConfigTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RaiBlocklistConfig model = BinaryData.fromString("{\"blocklistName\":\"shqvcimpev\",\"blocking\":true}") - .toObject(RaiBlocklistConfig.class); - Assertions.assertEquals("shqvcimpev", model.blocklistName()); - Assertions.assertEquals(true, model.blocking()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RaiBlocklistConfig model = new RaiBlocklistConfig().withBlocklistName("shqvcimpev").withBlocking(true); - model = BinaryData.fromObject(model).toObject(RaiBlocklistConfig.class); - Assertions.assertEquals("shqvcimpev", model.blocklistName()); - Assertions.assertEquals(true, model.blocking()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistInnerTests.java deleted file mode 100644 index e76bcbde6d8d..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistInnerTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiBlocklistInner; -import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class RaiBlocklistInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RaiBlocklistInner model = BinaryData.fromString( - "{\"etag\":\"fvazivjlfrqttba\",\"tags\":{\"kqqfk\":\"atnwxyiopi\",\"dmligovibrxk\":\"vscx\"},\"properties\":{\"description\":\"oaz\"},\"id\":\"ruocbgo\",\"name\":\"rb\",\"type\":\"eoybfhjxakvvjgs\"}") - .toObject(RaiBlocklistInner.class); - Assertions.assertEquals("atnwxyiopi", model.tags().get("kqqfk")); - Assertions.assertEquals("oaz", model.properties().description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RaiBlocklistInner model = new RaiBlocklistInner().withTags(mapOf("kqqfk", "atnwxyiopi", "dmligovibrxk", "vscx")) - .withProperties(new RaiBlocklistProperties().withDescription("oaz")); - model = BinaryData.fromObject(model).toObject(RaiBlocklistInner.class); - Assertions.assertEquals("atnwxyiopi", model.tags().get("kqqfk")); - Assertions.assertEquals("oaz", model.properties().description()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemBulkRequestTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemBulkRequestTests.java deleted file mode 100644 index 12c236dbe42f..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemBulkRequestTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistItemBulkRequest; -import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistItemProperties; -import org.junit.jupiter.api.Assertions; - -public final class RaiBlocklistItemBulkRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RaiBlocklistItemBulkRequest model - = BinaryData.fromString("{\"name\":\"dcgzul\",\"properties\":{\"pattern\":\"rqzz\",\"isRegex\":true}}") - .toObject(RaiBlocklistItemBulkRequest.class); - Assertions.assertEquals("dcgzul", model.name()); - Assertions.assertEquals("rqzz", model.properties().pattern()); - Assertions.assertEquals(true, model.properties().isRegex()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RaiBlocklistItemBulkRequest model = new RaiBlocklistItemBulkRequest().withName("dcgzul") - .withProperties(new RaiBlocklistItemProperties().withPattern("rqzz").withIsRegex(true)); - model = BinaryData.fromObject(model).toObject(RaiBlocklistItemBulkRequest.class); - Assertions.assertEquals("dcgzul", model.name()); - Assertions.assertEquals("rqzz", model.properties().pattern()); - Assertions.assertEquals(true, model.properties().isRegex()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemInnerTests.java deleted file mode 100644 index cdc0bc293bcf..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemInnerTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiBlocklistItemInner; -import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistItemProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class RaiBlocklistItemInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RaiBlocklistItemInner model = BinaryData.fromString( - "{\"etag\":\"xfzwi\",\"tags\":{\"yzsxjrkambtrne\":\"zjb\",\"eqvldspast\":\"vmnvu\"},\"properties\":{\"pattern\":\"kdmflvestmjlx\",\"isRegex\":true},\"id\":\"lozapeewchpxlk\",\"name\":\"wk\",\"type\":\"ziycslevufuztck\"}") - .toObject(RaiBlocklistItemInner.class); - Assertions.assertEquals("zjb", model.tags().get("yzsxjrkambtrne")); - Assertions.assertEquals("kdmflvestmjlx", model.properties().pattern()); - Assertions.assertEquals(true, model.properties().isRegex()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RaiBlocklistItemInner model - = new RaiBlocklistItemInner().withTags(mapOf("yzsxjrkambtrne", "zjb", "eqvldspast", "vmnvu")) - .withProperties(new RaiBlocklistItemProperties().withPattern("kdmflvestmjlx").withIsRegex(true)); - model = BinaryData.fromObject(model).toObject(RaiBlocklistItemInner.class); - Assertions.assertEquals("zjb", model.tags().get("yzsxjrkambtrne")); - Assertions.assertEquals("kdmflvestmjlx", model.properties().pattern()); - Assertions.assertEquals(true, model.properties().isRegex()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemPropertiesTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemPropertiesTests.java deleted file mode 100644 index a83eadcf592c..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemPropertiesTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistItemProperties; -import org.junit.jupiter.api.Assertions; - -public final class RaiBlocklistItemPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RaiBlocklistItemProperties model - = BinaryData.fromString("{\"pattern\":\"h\",\"isRegex\":true}").toObject(RaiBlocklistItemProperties.class); - Assertions.assertEquals("h", model.pattern()); - Assertions.assertEquals(true, model.isRegex()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RaiBlocklistItemProperties model = new RaiBlocklistItemProperties().withPattern("h").withIsRegex(true); - model = BinaryData.fromObject(model).toObject(RaiBlocklistItemProperties.class); - Assertions.assertEquals("h", model.pattern()); - Assertions.assertEquals(true, model.isRegex()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsBatchAddWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsBatchAddWithResponseMockTests.java deleted file mode 100644 index 85126bbdf4a9..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsBatchAddWithResponseMockTests.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklist; -import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistItemBulkRequest; -import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistItemProperties; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class RaiBlocklistItemsBatchAddWithResponseMockTests { - @Test - public void testBatchAddWithResponse() throws Exception { - String responseStr - = "{\"etag\":\"ogxsvtzarhz\",\"tags\":{\"oslpky\":\"sqktcmbjwz\",\"mqbmfuvqarwz\":\"tglwkzpgajsqjc\"},\"properties\":{\"description\":\"rebluimmbwxsf\"},\"id\":\"td\",\"name\":\"b\",\"type\":\"xekr\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - RaiBlocklist response - = manager.raiBlocklistItems() - .batchAddWithResponse("kwwwnckn", "zdajlskzptjxu", "weucyrth", Arrays.asList( - new RaiBlocklistItemBulkRequest().withName("ehmcgcje") - .withProperties(new RaiBlocklistItemProperties().withPattern("ehokamvfej").withIsRegex(false)), - new RaiBlocklistItemBulkRequest().withName("tmbqdabzfivfok") - .withProperties(new RaiBlocklistItemProperties().withPattern("thhzagjfw").withIsRegex(true)), - new RaiBlocklistItemBulkRequest().withName("hgenuzejgvkveb") - .withProperties(new RaiBlocklistItemProperties().withPattern("zllrz").withIsRegex(true)), - new RaiBlocklistItemBulkRequest().withName("dqgmih") - .withProperties(new RaiBlocklistItemProperties().withPattern("mcqrhnxt").withIsRegex(true))), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("sqktcmbjwz", response.tags().get("oslpky")); - Assertions.assertEquals("rebluimmbwxsf", response.properties().description()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsBatchDeleteWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsBatchDeleteWithResponseMockTests.java deleted file mode 100644 index e003427d9457..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsBatchDeleteWithResponseMockTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class RaiBlocklistItemsBatchDeleteWithResponseMockTests { - @Test - public void testBatchDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 204, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.raiBlocklistItems() - .batchDeleteWithResponse("okqkbudbtwao", "bavly", "taaknwfrkebsmhp", "dataujd", - com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsCreateOrUpdateWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 4a5fa996f130..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistItem; -import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistItemProperties; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class RaiBlocklistItemsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - String responseStr - = "{\"etag\":\"osrnawnvzmlnkoy\",\"tags\":{\"nudn\":\"vjabjqqaxuyvym\",\"pvksmit\":\"oabhjxwxqweuip\"},\"properties\":{\"pattern\":\"xtlt\",\"isRegex\":true},\"id\":\"rdpqgfhy\",\"name\":\"frakkldgrc\",\"type\":\"fcmfcn\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - RaiBlocklistItem response = manager.raiBlocklistItems() - .define("mud") - .withExistingRaiBlocklist("gatolekscbctnan", "imwbzxpdcldpk", "wnsnlaimouxwks") - .withTags(mapOf("qqvyfscyrfw", "uswswjrkbqsjhb", "vogfuyzwvbh", "iv")) - .withProperties(new RaiBlocklistItemProperties().withPattern("byqecroo").withIsRegex(true)) - .create(); - - Assertions.assertEquals("vjabjqqaxuyvym", response.tags().get("nudn")); - Assertions.assertEquals("xtlt", response.properties().pattern()); - Assertions.assertEquals(true, response.properties().isRegex()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsGetWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsGetWithResponseMockTests.java deleted file mode 100644 index 670946b3c1b3..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsGetWithResponseMockTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistItem; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class RaiBlocklistItemsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"etag\":\"crdcueljti\",\"tags\":{\"q\":\"m\",\"yspthzod\":\"yarvsxzqbglcjk\",\"jtgblios\":\"btl\",\"qvjcteoe\":\"kfmkmfdjxyxgbk\"},\"properties\":{\"pattern\":\"slskkz\",\"isRegex\":true},\"id\":\"jnzdpvocojhpcna\",\"name\":\"xzfsnggytexvzilm\",\"type\":\"iv\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - RaiBlocklistItem response = manager.raiBlocklistItems() - .getWithResponse("yeyng", "g", "rquv", "ygg", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("m", response.tags().get("q")); - Assertions.assertEquals("slskkz", response.properties().pattern()); - Assertions.assertEquals(true, response.properties().isRegex()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsListMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsListMockTests.java deleted file mode 100644 index 9a6b6a3fc560..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsListMockTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistItem; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class RaiBlocklistItemsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"etag\":\"jqf\",\"tags\":{\"hwu\":\"eexpgeumi\",\"dbzsx\":\"trdexyionofnin\",\"bzbcyksiv\":\"wqqrsmpcbbprtuga\",\"rftsjcwjjxs\":\"fogdrtbfcm\"},\"properties\":{\"pattern\":\"awvifdxke\",\"isRegex\":false},\"id\":\"hocjxwkloozrv\",\"name\":\"xvcmufunlcp\",\"type\":\"xvi\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.raiBlocklistItems().list("wtthaokgksk", "i", "bs", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("eexpgeumi", response.iterator().next().tags().get("hwu")); - Assertions.assertEquals("awvifdxke", response.iterator().next().properties().pattern()); - Assertions.assertEquals(false, response.iterator().next().properties().isRegex()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistPropertiesTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistPropertiesTests.java deleted file mode 100644 index 1a6d24eefd44..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistPropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistProperties; -import org.junit.jupiter.api.Assertions; - -public final class RaiBlocklistPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RaiBlocklistProperties model - = BinaryData.fromString("{\"description\":\"r\"}").toObject(RaiBlocklistProperties.class); - Assertions.assertEquals("r", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RaiBlocklistProperties model = new RaiBlocklistProperties().withDescription("r"); - model = BinaryData.fromObject(model).toObject(RaiBlocklistProperties.class); - Assertions.assertEquals("r", model.description()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsCreateOrUpdateWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 014aa1d8aa94..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklist; -import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistProperties; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class RaiBlocklistsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - String responseStr - = "{\"etag\":\"hctmjtsgh\",\"tags\":{\"mpypefcpczshnuq\":\"bcpzarpzeqacdldt\"},\"properties\":{\"description\":\"izupfkhu\"},\"id\":\"tu\",\"name\":\"zx\",\"type\":\"mtvtvegwqiukvzwy\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - RaiBlocklist response = manager.raiBlocklists() - .define("cvumepjpbi") - .withExistingAccount("rceqnkbrupob", "hdmljz") - .withTags(mapOf("czuod", "rccjclykcgxvrpjl")) - .withProperties(new RaiBlocklistProperties().withDescription("u")) - .create(); - - Assertions.assertEquals("bcpzarpzeqacdldt", response.tags().get("mpypefcpczshnuq")); - Assertions.assertEquals("izupfkhu", response.properties().description()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsGetWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsGetWithResponseMockTests.java deleted file mode 100644 index ebffc7fb6bdc..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsGetWithResponseMockTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklist; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class RaiBlocklistsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"etag\":\"krmukmyjmkxett\",\"tags\":{\"dnqtoqxjhqx\":\"ojfkq\",\"htkbtnq\":\"s\",\"mbiipsnawwlqk\":\"rngl\"},\"properties\":{\"description\":\"hhl\"},\"id\":\"xricctkwmuqq\",\"name\":\"ajxeiygle\",\"type\":\"rwvaexhdc\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - RaiBlocklist response = manager.raiBlocklists() - .getWithResponse("txtjrrlkmds", "jhhxdlajf", "xcxscvslxlh", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("ojfkq", response.tags().get("dnqtoqxjhqx")); - Assertions.assertEquals("hhl", response.properties().description()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsListMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsListMockTests.java deleted file mode 100644 index 77c7a55e5e66..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsListMockTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklist; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class RaiBlocklistsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"etag\":\"mbpjptnvwjh\",\"tags\":{\"btpakftngatw\":\"dqpx\",\"pycvjqdvdwkqpldr\":\"ykyutrymdwmfj\",\"taoutnpdct\":\"efgnaavuagnt\",\"yeuyldph\":\"hspfefyihd\"},\"properties\":{\"description\":\"bkcgsuthhllnm\"},\"id\":\"y\",\"name\":\"efxexlf\",\"type\":\"i\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.raiBlocklists().list("ev", "wmseharxifvqn", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("dqpx", response.iterator().next().tags().get("btpakftngatw")); - Assertions.assertEquals("bkcgsuthhllnm", response.iterator().next().properties().description()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFilterInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFilterInnerTests.java deleted file mode 100644 index c90fac625c68..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFilterInnerTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiContentFilterInner; -import com.azure.resourcemanager.cognitiveservices.models.RaiContentFilterProperties; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentSource; -import org.junit.jupiter.api.Assertions; - -public final class RaiContentFilterInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RaiContentFilterInner model = BinaryData.fromString( - "{\"properties\":{\"name\":\"yavluwmncstt\",\"isMultiLevelFilter\":false,\"source\":\"Completion\"},\"id\":\"vpo\",\"name\":\"krsgsgb\",\"type\":\"huzqgn\"}") - .toObject(RaiContentFilterInner.class); - Assertions.assertEquals("yavluwmncstt", model.properties().name()); - Assertions.assertEquals(false, model.properties().isMultiLevelFilter()); - Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, model.properties().source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RaiContentFilterInner model - = new RaiContentFilterInner().withProperties(new RaiContentFilterProperties().withName("yavluwmncstt") - .withIsMultiLevelFilter(false) - .withSource(RaiPolicyContentSource.COMPLETION)); - model = BinaryData.fromObject(model).toObject(RaiContentFilterInner.class); - Assertions.assertEquals("yavluwmncstt", model.properties().name()); - Assertions.assertEquals(false, model.properties().isMultiLevelFilter()); - Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, model.properties().source()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFilterListResultTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFilterListResultTests.java deleted file mode 100644 index 700a21ba429e..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFilterListResultTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiContentFilterInner; -import com.azure.resourcemanager.cognitiveservices.models.RaiContentFilterListResult; -import com.azure.resourcemanager.cognitiveservices.models.RaiContentFilterProperties; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentSource; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class RaiContentFilterListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RaiContentFilterListResult model = BinaryData.fromString( - "{\"nextLink\":\"pglydz\",\"value\":[{\"properties\":{\"name\":\"eevt\",\"isMultiLevelFilter\":false,\"source\":\"Completion\"},\"id\":\"utnwytpzdmovzvf\",\"name\":\"aawzqadfl\",\"type\":\"z\"},{\"properties\":{\"name\":\"glae\",\"isMultiLevelFilter\":false,\"source\":\"Prompt\"},\"id\":\"icokpv\",\"name\":\"mlqtmldgxob\",\"type\":\"irclnpk\"},{\"properties\":{\"name\":\"yzriykhy\",\"isMultiLevelFilter\":true,\"source\":\"Prompt\"},\"id\":\"lboxqvkjl\",\"name\":\"xhom\",\"type\":\"ynhdwdigum\"},{\"properties\":{\"name\":\"aauzzptjazysd\",\"isMultiLevelFilter\":false,\"source\":\"Completion\"},\"id\":\"wva\",\"name\":\"qyuvvfonkp\",\"type\":\"hqyikvy\"}]}") - .toObject(RaiContentFilterListResult.class); - Assertions.assertEquals("pglydz", model.nextLink()); - Assertions.assertEquals("eevt", model.value().get(0).properties().name()); - Assertions.assertEquals(false, model.value().get(0).properties().isMultiLevelFilter()); - Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, model.value().get(0).properties().source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RaiContentFilterListResult model = new RaiContentFilterListResult().withNextLink("pglydz") - .withValue(Arrays.asList( - new RaiContentFilterInner().withProperties(new RaiContentFilterProperties().withName("eevt") - .withIsMultiLevelFilter(false) - .withSource(RaiPolicyContentSource.COMPLETION)), - new RaiContentFilterInner().withProperties(new RaiContentFilterProperties().withName("glae") - .withIsMultiLevelFilter(false) - .withSource(RaiPolicyContentSource.PROMPT)), - new RaiContentFilterInner().withProperties(new RaiContentFilterProperties().withName("yzriykhy") - .withIsMultiLevelFilter(true) - .withSource(RaiPolicyContentSource.PROMPT)), - new RaiContentFilterInner().withProperties(new RaiContentFilterProperties().withName("aauzzptjazysd") - .withIsMultiLevelFilter(false) - .withSource(RaiPolicyContentSource.COMPLETION)))); - model = BinaryData.fromObject(model).toObject(RaiContentFilterListResult.class); - Assertions.assertEquals("pglydz", model.nextLink()); - Assertions.assertEquals("eevt", model.value().get(0).properties().name()); - Assertions.assertEquals(false, model.value().get(0).properties().isMultiLevelFilter()); - Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, model.value().get(0).properties().source()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFilterPropertiesTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFilterPropertiesTests.java deleted file mode 100644 index 8e371c58071f..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFilterPropertiesTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.RaiContentFilterProperties; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentSource; -import org.junit.jupiter.api.Assertions; - -public final class RaiContentFilterPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RaiContentFilterProperties model - = BinaryData.fromString("{\"name\":\"gkynscliqh\",\"isMultiLevelFilter\":false,\"source\":\"Prompt\"}") - .toObject(RaiContentFilterProperties.class); - Assertions.assertEquals("gkynscliqh", model.name()); - Assertions.assertEquals(false, model.isMultiLevelFilter()); - Assertions.assertEquals(RaiPolicyContentSource.PROMPT, model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RaiContentFilterProperties model = new RaiContentFilterProperties().withName("gkynscliqh") - .withIsMultiLevelFilter(false) - .withSource(RaiPolicyContentSource.PROMPT); - model = BinaryData.fromObject(model).toObject(RaiContentFilterProperties.class); - Assertions.assertEquals("gkynscliqh", model.name()); - Assertions.assertEquals(false, model.isMultiLevelFilter()); - Assertions.assertEquals(RaiPolicyContentSource.PROMPT, model.source()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFiltersGetWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFiltersGetWithResponseMockTests.java deleted file mode 100644 index 553eb9270291..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFiltersGetWithResponseMockTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.RaiContentFilter; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentSource; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class RaiContentFiltersGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"name\":\"zowpuohdkcprgukx\",\"isMultiLevelFilter\":true,\"source\":\"Prompt\"},\"id\":\"chlutixmqru\",\"name\":\"jizcbfzmcrunfhiu\",\"type\":\"nmfbc\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - RaiContentFilter response = manager.raiContentFilters() - .getWithResponse("hfupetasvvoqsbpk", "lanfkgxsya", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("zowpuohdkcprgukx", response.properties().name()); - Assertions.assertEquals(true, response.properties().isMultiLevelFilter()); - Assertions.assertEquals(RaiPolicyContentSource.PROMPT, response.properties().source()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFiltersListMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFiltersListMockTests.java deleted file mode 100644 index e56087dc03f1..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFiltersListMockTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.RaiContentFilter; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentSource; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class RaiContentFiltersListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"name\":\"nzqgxxgfbbmtlpq\",\"isMultiLevelFilter\":false,\"source\":\"Completion\"},\"id\":\"iprnzcalincry\",\"name\":\"xzxaqzibmqimiym\",\"type\":\"ruqg\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.raiContentFilters().list("jajqmatxjt", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("nzqgxxgfbbmtlpq", response.iterator().next().properties().name()); - Assertions.assertEquals(false, response.iterator().next().properties().isMultiLevelFilter()); - Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, response.iterator().next().properties().source()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiMonitorConfigTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiMonitorConfigTests.java deleted file mode 100644 index d83176ff85c6..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiMonitorConfigTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.RaiMonitorConfig; -import org.junit.jupiter.api.Assertions; - -public final class RaiMonitorConfigTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RaiMonitorConfig model - = BinaryData.fromString("{\"adxStorageResourceId\":\"xgjvtbv\",\"identityClientId\":\"sszdnru\"}") - .toObject(RaiMonitorConfig.class); - Assertions.assertEquals("xgjvtbv", model.adxStorageResourceId()); - Assertions.assertEquals("sszdnru", model.identityClientId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RaiMonitorConfig model - = new RaiMonitorConfig().withAdxStorageResourceId("xgjvtbv").withIdentityClientId("sszdnru"); - model = BinaryData.fromObject(model).toObject(RaiMonitorConfig.class); - Assertions.assertEquals("xgjvtbv", model.adxStorageResourceId()); - Assertions.assertEquals("sszdnru", model.identityClientId()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesCreateOrUpdateWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 3ab1b12d5781..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.ContentLevel; -import com.azure.resourcemanager.cognitiveservices.models.CustomBlocklistConfig; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicy; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentFilter; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentSource; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyMode; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyProperties; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class RaiPoliciesCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - String responseStr - = "{\"etag\":\"gl\",\"tags\":{\"ryc\":\"ahvmywhsbrc\"},\"properties\":{\"type\":\"UserManaged\",\"mode\":\"Asynchronous_filter\",\"basePolicyName\":\"aqaj\",\"contentFilters\":[{\"name\":\"zptdmkrrbh\",\"enabled\":false,\"severityThreshold\":\"Medium\",\"blocking\":false,\"source\":\"Completion\"},{\"name\":\"ybpmf\",\"enabled\":false,\"severityThreshold\":\"Low\",\"blocking\":true,\"source\":\"Prompt\"}],\"customBlocklists\":[{\"source\":\"Prompt\",\"blocklistName\":\"ifkdschlzvf\",\"blocking\":true},{\"source\":\"Prompt\",\"blocklistName\":\"jwg\",\"blocking\":true},{\"source\":\"Prompt\",\"blocklistName\":\"kgf\",\"blocking\":true}]},\"id\":\"ogmhmjpj\",\"name\":\"cdf\",\"type\":\"dqwty\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - RaiPolicy response = manager.raiPolicies() - .define("ajsvk") - .withExistingAccount("rexkxbhxvucn", "lgmnhjevdyzn") - .withTags(mapOf("onqqlmgn", "qfhefkwabsol", "exhvuqbozoolz", "qxsjxte", "nx", "ocarkuzlbcnndt")) - .withProperties(new RaiPolicyProperties().withMode(RaiPolicyMode.DEFERRED) - .withBasePolicyName("hd") - .withContentFilters(Arrays.asList(new RaiPolicyContentFilter().withName("ckze") - .withEnabled(false) - .withSeverityThreshold(ContentLevel.LOW) - .withBlocking(true) - .withSource(RaiPolicyContentSource.COMPLETION))) - .withCustomBlocklists(Arrays.asList( - new CustomBlocklistConfig().withBlocklistName("abjkdtfohfao") - .withBlocking(true) - .withSource(RaiPolicyContentSource.COMPLETION), - new CustomBlocklistConfig().withBlocklistName("rsiwdyjqur") - .withBlocking(true) - .withSource(RaiPolicyContentSource.PROMPT), - new CustomBlocklistConfig().withBlocklistName("ueekcsue") - .withBlocking(false) - .withSource(RaiPolicyContentSource.COMPLETION), - new CustomBlocklistConfig().withBlocklistName("cbcbgydlqidy") - .withBlocking(true) - .withSource(RaiPolicyContentSource.PROMPT)))) - .create(); - - Assertions.assertEquals("ahvmywhsbrc", response.tags().get("ryc")); - Assertions.assertEquals(RaiPolicyMode.ASYNCHRONOUS_FILTER, response.properties().mode()); - Assertions.assertEquals("aqaj", response.properties().basePolicyName()); - Assertions.assertEquals("zptdmkrrbh", response.properties().contentFilters().get(0).name()); - Assertions.assertEquals(false, response.properties().contentFilters().get(0).enabled()); - Assertions.assertEquals(ContentLevel.MEDIUM, response.properties().contentFilters().get(0).severityThreshold()); - Assertions.assertEquals(false, response.properties().contentFilters().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, - response.properties().contentFilters().get(0).source()); - Assertions.assertEquals("ifkdschlzvf", response.properties().customBlocklists().get(0).blocklistName()); - Assertions.assertEquals(true, response.properties().customBlocklists().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.PROMPT, - response.properties().customBlocklists().get(0).source()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesGetWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesGetWithResponseMockTests.java deleted file mode 100644 index 21d3d0d6fef2..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesGetWithResponseMockTests.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.ContentLevel; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicy; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentSource; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyMode; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class RaiPoliciesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"etag\":\"srhkhgsnxuwwkpph\",\"tags\":{\"wzacnmw\":\"bzxlbzxomeikjc\",\"oyfpuq\":\"fsuqtaazyqbxy\"},\"properties\":{\"type\":\"SystemManaged\",\"mode\":\"Deferred\",\"basePolicyName\":\"hdjzqdcadwvpsoz\",\"contentFilters\":[{\"name\":\"jriyb\",\"enabled\":false,\"severityThreshold\":\"Medium\",\"blocking\":true,\"source\":\"Completion\"}],\"customBlocklists\":[{\"source\":\"Completion\",\"blocklistName\":\"kgvfnmxaursqf\",\"blocking\":false}]},\"id\":\"tyibuyvpirfqjpnq\",\"name\":\"oowsbe\",\"type\":\"e\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - RaiPolicy response = manager.raiPolicies() - .getWithResponse("uiyqvldaswvppi", "qqzlgcndhz", "rr", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("bzxlbzxomeikjc", response.tags().get("wzacnmw")); - Assertions.assertEquals(RaiPolicyMode.DEFERRED, response.properties().mode()); - Assertions.assertEquals("hdjzqdcadwvpsoz", response.properties().basePolicyName()); - Assertions.assertEquals("jriyb", response.properties().contentFilters().get(0).name()); - Assertions.assertEquals(false, response.properties().contentFilters().get(0).enabled()); - Assertions.assertEquals(ContentLevel.MEDIUM, response.properties().contentFilters().get(0).severityThreshold()); - Assertions.assertEquals(true, response.properties().contentFilters().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, - response.properties().contentFilters().get(0).source()); - Assertions.assertEquals("kgvfnmxaursqf", response.properties().customBlocklists().get(0).blocklistName()); - Assertions.assertEquals(false, response.properties().customBlocklists().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, - response.properties().customBlocklists().get(0).source()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesListMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesListMockTests.java deleted file mode 100644 index 0e83063f7064..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesListMockTests.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.ContentLevel; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicy; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentSource; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyMode; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class RaiPoliciesListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"etag\":\"b\",\"tags\":{\"gv\":\"clkfkee\",\"l\":\"pemtuoqu\",\"nyjpylxdbfv\":\"egqavnigflqqb\"},\"properties\":{\"type\":\"SystemManaged\",\"mode\":\"Default\",\"basePolicyName\":\"baevwjcnkottl\",\"contentFilters\":[{\"name\":\"ajmailfemjjza\",\"enabled\":true,\"severityThreshold\":\"High\",\"blocking\":true,\"source\":\"Prompt\"},{\"name\":\"xbdmvrscmqernd\",\"enabled\":true,\"severityThreshold\":\"High\",\"blocking\":false,\"source\":\"Prompt\"},{\"name\":\"nnxrkad\",\"enabled\":true,\"severityThreshold\":\"High\",\"blocking\":false,\"source\":\"Prompt\"},{\"name\":\"iripfohyk\",\"enabled\":false,\"severityThreshold\":\"High\",\"blocking\":true,\"source\":\"Completion\"}],\"customBlocklists\":[{\"source\":\"Completion\",\"blocklistName\":\"njizb\",\"blocking\":false},{\"source\":\"Prompt\",\"blocklistName\":\"mrvz\",\"blocking\":true},{\"source\":\"Completion\",\"blocklistName\":\"rziuctixgbdsuif\",\"blocking\":false},{\"source\":\"Completion\",\"blocklistName\":\"pezkis\",\"blocking\":false}]},\"id\":\"mdghsyparyb\",\"name\":\"ufptb\",\"type\":\"czjnc\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.raiPolicies().list("shxgonoy", "fq", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("clkfkee", response.iterator().next().tags().get("gv")); - Assertions.assertEquals(RaiPolicyMode.DEFAULT, response.iterator().next().properties().mode()); - Assertions.assertEquals("baevwjcnkottl", response.iterator().next().properties().basePolicyName()); - Assertions.assertEquals("ajmailfemjjza", - response.iterator().next().properties().contentFilters().get(0).name()); - Assertions.assertEquals(true, response.iterator().next().properties().contentFilters().get(0).enabled()); - Assertions.assertEquals(ContentLevel.HIGH, - response.iterator().next().properties().contentFilters().get(0).severityThreshold()); - Assertions.assertEquals(true, response.iterator().next().properties().contentFilters().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.PROMPT, - response.iterator().next().properties().contentFilters().get(0).source()); - Assertions.assertEquals("njizb", - response.iterator().next().properties().customBlocklists().get(0).blocklistName()); - Assertions.assertEquals(false, response.iterator().next().properties().customBlocklists().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, - response.iterator().next().properties().customBlocklists().get(0).source()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPolicyContentFilterTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPolicyContentFilterTests.java deleted file mode 100644 index b23dd7060708..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPolicyContentFilterTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.ContentLevel; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentFilter; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentSource; -import org.junit.jupiter.api.Assertions; - -public final class RaiPolicyContentFilterTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RaiPolicyContentFilter model = BinaryData.fromString( - "{\"name\":\"yyysfgdotcubi\",\"enabled\":true,\"severityThreshold\":\"Medium\",\"blocking\":false,\"source\":\"Completion\"}") - .toObject(RaiPolicyContentFilter.class); - Assertions.assertEquals("yyysfgdotcubi", model.name()); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals(ContentLevel.MEDIUM, model.severityThreshold()); - Assertions.assertEquals(false, model.blocking()); - Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RaiPolicyContentFilter model = new RaiPolicyContentFilter().withName("yyysfgdotcubi") - .withEnabled(true) - .withSeverityThreshold(ContentLevel.MEDIUM) - .withBlocking(false) - .withSource(RaiPolicyContentSource.COMPLETION); - model = BinaryData.fromObject(model).toObject(RaiPolicyContentFilter.class); - Assertions.assertEquals("yyysfgdotcubi", model.name()); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals(ContentLevel.MEDIUM, model.severityThreshold()); - Assertions.assertEquals(false, model.blocking()); - Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, model.source()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPolicyInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPolicyInnerTests.java deleted file mode 100644 index 51f39ca3f52f..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPolicyInnerTests.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiPolicyInner; -import com.azure.resourcemanager.cognitiveservices.models.ContentLevel; -import com.azure.resourcemanager.cognitiveservices.models.CustomBlocklistConfig; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentFilter; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentSource; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyMode; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class RaiPolicyInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RaiPolicyInner model = BinaryData.fromString( - "{\"etag\":\"wagohbuffk\",\"tags\":{\"tdrjfutacoebj\":\"emvvhm\"},\"properties\":{\"type\":\"SystemManaged\",\"mode\":\"Blocking\",\"basePolicyName\":\"nmwcpmgu\",\"contentFilters\":[{\"name\":\"aufactkahzovajjz\",\"enabled\":true,\"severityThreshold\":\"High\",\"blocking\":false,\"source\":\"Completion\"},{\"name\":\"kulfg\",\"enabled\":false,\"severityThreshold\":\"High\",\"blocking\":true,\"source\":\"Prompt\"},{\"name\":\"nrdsutujbazpjuoh\",\"enabled\":false,\"severityThreshold\":\"High\",\"blocking\":true,\"source\":\"Prompt\"}],\"customBlocklists\":[{\"source\":\"Completion\",\"blocklistName\":\"wpklvxw\",\"blocking\":false},{\"source\":\"Prompt\",\"blocklistName\":\"gpqch\",\"blocking\":false}]},\"id\":\"epn\",\"name\":\"bjcrxgibbdaxco\",\"type\":\"fozauorsuk\"}") - .toObject(RaiPolicyInner.class); - Assertions.assertEquals("emvvhm", model.tags().get("tdrjfutacoebj")); - Assertions.assertEquals(RaiPolicyMode.BLOCKING, model.properties().mode()); - Assertions.assertEquals("nmwcpmgu", model.properties().basePolicyName()); - Assertions.assertEquals("aufactkahzovajjz", model.properties().contentFilters().get(0).name()); - Assertions.assertEquals(true, model.properties().contentFilters().get(0).enabled()); - Assertions.assertEquals(ContentLevel.HIGH, model.properties().contentFilters().get(0).severityThreshold()); - Assertions.assertEquals(false, model.properties().contentFilters().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, model.properties().contentFilters().get(0).source()); - Assertions.assertEquals("wpklvxw", model.properties().customBlocklists().get(0).blocklistName()); - Assertions.assertEquals(false, model.properties().customBlocklists().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, - model.properties().customBlocklists().get(0).source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RaiPolicyInner model = new RaiPolicyInner().withTags(mapOf("tdrjfutacoebj", "emvvhm")) - .withProperties(new RaiPolicyProperties().withMode(RaiPolicyMode.BLOCKING) - .withBasePolicyName("nmwcpmgu") - .withContentFilters(Arrays.asList( - new RaiPolicyContentFilter().withName("aufactkahzovajjz") - .withEnabled(true) - .withSeverityThreshold(ContentLevel.HIGH) - .withBlocking(false) - .withSource(RaiPolicyContentSource.COMPLETION), - new RaiPolicyContentFilter().withName("kulfg") - .withEnabled(false) - .withSeverityThreshold(ContentLevel.HIGH) - .withBlocking(true) - .withSource(RaiPolicyContentSource.PROMPT), - new RaiPolicyContentFilter().withName("nrdsutujbazpjuoh") - .withEnabled(false) - .withSeverityThreshold(ContentLevel.HIGH) - .withBlocking(true) - .withSource(RaiPolicyContentSource.PROMPT))) - .withCustomBlocklists(Arrays.asList( - new CustomBlocklistConfig().withBlocklistName("wpklvxw") - .withBlocking(false) - .withSource(RaiPolicyContentSource.COMPLETION), - new CustomBlocklistConfig().withBlocklistName("gpqch") - .withBlocking(false) - .withSource(RaiPolicyContentSource.PROMPT)))); - model = BinaryData.fromObject(model).toObject(RaiPolicyInner.class); - Assertions.assertEquals("emvvhm", model.tags().get("tdrjfutacoebj")); - Assertions.assertEquals(RaiPolicyMode.BLOCKING, model.properties().mode()); - Assertions.assertEquals("nmwcpmgu", model.properties().basePolicyName()); - Assertions.assertEquals("aufactkahzovajjz", model.properties().contentFilters().get(0).name()); - Assertions.assertEquals(true, model.properties().contentFilters().get(0).enabled()); - Assertions.assertEquals(ContentLevel.HIGH, model.properties().contentFilters().get(0).severityThreshold()); - Assertions.assertEquals(false, model.properties().contentFilters().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, model.properties().contentFilters().get(0).source()); - Assertions.assertEquals("wpklvxw", model.properties().customBlocklists().get(0).blocklistName()); - Assertions.assertEquals(false, model.properties().customBlocklists().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, - model.properties().customBlocklists().get(0).source()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPolicyListResultTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPolicyListResultTests.java deleted file mode 100644 index 19c3028d60e0..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPolicyListResultTests.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiPolicyInner; -import com.azure.resourcemanager.cognitiveservices.models.ContentLevel; -import com.azure.resourcemanager.cognitiveservices.models.CustomBlocklistConfig; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentFilter; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentSource; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyListResult; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyMode; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class RaiPolicyListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RaiPolicyListResult model = BinaryData.fromString( - "{\"nextLink\":\"gx\",\"value\":[{\"etag\":\"pyklyhpluodpvru\",\"tags\":{\"xeclzedqbcvhzlhp\":\"gzibthostgktstv\"},\"properties\":{\"type\":\"UserManaged\",\"mode\":\"Asynchronous_filter\",\"basePolicyName\":\"wwqfbumlkxtrqj\",\"contentFilters\":[{\"name\":\"mbtxhwgf\",\"enabled\":true,\"severityThreshold\":\"Medium\",\"blocking\":true,\"source\":\"Completion\"},{\"name\":\"brhu\",\"enabled\":false,\"severityThreshold\":\"High\",\"blocking\":false,\"source\":\"Prompt\"},{\"name\":\"okkqfqjbvleo\",\"enabled\":false,\"severityThreshold\":\"Low\",\"blocking\":true,\"source\":\"Prompt\"},{\"name\":\"fa\",\"enabled\":true,\"severityThreshold\":\"High\",\"blocking\":false,\"source\":\"Prompt\"}],\"customBlocklists\":[{\"source\":\"Prompt\",\"blocklistName\":\"yjkqabqgzslesjcb\",\"blocking\":true}]},\"id\":\"n\",\"name\":\"tiewdj\",\"type\":\"vbquwr\"}]}") - .toObject(RaiPolicyListResult.class); - Assertions.assertEquals("gx", model.nextLink()); - Assertions.assertEquals("gzibthostgktstv", model.value().get(0).tags().get("xeclzedqbcvhzlhp")); - Assertions.assertEquals(RaiPolicyMode.ASYNCHRONOUS_FILTER, model.value().get(0).properties().mode()); - Assertions.assertEquals("wwqfbumlkxtrqj", model.value().get(0).properties().basePolicyName()); - Assertions.assertEquals("mbtxhwgf", model.value().get(0).properties().contentFilters().get(0).name()); - Assertions.assertEquals(true, model.value().get(0).properties().contentFilters().get(0).enabled()); - Assertions.assertEquals(ContentLevel.MEDIUM, - model.value().get(0).properties().contentFilters().get(0).severityThreshold()); - Assertions.assertEquals(true, model.value().get(0).properties().contentFilters().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, - model.value().get(0).properties().contentFilters().get(0).source()); - Assertions.assertEquals("yjkqabqgzslesjcb", - model.value().get(0).properties().customBlocklists().get(0).blocklistName()); - Assertions.assertEquals(true, model.value().get(0).properties().customBlocklists().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.PROMPT, - model.value().get(0).properties().customBlocklists().get(0).source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RaiPolicyListResult model = new RaiPolicyListResult().withNextLink("gx") - .withValue(Arrays.asList(new RaiPolicyInner().withTags(mapOf("xeclzedqbcvhzlhp", "gzibthostgktstv")) - .withProperties(new RaiPolicyProperties().withMode(RaiPolicyMode.ASYNCHRONOUS_FILTER) - .withBasePolicyName("wwqfbumlkxtrqj") - .withContentFilters(Arrays.asList( - new RaiPolicyContentFilter().withName("mbtxhwgf") - .withEnabled(true) - .withSeverityThreshold(ContentLevel.MEDIUM) - .withBlocking(true) - .withSource(RaiPolicyContentSource.COMPLETION), - new RaiPolicyContentFilter().withName("brhu") - .withEnabled(false) - .withSeverityThreshold(ContentLevel.HIGH) - .withBlocking(false) - .withSource(RaiPolicyContentSource.PROMPT), - new RaiPolicyContentFilter().withName("okkqfqjbvleo") - .withEnabled(false) - .withSeverityThreshold(ContentLevel.LOW) - .withBlocking(true) - .withSource(RaiPolicyContentSource.PROMPT), - new RaiPolicyContentFilter().withName("fa") - .withEnabled(true) - .withSeverityThreshold(ContentLevel.HIGH) - .withBlocking(false) - .withSource(RaiPolicyContentSource.PROMPT))) - .withCustomBlocklists( - Arrays.asList(new CustomBlocklistConfig().withBlocklistName("yjkqabqgzslesjcb") - .withBlocking(true) - .withSource(RaiPolicyContentSource.PROMPT)))))); - model = BinaryData.fromObject(model).toObject(RaiPolicyListResult.class); - Assertions.assertEquals("gx", model.nextLink()); - Assertions.assertEquals("gzibthostgktstv", model.value().get(0).tags().get("xeclzedqbcvhzlhp")); - Assertions.assertEquals(RaiPolicyMode.ASYNCHRONOUS_FILTER, model.value().get(0).properties().mode()); - Assertions.assertEquals("wwqfbumlkxtrqj", model.value().get(0).properties().basePolicyName()); - Assertions.assertEquals("mbtxhwgf", model.value().get(0).properties().contentFilters().get(0).name()); - Assertions.assertEquals(true, model.value().get(0).properties().contentFilters().get(0).enabled()); - Assertions.assertEquals(ContentLevel.MEDIUM, - model.value().get(0).properties().contentFilters().get(0).severityThreshold()); - Assertions.assertEquals(true, model.value().get(0).properties().contentFilters().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, - model.value().get(0).properties().contentFilters().get(0).source()); - Assertions.assertEquals("yjkqabqgzslesjcb", - model.value().get(0).properties().customBlocklists().get(0).blocklistName()); - Assertions.assertEquals(true, model.value().get(0).properties().customBlocklists().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.PROMPT, - model.value().get(0).properties().customBlocklists().get(0).source()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPolicyPropertiesTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPolicyPropertiesTests.java deleted file mode 100644 index 80df77e4a7cd..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPolicyPropertiesTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.ContentLevel; -import com.azure.resourcemanager.cognitiveservices.models.CustomBlocklistConfig; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentFilter; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentSource; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyMode; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class RaiPolicyPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RaiPolicyProperties model = BinaryData.fromString( - "{\"type\":\"UserManaged\",\"mode\":\"Deferred\",\"basePolicyName\":\"lhlv\",\"contentFilters\":[{\"name\":\"pzlrphw\",\"enabled\":true,\"severityThreshold\":\"Low\",\"blocking\":true,\"source\":\"Completion\"},{\"name\":\"dunvmnnrwrbiorkt\",\"enabled\":true,\"severityThreshold\":\"Low\",\"blocking\":true,\"source\":\"Prompt\"}],\"customBlocklists\":[{\"source\":\"Prompt\",\"blocklistName\":\"ivfomiloxgg\",\"blocking\":false},{\"source\":\"Prompt\",\"blocklistName\":\"dieuzaofj\",\"blocking\":false}]}") - .toObject(RaiPolicyProperties.class); - Assertions.assertEquals(RaiPolicyMode.DEFERRED, model.mode()); - Assertions.assertEquals("lhlv", model.basePolicyName()); - Assertions.assertEquals("pzlrphw", model.contentFilters().get(0).name()); - Assertions.assertEquals(true, model.contentFilters().get(0).enabled()); - Assertions.assertEquals(ContentLevel.LOW, model.contentFilters().get(0).severityThreshold()); - Assertions.assertEquals(true, model.contentFilters().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, model.contentFilters().get(0).source()); - Assertions.assertEquals("ivfomiloxgg", model.customBlocklists().get(0).blocklistName()); - Assertions.assertEquals(false, model.customBlocklists().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.PROMPT, model.customBlocklists().get(0).source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RaiPolicyProperties model = new RaiPolicyProperties().withMode(RaiPolicyMode.DEFERRED) - .withBasePolicyName("lhlv") - .withContentFilters(Arrays.asList( - new RaiPolicyContentFilter().withName("pzlrphw") - .withEnabled(true) - .withSeverityThreshold(ContentLevel.LOW) - .withBlocking(true) - .withSource(RaiPolicyContentSource.COMPLETION), - new RaiPolicyContentFilter().withName("dunvmnnrwrbiorkt") - .withEnabled(true) - .withSeverityThreshold(ContentLevel.LOW) - .withBlocking(true) - .withSource(RaiPolicyContentSource.PROMPT))) - .withCustomBlocklists(Arrays.asList( - new CustomBlocklistConfig().withBlocklistName("ivfomiloxgg") - .withBlocking(false) - .withSource(RaiPolicyContentSource.PROMPT), - new CustomBlocklistConfig().withBlocklistName("dieuzaofj") - .withBlocking(false) - .withSource(RaiPolicyContentSource.PROMPT))); - model = BinaryData.fromObject(model).toObject(RaiPolicyProperties.class); - Assertions.assertEquals(RaiPolicyMode.DEFERRED, model.mode()); - Assertions.assertEquals("lhlv", model.basePolicyName()); - Assertions.assertEquals("pzlrphw", model.contentFilters().get(0).name()); - Assertions.assertEquals(true, model.contentFilters().get(0).enabled()); - Assertions.assertEquals(ContentLevel.LOW, model.contentFilters().get(0).severityThreshold()); - Assertions.assertEquals(true, model.contentFilters().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, model.contentFilters().get(0).source()); - Assertions.assertEquals("ivfomiloxgg", model.customBlocklists().get(0).blocklistName()); - Assertions.assertEquals(false, model.customBlocklists().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.PROMPT, model.customBlocklists().get(0).source()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RegionSettingTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RegionSettingTests.java deleted file mode 100644 index 7cd69e9dcec0..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RegionSettingTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.RegionSetting; -import org.junit.jupiter.api.Assertions; - -public final class RegionSettingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RegionSetting model - = BinaryData.fromString("{\"name\":\"jgzjaoyfhrtx\",\"value\":5.565733,\"customsubdomain\":\"rkujy\"}") - .toObject(RegionSetting.class); - Assertions.assertEquals("jgzjaoyfhrtx", model.name()); - Assertions.assertEquals(5.565733F, model.value()); - Assertions.assertEquals("rkujy", model.customsubdomain()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RegionSetting model - = new RegionSetting().withName("jgzjaoyfhrtx").withValue(5.565733F).withCustomsubdomain("rkujy"); - model = BinaryData.fromObject(model).toObject(RegionSetting.class); - Assertions.assertEquals("jgzjaoyfhrtx", model.name()); - Assertions.assertEquals(5.565733F, model.value()); - Assertions.assertEquals("rkujy", model.customsubdomain()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RequestMatchPatternTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RequestMatchPatternTests.java deleted file mode 100644 index 1eca6a2d0c03..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RequestMatchPatternTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.RequestMatchPattern; -import org.junit.jupiter.api.Assertions; - -public final class RequestMatchPatternTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RequestMatchPattern model = BinaryData.fromString("{\"path\":\"hsgcbacphejkot\",\"method\":\"qgoulznd\"}") - .toObject(RequestMatchPattern.class); - Assertions.assertEquals("hsgcbacphejkot", model.path()); - Assertions.assertEquals("qgoulznd", model.method()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RequestMatchPattern model = new RequestMatchPattern().withPath("hsgcbacphejkot").withMethod("qgoulznd"); - model = BinaryData.fromObject(model).toObject(RequestMatchPattern.class); - Assertions.assertEquals("hsgcbacphejkot", model.path()); - Assertions.assertEquals("qgoulznd", model.method()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProvidersCheckDomainAvailabilityWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProvidersCheckDomainAvailabilityWithResponseMockTests.java deleted file mode 100644 index d210ef5a9b81..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProvidersCheckDomainAvailabilityWithResponseMockTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.CheckDomainAvailabilityParameter; -import com.azure.resourcemanager.cognitiveservices.models.DomainAvailability; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ResourceProvidersCheckDomainAvailabilityWithResponseMockTests { - @Test - public void testCheckDomainAvailabilityWithResponse() throws Exception { - String responseStr - = "{\"isSubdomainAvailable\":true,\"reason\":\"xsi\",\"subdomainName\":\"etgbebjfulb\",\"type\":\"ichdlpn\",\"kind\":\"ubntnbatzviqsow\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DomainAvailability response = manager.resourceProviders() - .checkDomainAvailabilityWithResponse(new CheckDomainAvailabilityParameter().withSubdomainName("refqy") - .withType("qotoihiqakydiwfb") - .withKind("wpzdqtvhcspo"), com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(true, response.isSubdomainAvailable()); - Assertions.assertEquals("xsi", response.reason()); - Assertions.assertEquals("etgbebjfulb", response.subdomainName()); - Assertions.assertEquals("ichdlpn", response.type()); - Assertions.assertEquals("ubntnbatzviqsow", response.kind()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProvidersCheckSkuAvailabilityWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProvidersCheckSkuAvailabilityWithResponseMockTests.java deleted file mode 100644 index b5fbfedeadd1..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProvidersCheckSkuAvailabilityWithResponseMockTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.CheckSkuAvailabilityParameter; -import com.azure.resourcemanager.cognitiveservices.models.SkuAvailabilityListResult; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ResourceProvidersCheckSkuAvailabilityWithResponseMockTests { - @Test - public void testCheckSkuAvailabilityWithResponse() throws Exception { - String responseStr - = "{\"value\":[{\"kind\":\"tmhqykiz\",\"type\":\"ksaoafcluqvox\",\"skuName\":\"cjimryvwgcwwpbmz\",\"skuAvailable\":false,\"reason\":\"ydsx\",\"message\":\"fo\"},{\"kind\":\"cbvopwndyqleallk\",\"type\":\"tkhlowkxxpvbr\",\"skuName\":\"jmzsyzfh\",\"skuAvailable\":true,\"reason\":\"ikcyyc\",\"message\":\"nsjlpjrtws\"},{\"kind\":\"vv\",\"type\":\"c\",\"skuName\":\"vtrrmhwrbfdpyflu\",\"skuAvailable\":true,\"reason\":\"glrocuy\",\"message\":\"whhmemhooc\"},{\"kind\":\"tnpqmemczjk\",\"type\":\"ykyujxsg\",\"skuName\":\"srrryejylmbkzu\",\"skuAvailable\":true,\"reason\":\"rfih\",\"message\":\"jewlpxuzzjg\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SkuAvailabilityListResult response = manager.resourceProviders() - .checkSkuAvailabilityWithResponse("qhnlbqnbld", - new CheckSkuAvailabilityParameter() - .withSkus(Arrays.asList("aclgschorimk", "srrm", "ucsofldpuviyf", "aabeolhbhlvbmxuq")) - .withKind("bsxtkcudfbsfarfs") - .withType("owlkjxnqpv"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("tmhqykiz", response.value().get(0).kind()); - Assertions.assertEquals("ksaoafcluqvox", response.value().get(0).type()); - Assertions.assertEquals("cjimryvwgcwwpbmz", response.value().get(0).skuName()); - Assertions.assertEquals(false, response.value().get(0).skuAvailable()); - Assertions.assertEquals("ydsx", response.value().get(0).reason()); - Assertions.assertEquals("fo", response.value().get(0).message()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceSkuRestrictionInfoTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceSkuRestrictionInfoTests.java deleted file mode 100644 index d432ee50aa15..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceSkuRestrictionInfoTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.ResourceSkuRestrictionInfo; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ResourceSkuRestrictionInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceSkuRestrictionInfo model = BinaryData.fromString( - "{\"locations\":[\"nwsubisnj\",\"mpmngnzscxaqwoo\",\"hcbonqvpkvlr\"],\"zones\":[\"ea\",\"eipheoflokeyy\"]}") - .toObject(ResourceSkuRestrictionInfo.class); - Assertions.assertEquals("nwsubisnj", model.locations().get(0)); - Assertions.assertEquals("ea", model.zones().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceSkuRestrictionInfo model = new ResourceSkuRestrictionInfo() - .withLocations(Arrays.asList("nwsubisnj", "mpmngnzscxaqwoo", "hcbonqvpkvlr")) - .withZones(Arrays.asList("ea", "eipheoflokeyy")); - model = BinaryData.fromObject(model).toObject(ResourceSkuRestrictionInfo.class); - Assertions.assertEquals("nwsubisnj", model.locations().get(0)); - Assertions.assertEquals("ea", model.zones().get(0)); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuAvailabilityListResultInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuAvailabilityListResultInnerTests.java deleted file mode 100644 index d2394b60e74b..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuAvailabilityListResultInnerTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.SkuAvailabilityListResultInner; -import com.azure.resourcemanager.cognitiveservices.models.SkuAvailability; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SkuAvailabilityListResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SkuAvailabilityListResultInner model = BinaryData.fromString( - "{\"value\":[{\"kind\":\"rpabg\",\"type\":\"psbjta\",\"skuName\":\"ugxywpmueef\",\"skuAvailable\":false,\"reason\":\"qkqujidsu\",\"message\":\"nobglaocq\"},{\"kind\":\"ccm\",\"type\":\"udxytlmoyrx\",\"skuName\":\"fudwpznt\",\"skuAvailable\":false,\"reason\":\"hl\",\"message\":\"jbhckfrlhr\"},{\"kind\":\"bkyvp\",\"type\":\"anuzbpzkafkuw\",\"skuName\":\"rnwb\",\"skuAvailable\":false,\"reason\":\"seyvj\",\"message\":\"rts\"},{\"kind\":\"spkdee\",\"type\":\"ofmxagkvtmelmqkr\",\"skuName\":\"hvljuahaquh\",\"skuAvailable\":false,\"reason\":\"duala\",\"message\":\"qpv\"}]}") - .toObject(SkuAvailabilityListResultInner.class); - Assertions.assertEquals("rpabg", model.value().get(0).kind()); - Assertions.assertEquals("psbjta", model.value().get(0).type()); - Assertions.assertEquals("ugxywpmueef", model.value().get(0).skuName()); - Assertions.assertEquals(false, model.value().get(0).skuAvailable()); - Assertions.assertEquals("qkqujidsu", model.value().get(0).reason()); - Assertions.assertEquals("nobglaocq", model.value().get(0).message()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuAvailabilityListResultInner model = new SkuAvailabilityListResultInner().withValue(Arrays.asList( - new SkuAvailability().withKind("rpabg") - .withType("psbjta") - .withSkuName("ugxywpmueef") - .withSkuAvailable(false) - .withReason("qkqujidsu") - .withMessage("nobglaocq"), - new SkuAvailability().withKind("ccm") - .withType("udxytlmoyrx") - .withSkuName("fudwpznt") - .withSkuAvailable(false) - .withReason("hl") - .withMessage("jbhckfrlhr"), - new SkuAvailability().withKind("bkyvp") - .withType("anuzbpzkafkuw") - .withSkuName("rnwb") - .withSkuAvailable(false) - .withReason("seyvj") - .withMessage("rts"), - new SkuAvailability().withKind("spkdee") - .withType("ofmxagkvtmelmqkr") - .withSkuName("hvljuahaquh") - .withSkuAvailable(false) - .withReason("duala") - .withMessage("qpv"))); - model = BinaryData.fromObject(model).toObject(SkuAvailabilityListResultInner.class); - Assertions.assertEquals("rpabg", model.value().get(0).kind()); - Assertions.assertEquals("psbjta", model.value().get(0).type()); - Assertions.assertEquals("ugxywpmueef", model.value().get(0).skuName()); - Assertions.assertEquals(false, model.value().get(0).skuAvailable()); - Assertions.assertEquals("qkqujidsu", model.value().get(0).reason()); - Assertions.assertEquals("nobglaocq", model.value().get(0).message()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuAvailabilityTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuAvailabilityTests.java deleted file mode 100644 index 10d2f0a952bc..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuAvailabilityTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.SkuAvailability; -import org.junit.jupiter.api.Assertions; - -public final class SkuAvailabilityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SkuAvailability model = BinaryData.fromString( - "{\"kind\":\"dmwsrcrgvxpvgomz\",\"type\":\"misgwbnb\",\"skuName\":\"ldawkzbaliourqha\",\"skuAvailable\":true,\"reason\":\"ashsfwxos\",\"message\":\"z\"}") - .toObject(SkuAvailability.class); - Assertions.assertEquals("dmwsrcrgvxpvgomz", model.kind()); - Assertions.assertEquals("misgwbnb", model.type()); - Assertions.assertEquals("ldawkzbaliourqha", model.skuName()); - Assertions.assertEquals(true, model.skuAvailable()); - Assertions.assertEquals("ashsfwxos", model.reason()); - Assertions.assertEquals("z", model.message()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuAvailability model = new SkuAvailability().withKind("dmwsrcrgvxpvgomz") - .withType("misgwbnb") - .withSkuName("ldawkzbaliourqha") - .withSkuAvailable(true) - .withReason("ashsfwxos") - .withMessage("z"); - model = BinaryData.fromObject(model).toObject(SkuAvailability.class); - Assertions.assertEquals("dmwsrcrgvxpvgomz", model.kind()); - Assertions.assertEquals("misgwbnb", model.type()); - Assertions.assertEquals("ldawkzbaliourqha", model.skuName()); - Assertions.assertEquals(true, model.skuAvailable()); - Assertions.assertEquals("ashsfwxos", model.reason()); - Assertions.assertEquals("z", model.message()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuCapabilityTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuCapabilityTests.java deleted file mode 100644 index d4f0ec7f0008..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuCapabilityTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.SkuCapability; -import org.junit.jupiter.api.Assertions; - -public final class SkuCapabilityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SkuCapability model = BinaryData.fromString("{\"name\":\"jwyahuxinpmqnja\",\"value\":\"ixjsprozvcputeg\"}") - .toObject(SkuCapability.class); - Assertions.assertEquals("jwyahuxinpmqnja", model.name()); - Assertions.assertEquals("ixjsprozvcputeg", model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuCapability model = new SkuCapability().withName("jwyahuxinpmqnja").withValue("ixjsprozvcputeg"); - model = BinaryData.fromObject(model).toObject(SkuCapability.class); - Assertions.assertEquals("jwyahuxinpmqnja", model.name()); - Assertions.assertEquals("ixjsprozvcputeg", model.value()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuChangeInfoTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuChangeInfoTests.java deleted file mode 100644 index 0d03c4d030ee..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuChangeInfoTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.SkuChangeInfo; -import org.junit.jupiter.api.Assertions; - -public final class SkuChangeInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SkuChangeInfo model = BinaryData.fromString( - "{\"countOfDowngrades\":94.32142,\"countOfUpgradesAfterDowngrades\":35.12105,\"lastChangeDate\":\"atscmd\"}") - .toObject(SkuChangeInfo.class); - Assertions.assertEquals(94.32142F, model.countOfDowngrades()); - Assertions.assertEquals(35.12105F, model.countOfUpgradesAfterDowngrades()); - Assertions.assertEquals("atscmd", model.lastChangeDate()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuChangeInfo model = new SkuChangeInfo().withCountOfDowngrades(94.32142F) - .withCountOfUpgradesAfterDowngrades(35.12105F) - .withLastChangeDate("atscmd"); - model = BinaryData.fromObject(model).toObject(SkuChangeInfo.class); - Assertions.assertEquals(94.32142F, model.countOfDowngrades()); - Assertions.assertEquals(35.12105F, model.countOfUpgradesAfterDowngrades()); - Assertions.assertEquals("atscmd", model.lastChangeDate()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuResourceInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuResourceInnerTests.java deleted file mode 100644 index 0f942a16a468..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuResourceInnerTests.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.SkuResourceInner; -import com.azure.resourcemanager.cognitiveservices.models.CapacityConfig; -import com.azure.resourcemanager.cognitiveservices.models.Sku; -import com.azure.resourcemanager.cognitiveservices.models.SkuTier; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SkuResourceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SkuResourceInner model = BinaryData.fromString( - "{\"resourceType\":\"deibqip\",\"sku\":{\"name\":\"ghvxndzwmkrefa\",\"tier\":\"Free\",\"size\":\"rwkq\",\"family\":\"hgbijt\",\"capacity\":1921447285},\"capacity\":{\"minimum\":394204922,\"maximum\":1033603649,\"step\":1988757032,\"default\":1529871140,\"allowedValues\":[1037462008,838227429,1939074971,1059509232]}}") - .toObject(SkuResourceInner.class); - Assertions.assertEquals("deibqip", model.resourceType()); - Assertions.assertEquals("ghvxndzwmkrefa", model.sku().name()); - Assertions.assertEquals(SkuTier.FREE, model.sku().tier()); - Assertions.assertEquals("rwkq", model.sku().size()); - Assertions.assertEquals("hgbijt", model.sku().family()); - Assertions.assertEquals(1921447285, model.sku().capacity()); - Assertions.assertEquals(394204922, model.capacity().minimum()); - Assertions.assertEquals(1033603649, model.capacity().maximum()); - Assertions.assertEquals(1988757032, model.capacity().step()); - Assertions.assertEquals(1529871140, model.capacity().defaultProperty()); - Assertions.assertEquals(1037462008, model.capacity().allowedValues().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuResourceInner model = new SkuResourceInner().withResourceType("deibqip") - .withSku(new Sku().withName("ghvxndzwmkrefa") - .withTier(SkuTier.FREE) - .withSize("rwkq") - .withFamily("hgbijt") - .withCapacity(1921447285)) - .withCapacity(new CapacityConfig().withMinimum(394204922) - .withMaximum(1033603649) - .withStep(1988757032) - .withDefaultProperty(1529871140) - .withAllowedValues(Arrays.asList(1037462008, 838227429, 1939074971, 1059509232))); - model = BinaryData.fromObject(model).toObject(SkuResourceInner.class); - Assertions.assertEquals("deibqip", model.resourceType()); - Assertions.assertEquals("ghvxndzwmkrefa", model.sku().name()); - Assertions.assertEquals(SkuTier.FREE, model.sku().tier()); - Assertions.assertEquals("rwkq", model.sku().size()); - Assertions.assertEquals("hgbijt", model.sku().family()); - Assertions.assertEquals(1921447285, model.sku().capacity()); - Assertions.assertEquals(394204922, model.capacity().minimum()); - Assertions.assertEquals(1033603649, model.capacity().maximum()); - Assertions.assertEquals(1988757032, model.capacity().step()); - Assertions.assertEquals(1529871140, model.capacity().defaultProperty()); - Assertions.assertEquals(1037462008, model.capacity().allowedValues().get(0)); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuTests.java deleted file mode 100644 index c84b87e60fdd..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.Sku; -import com.azure.resourcemanager.cognitiveservices.models.SkuTier; -import org.junit.jupiter.api.Assertions; - -public final class SkuTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Sku model = BinaryData.fromString( - "{\"name\":\"hmwhfpmrqo\",\"tier\":\"Basic\",\"size\":\"kknryrtihf\",\"family\":\"ijbpzvgnwzsymgl\",\"capacity\":2137761200}") - .toObject(Sku.class); - Assertions.assertEquals("hmwhfpmrqo", model.name()); - Assertions.assertEquals(SkuTier.BASIC, model.tier()); - Assertions.assertEquals("kknryrtihf", model.size()); - Assertions.assertEquals("ijbpzvgnwzsymgl", model.family()); - Assertions.assertEquals(2137761200, model.capacity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Sku model = new Sku().withName("hmwhfpmrqo") - .withTier(SkuTier.BASIC) - .withSize("kknryrtihf") - .withFamily("ijbpzvgnwzsymgl") - .withCapacity(2137761200); - model = BinaryData.fromObject(model).toObject(Sku.class); - Assertions.assertEquals("hmwhfpmrqo", model.name()); - Assertions.assertEquals(SkuTier.BASIC, model.tier()); - Assertions.assertEquals("kknryrtihf", model.size()); - Assertions.assertEquals("ijbpzvgnwzsymgl", model.family()); - Assertions.assertEquals(2137761200, model.capacity()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UsageListResultInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UsageListResultInnerTests.java deleted file mode 100644 index 5fcb1ddb07d8..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UsageListResultInnerTests.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.UsageListResultInner; -import com.azure.resourcemanager.cognitiveservices.models.MetricName; -import com.azure.resourcemanager.cognitiveservices.models.QuotaUsageStatus; -import com.azure.resourcemanager.cognitiveservices.models.UnitType; -import com.azure.resourcemanager.cognitiveservices.models.Usage; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class UsageListResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UsageListResultInner model = BinaryData.fromString( - "{\"nextLink\":\"mohctb\",\"value\":[{\"unit\":\"BytesPerSecond\",\"name\":{\"value\":\"ndnvo\",\"localizedValue\":\"ujjugwdkcglh\"},\"quotaPeriod\":\"azjdyggd\",\"limit\":92.2174087854439,\"currentValue\":3.8497339257224095,\"nextResetTime\":\"ofqweykhmenevfye\",\"status\":\"Blocked\"},{\"unit\":\"Bytes\",\"name\":{\"value\":\"i\",\"localizedValue\":\"yvdcsitynnaa\"},\"quotaPeriod\":\"ectehf\",\"limit\":43.32844185113748,\"currentValue\":61.13135450146281,\"nextResetTime\":\"vhezrkgqhcj\",\"status\":\"Unknown\"},{\"unit\":\"Milliseconds\",\"name\":{\"value\":\"kqsleyyvxy\",\"localizedValue\":\"pkc\"},\"quotaPeriod\":\"tpngjcrcczsqpjh\",\"limit\":15.683771184024254,\"currentValue\":5.670664395942426,\"nextResetTime\":\"sounqecanoaeu\",\"status\":\"Included\"},{\"unit\":\"BytesPerSecond\",\"name\":{\"value\":\"rpmopjmc\",\"localizedValue\":\"tuo\"},\"quotaPeriod\":\"hfuiuaodsfc\",\"limit\":36.548139076292394,\"currentValue\":48.52450589513511,\"nextResetTime\":\"ozmyzydagfu\",\"status\":\"Included\"}]}") - .toObject(UsageListResultInner.class); - Assertions.assertEquals("mohctb", model.nextLink()); - Assertions.assertEquals(UnitType.BYTES_PER_SECOND, model.value().get(0).unit()); - Assertions.assertEquals("ndnvo", model.value().get(0).name().value()); - Assertions.assertEquals("ujjugwdkcglh", model.value().get(0).name().localizedValue()); - Assertions.assertEquals("azjdyggd", model.value().get(0).quotaPeriod()); - Assertions.assertEquals(92.2174087854439D, model.value().get(0).limit()); - Assertions.assertEquals(3.8497339257224095D, model.value().get(0).currentValue()); - Assertions.assertEquals("ofqweykhmenevfye", model.value().get(0).nextResetTime()); - Assertions.assertEquals(QuotaUsageStatus.BLOCKED, model.value().get(0).status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UsageListResultInner model = new UsageListResultInner().withNextLink("mohctb") - .withValue(Arrays.asList( - new Usage().withUnit(UnitType.BYTES_PER_SECOND) - .withName(new MetricName().withValue("ndnvo").withLocalizedValue("ujjugwdkcglh")) - .withQuotaPeriod("azjdyggd") - .withLimit(92.2174087854439D) - .withCurrentValue(3.8497339257224095D) - .withNextResetTime("ofqweykhmenevfye") - .withStatus(QuotaUsageStatus.BLOCKED), - new Usage().withUnit(UnitType.BYTES) - .withName(new MetricName().withValue("i").withLocalizedValue("yvdcsitynnaa")) - .withQuotaPeriod("ectehf") - .withLimit(43.32844185113748D) - .withCurrentValue(61.13135450146281D) - .withNextResetTime("vhezrkgqhcj") - .withStatus(QuotaUsageStatus.UNKNOWN), - new Usage().withUnit(UnitType.MILLISECONDS) - .withName(new MetricName().withValue("kqsleyyvxy").withLocalizedValue("pkc")) - .withQuotaPeriod("tpngjcrcczsqpjh") - .withLimit(15.683771184024254D) - .withCurrentValue(5.670664395942426D) - .withNextResetTime("sounqecanoaeu") - .withStatus(QuotaUsageStatus.INCLUDED), - new Usage().withUnit(UnitType.BYTES_PER_SECOND) - .withName(new MetricName().withValue("rpmopjmc").withLocalizedValue("tuo")) - .withQuotaPeriod("hfuiuaodsfc") - .withLimit(36.548139076292394D) - .withCurrentValue(48.52450589513511D) - .withNextResetTime("ozmyzydagfu") - .withStatus(QuotaUsageStatus.INCLUDED))); - model = BinaryData.fromObject(model).toObject(UsageListResultInner.class); - Assertions.assertEquals("mohctb", model.nextLink()); - Assertions.assertEquals(UnitType.BYTES_PER_SECOND, model.value().get(0).unit()); - Assertions.assertEquals("ndnvo", model.value().get(0).name().value()); - Assertions.assertEquals("ujjugwdkcglh", model.value().get(0).name().localizedValue()); - Assertions.assertEquals("azjdyggd", model.value().get(0).quotaPeriod()); - Assertions.assertEquals(92.2174087854439D, model.value().get(0).limit()); - Assertions.assertEquals(3.8497339257224095D, model.value().get(0).currentValue()); - Assertions.assertEquals("ofqweykhmenevfye", model.value().get(0).nextResetTime()); - Assertions.assertEquals(QuotaUsageStatus.BLOCKED, model.value().get(0).status()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UsageTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UsageTests.java deleted file mode 100644 index 25d852e170a5..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UsageTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.MetricName; -import com.azure.resourcemanager.cognitiveservices.models.QuotaUsageStatus; -import com.azure.resourcemanager.cognitiveservices.models.UnitType; -import com.azure.resourcemanager.cognitiveservices.models.Usage; -import org.junit.jupiter.api.Assertions; - -public final class UsageTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Usage model = BinaryData.fromString( - "{\"unit\":\"Seconds\",\"name\":{\"value\":\"uokktwhrdxwz\",\"localizedValue\":\"q\"},\"quotaPeriod\":\"bsureximo\",\"limit\":23.538238166454796,\"currentValue\":27.071751224209883,\"nextResetTime\":\"s\",\"status\":\"Unknown\"}") - .toObject(Usage.class); - Assertions.assertEquals(UnitType.SECONDS, model.unit()); - Assertions.assertEquals("uokktwhrdxwz", model.name().value()); - Assertions.assertEquals("q", model.name().localizedValue()); - Assertions.assertEquals("bsureximo", model.quotaPeriod()); - Assertions.assertEquals(23.538238166454796D, model.limit()); - Assertions.assertEquals(27.071751224209883D, model.currentValue()); - Assertions.assertEquals("s", model.nextResetTime()); - Assertions.assertEquals(QuotaUsageStatus.UNKNOWN, model.status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Usage model = new Usage().withUnit(UnitType.SECONDS) - .withName(new MetricName().withValue("uokktwhrdxwz").withLocalizedValue("q")) - .withQuotaPeriod("bsureximo") - .withLimit(23.538238166454796D) - .withCurrentValue(27.071751224209883D) - .withNextResetTime("s") - .withStatus(QuotaUsageStatus.UNKNOWN); - model = BinaryData.fromObject(model).toObject(Usage.class); - Assertions.assertEquals(UnitType.SECONDS, model.unit()); - Assertions.assertEquals("uokktwhrdxwz", model.name().value()); - Assertions.assertEquals("q", model.name().localizedValue()); - Assertions.assertEquals("bsureximo", model.quotaPeriod()); - Assertions.assertEquals(23.538238166454796D, model.limit()); - Assertions.assertEquals(27.071751224209883D, model.currentValue()); - Assertions.assertEquals("s", model.nextResetTime()); - Assertions.assertEquals(QuotaUsageStatus.UNKNOWN, model.status()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UsagesListMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UsagesListMockTests.java deleted file mode 100644 index 73fb31b008e9..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UsagesListMockTests.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.QuotaUsageStatus; -import com.azure.resourcemanager.cognitiveservices.models.UnitType; -import com.azure.resourcemanager.cognitiveservices.models.Usage; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class UsagesListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"unit\":\"Milliseconds\",\"name\":{\"value\":\"awpcbbnzqcykn\",\"localizedValue\":\"qofyuicdhzbdy\"},\"quotaPeriod\":\"wgbdvibidmhmwffp\",\"limit\":33.43817000854751,\"currentValue\":59.58054394314235,\"nextResetTime\":\"kccrrvwey\",\"status\":\"Included\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - CognitiveServicesManager manager = CognitiveServicesManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.usages().list("xzopjhbzxl", "ohrdddt", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(UnitType.MILLISECONDS, response.iterator().next().unit()); - Assertions.assertEquals("awpcbbnzqcykn", response.iterator().next().name().value()); - Assertions.assertEquals("qofyuicdhzbdy", response.iterator().next().name().localizedValue()); - Assertions.assertEquals("wgbdvibidmhmwffp", response.iterator().next().quotaPeriod()); - Assertions.assertEquals(33.43817000854751D, response.iterator().next().limit()); - Assertions.assertEquals(59.58054394314235D, response.iterator().next().currentValue()); - Assertions.assertEquals("kccrrvwey", response.iterator().next().nextResetTime()); - Assertions.assertEquals(QuotaUsageStatus.INCLUDED, response.iterator().next().status()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UserAssignedIdentityTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UserAssignedIdentityTests.java deleted file mode 100644 index 353f5d2cb850..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UserAssignedIdentityTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.UserAssignedIdentity; - -public final class UserAssignedIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserAssignedIdentity model = BinaryData.fromString("{\"principalId\":\"vyq\",\"clientId\":\"wby\"}") - .toObject(UserAssignedIdentity.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserAssignedIdentity model = new UserAssignedIdentity(); - model = BinaryData.fromObject(model).toObject(UserAssignedIdentity.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UserOwnedAmlWorkspaceTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UserOwnedAmlWorkspaceTests.java deleted file mode 100644 index 0dd4bfdd2ba2..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UserOwnedAmlWorkspaceTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.UserOwnedAmlWorkspace; -import org.junit.jupiter.api.Assertions; - -public final class UserOwnedAmlWorkspaceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserOwnedAmlWorkspace model - = BinaryData.fromString("{\"resourceId\":\"nmayhuybb\",\"identityClientId\":\"odepoogin\"}") - .toObject(UserOwnedAmlWorkspace.class); - Assertions.assertEquals("nmayhuybb", model.resourceId()); - Assertions.assertEquals("odepoogin", model.identityClientId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserOwnedAmlWorkspace model - = new UserOwnedAmlWorkspace().withResourceId("nmayhuybb").withIdentityClientId("odepoogin"); - model = BinaryData.fromObject(model).toObject(UserOwnedAmlWorkspace.class); - Assertions.assertEquals("nmayhuybb", model.resourceId()); - Assertions.assertEquals("odepoogin", model.identityClientId()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UserOwnedStorageTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UserOwnedStorageTests.java deleted file mode 100644 index ac5e13169729..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UserOwnedStorageTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.UserOwnedStorage; -import org.junit.jupiter.api.Assertions; - -public final class UserOwnedStorageTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserOwnedStorage model - = BinaryData.fromString("{\"resourceId\":\"zitonpeqfpjkjl\",\"identityClientId\":\"fpdvhpfxxypi\"}") - .toObject(UserOwnedStorage.class); - Assertions.assertEquals("zitonpeqfpjkjl", model.resourceId()); - Assertions.assertEquals("fpdvhpfxxypi", model.identityClientId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserOwnedStorage model - = new UserOwnedStorage().withResourceId("zitonpeqfpjkjl").withIdentityClientId("fpdvhpfxxypi"); - model = BinaryData.fromObject(model).toObject(UserOwnedStorage.class); - Assertions.assertEquals("zitonpeqfpjkjl", model.resourceId()); - Assertions.assertEquals("fpdvhpfxxypi", model.identityClientId()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/VirtualNetworkRuleTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/VirtualNetworkRuleTests.java deleted file mode 100644 index c1c02e94ee2b..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/VirtualNetworkRuleTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.VirtualNetworkRule; -import org.junit.jupiter.api.Assertions; - -public final class VirtualNetworkRuleTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualNetworkRule model = BinaryData - .fromString("{\"id\":\"jakhmsbzjh\",\"state\":\"zevdphlx\",\"ignoreMissingVnetServiceEndpoint\":true}") - .toObject(VirtualNetworkRule.class); - Assertions.assertEquals("jakhmsbzjh", model.id()); - Assertions.assertEquals("zevdphlx", model.state()); - Assertions.assertEquals(true, model.ignoreMissingVnetServiceEndpoint()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualNetworkRule model = new VirtualNetworkRule().withId("jakhmsbzjh") - .withState("zevdphlx") - .withIgnoreMissingVnetServiceEndpoint(true); - model = BinaryData.fromObject(model).toObject(VirtualNetworkRule.class); - Assertions.assertEquals("jakhmsbzjh", model.id()); - Assertions.assertEquals("zevdphlx", model.state()); - Assertions.assertEquals(true, model.ignoreMissingVnetServiceEndpoint()); - } -}