diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/CHANGELOG.md b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/CHANGELOG.md index 67ea3c38e5d7..cdf7d54914e7 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/CHANGELOG.md +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2023-05-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-2023-05. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/README.md b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/README.md index 75dd5a5f1d58..1059fdc9e940 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-2022-12. 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-2023-05. 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 @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-cognitiveservices - 1.0.0 + 1.1.0-beta.1 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/SAMPLE.md b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/SAMPLE.md index 41e984930d12..ee7acd5e1c7b 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/SAMPLE.md +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/SAMPLE.md @@ -49,6 +49,10 @@ - [Get](#deployments_get) - [List](#deployments_list) +## Models + +- [List](#models_list) + ## Operations - [List](#operations_list) @@ -72,6 +76,10 @@ ## ResourceSkus - [List](#resourceskus_list) + +## Usages + +- [List](#usages_list) ### Accounts_Create ```java @@ -88,7 +96,7 @@ import java.util.Arrays; /** Samples for Accounts Create. */ public final class AccountsCreateSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/CreateAccountMin.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/CreateAccountMin.json */ /** * Sample code: Create Account Min. @@ -109,7 +117,7 @@ public final class AccountsCreateSamples { } /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/CreateAccount.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/CreateAccount.json */ /** * Sample code: Create Account. @@ -152,7 +160,7 @@ public final class AccountsCreateSamples { /** Samples for Accounts Delete. */ public final class AccountsDeleteSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/DeleteAccount.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/DeleteAccount.json */ /** * Sample code: Delete Account. @@ -171,7 +179,7 @@ public final class AccountsDeleteSamples { /** Samples for Accounts GetByResourceGroup. */ public final class AccountsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/GetAccount.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/GetAccount.json */ /** * Sample code: Get Account. @@ -192,7 +200,7 @@ public final class AccountsGetByResourceGroupSamples { /** Samples for Accounts List. */ public final class AccountsListSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/ListAccountsBySubscription.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/ListAccountsBySubscription.json */ /** * Sample code: List Accounts by Subscription. @@ -212,7 +220,7 @@ public final class AccountsListSamples { /** Samples for Accounts ListByResourceGroup. */ public final class AccountsListByResourceGroupSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/ListAccountsByResourceGroup.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/ListAccountsByResourceGroup.json */ /** * Sample code: List Accounts by Resource Group. @@ -232,7 +240,7 @@ public final class AccountsListByResourceGroupSamples { /** Samples for Accounts ListKeys. */ public final class AccountsListKeysSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/ListKeys.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/ListKeys.json */ /** * Sample code: List Keys. @@ -251,7 +259,7 @@ public final class AccountsListKeysSamples { /** Samples for Accounts ListModels. */ public final class AccountsListModelsSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/ListAccountModels.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/ListAccountModels.json */ /** * Sample code: List AccountModels. @@ -270,7 +278,7 @@ public final class AccountsListModelsSamples { /** Samples for Accounts ListSkus. */ public final class AccountsListSkusSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/ListSkus.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/ListSkus.json */ /** * Sample code: List SKUs. @@ -289,7 +297,7 @@ public final class AccountsListSkusSamples { /** Samples for Accounts ListUsages. */ public final class AccountsListUsagesSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/GetUsages.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/GetUsages.json */ /** * Sample code: Get Usages. @@ -313,7 +321,7 @@ import com.azure.resourcemanager.cognitiveservices.models.RegenerateKeyParameter /** Samples for Accounts RegenerateKey. */ public final class AccountsRegenerateKeySamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/RegenerateKey.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/RegenerateKey.json */ /** * Sample code: Regenerate Keys. @@ -341,7 +349,7 @@ import com.azure.resourcemanager.cognitiveservices.models.Sku; /** Samples for Accounts Update. */ public final class AccountsUpdateSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/UpdateAccount.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/UpdateAccount.json */ /** * Sample code: Update Account. @@ -370,7 +378,7 @@ import com.azure.resourcemanager.cognitiveservices.models.HostingModel; /** Samples for CommitmentPlans CreateOrUpdate. */ public final class CommitmentPlansCreateOrUpdateSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/PutCommitmentPlan.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/PutCommitmentPlan.json */ /** * Sample code: PutCommitmentPlan. @@ -402,7 +410,7 @@ public final class CommitmentPlansCreateOrUpdateSamples { /** Samples for CommitmentPlans CreateOrUpdateAssociation. */ public final class CommitmentPlansCreateOrUpdateAssociationSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/CreateSharedCommitmentPlanAssociation.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/CreateSharedCommitmentPlanAssociation.json */ /** * Sample code: PutCommitmentPlan. @@ -432,7 +440,7 @@ import com.azure.resourcemanager.cognitiveservices.models.Sku; /** Samples for CommitmentPlans CreateOrUpdatePlan. */ public final class CommitmentPlansCreateOrUpdatePlanSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/CreateSharedCommitmentPlan.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/CreateSharedCommitmentPlan.json */ /** * Sample code: Create Commitment Plan. @@ -465,7 +473,7 @@ public final class CommitmentPlansCreateOrUpdatePlanSamples { /** Samples for CommitmentPlans Delete. */ public final class CommitmentPlansDeleteSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/DeleteCommitmentPlan.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/DeleteCommitmentPlan.json */ /** * Sample code: DeleteCommitmentPlan. @@ -487,7 +495,7 @@ public final class CommitmentPlansDeleteSamples { /** Samples for CommitmentPlans DeleteAssociation. */ public final class CommitmentPlansDeleteAssociationSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/DeleteSharedCommitmentPlanAssociation.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/DeleteSharedCommitmentPlanAssociation.json */ /** * Sample code: DeleteCommitmentPlan. @@ -513,7 +521,7 @@ public final class CommitmentPlansDeleteAssociationSamples { /** Samples for CommitmentPlans DeletePlan. */ public final class CommitmentPlansDeletePlanSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/DeleteSharedCommitmentPlan.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/DeleteSharedCommitmentPlan.json */ /** * Sample code: Delete Commitment Plan. @@ -535,7 +543,7 @@ public final class CommitmentPlansDeletePlanSamples { /** Samples for CommitmentPlans Get. */ public final class CommitmentPlansGetSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/GetCommitmentPlan.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/GetCommitmentPlan.json */ /** * Sample code: GetCommitmentPlan. @@ -557,7 +565,7 @@ public final class CommitmentPlansGetSamples { /** Samples for CommitmentPlans GetAssociation. */ public final class CommitmentPlansGetAssociationSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/GetSharedCommitmentPlanAssociation.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/GetSharedCommitmentPlanAssociation.json */ /** * Sample code: GetCommitmentPlan. @@ -582,7 +590,7 @@ public final class CommitmentPlansGetAssociationSamples { /** Samples for CommitmentPlans GetByResourceGroup. */ public final class CommitmentPlansGetByResourceGroupSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/GetSharedCommitmentPlan.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/GetSharedCommitmentPlan.json */ /** * Sample code: Get Commitment Plan. @@ -604,7 +612,7 @@ public final class CommitmentPlansGetByResourceGroupSamples { /** Samples for CommitmentPlans List. */ public final class CommitmentPlansListSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/ListCommitmentPlans.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/ListCommitmentPlans.json */ /** * Sample code: ListCommitmentPlans. @@ -624,7 +632,7 @@ public final class CommitmentPlansListSamples { /** Samples for CommitmentPlans ListAssociations. */ public final class CommitmentPlansListAssociationsSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/ListSharedCommitmentPlanAssociations.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/ListSharedCommitmentPlanAssociations.json */ /** * Sample code: ListCommitmentPlans. @@ -646,7 +654,7 @@ public final class CommitmentPlansListAssociationsSamples { /** Samples for CommitmentPlans ListByResourceGroup. */ public final class CommitmentPlansListByResourceGroupSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/ListSharedCommitmentPlansByResourceGroup.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/ListSharedCommitmentPlansByResourceGroup.json */ /** * Sample code: List Commitment Plans by Resource Group. @@ -666,7 +674,7 @@ public final class CommitmentPlansListByResourceGroupSamples { /** Samples for CommitmentPlans ListPlansBySubscription. */ public final class CommitmentPlansListPlansBySubscriptionSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/ListSharedCommitmentPlansBySubscription.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/ListSharedCommitmentPlansBySubscription.json */ /** * Sample code: List Accounts by Subscription. @@ -690,7 +698,7 @@ import java.util.Map; /** Samples for CommitmentPlans UpdatePlan. */ public final class CommitmentPlansUpdatePlanSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/UpdateSharedCommitmentPlan.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/UpdateSharedCommitmentPlan.json */ /** * Sample code: Create Commitment Plan. @@ -727,7 +735,7 @@ public final class CommitmentPlansUpdatePlanSamples { /** Samples for CommitmentTiers List. */ public final class CommitmentTiersListSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/ListCommitmentTiers.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/ListCommitmentTiers.json */ /** * Sample code: ListCommitmentTiers. @@ -747,7 +755,7 @@ public final class CommitmentTiersListSamples { /** Samples for DeletedAccounts Get. */ public final class DeletedAccountsGetSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/GetDeletedAccount.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/GetDeletedAccount.json */ /** * Sample code: Get Account. @@ -768,7 +776,7 @@ public final class DeletedAccountsGetSamples { /** Samples for DeletedAccounts List. */ public final class DeletedAccountsListSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/ListDeletedAccountsBySubscription.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/ListDeletedAccountsBySubscription.json */ /** * Sample code: List Deleted Accounts by Subscription. @@ -788,7 +796,7 @@ public final class DeletedAccountsListSamples { /** Samples for DeletedAccounts Purge. */ public final class DeletedAccountsPurgeSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/PurgeDeletedAccount.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/PurgeDeletedAccount.json */ /** * Sample code: Delete Account. @@ -812,7 +820,7 @@ import com.azure.resourcemanager.cognitiveservices.models.DeploymentScaleType; /** Samples for Deployments CreateOrUpdate. */ public final class DeploymentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/PutDeployment.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/PutDeployment.json */ /** * Sample code: PutDeployment. @@ -840,7 +848,7 @@ public final class DeploymentsCreateOrUpdateSamples { /** Samples for Deployments Delete. */ public final class DeploymentsDeleteSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/DeleteDeployment.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/DeleteDeployment.json */ /** * Sample code: DeleteDeployment. @@ -861,7 +869,7 @@ public final class DeploymentsDeleteSamples { /** Samples for Deployments Get. */ public final class DeploymentsGetSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/GetDeployment.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/GetDeployment.json */ /** * Sample code: GetDeployment. @@ -882,7 +890,7 @@ public final class DeploymentsGetSamples { /** Samples for Deployments List. */ public final class DeploymentsListSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/ListDeployments.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/ListDeployments.json */ /** * Sample code: ListDeployments. @@ -895,13 +903,32 @@ public final class DeploymentsListSamples { } ``` +### Models_List + +```java +/** Samples for Models List. */ +public final class ModelsListSamples { + /* + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/ListModels.json + */ + /** + * Sample code: ListModels. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void listModels(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.models().list("WestUS", com.azure.core.util.Context.NONE); + } +} +``` + ### Operations_List ```java /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/GetOperations.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/GetOperations.json */ /** * Sample code: Get Operations. @@ -924,7 +951,7 @@ import com.azure.resourcemanager.cognitiveservices.models.PrivateLinkServiceConn /** Samples for PrivateEndpointConnections CreateOrUpdate. */ public final class PrivateEndpointConnectionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/PutPrivateEndpointConnection.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/PutPrivateEndpointConnection.json */ /** * Sample code: PutPrivateEndpointConnection. @@ -954,7 +981,7 @@ public final class PrivateEndpointConnectionsCreateOrUpdateSamples { /** Samples for PrivateEndpointConnections Delete. */ public final class PrivateEndpointConnectionsDeleteSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/DeletePrivateEndpointConnection.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/DeletePrivateEndpointConnection.json */ /** * Sample code: DeletePrivateEndpointConnection. @@ -976,7 +1003,7 @@ public final class PrivateEndpointConnectionsDeleteSamples { /** Samples for PrivateEndpointConnections Get. */ public final class PrivateEndpointConnectionsGetSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/GetPrivateEndpointConnection.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/GetPrivateEndpointConnection.json */ /** * Sample code: GetPrivateEndpointConnection. @@ -998,7 +1025,7 @@ public final class PrivateEndpointConnectionsGetSamples { /** Samples for PrivateEndpointConnections List. */ public final class PrivateEndpointConnectionsListSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/ListPrivateEndpointConnections.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/ListPrivateEndpointConnections.json */ /** * Sample code: GetPrivateEndpointConnection. @@ -1018,7 +1045,7 @@ public final class PrivateEndpointConnectionsListSamples { /** Samples for PrivateLinkResources List. */ public final class PrivateLinkResourcesListSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/ListPrivateLinkResources.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/ListPrivateLinkResources.json */ /** * Sample code: ListPrivateLinkResources. @@ -1040,7 +1067,7 @@ import com.azure.resourcemanager.cognitiveservices.models.CheckDomainAvailabilit /** Samples for ResourceProvider CheckDomainAvailability. */ public final class ResourceProviderCheckDomainAvailabilitySamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/CheckDomainAvailability.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/CheckDomainAvailability.json */ /** * Sample code: Check SKU Availability. @@ -1069,7 +1096,7 @@ import java.util.Arrays; /** Samples for ResourceProvider CheckSkuAvailability. */ public final class ResourceProviderCheckSkuAvailabilitySamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/CheckSkuAvailability.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/CheckSkuAvailability.json */ /** * Sample code: Check SKU Availability. @@ -1097,7 +1124,7 @@ public final class ResourceProviderCheckSkuAvailabilitySamples { /** Samples for ResourceSkus List. */ public final class ResourceSkusListSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/GetSkus.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/GetSkus.json */ /** * Sample code: Regenerate Keys. @@ -1110,3 +1137,22 @@ public final class ResourceSkusListSamples { } ``` +### Usages_List + +```java +/** Samples for Usages List. */ +public final class UsagesListSamples { + /* + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/ListUsages.json + */ + /** + * Sample code: Get Usages. + * + * @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); + } +} +``` + diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/pom.xml b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/pom.xml index a25c90e1c680..6f87e052570d 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-2022-12. + 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-2023-05. https://github.com/Azure/azure-sdk-for-java 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 52a4ce7f6d4c..a9a104e78ef9 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 @@ -30,21 +30,25 @@ import com.azure.resourcemanager.cognitiveservices.implementation.CommitmentTiersImpl; import com.azure.resourcemanager.cognitiveservices.implementation.DeletedAccountsImpl; import com.azure.resourcemanager.cognitiveservices.implementation.DeploymentsImpl; +import com.azure.resourcemanager.cognitiveservices.implementation.ModelsImpl; 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.ResourceProvidersImpl; import com.azure.resourcemanager.cognitiveservices.implementation.ResourceSkusImpl; +import com.azure.resourcemanager.cognitiveservices.implementation.UsagesImpl; import com.azure.resourcemanager.cognitiveservices.models.Accounts; import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlans; import com.azure.resourcemanager.cognitiveservices.models.CommitmentTiers; import com.azure.resourcemanager.cognitiveservices.models.DeletedAccounts; import com.azure.resourcemanager.cognitiveservices.models.Deployments; +import com.azure.resourcemanager.cognitiveservices.models.Models; 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.ResourceProviders; import com.azure.resourcemanager.cognitiveservices.models.ResourceSkus; +import com.azure.resourcemanager.cognitiveservices.models.Usages; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; @@ -60,12 +64,16 @@ public final class CognitiveServicesManager { private ResourceSkus resourceSkus; + private Usages usages; + private Operations operations; private ResourceProviders resourceProviders; private CommitmentTiers commitmentTiers; + private Models models; + private PrivateEndpointConnections privateEndpointConnections; private PrivateLinkResources privateLinkResources; @@ -239,7 +247,7 @@ public CognitiveServicesManager authenticate(TokenCredential credential, AzurePr .append("-") .append("com.azure.resourcemanager.cognitiveservices") .append("/") - .append("1.0.0"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -332,6 +340,18 @@ public ResourceSkus resourceSkus() { return resourceSkus; } + /** + * Gets the resource collection API of Usages. + * + * @return Resource collection API of Usages. + */ + public Usages usages() { + if (this.usages == null) { + this.usages = new UsagesImpl(clientObject.getUsages(), this); + } + return usages; + } + /** * Gets the resource collection API of Operations. * @@ -368,6 +388,18 @@ public CommitmentTiers commitmentTiers() { return commitmentTiers; } + /** + * Gets the resource collection API of Models. + * + * @return Resource collection API of Models. + */ + public Models models() { + if (this.models == null) { + this.models = new ModelsImpl(clientObject.getModels(), this); + } + return models; + } + /** * Gets the resource collection API of PrivateEndpointConnections. It manages PrivateEndpointConnection. * 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 9c512ec1d022..108b1d3a9149 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 @@ -65,6 +65,13 @@ public interface CognitiveServicesManagementClient { */ ResourceSkusClient getResourceSkus(); + /** + * Gets the UsagesClient object to access its operations. + * + * @return the UsagesClient object. + */ + UsagesClient getUsages(); + /** * Gets the OperationsClient object to access its operations. * @@ -86,6 +93,13 @@ public interface CognitiveServicesManagementClient { */ CommitmentTiersClient getCommitmentTiers(); + /** + * Gets the ModelsClient object to access its operations. + * + * @return the ModelsClient object. + */ + ModelsClient getModels(); + /** * Gets the PrivateEndpointConnectionsClient object to access its operations. * diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ModelsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ModelsClient.java new file mode 100644 index 000000000000..a6237269fe43 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ModelsClient.java @@ -0,0 +1,39 @@ +// 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.util.Context; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ModelInner; + +/** An instance of this class provides access to all the operations defined in ModelsClient. */ +public interface ModelsClient { + /** + * List Models. + * + * @param location Resource location. + * @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 models as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location); + + /** + * List Models. + * + * @param location Resource location. + * @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 models as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, Context context); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/UsagesClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/UsagesClient.java new file mode 100644 index 000000000000..88102c1a1dbd --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/UsagesClient.java @@ -0,0 +1,41 @@ +// 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.util.Context; +import com.azure.resourcemanager.cognitiveservices.fluent.models.UsageInner; + +/** An instance of this class provides access to all the operations defined in UsagesClient. */ +public interface UsagesClient { + /** + * Get usages for the requested subscription. + * + * @param location Resource location. + * @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 usages for the requested subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location); + + /** + * Get usages for the requested subscription. + * + * @param location Resource location. + * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is + * name.value (name of the metric, can have an or of multiple names). + * @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 usages for the requested subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, String filter, Context context); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AccountModelInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AccountModelInner.java index c88de0adeb33..af9875c0b5cb 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AccountModelInner.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AccountModelInner.java @@ -9,8 +9,10 @@ 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.ModelSku; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; import java.util.Map; /** Cognitive Services account Model. */ @@ -22,6 +24,18 @@ public final class AccountModelInner extends DeploymentModel { @JsonProperty(value = "baseModel") private DeploymentModel baseModel; + /* + * If the model is default version. + */ + @JsonProperty(value = "isDefaultVersion") + private Boolean isDefaultVersion; + + /* + * The list of Model Sku. + */ + @JsonProperty(value = "skus") + private List skus; + /* * The max capacity. */ @@ -84,6 +98,46 @@ public AccountModelInner withBaseModel(DeploymentModel baseModel) { return this; } + /** + * Get the isDefaultVersion property: If the model is default version. + * + * @return the isDefaultVersion value. + */ + public Boolean isDefaultVersion() { + return this.isDefaultVersion; + } + + /** + * Set the isDefaultVersion property: If the model is default version. + * + * @param isDefaultVersion the isDefaultVersion value to set. + * @return the AccountModelInner object itself. + */ + public AccountModelInner withIsDefaultVersion(Boolean isDefaultVersion) { + this.isDefaultVersion = isDefaultVersion; + return this; + } + + /** + * Get the skus property: The list of Model Sku. + * + * @return the skus value. + */ + public List skus() { + return this.skus; + } + + /** + * Set the skus property: The list of Model Sku. + * + * @param skus the skus value to set. + * @return the AccountModelInner object itself. + */ + public AccountModelInner withSkus(List skus) { + this.skus = skus; + return this; + } + /** * Get the maxCapacity property: The max capacity. * @@ -214,6 +268,13 @@ public AccountModelInner withVersion(String version) { return this; } + /** {@inheritDoc} */ + @Override + public AccountModelInner withSource(String source) { + super.withSource(source); + return this; + } + /** * Validates the instance. * @@ -225,6 +286,9 @@ public void validate() { if (baseModel() != null) { baseModel().validate(); } + if (skus() != null) { + skus().forEach(e -> e.validate()); + } if (deprecation() != null) { deprecation().validate(); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/DeploymentInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/DeploymentInner.java index 1562e0dbd5be..ea192175d3bd 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/DeploymentInner.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/DeploymentInner.java @@ -8,11 +8,18 @@ import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.resourcemanager.cognitiveservices.models.DeploymentProperties; +import com.azure.resourcemanager.cognitiveservices.models.Sku; import com.fasterxml.jackson.annotation.JsonProperty; /** Cognitive Services account deployment. */ @Fluent public final class DeploymentInner extends ProxyResource { + /* + * The resource model definition representing SKU + */ + @JsonProperty(value = "sku") + private Sku sku; + /* * Metadata pertaining to creation and last modification of the resource. */ @@ -35,6 +42,26 @@ public final class DeploymentInner extends ProxyResource { public DeploymentInner() { } + /** + * Get the sku property: The resource model definition representing SKU. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: The resource model definition representing SKU. + * + * @param sku the sku value to set. + * @return the DeploymentInner object itself. + */ + public DeploymentInner withSku(Sku sku) { + this.sku = sku; + return this; + } + /** * Get the systemData property: Metadata pertaining to creation and last modification of the resource. * @@ -79,6 +106,9 @@ public DeploymentInner withProperties(DeploymentProperties properties) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (sku() != null) { + sku().validate(); + } if (properties() != null) { properties().validate(); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ModelInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ModelInner.java new file mode 100644 index 000000000000..2d2e99467226 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ModelInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Cognitive Services Model. */ +@Fluent +public final class ModelInner { + /* + * Model Metadata. + */ + @JsonProperty(value = "model") + private AccountModelInner model; + + /* + * The Kind of the Model. + */ + @JsonProperty(value = "kind") + private String kind; + + /* + * The SKU of the Model. + */ + @JsonProperty(value = "skuName") + private String skuName; + + /** Creates an instance of ModelInner class. */ + public ModelInner() { + } + + /** + * Get the model property: Model Metadata. + * + * @return the model value. + */ + public AccountModelInner model() { + return this.model; + } + + /** + * Set the model property: Model Metadata. + * + * @param model the model value to set. + * @return the ModelInner object itself. + */ + public ModelInner withModel(AccountModelInner model) { + this.model = model; + return this; + } + + /** + * Get the kind property: The Kind of the Model. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Set the kind property: The Kind of the Model. + * + * @param kind the kind value to set. + * @return the ModelInner object itself. + */ + public ModelInner withKind(String kind) { + this.kind = kind; + return this; + } + + /** + * Get the skuName property: The SKU of the Model. + * + * @return the skuName value. + */ + public String skuName() { + return this.skuName; + } + + /** + * Set the skuName property: The SKU of the Model. + * + * @param skuName the skuName value to set. + * @return the ModelInner object itself. + */ + public ModelInner withSkuName(String skuName) { + this.skuName = skuName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (model() != null) { + model().validate(); + } + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/UsageInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/UsageInner.java new file mode 100644 index 000000000000..37a9d0ea1934 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/UsageInner.java @@ -0,0 +1,212 @@ +// 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.resourcemanager.cognitiveservices.models.MetricName; +import com.azure.resourcemanager.cognitiveservices.models.QuotaUsageStatus; +import com.azure.resourcemanager.cognitiveservices.models.UnitType; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The usage data for a usage request. */ +@Fluent +public final class UsageInner { + /* + * The unit of the metric. + */ + @JsonProperty(value = "unit") + private UnitType unit; + + /* + * The name information for the metric. + */ + @JsonProperty(value = "name") + private MetricName name; + + /* + * The quota period used to summarize the usage values. + */ + @JsonProperty(value = "quotaPeriod") + private String quotaPeriod; + + /* + * Maximum value for this metric. + */ + @JsonProperty(value = "limit") + private Double limit; + + /* + * Current value for this metric. + */ + @JsonProperty(value = "currentValue") + private Double currentValue; + + /* + * Next reset time for current quota. + */ + @JsonProperty(value = "nextResetTime") + private String nextResetTime; + + /* + * Cognitive Services account quota usage status. + */ + @JsonProperty(value = "status") + private QuotaUsageStatus status; + + /** Creates an instance of UsageInner class. */ + public UsageInner() { + } + + /** + * Get the unit property: The unit of the metric. + * + * @return the unit value. + */ + public UnitType unit() { + return this.unit; + } + + /** + * Set the unit property: The unit of the metric. + * + * @param unit the unit value to set. + * @return the UsageInner object itself. + */ + public UsageInner withUnit(UnitType unit) { + this.unit = unit; + return this; + } + + /** + * Get the name property: The name information for the metric. + * + * @return the name value. + */ + public MetricName name() { + return this.name; + } + + /** + * Set the name property: The name information for the metric. + * + * @param name the name value to set. + * @return the UsageInner object itself. + */ + public UsageInner withName(MetricName name) { + this.name = name; + return this; + } + + /** + * Get the quotaPeriod property: The quota period used to summarize the usage values. + * + * @return the quotaPeriod value. + */ + public String quotaPeriod() { + return this.quotaPeriod; + } + + /** + * Set the quotaPeriod property: The quota period used to summarize the usage values. + * + * @param quotaPeriod the quotaPeriod value to set. + * @return the UsageInner object itself. + */ + public UsageInner withQuotaPeriod(String quotaPeriod) { + this.quotaPeriod = quotaPeriod; + return this; + } + + /** + * Get the limit property: Maximum value for this metric. + * + * @return the limit value. + */ + public Double limit() { + return this.limit; + } + + /** + * Set the limit property: Maximum value for this metric. + * + * @param limit the limit value to set. + * @return the UsageInner object itself. + */ + public UsageInner withLimit(Double limit) { + this.limit = limit; + return this; + } + + /** + * Get the currentValue property: Current value for this metric. + * + * @return the currentValue value. + */ + public Double currentValue() { + return this.currentValue; + } + + /** + * Set the currentValue property: Current value for this metric. + * + * @param currentValue the currentValue value to set. + * @return the UsageInner object itself. + */ + public UsageInner withCurrentValue(Double currentValue) { + this.currentValue = currentValue; + return this; + } + + /** + * Get the nextResetTime property: Next reset time for current quota. + * + * @return the nextResetTime value. + */ + public String nextResetTime() { + return this.nextResetTime; + } + + /** + * Set the nextResetTime property: Next reset time for current quota. + * + * @param nextResetTime the nextResetTime value to set. + * @return the UsageInner object itself. + */ + public UsageInner withNextResetTime(String nextResetTime) { + this.nextResetTime = nextResetTime; + return this; + } + + /** + * Get the status property: Cognitive Services account quota usage status. + * + * @return the status value. + */ + public QuotaUsageStatus status() { + return this.status; + } + + /** + * Set the status property: Cognitive Services account quota usage status. + * + * @param status the status value to set. + * @return the UsageInner object itself. + */ + public UsageInner withStatus(QuotaUsageStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() != null) { + name().validate(); + } + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/UsageListResultInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/UsageListResultInner.java index 61c60c29c0e6..235962a32d44 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/UsageListResultInner.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/UsageListResultInner.java @@ -5,29 +5,54 @@ package com.azure.resourcemanager.cognitiveservices.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.cognitiveservices.models.Usage; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The response to a list usage request. */ @Fluent public final class UsageListResultInner { + /* + * The link used to get the next page of Usages. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + /* * The list of usages for Cognitive Service account. */ @JsonProperty(value = "value") - private List value; + private List value; /** Creates an instance of UsageListResultInner class. */ public UsageListResultInner() { } + /** + * Get the nextLink property: The link used to get the next page of Usages. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link used to get the next page of Usages. + * + * @param nextLink the nextLink value to set. + * @return the UsageListResultInner object itself. + */ + public UsageListResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + /** * Get the value property: The list of usages for Cognitive Service account. * * @return the value value. */ - public List value() { + public List value() { return this.value; } @@ -37,7 +62,7 @@ public List value() { * @param value the value value to set. * @return the UsageListResultInner object itself. */ - public UsageListResultInner withValue(List value) { + public UsageListResultInner withValue(List value) { this.value = value; return this; } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountModelImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountModelImpl.java index 77fb249973be..e8f68610b5ea 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountModelImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountModelImpl.java @@ -11,7 +11,9 @@ 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.ModelSku; import java.util.Collections; +import java.util.List; import java.util.Map; public final class AccountModelImpl implements AccountModel { @@ -38,6 +40,10 @@ public String version() { return this.innerModel().version(); } + public String source() { + return this.innerModel().source(); + } + public CallRateLimit callRateLimit() { return this.innerModel().callRateLimit(); } @@ -46,6 +52,19 @@ public DeploymentModel baseModel() { return this.innerModel().baseModel(); } + public Boolean isDefaultVersion() { + return this.innerModel().isDefaultVersion(); + } + + public List skus() { + List inner = this.innerModel().skus(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + public Integer maxCapacity() { return this.innerModel().maxCapacity(); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountsClientImpl.java index 7d4dfb4ead58..2c984106f00c 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountsClientImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountsClientImpl.java @@ -73,8 +73,7 @@ public final class AccountsClientImpl implements AccountsClient { public interface AccountsService { @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices" - + "/accounts/{accountName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}") @ExpectedResponses({200, 201, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> create( @@ -89,8 +88,7 @@ Mono>> create( @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices" - + "/accounts/{accountName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> update( @@ -105,8 +103,7 @@ Mono>> update( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices" - + "/accounts/{accountName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @@ -120,8 +117,7 @@ Mono>> delete( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices" - + "/accounts/{accountName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getByResourceGroup( @@ -135,8 +131,7 @@ Mono> getByResourceGroup( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices" - + "/accounts") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroup( @@ -160,8 +155,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices" - + "/accounts/{accountName}/listKeys") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/listKeys") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listKeys( @@ -175,8 +169,7 @@ Mono> listKeys( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices" - + "/accounts/{accountName}/regenerateKey") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/regenerateKey") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> regenerateKey( @@ -191,8 +184,7 @@ Mono> regenerateKey( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices" - + "/accounts/{accountName}/skus") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/skus") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listSkus( @@ -206,8 +198,7 @@ Mono> listSkus( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices" - + "/accounts/{accountName}/usages") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/usages") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listUsages( @@ -222,8 +213,7 @@ Mono> listUsages( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices" - + "/accounts/{accountName}/models") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/models") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listModels( 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 d7ee37809b2e..bb0b98ba47a6 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 @@ -28,11 +28,13 @@ import com.azure.resourcemanager.cognitiveservices.fluent.CommitmentTiersClient; import com.azure.resourcemanager.cognitiveservices.fluent.DeletedAccountsClient; import com.azure.resourcemanager.cognitiveservices.fluent.DeploymentsClient; +import com.azure.resourcemanager.cognitiveservices.fluent.ModelsClient; 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.ResourceProvidersClient; import com.azure.resourcemanager.cognitiveservices.fluent.ResourceSkusClient; +import com.azure.resourcemanager.cognitiveservices.fluent.UsagesClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -153,6 +155,18 @@ public ResourceSkusClient getResourceSkus() { return this.resourceSkus; } + /** The UsagesClient object to access its operations. */ + private final UsagesClient usages; + + /** + * Gets the UsagesClient object to access its operations. + * + * @return the UsagesClient object. + */ + public UsagesClient getUsages() { + return this.usages; + } + /** The OperationsClient object to access its operations. */ private final OperationsClient operations; @@ -189,6 +203,18 @@ public CommitmentTiersClient getCommitmentTiers() { return this.commitmentTiers; } + /** The ModelsClient object to access its operations. */ + private final ModelsClient models; + + /** + * Gets the ModelsClient object to access its operations. + * + * @return the ModelsClient object. + */ + public ModelsClient getModels() { + return this.models; + } + /** The PrivateEndpointConnectionsClient object to access its operations. */ private final PrivateEndpointConnectionsClient privateEndpointConnections; @@ -259,13 +285,15 @@ public CommitmentPlansClient getCommitmentPlans() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2022-12-01"; + this.apiVersion = "2023-05-01"; this.accounts = new AccountsClientImpl(this); this.deletedAccounts = new DeletedAccountsClientImpl(this); this.resourceSkus = new ResourceSkusClientImpl(this); + this.usages = new UsagesClientImpl(this); this.operations = new OperationsClientImpl(this); this.resourceProviders = new ResourceProvidersClientImpl(this); this.commitmentTiers = new CommitmentTiersClientImpl(this); + this.models = new ModelsClientImpl(this); this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); this.deployments = new DeploymentsClientImpl(this); diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlansClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlansClientImpl.java index 1af757384675..80b26894d827 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlansClientImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlansClientImpl.java @@ -70,8 +70,7 @@ public final class CommitmentPlansClientImpl implements CommitmentPlansClient { public interface CommitmentPlansService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices" - + "/accounts/{accountName}/commitmentPlans") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @@ -85,8 +84,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices" - + "/accounts/{accountName}/commitmentPlans/{commitmentPlanName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans/{commitmentPlanName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -101,8 +99,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices" - + "/accounts/{accountName}/commitmentPlans/{commitmentPlanName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans/{commitmentPlanName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> createOrUpdate( @@ -118,8 +115,7 @@ Mono> createOrUpdate( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices" - + "/accounts/{accountName}/commitmentPlans/{commitmentPlanName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans/{commitmentPlanName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @@ -134,8 +130,7 @@ Mono>> delete( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices" - + "/commitmentPlans/{commitmentPlanName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdatePlan( @@ -150,8 +145,7 @@ Mono>> createOrUpdatePlan( @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices" - + "/commitmentPlans/{commitmentPlanName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> updatePlan( @@ -166,8 +160,7 @@ Mono>> updatePlan( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices" - + "/commitmentPlans/{commitmentPlanName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> deletePlan( @@ -181,8 +174,7 @@ Mono>> deletePlan( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices" - + "/commitmentPlans/{commitmentPlanName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getByResourceGroup( @@ -196,8 +188,7 @@ Mono> getByResourceGroup( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices" - + "/commitmentPlans") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroup( @@ -221,8 +212,7 @@ Mono> listPlansBySubscription( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices" - + "/commitmentPlans/{commitmentPlanName}/accountAssociations") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}/accountAssociations") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listAssociations( @@ -236,8 +226,7 @@ Mono> listAssociations( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices" - + "/commitmentPlans/{commitmentPlanName}/accountAssociations/{commitmentPlanAssociationName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}/accountAssociations/{commitmentPlanAssociationName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getAssociation( @@ -252,8 +241,7 @@ Mono> getAssociation( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices" - + "/commitmentPlans/{commitmentPlanName}/accountAssociations/{commitmentPlanAssociationName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}/accountAssociations/{commitmentPlanAssociationName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdateAssociation( @@ -269,8 +257,7 @@ Mono>> createOrUpdateAssociation( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices" - + "/commitmentPlans/{commitmentPlanName}/accountAssociations/{commitmentPlanAssociationName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}/accountAssociations/{commitmentPlanAssociationName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> deleteAssociation( diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentTiersClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentTiersClientImpl.java index 45a1c9cc866b..1dfadad580bb 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentTiersClientImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentTiersClientImpl.java @@ -58,8 +58,7 @@ public final class CommitmentTiersClientImpl implements CommitmentTiersClient { public interface CommitmentTiersService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}" - + "/commitmentTiers") + "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/commitmentTiers") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeletedAccountsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeletedAccountsClientImpl.java index baaefb63b5bd..6c41a70f32aa 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeletedAccountsClientImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeletedAccountsClientImpl.java @@ -64,8 +64,7 @@ public final class DeletedAccountsClientImpl implements DeletedAccountsClient { public interface DeletedAccountsService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/resourceGroups" - + "/{resourceGroupName}/deletedAccounts/{accountName}") + "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/resourceGroups/{resourceGroupName}/deletedAccounts/{accountName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -80,8 +79,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/resourceGroups" - + "/{resourceGroupName}/deletedAccounts/{accountName}") + "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/resourceGroups/{resourceGroupName}/deletedAccounts/{accountName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> purge( diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeploymentImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeploymentImpl.java index e3cc0a84fdd2..6c22989cc0f5 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeploymentImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeploymentImpl.java @@ -9,6 +9,7 @@ import com.azure.resourcemanager.cognitiveservices.fluent.models.DeploymentInner; import com.azure.resourcemanager.cognitiveservices.models.Deployment; import com.azure.resourcemanager.cognitiveservices.models.DeploymentProperties; +import com.azure.resourcemanager.cognitiveservices.models.Sku; public final class DeploymentImpl implements Deployment, Deployment.Definition, Deployment.Update { private DeploymentInner innerObject; @@ -27,6 +28,10 @@ public String type() { return this.innerModel().type(); } + public Sku sku() { + return this.innerModel().sku(); + } + public SystemData systemData() { return this.innerModel().systemData(); } @@ -139,6 +144,11 @@ public Deployment refresh(Context context) { return this; } + public DeploymentImpl withSku(Sku sku) { + this.innerModel().withSku(sku); + return this; + } + public DeploymentImpl withProperties(DeploymentProperties properties) { this.innerModel().withProperties(properties); return this; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeploymentsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeploymentsClientImpl.java index d591608227ae..3a5da9f83ec1 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeploymentsClientImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeploymentsClientImpl.java @@ -66,8 +66,7 @@ public final class DeploymentsClientImpl implements DeploymentsClient { public interface DeploymentsService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices" - + "/accounts/{accountName}/deployments") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @@ -81,8 +80,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices" - + "/accounts/{accountName}/deployments/{deploymentName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -97,8 +95,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices" - + "/accounts/{accountName}/deployments/{deploymentName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdate( @@ -114,8 +111,7 @@ Mono>> createOrUpdate( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices" - + "/accounts/{accountName}/deployments/{deploymentName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelImpl.java new file mode 100644 index 000000000000..f285b8296b24 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelImpl.java @@ -0,0 +1,47 @@ +// 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.resourcemanager.cognitiveservices.fluent.models.AccountModelInner; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ModelInner; +import com.azure.resourcemanager.cognitiveservices.models.AccountModel; +import com.azure.resourcemanager.cognitiveservices.models.Model; + +public final class ModelImpl implements Model { + private ModelInner innerObject; + + private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; + + ModelImpl( + ModelInner innerObject, com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public AccountModel model() { + AccountModelInner inner = this.innerModel().model(); + if (inner != null) { + return new AccountModelImpl(inner, this.manager()); + } else { + return null; + } + } + + public String kind() { + return this.innerModel().kind(); + } + + public String skuName() { + return this.innerModel().skuName(); + } + + public ModelInner innerModel() { + return this.innerObject; + } + + 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/ModelsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelsClientImpl.java new file mode 100644 index 000000000000..f9162cca26ff --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelsClientImpl.java @@ -0,0 +1,314 @@ +// 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.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.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.ModelsClient; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ModelInner; +import com.azure.resourcemanager.cognitiveservices.models.ModelListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ModelsClient. */ +public final class ModelsClientImpl implements ModelsClient { + /** The proxy service used to perform REST calls. */ + private final ModelsService service; + + /** The service client containing this operation class. */ + private final CognitiveServicesManagementClientImpl client; + + /** + * Initializes an instance of ModelsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelsClientImpl(CognitiveServicesManagementClientImpl client) { + this.service = RestProxy.create(ModelsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CognitiveServicesManagementClientModels to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CognitiveServicesMan") + public interface ModelsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/models") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("location") String location, + @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); + } + + /** + * List Models. + * + * @param location Resource location. + * @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 models along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String location) { + 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + location, + 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())); + } + + /** + * List Models. + * + * @param location Resource location. + * @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 models along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String location, 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location 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(), + this.client.getApiVersion(), + location, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List Models. + * + * @param location Resource location. + * @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 models as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location) { + return new PagedFlux<>(() -> listSinglePageAsync(location), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List Models. + * + * @param location Resource location. + * @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 models as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(location, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List Models. + * + * @param location Resource location. + * @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 models as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location) { + return new PagedIterable<>(listAsync(location)); + } + + /** + * List Models. + * + * @param location Resource location. + * @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 models as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location, Context context) { + return new PagedIterable<>(listAsync(location, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 models 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 + *

The nextLink parameter. + * @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 models 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/ModelsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelsImpl.java new file mode 100644 index 000000000000..35b3a5f0e6bf --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelsImpl.java @@ -0,0 +1,45 @@ +// 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.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cognitiveservices.fluent.ModelsClient; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ModelInner; +import com.azure.resourcemanager.cognitiveservices.models.Model; +import com.azure.resourcemanager.cognitiveservices.models.Models; + +public final class ModelsImpl implements Models { + private static final ClientLogger LOGGER = new ClientLogger(ModelsImpl.class); + + private final ModelsClient innerClient; + + private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; + + public ModelsImpl( + ModelsClient innerClient, com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String location) { + PagedIterable inner = this.serviceClient().list(location); + return Utils.mapPage(inner, inner1 -> new ModelImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, Context context) { + PagedIterable inner = this.serviceClient().list(location, context); + return Utils.mapPage(inner, inner1 -> new ModelImpl(inner1, this.manager())); + } + + private ModelsClient 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/PrivateEndpointConnectionsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateEndpointConnectionsClientImpl.java index e190579507c7..ce7ef1ebb930 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateEndpointConnectionsClientImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateEndpointConnectionsClientImpl.java @@ -64,8 +64,7 @@ public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpoi public interface PrivateEndpointConnectionsService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices" - + "/accounts/{accountName}/privateEndpointConnections") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @@ -79,8 +78,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices" - + "/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -95,8 +93,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices" - + "/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdate( @@ -112,8 +109,7 @@ Mono>> createOrUpdate( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices" - + "/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateLinkResourcesClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateLinkResourcesClientImpl.java index 0d17e38b57e3..d306da27ec5c 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateLinkResourcesClientImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateLinkResourcesClientImpl.java @@ -54,8 +54,7 @@ public final class PrivateLinkResourcesClientImpl implements PrivateLinkResource public interface PrivateLinkResourcesService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices" - + "/accounts/{accountName}/privateLinkResources") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateLinkResources") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceProvidersClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceProvidersClientImpl.java index d40e561687b4..5b3cd8270628 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceProvidersClientImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceProvidersClientImpl.java @@ -57,8 +57,7 @@ public final class ResourceProvidersClientImpl implements ResourceProvidersClien public interface ResourceProvidersService { @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}" - + "/checkSkuAvailability") + "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/checkSkuAvailability") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> checkSkuAvailability( diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsageImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsageImpl.java new file mode 100644 index 000000000000..e6ee1607b7f8 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsageImpl.java @@ -0,0 +1,59 @@ +// 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.resourcemanager.cognitiveservices.fluent.models.UsageInner; +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; + +public final class UsageImpl implements Usage { + private UsageInner innerObject; + + private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; + + UsageImpl( + UsageInner innerObject, com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public UnitType unit() { + return this.innerModel().unit(); + } + + public MetricName name() { + return this.innerModel().name(); + } + + public String quotaPeriod() { + return this.innerModel().quotaPeriod(); + } + + public Double limit() { + return this.innerModel().limit(); + } + + public Double currentValue() { + return this.innerModel().currentValue(); + } + + public String nextResetTime() { + return this.innerModel().nextResetTime(); + } + + public QuotaUsageStatus status() { + return this.innerModel().status(); + } + + public UsageInner innerModel() { + return this.innerObject; + } + + 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/UsageListResultImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsageListResultImpl.java index 51d53c5db850..f9ee874092bb 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsageListResultImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsageListResultImpl.java @@ -4,11 +4,13 @@ package com.azure.resourcemanager.cognitiveservices.implementation; +import com.azure.resourcemanager.cognitiveservices.fluent.models.UsageInner; import com.azure.resourcemanager.cognitiveservices.fluent.models.UsageListResultInner; import com.azure.resourcemanager.cognitiveservices.models.Usage; import com.azure.resourcemanager.cognitiveservices.models.UsageListResult; import java.util.Collections; import java.util.List; +import java.util.stream.Collectors; public final class UsageListResultImpl implements UsageListResult { private UsageListResultInner innerObject; @@ -22,10 +24,16 @@ public final class UsageListResultImpl implements UsageListResult { this.serviceManager = serviceManager; } + public String nextLink() { + return this.innerModel().nextLink(); + } + public List value() { - List inner = this.innerModel().value(); + List inner = this.innerModel().value(); if (inner != null) { - return Collections.unmodifiableList(inner); + return Collections + .unmodifiableList( + inner.stream().map(inner1 -> new UsageImpl(inner1, this.manager())).collect(Collectors.toList())); } else { return Collections.emptyList(); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsagesClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsagesClientImpl.java new file mode 100644 index 000000000000..bdd35fc3e400 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsagesClientImpl.java @@ -0,0 +1,346 @@ +// 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.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.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.UsagesClient; +import com.azure.resourcemanager.cognitiveservices.fluent.models.UsageInner; +import com.azure.resourcemanager.cognitiveservices.fluent.models.UsageListResultInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in UsagesClient. */ +public final class UsagesClientImpl implements UsagesClient { + /** The proxy service used to perform REST calls. */ + private final UsagesService service; + + /** The service client containing this operation class. */ + private final CognitiveServicesManagementClientImpl client; + + /** + * Initializes an instance of UsagesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + UsagesClientImpl(CognitiveServicesManagementClientImpl client) { + this.service = RestProxy.create(UsagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CognitiveServicesManagementClientUsages to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "CognitiveServicesMan") + public interface UsagesService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/usages") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("location") String location, + @QueryParam("$filter") String filter, + @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); + } + + /** + * Get usages for the requested subscription. + * + * @param location Resource location. + * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is + * name.value (name of the metric, can have an or of multiple names). + * @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 usages for the requested subscription along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String location, String filter) { + 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + location, + filter, + 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 usages for the requested subscription. + * + * @param location Resource location. + * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is + * name.value (name of the metric, can have an or of multiple names). + * @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 usages for the requested subscription along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String location, String filter, 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location 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(), + this.client.getApiVersion(), + location, + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get usages for the requested subscription. + * + * @param location Resource location. + * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is + * name.value (name of the metric, can have an or of multiple names). + * @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 usages for the requested subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location, String filter) { + return new PagedFlux<>( + () -> listSinglePageAsync(location, filter), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get usages for the requested subscription. + * + * @param location Resource location. + * @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 usages for the requested subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location) { + final String filter = null; + return new PagedFlux<>( + () -> listSinglePageAsync(location, filter), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get usages for the requested subscription. + * + * @param location Resource location. + * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is + * name.value (name of the metric, can have an or of multiple names). + * @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 usages for the requested subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location, String filter, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(location, filter, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get usages for the requested subscription. + * + * @param location Resource location. + * @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 usages for the requested subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location) { + final String filter = null; + return new PagedIterable<>(listAsync(location, filter)); + } + + /** + * Get usages for the requested subscription. + * + * @param location Resource location. + * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is + * name.value (name of the metric, can have an or of multiple names). + * @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 usages for the requested subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location, String filter, Context context) { + return new PagedIterable<>(listAsync(location, filter, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 to a list usage request 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 + *

The nextLink parameter. + * @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 to a list usage request 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/UsagesImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsagesImpl.java new file mode 100644 index 000000000000..2a9a9a32c86a --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsagesImpl.java @@ -0,0 +1,45 @@ +// 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.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cognitiveservices.fluent.UsagesClient; +import com.azure.resourcemanager.cognitiveservices.fluent.models.UsageInner; +import com.azure.resourcemanager.cognitiveservices.models.Usage; +import com.azure.resourcemanager.cognitiveservices.models.Usages; + +public final class UsagesImpl implements Usages { + private static final ClientLogger LOGGER = new ClientLogger(UsagesImpl.class); + + private final UsagesClient innerClient; + + private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; + + public UsagesImpl( + UsagesClient innerClient, com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String location) { + PagedIterable inner = this.serviceClient().list(location); + return Utils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, String filter, Context context) { + PagedIterable inner = this.serviceClient().list(location, filter, context); + return Utils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); + } + + private UsagesClient 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/models/AbusePenalty.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AbusePenalty.java new file mode 100644 index 000000000000..d4fc44d25ee6 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AbusePenalty.java @@ -0,0 +1,103 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The abuse penalty. */ +@Fluent +public final class AbusePenalty { + /* + * The action of AbusePenalty. + */ + @JsonProperty(value = "action") + private AbusePenaltyAction action; + + /* + * The percentage of rate limit. + */ + @JsonProperty(value = "rateLimitPercentage") + private Float rateLimitPercentage; + + /* + * The datetime of expiration of the AbusePenalty. + */ + @JsonProperty(value = "expiration") + private OffsetDateTime expiration; + + /** Creates an instance of AbusePenalty class. */ + public AbusePenalty() { + } + + /** + * Get the action property: The action of AbusePenalty. + * + * @return the action value. + */ + public AbusePenaltyAction action() { + return this.action; + } + + /** + * Set the action property: The action of AbusePenalty. + * + * @param action the action value to set. + * @return the AbusePenalty object itself. + */ + public AbusePenalty withAction(AbusePenaltyAction action) { + this.action = action; + return this; + } + + /** + * Get the rateLimitPercentage property: The percentage of rate limit. + * + * @return the rateLimitPercentage value. + */ + public Float rateLimitPercentage() { + return this.rateLimitPercentage; + } + + /** + * Set the rateLimitPercentage property: The percentage of rate limit. + * + * @param rateLimitPercentage the rateLimitPercentage value to set. + * @return the AbusePenalty object itself. + */ + public AbusePenalty withRateLimitPercentage(Float rateLimitPercentage) { + this.rateLimitPercentage = rateLimitPercentage; + return this; + } + + /** + * Get the expiration property: The datetime of expiration of the AbusePenalty. + * + * @return the expiration value. + */ + public OffsetDateTime expiration() { + return this.expiration; + } + + /** + * Set the expiration property: The datetime of expiration of the AbusePenalty. + * + * @param expiration the expiration value to set. + * @return the AbusePenalty object itself. + */ + public AbusePenalty withExpiration(OffsetDateTime expiration) { + this.expiration = expiration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AbusePenaltyAction.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AbusePenaltyAction.java new file mode 100644 index 000000000000..1be50e4dfd4c --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AbusePenaltyAction.java @@ -0,0 +1,47 @@ +// 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 com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The action of AbusePenalty. */ +public final class AbusePenaltyAction extends ExpandableStringEnum { + /** Static value Throttle for AbusePenaltyAction. */ + public static final AbusePenaltyAction THROTTLE = fromString("Throttle"); + + /** Static value Block for AbusePenaltyAction. */ + public static final AbusePenaltyAction BLOCK = fromString("Block"); + + /** + * Creates a new instance of AbusePenaltyAction value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AbusePenaltyAction() { + } + + /** + * Creates or finds a AbusePenaltyAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding AbusePenaltyAction. + */ + @JsonCreator + public static AbusePenaltyAction fromString(String name) { + return fromString(name, AbusePenaltyAction.class); + } + + /** + * Gets known AbusePenaltyAction values. + * + * @return known AbusePenaltyAction values. + */ + public static Collection values() { + return values(AbusePenaltyAction.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountModel.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountModel.java index 4d3314b5778d..abd18c8a4bf1 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountModel.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountModel.java @@ -6,6 +6,7 @@ import com.azure.core.management.SystemData; import com.azure.resourcemanager.cognitiveservices.fluent.models.AccountModelInner; +import java.util.List; import java.util.Map; /** An immutable client-side representation of AccountModel. */ @@ -25,12 +26,21 @@ public interface AccountModel { String name(); /** - * Gets the version property: Deployment model version. + * Gets the version property: Optional. Deployment model version. If version is not specified, a default version + * will be assigned. The default version is different for different models and might change when there is new + * version available for a model. Default version for a model could be found from list models API. * * @return the version value. */ String version(); + /** + * Gets the source property: Optional. Deployment model source ARM resource ID. + * + * @return the source value. + */ + String source(); + /** * Gets the callRateLimit property: The call rate limit Cognitive Services account. * @@ -45,6 +55,20 @@ public interface AccountModel { */ DeploymentModel baseModel(); + /** + * Gets the isDefaultVersion property: If the model is default version. + * + * @return the isDefaultVersion value. + */ + Boolean isDefaultVersion(); + + /** + * Gets the skus property: The list of Model Sku. + * + * @return the skus value. + */ + List skus(); + /** * Gets the maxCapacity property: The max capacity. * 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 0ebeb26ab1a2..e0f633051923 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 @@ -178,6 +178,12 @@ public final class AccountProperties { @JsonProperty(value = "commitmentPlanAssociations", access = JsonProperty.Access.WRITE_ONLY) private List commitmentPlanAssociations; + /* + * The abuse penalty. + */ + @JsonProperty(value = "abusePenalty", access = JsonProperty.Access.WRITE_ONLY) + private AbusePenalty abusePenalty; + /** Creates an instance of AccountProperties class. */ public AccountProperties() { } @@ -571,6 +577,15 @@ public List commitmentPlanAssociations() { return this.commitmentPlanAssociations; } + /** + * Get the abusePenalty property: The abuse penalty. + * + * @return the abusePenalty value. + */ + public AbusePenalty abusePenalty() { + return this.abusePenalty; + } + /** * Validates the instance. * @@ -610,5 +625,8 @@ public void validate() { if (commitmentPlanAssociations() != null) { commitmentPlanAssociations().forEach(e -> e.validate()); } + if (abusePenalty() != null) { + abusePenalty().validate(); + } } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapacityConfig.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapacityConfig.java new file mode 100644 index 000000000000..d77f5466213e --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapacityConfig.java @@ -0,0 +1,128 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** The capacity configuration. */ +@Fluent +public final class CapacityConfig { + /* + * The minimum capacity. + */ + @JsonProperty(value = "minimum") + private Integer minimum; + + /* + * The maximum capacity. + */ + @JsonProperty(value = "maximum") + private Integer maximum; + + /* + * The minimal incremental between allowed values for capacity. + */ + @JsonProperty(value = "step") + private Integer step; + + /* + * The default capacity. + */ + @JsonProperty(value = "default") + private Integer defaultProperty; + + /** Creates an instance of CapacityConfig class. */ + public CapacityConfig() { + } + + /** + * Get the minimum property: The minimum capacity. + * + * @return the minimum value. + */ + public Integer minimum() { + return this.minimum; + } + + /** + * Set the minimum property: The minimum capacity. + * + * @param minimum the minimum value to set. + * @return the CapacityConfig object itself. + */ + public CapacityConfig withMinimum(Integer minimum) { + this.minimum = minimum; + return this; + } + + /** + * Get the maximum property: The maximum capacity. + * + * @return the maximum value. + */ + public Integer maximum() { + return this.maximum; + } + + /** + * Set the maximum property: The maximum capacity. + * + * @param maximum the maximum value to set. + * @return the CapacityConfig object itself. + */ + public CapacityConfig withMaximum(Integer maximum) { + this.maximum = maximum; + return this; + } + + /** + * Get the step property: The minimal incremental between allowed values for capacity. + * + * @return the step value. + */ + public Integer step() { + return this.step; + } + + /** + * Set the step property: The minimal incremental between allowed values for capacity. + * + * @param step the step value to set. + * @return the CapacityConfig object itself. + */ + public CapacityConfig withStep(Integer step) { + this.step = step; + return this; + } + + /** + * Get the defaultProperty property: The default capacity. + * + * @return the defaultProperty value. + */ + public Integer defaultProperty() { + return this.defaultProperty; + } + + /** + * Set the defaultProperty property: The default capacity. + * + * @param defaultProperty the defaultProperty value to set. + * @return the CapacityConfig object itself. + */ + public CapacityConfig withDefaultProperty(Integer defaultProperty) { + this.defaultProperty = defaultProperty; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanProperties.java index 33502bed63d0..5883090ed2ea 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanProperties.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanProperties.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; /** Properties of Cognitive Services account commitment plan. */ @Fluent @@ -58,6 +59,12 @@ public final class CommitmentPlanProperties { @JsonProperty(value = "last", access = JsonProperty.Access.WRITE_ONLY) private CommitmentPeriod last; + /* + * The list of ProvisioningIssue. + */ + @JsonProperty(value = "provisioningIssues", access = JsonProperty.Access.WRITE_ONLY) + private List provisioningIssues; + /** Creates an instance of CommitmentPlanProperties class. */ public CommitmentPlanProperties() { } @@ -200,6 +207,15 @@ public CommitmentPeriod last() { return this.last; } + /** + * Get the provisioningIssues property: The list of ProvisioningIssue. + * + * @return the provisioningIssues value. + */ + public List provisioningIssues() { + return this.provisioningIssues; + } + /** * Validates the instance. * diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Deployment.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Deployment.java index f560fbd3a972..9c4e5dbf367c 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Deployment.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Deployment.java @@ -31,6 +31,13 @@ public interface Deployment { */ String type(); + /** + * Gets the sku property: The resource model definition representing SKU. + * + * @return the sku value. + */ + Sku sku(); + /** * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. * @@ -90,7 +97,7 @@ interface WithParentResource { * The stage of the Deployment 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.WithProperties { + interface WithCreate extends DefinitionStages.WithSku, DefinitionStages.WithProperties { /** * Executes the create request. * @@ -106,6 +113,16 @@ interface WithCreate extends DefinitionStages.WithProperties { */ Deployment create(Context context); } + /** The stage of the Deployment definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The resource model definition representing SKU. + * + * @param sku The resource model definition representing SKU. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } /** The stage of the Deployment definition allowing to specify properties. */ interface WithProperties { /** @@ -125,7 +142,7 @@ interface WithProperties { Deployment.Update update(); /** The template for Deployment update. */ - interface Update extends UpdateStages.WithProperties { + interface Update extends UpdateStages.WithSku, UpdateStages.WithProperties { /** * Executes the update request. * @@ -143,6 +160,16 @@ interface Update extends UpdateStages.WithProperties { } /** The Deployment update stages. */ interface UpdateStages { + /** The stage of the Deployment update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The resource model definition representing SKU. + * + * @param sku The resource model definition representing SKU. + * @return the next definition stage. + */ + Update withSku(Sku sku); + } /** The stage of the Deployment update allowing to specify properties. */ interface WithProperties { /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentModel.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentModel.java index e462190b7b52..e1a27bdefa27 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentModel.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentModel.java @@ -23,11 +23,19 @@ public class DeploymentModel { private String name; /* - * Deployment model version. + * Optional. Deployment model version. If version is not specified, a default version will be assigned. The default + * version is different for different models and might change when there is new version available for a model. + * Default version for a model could be found from list models API. */ @JsonProperty(value = "version") private String version; + /* + * Optional. Deployment model source ARM resource ID. + */ + @JsonProperty(value = "source") + private String source; + /* * The call rate limit Cognitive Services account. */ @@ -79,7 +87,9 @@ public DeploymentModel withName(String name) { } /** - * Get the version property: Deployment model version. + * Get the version property: Optional. Deployment model version. If version is not specified, a default version will + * be assigned. The default version is different for different models and might change when there is new version + * available for a model. Default version for a model could be found from list models API. * * @return the version value. */ @@ -88,7 +98,9 @@ public String version() { } /** - * Set the version property: Deployment model version. + * Set the version property: Optional. Deployment model version. If version is not specified, a default version will + * be assigned. The default version is different for different models and might change when there is new version + * available for a model. Default version for a model could be found from list models API. * * @param version the version value to set. * @return the DeploymentModel object itself. @@ -98,6 +110,26 @@ public DeploymentModel withVersion(String version) { return this; } + /** + * Get the source property: Optional. Deployment model source ARM resource ID. + * + * @return the source value. + */ + public String source() { + return this.source; + } + + /** + * Set the source property: Optional. Deployment model source ARM resource ID. + * + * @param source the source value to set. + * @return the DeploymentModel object itself. + */ + public DeploymentModel withSource(String source) { + this.source = source; + return this; + } + /** * Get the callRateLimit property: The call rate limit Cognitive Services account. * diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentModelVersionUpgradeOption.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentModelVersionUpgradeOption.java new file mode 100644 index 000000000000..77244ad1e046 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentModelVersionUpgradeOption.java @@ -0,0 +1,53 @@ +// 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 com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Deployment model version upgrade option. */ +public final class DeploymentModelVersionUpgradeOption + extends ExpandableStringEnum { + /** Static value OnceNewDefaultVersionAvailable for DeploymentModelVersionUpgradeOption. */ + public static final DeploymentModelVersionUpgradeOption ONCE_NEW_DEFAULT_VERSION_AVAILABLE = + fromString("OnceNewDefaultVersionAvailable"); + + /** Static value OnceCurrentVersionExpired for DeploymentModelVersionUpgradeOption. */ + public static final DeploymentModelVersionUpgradeOption ONCE_CURRENT_VERSION_EXPIRED = + fromString("OnceCurrentVersionExpired"); + + /** Static value NoAutoUpgrade for DeploymentModelVersionUpgradeOption. */ + public static final DeploymentModelVersionUpgradeOption NO_AUTO_UPGRADE = fromString("NoAutoUpgrade"); + + /** + * Creates a new instance of DeploymentModelVersionUpgradeOption value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DeploymentModelVersionUpgradeOption() { + } + + /** + * Creates or finds a DeploymentModelVersionUpgradeOption from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeploymentModelVersionUpgradeOption. + */ + @JsonCreator + public static DeploymentModelVersionUpgradeOption fromString(String name) { + return fromString(name, DeploymentModelVersionUpgradeOption.class); + } + + /** + * Gets known DeploymentModelVersionUpgradeOption values. + * + * @return known DeploymentModelVersionUpgradeOption values. + */ + public static Collection values() { + return values(DeploymentModelVersionUpgradeOption.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentProperties.java index be4d07c30917..d788b7cf87eb 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentProperties.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentProperties.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; import java.util.Map; /** Properties of Cognitive Services account deployment. */ @@ -49,6 +50,18 @@ public final class DeploymentProperties { @JsonProperty(value = "callRateLimit", access = JsonProperty.Access.WRITE_ONLY) private CallRateLimit callRateLimit; + /* + * The rateLimits property. + */ + @JsonProperty(value = "rateLimits", access = JsonProperty.Access.WRITE_ONLY) + private List rateLimits; + + /* + * Deployment model version upgrade option. + */ + @JsonProperty(value = "versionUpgradeOption") + private DeploymentModelVersionUpgradeOption versionUpgradeOption; + /** Creates an instance of DeploymentProperties class. */ public DeploymentProperties() { } @@ -140,6 +153,35 @@ public CallRateLimit callRateLimit() { return this.callRateLimit; } + /** + * Get the rateLimits property: The rateLimits property. + * + * @return the rateLimits value. + */ + public List rateLimits() { + return this.rateLimits; + } + + /** + * Get the versionUpgradeOption property: Deployment model version upgrade option. + * + * @return the versionUpgradeOption value. + */ + public DeploymentModelVersionUpgradeOption versionUpgradeOption() { + return this.versionUpgradeOption; + } + + /** + * Set the versionUpgradeOption property: Deployment model version upgrade option. + * + * @param versionUpgradeOption the versionUpgradeOption value to set. + * @return the DeploymentProperties object itself. + */ + public DeploymentProperties withVersionUpgradeOption(DeploymentModelVersionUpgradeOption versionUpgradeOption) { + this.versionUpgradeOption = versionUpgradeOption; + return this; + } + /** * Validates the instance. * @@ -155,5 +197,8 @@ public void validate() { if (callRateLimit() != null) { callRateLimit().validate(); } + if (rateLimits() != null) { + rateLimits().forEach(e -> e.validate()); + } } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentProvisioningState.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentProvisioningState.java index a52509f3a509..aeef88f401d5 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentProvisioningState.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentProvisioningState.java @@ -28,6 +28,12 @@ public final class DeploymentProvisioningState extends ExpandableStringEnum { /** Static value DisconnectedContainer for HostingModel. */ public static final HostingModel DISCONNECTED_CONTAINER = fromString("DisconnectedContainer"); + /** Static value ProvisionedWeb for HostingModel. */ + public static final HostingModel PROVISIONED_WEB = fromString("ProvisionedWeb"); + /** * Creates a new instance of HostingModel value. * diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Identity.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Identity.java index 5f099c281fd7..f9fccaa5ddfa 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Identity.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Identity.java @@ -11,7 +11,7 @@ /** Identity for the resource. */ @Fluent -public class Identity { +public final class Identity { /* * The identity type. */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Model.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Model.java new file mode 100644 index 000000000000..970a7006547b --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Model.java @@ -0,0 +1,38 @@ +// 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.resourcemanager.cognitiveservices.fluent.models.ModelInner; + +/** An immutable client-side representation of Model. */ +public interface Model { + /** + * Gets the model property: Model Metadata. + * + * @return the model value. + */ + AccountModel model(); + + /** + * Gets the kind property: The Kind of the Model. + * + * @return the kind value. + */ + String kind(); + + /** + * Gets the skuName property: The SKU of the Model. + * + * @return the skuName value. + */ + String skuName(); + + /** + * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.ModelInner object. + * + * @return the inner object. + */ + ModelInner innerModel(); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelListResult.java new file mode 100644 index 000000000000..89f942ea64c8 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelListResult.java @@ -0,0 +1,81 @@ +// 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.resourcemanager.cognitiveservices.fluent.models.ModelInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of cognitive services models. */ +@Fluent +public final class ModelListResult { + /* + * The link used to get the next page of Model. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * Gets the list of Cognitive Services accounts Model and their properties. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of ModelListResult class. */ + public ModelListResult() { + } + + /** + * Get the nextLink property: The link used to get the next page of Model. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link used to get the next page of Model. + * + * @param nextLink the nextLink value to set. + * @return the ModelListResult object itself. + */ + public ModelListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: Gets the list of Cognitive Services accounts Model and their properties. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets the list of Cognitive Services accounts Model and their properties. + * + * @param value the value value to set. + * @return the ModelListResult object itself. + */ + public ModelListResult 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()); + } + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelSku.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelSku.java new file mode 100644 index 000000000000..05284d0547f3 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelSku.java @@ -0,0 +1,162 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Describes an available Cognitive Services Model SKU. */ +@Fluent +public final class ModelSku { + /* + * The name of the model SKU. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The usage name of the model SKU. + */ + @JsonProperty(value = "usageName") + private String usageName; + + /* + * The datetime of deprecation of the model SKU. + */ + @JsonProperty(value = "deprecationDate") + private OffsetDateTime deprecationDate; + + /* + * The capacity configuration. + */ + @JsonProperty(value = "capacity") + private CapacityConfig capacity; + + /* + * The list of rateLimit. + */ + @JsonProperty(value = "rateLimits") + private List rateLimits; + + /** Creates an instance of ModelSku class. */ + public ModelSku() { + } + + /** + * Get the name property: The name of the model SKU. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the model SKU. + * + * @param name the name value to set. + * @return the ModelSku object itself. + */ + public ModelSku withName(String name) { + this.name = name; + return this; + } + + /** + * Get the usageName property: The usage name of the model SKU. + * + * @return the usageName value. + */ + public String usageName() { + return this.usageName; + } + + /** + * Set the usageName property: The usage name of the model SKU. + * + * @param usageName the usageName value to set. + * @return the ModelSku object itself. + */ + public ModelSku withUsageName(String usageName) { + this.usageName = usageName; + return this; + } + + /** + * Get the deprecationDate property: The datetime of deprecation of the model SKU. + * + * @return the deprecationDate value. + */ + public OffsetDateTime deprecationDate() { + return this.deprecationDate; + } + + /** + * Set the deprecationDate property: The datetime of deprecation of the model SKU. + * + * @param deprecationDate the deprecationDate value to set. + * @return the ModelSku object itself. + */ + public ModelSku withDeprecationDate(OffsetDateTime deprecationDate) { + this.deprecationDate = deprecationDate; + return this; + } + + /** + * Get the capacity property: The capacity configuration. + * + * @return the capacity value. + */ + public CapacityConfig capacity() { + return this.capacity; + } + + /** + * Set the capacity property: The capacity configuration. + * + * @param capacity the capacity value to set. + * @return the ModelSku object itself. + */ + public ModelSku withCapacity(CapacityConfig capacity) { + this.capacity = capacity; + return this; + } + + /** + * Get the rateLimits property: The list of rateLimit. + * + * @return the rateLimits value. + */ + public List rateLimits() { + return this.rateLimits; + } + + /** + * Set the rateLimits property: The list of rateLimit. + * + * @param rateLimits the rateLimits value to set. + * @return the ModelSku object itself. + */ + public ModelSku withRateLimits(List rateLimits) { + this.rateLimits = rateLimits; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (capacity() != null) { + capacity().validate(); + } + if (rateLimits() != null) { + rateLimits().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Models.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Models.java new file mode 100644 index 000000000000..2dc6aae5fc0b --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Models.java @@ -0,0 +1,34 @@ +// 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.util.Context; + +/** Resource collection API of Models. */ +public interface Models { + /** + * List Models. + * + * @param location Resource location. + * @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 models as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String location); + + /** + * List Models. + * + * @param location Resource location. + * @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 models as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String location, Context context); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Usage.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Usage.java index 124cd0687e81..ea430c774016 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Usage.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Usage.java @@ -4,206 +4,63 @@ package com.azure.resourcemanager.cognitiveservices.models; -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The usage data for a usage request. */ -@Fluent -public final class Usage { - /* - * The unit of the metric. - */ - @JsonProperty(value = "unit") - private UnitType unit; - - /* - * The name information for the metric. - */ - @JsonProperty(value = "name") - private MetricName name; - - /* - * The quota period used to summarize the usage values. - */ - @JsonProperty(value = "quotaPeriod") - private String quotaPeriod; - - /* - * Maximum value for this metric. - */ - @JsonProperty(value = "limit") - private Double limit; - - /* - * Current value for this metric. - */ - @JsonProperty(value = "currentValue") - private Double currentValue; - - /* - * Next reset time for current quota. - */ - @JsonProperty(value = "nextResetTime") - private String nextResetTime; - - /* - * Cognitive Services account quota usage status. - */ - @JsonProperty(value = "status") - private QuotaUsageStatus status; - - /** Creates an instance of Usage class. */ - public Usage() { - } +import com.azure.resourcemanager.cognitiveservices.fluent.models.UsageInner; +/** An immutable client-side representation of Usage. */ +public interface Usage { /** - * Get the unit property: The unit of the metric. + * Gets the unit property: The unit of the metric. * * @return the unit value. */ - public UnitType unit() { - return this.unit; - } + UnitType unit(); /** - * Set the unit property: The unit of the metric. - * - * @param unit the unit value to set. - * @return the Usage object itself. - */ - public Usage withUnit(UnitType unit) { - this.unit = unit; - return this; - } - - /** - * Get the name property: The name information for the metric. + * Gets the name property: The name information for the metric. * * @return the name value. */ - public MetricName name() { - return this.name; - } + MetricName name(); /** - * Set the name property: The name information for the metric. - * - * @param name the name value to set. - * @return the Usage object itself. - */ - public Usage withName(MetricName name) { - this.name = name; - return this; - } - - /** - * Get the quotaPeriod property: The quota period used to summarize the usage values. + * Gets the quotaPeriod property: The quota period used to summarize the usage values. * * @return the quotaPeriod value. */ - public String quotaPeriod() { - return this.quotaPeriod; - } - - /** - * Set the quotaPeriod property: The quota period used to summarize the usage values. - * - * @param quotaPeriod the quotaPeriod value to set. - * @return the Usage object itself. - */ - public Usage withQuotaPeriod(String quotaPeriod) { - this.quotaPeriod = quotaPeriod; - return this; - } + String quotaPeriod(); /** - * Get the limit property: Maximum value for this metric. + * Gets the limit property: Maximum value for this metric. * * @return the limit value. */ - public Double limit() { - return this.limit; - } + Double limit(); /** - * Set the limit property: Maximum value for this metric. - * - * @param limit the limit value to set. - * @return the Usage object itself. - */ - public Usage withLimit(Double limit) { - this.limit = limit; - return this; - } - - /** - * Get the currentValue property: Current value for this metric. + * Gets the currentValue property: Current value for this metric. * * @return the currentValue value. */ - public Double currentValue() { - return this.currentValue; - } + Double currentValue(); /** - * Set the currentValue property: Current value for this metric. - * - * @param currentValue the currentValue value to set. - * @return the Usage object itself. - */ - public Usage withCurrentValue(Double currentValue) { - this.currentValue = currentValue; - return this; - } - - /** - * Get the nextResetTime property: Next reset time for current quota. + * Gets the nextResetTime property: Next reset time for current quota. * * @return the nextResetTime value. */ - public String nextResetTime() { - return this.nextResetTime; - } - - /** - * Set the nextResetTime property: Next reset time for current quota. - * - * @param nextResetTime the nextResetTime value to set. - * @return the Usage object itself. - */ - public Usage withNextResetTime(String nextResetTime) { - this.nextResetTime = nextResetTime; - return this; - } + String nextResetTime(); /** - * Get the status property: Cognitive Services account quota usage status. + * Gets the status property: Cognitive Services account quota usage status. * * @return the status value. */ - public QuotaUsageStatus status() { - return this.status; - } - - /** - * Set the status property: Cognitive Services account quota usage status. - * - * @param status the status value to set. - * @return the Usage object itself. - */ - public Usage withStatus(QuotaUsageStatus status) { - this.status = status; - return this; - } + QuotaUsageStatus status(); /** - * Validates the instance. + * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.UsageInner object. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the inner object. */ - public void validate() { - if (name() != null) { - name().validate(); - } - } + UsageInner innerModel(); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UsageListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UsageListResult.java index 01ebde957a62..cc6dc0c75546 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UsageListResult.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UsageListResult.java @@ -9,6 +9,13 @@ /** An immutable client-side representation of UsageListResult. */ public interface UsageListResult { + /** + * Gets the nextLink property: The link used to get the next page of Usages. + * + * @return the nextLink value. + */ + String nextLink(); + /** * Gets the value property: The list of usages for Cognitive Service account. * diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Usages.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Usages.java new file mode 100644 index 000000000000..3b9f9f230f2a --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Usages.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.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Usages. */ +public interface Usages { + /** + * Get usages for the requested subscription. + * + * @param location Resource location. + * @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 usages for the requested subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String location); + + /** + * Get usages for the requested subscription. + * + * @param location Resource location. + * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is + * name.value (name of the metric, can have an or of multiple names). + * @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 usages for the requested subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String location, String filter, Context context); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UserAssignedIdentity.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UserAssignedIdentity.java index 742da13772a3..f92f143ff788 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UserAssignedIdentity.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UserAssignedIdentity.java @@ -9,7 +9,7 @@ /** User-assigned managed identity. */ @Immutable -public class UserAssignedIdentity { +public final class UserAssignedIdentity { /* * Azure Active Directory principal ID associated with this Identity. */ 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 fed45f0e4f7b..05ea0b9f1a19 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 @@ -17,7 +17,7 @@ /** Samples for Accounts Create. */ public final class AccountsCreateSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/CreateAccountMin.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/CreateAccountMin.json */ /** * Sample code: Create Account Min. @@ -38,7 +38,7 @@ public static void createAccountMin(com.azure.resourcemanager.cognitiveservices. } /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/CreateAccount.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/CreateAccount.json */ /** * Sample code: Create Account. 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 291ffe6a37d6..7a559de934f7 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 @@ -7,7 +7,7 @@ /** Samples for Accounts Delete. */ public final class AccountsDeleteSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/DeleteAccount.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/DeleteAccount.json */ /** * Sample code: Delete Account. 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 1f6311857f1b..989c3901628f 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 @@ -7,7 +7,7 @@ /** Samples for Accounts GetByResourceGroup. */ public final class AccountsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/GetAccount.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/GetAccount.json */ /** * Sample code: Get Account. 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 76e74d470950..115e54c3fde7 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 @@ -7,7 +7,7 @@ /** Samples for Accounts ListByResourceGroup. */ public final class AccountsListByResourceGroupSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/ListAccountsByResourceGroup.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/ListAccountsByResourceGroup.json */ /** * Sample code: List Accounts by Resource Group. 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 67bffb4c69cf..0aeaa4585d0e 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 @@ -7,7 +7,7 @@ /** Samples for Accounts ListKeys. */ public final class AccountsListKeysSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/ListKeys.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/ListKeys.json */ /** * Sample code: List Keys. 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 115a3ba6a058..ad675c5424b1 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 @@ -7,7 +7,7 @@ /** Samples for Accounts ListModels. */ public final class AccountsListModelsSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/ListAccountModels.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/ListAccountModels.json */ /** * Sample code: List AccountModels. 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 0753b4822d5e..f50a1efbc4d3 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 @@ -7,7 +7,7 @@ /** Samples for Accounts List. */ public final class AccountsListSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/ListAccountsBySubscription.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/ListAccountsBySubscription.json */ /** * Sample code: List Accounts by Subscription. 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 e8cdd4f3a681..1506bb9a5e64 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 @@ -7,7 +7,7 @@ /** Samples for Accounts ListSkus. */ public final class AccountsListSkusSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/ListSkus.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/ListSkus.json */ /** * Sample code: List SKUs. 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 ac137bc7def8..6dce61a3741c 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 @@ -7,7 +7,7 @@ /** Samples for Accounts ListUsages. */ public final class AccountsListUsagesSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/GetUsages.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/GetUsages.json */ /** * Sample code: Get Usages. 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 56b896935282..e91750cc2183 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 @@ -10,7 +10,7 @@ /** Samples for Accounts RegenerateKey. */ public final class AccountsRegenerateKeySamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/RegenerateKey.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/RegenerateKey.json */ /** * Sample code: Regenerate Keys. 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 b0d215815026..42d975a7d288 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 @@ -10,7 +10,7 @@ /** Samples for Accounts Update. */ public final class AccountsUpdateSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/UpdateAccount.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/UpdateAccount.json */ /** * Sample code: Update Account. 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 2216be556bb4..83591f0e4a43 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 @@ -7,7 +7,7 @@ /** Samples for CommitmentPlans CreateOrUpdateAssociation. */ public final class CommitmentPlansCreateOrUpdateAssociationSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/CreateSharedCommitmentPlanAssociation.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/CreateSharedCommitmentPlanAssociation.json */ /** * Sample code: PutCommitmentPlan. 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 97e4a464e7e9..555ef0758eb0 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 @@ -12,7 +12,7 @@ /** Samples for CommitmentPlans CreateOrUpdatePlan. */ public final class CommitmentPlansCreateOrUpdatePlanSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/CreateSharedCommitmentPlan.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/CreateSharedCommitmentPlan.json */ /** * Sample code: Create Commitment Plan. 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 73afeb79fe7a..caa171f19972 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 @@ -12,7 +12,7 @@ /** Samples for CommitmentPlans CreateOrUpdate. */ public final class CommitmentPlansCreateOrUpdateSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/PutCommitmentPlan.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/PutCommitmentPlan.json */ /** * Sample code: PutCommitmentPlan. 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 a4c46bc402da..1aed6139795d 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 @@ -7,7 +7,7 @@ /** Samples for CommitmentPlans DeleteAssociation. */ public final class CommitmentPlansDeleteAssociationSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/DeleteSharedCommitmentPlanAssociation.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/DeleteSharedCommitmentPlanAssociation.json */ /** * Sample code: DeleteCommitmentPlan. 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 355d1a47eb78..ab4fcd413747 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 @@ -7,7 +7,7 @@ /** Samples for CommitmentPlans DeletePlan. */ public final class CommitmentPlansDeletePlanSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/DeleteSharedCommitmentPlan.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/DeleteSharedCommitmentPlan.json */ /** * Sample code: Delete Commitment Plan. 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 cef83ccb162f..07da42a34271 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 @@ -7,7 +7,7 @@ /** Samples for CommitmentPlans Delete. */ public final class CommitmentPlansDeleteSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/DeleteCommitmentPlan.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/DeleteCommitmentPlan.json */ /** * Sample code: DeleteCommitmentPlan. 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 30587c0bce79..4d7f79e1c11c 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 @@ -7,7 +7,7 @@ /** Samples for CommitmentPlans GetAssociation. */ public final class CommitmentPlansGetAssociationSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/GetSharedCommitmentPlanAssociation.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/GetSharedCommitmentPlanAssociation.json */ /** * Sample code: GetCommitmentPlan. 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 92b533afb509..e98fd45611fc 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 @@ -7,7 +7,7 @@ /** Samples for CommitmentPlans GetByResourceGroup. */ public final class CommitmentPlansGetByResourceGroupSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/GetSharedCommitmentPlan.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/GetSharedCommitmentPlan.json */ /** * Sample code: Get Commitment Plan. 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 2c8bd1999ee5..32406136d4ed 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 @@ -7,7 +7,7 @@ /** Samples for CommitmentPlans Get. */ public final class CommitmentPlansGetSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/GetCommitmentPlan.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/GetCommitmentPlan.json */ /** * Sample code: GetCommitmentPlan. 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 f0b4edecdd46..edcb77141a00 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 @@ -7,7 +7,7 @@ /** Samples for CommitmentPlans ListAssociations. */ public final class CommitmentPlansListAssociationsSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/ListSharedCommitmentPlanAssociations.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/ListSharedCommitmentPlanAssociations.json */ /** * Sample code: ListCommitmentPlans. 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 7472a199bba0..d1739501916c 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 @@ -7,7 +7,7 @@ /** Samples for CommitmentPlans ListByResourceGroup. */ public final class CommitmentPlansListByResourceGroupSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/ListSharedCommitmentPlansByResourceGroup.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/ListSharedCommitmentPlansByResourceGroup.json */ /** * Sample code: List Commitment Plans by Resource Group. 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 382fa19a2219..3455a1440732 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 @@ -7,7 +7,7 @@ /** Samples for CommitmentPlans ListPlansBySubscription. */ public final class CommitmentPlansListPlansBySubscriptionSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/ListSharedCommitmentPlansBySubscription.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/ListSharedCommitmentPlansBySubscription.json */ /** * Sample code: List Accounts by Subscription. 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 b34f84fa457f..9025ef8c9cb3 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 @@ -7,7 +7,7 @@ /** Samples for CommitmentPlans List. */ public final class CommitmentPlansListSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/ListCommitmentPlans.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/ListCommitmentPlans.json */ /** * Sample code: ListCommitmentPlans. 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 525e7d1bec3f..c5061dc812b6 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 @@ -11,7 +11,7 @@ /** Samples for CommitmentPlans UpdatePlan. */ public final class CommitmentPlansUpdatePlanSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/UpdateSharedCommitmentPlan.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/UpdateSharedCommitmentPlan.json */ /** * Sample code: Create Commitment Plan. 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 56eaf06313f7..f143200f77eb 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 @@ -7,7 +7,7 @@ /** Samples for CommitmentTiers List. */ public final class CommitmentTiersListSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/ListCommitmentTiers.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/ListCommitmentTiers.json */ /** * Sample code: ListCommitmentTiers. 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 1a03e70175a0..d76dba061384 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 @@ -7,7 +7,7 @@ /** Samples for DeletedAccounts Get. */ public final class DeletedAccountsGetSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/GetDeletedAccount.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/GetDeletedAccount.json */ /** * Sample code: Get Account. 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 ec670275e889..ba46950ad365 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 @@ -7,7 +7,7 @@ /** Samples for DeletedAccounts List. */ public final class DeletedAccountsListSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/ListDeletedAccountsBySubscription.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/ListDeletedAccountsBySubscription.json */ /** * Sample code: List Deleted Accounts by Subscription. 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 73d12c47fd1e..914dada5552a 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 @@ -7,7 +7,7 @@ /** Samples for DeletedAccounts Purge. */ public final class DeletedAccountsPurgeSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/PurgeDeletedAccount.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/PurgeDeletedAccount.json */ /** * Sample code: Delete Account. 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 10995e624d7a..15413bab4c7e 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 @@ -12,7 +12,7 @@ /** Samples for Deployments CreateOrUpdate. */ public final class DeploymentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/PutDeployment.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/PutDeployment.json */ /** * Sample code: PutDeployment. 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 8f52635ae80d..d1365ae3ed17 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 @@ -7,7 +7,7 @@ /** Samples for Deployments Delete. */ public final class DeploymentsDeleteSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/DeleteDeployment.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/DeleteDeployment.json */ /** * Sample code: DeleteDeployment. 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 34bf913c3f9e..d300d44296f5 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 @@ -7,7 +7,7 @@ /** Samples for Deployments Get. */ public final class DeploymentsGetSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/GetDeployment.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/GetDeployment.json */ /** * Sample code: GetDeployment. 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 08a342ec2a1b..f30aa362d918 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 @@ -7,7 +7,7 @@ /** Samples for Deployments List. */ public final class DeploymentsListSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/ListDeployments.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/ListDeployments.json */ /** * Sample code: ListDeployments. 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 new file mode 100644 index 000000000000..799db3d5f5a7 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ModelsListSamples.java @@ -0,0 +1,20 @@ +// 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 Models List. */ +public final class ModelsListSamples { + /* + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/ListModels.json + */ + /** + * Sample code: ListModels. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void listModels(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.models().list("WestUS", com.azure.core.util.Context.NONE); + } +} 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 c2edf3c51a94..e0f7d0e943ca 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 @@ -7,7 +7,7 @@ /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/GetOperations.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/GetOperations.json */ /** * Sample code: Get Operations. 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 7029e663029e..69f3d1a135c4 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 @@ -11,7 +11,7 @@ /** Samples for PrivateEndpointConnections CreateOrUpdate. */ public final class PrivateEndpointConnectionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/PutPrivateEndpointConnection.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/PutPrivateEndpointConnection.json */ /** * Sample code: PutPrivateEndpointConnection. 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 36c1ee9a50da..443748725fbf 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 @@ -7,7 +7,7 @@ /** Samples for PrivateEndpointConnections Delete. */ public final class PrivateEndpointConnectionsDeleteSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/DeletePrivateEndpointConnection.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/DeletePrivateEndpointConnection.json */ /** * Sample code: DeletePrivateEndpointConnection. 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 517839061608..70bffb1e1e42 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 @@ -7,7 +7,7 @@ /** Samples for PrivateEndpointConnections Get. */ public final class PrivateEndpointConnectionsGetSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/GetPrivateEndpointConnection.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/GetPrivateEndpointConnection.json */ /** * Sample code: GetPrivateEndpointConnection. 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 834852ceec03..7c29a26082db 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 @@ -7,7 +7,7 @@ /** Samples for PrivateEndpointConnections List. */ public final class PrivateEndpointConnectionsListSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/ListPrivateEndpointConnections.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/ListPrivateEndpointConnections.json */ /** * Sample code: GetPrivateEndpointConnection. 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 e94ba4aaf3ca..851f2b7f79e2 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 @@ -7,7 +7,7 @@ /** Samples for PrivateLinkResources List. */ public final class PrivateLinkResourcesListSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/ListPrivateLinkResources.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/ListPrivateLinkResources.json */ /** * Sample code: ListPrivateLinkResources. 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 94c94e060b6f..b67bf80528bc 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 @@ -9,7 +9,7 @@ /** Samples for ResourceProvider CheckDomainAvailability. */ public final class ResourceProviderCheckDomainAvailabilitySamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/CheckDomainAvailability.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/CheckDomainAvailability.json */ /** * Sample code: Check SKU Availability. 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 2af1c375ea8a..360f6e4925be 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 @@ -10,7 +10,7 @@ /** Samples for ResourceProvider CheckSkuAvailability. */ public final class ResourceProviderCheckSkuAvailabilitySamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/CheckSkuAvailability.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/CheckSkuAvailability.json */ /** * Sample code: Check SKU Availability. 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 1cd9127a5e87..78e548eaa0e4 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 @@ -7,7 +7,7 @@ /** Samples for ResourceSkus List. */ public final class ResourceSkusListSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/GetSkus.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/GetSkus.json */ /** * Sample code: Regenerate Keys. 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 new file mode 100644 index 000000000000..281b7ed92920 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/UsagesListSamples.java @@ -0,0 +1,20 @@ +// 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 Usages List. */ +public final class UsagesListSamples { + /* + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2023-05-01/examples/ListUsages.json + */ + /** + * Sample code: Get Usages. + * + * @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); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountModelListResultTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountModelListResultTests.java deleted file mode 100644 index da6577e0f71f..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountModelListResultTests.java +++ /dev/null @@ -1,144 +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.models.AccountModelListResult; -import com.azure.resourcemanager.cognitiveservices.models.DeploymentModel; -import com.azure.resourcemanager.cognitiveservices.models.ModelDeprecationInfo; -import com.azure.resourcemanager.cognitiveservices.models.ModelLifecycleStatus; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class AccountModelListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AccountModelListResult model = - BinaryData - .fromString( - "{\"nextLink\":\"vxodpu\",\"value\":[{\"baseModel\":{\"format\":\"ydagfuaxbe\",\"name\":\"iu\",\"version\":\"ktwh\"},\"maxCapacity\":334875262,\"capabilities\":{\"xim\":\"wqsmbsur\",\"stkiiuxhqyud\":\"ryocfsfksymdd\",\"rq\":\"o\",\"oczvy\":\"b\"},\"finetuneCapabilities\":{\"vdfwatkpn\":\"rvkdvjsllrm\",\"wiqzbqjvsovmyo\":\"ulexxbczwtr\"},\"deprecation\":{\"fineTune\":\"spkwlhzdobpxjm\",\"inference\":\"bvvnchrkcciw\"},\"lifecycleStatus\":\"GenerallyAvailable\",\"format\":\"khrs\",\"name\":\"iwkuofos\",\"version\":\"hsauuimjmvxied\",\"callRateLimit\":{\"count\":93.76809,\"renewalPeriod\":14.127278,\"rules\":[]}},{\"baseModel\":{\"format\":\"f\",\"name\":\"aos\",\"version\":\"xc\"},\"maxCapacity\":771742090,\"capabilities\":{\"eggzfb\":\"hocohslkev\",\"ithlvmezyvshxm\":\"hfmvfaxkffe\",\"gigr\":\"sbbzo\"},\"finetuneCapabilities\":{\"jx\":\"ur\",\"koen\":\"jnspydp\",\"nvudwtiukb\":\"ou\"},\"deprecation\":{\"fineTune\":\"gkpocipazyxoe\",\"inference\":\"kgjn\"},\"lifecycleStatus\":\"Preview\",\"format\":\"ygevqzntypmrbpiz\",\"name\":\"r\",\"version\":\"sdpydnfyhxdeoejz\",\"callRateLimit\":{\"count\":90.01345,\"renewalPeriod\":67.792435,\"rules\":[]}},{\"baseModel\":{\"format\":\"gzfbishcbk\",\"name\":\"jdeyeamdpha\",\"version\":\"lpbuxwgipwhonowk\"},\"maxCapacity\":69341003,\"capabilities\":{\"bin\":\"kix\",\"iyqzrnk\":\"eputtmrywnuzoqf\",\"qnwvlrya\":\"qvyxlwhzlsicoho\"},\"finetuneCapabilities\":{\"mqhgyxzkonocuk\":\"heun\",\"szfkbe\":\"klyaxuconu\",\"jmwvvj\":\"pewr\"},\"deprecation\":{\"fineTune\":\"cxsenhwlrsff\",\"inference\":\"pwvlqdq\"},\"lifecycleStatus\":\"Preview\",\"format\":\"lihkaetcktvfc\",\"name\":\"fsnkymuctq\",\"version\":\"fbebrjcxer\",\"callRateLimit\":{\"count\":76.095024,\"renewalPeriod\":39.56957,\"rules\":[]}},{\"baseModel\":{\"format\":\"vjrbirphxepcyvah\",\"name\":\"ljkyqxjvuuj\",\"version\":\"idokgjlj\"},\"maxCapacity\":831407974,\"capabilities\":{\"szzhbijhtxfvgxbf\":\"ltbgsncghkj\",\"ec\":\"mxnehmp\",\"gr\":\"godebfqkkrbmpu\",\"ispnqzahmgkbrp\":\"wflzlfbxzpuzy\"},\"finetuneCapabilities\":{\"rgvtqag\":\"hibnuqqkpika\",\"bfs\":\"buynhijggm\"},\"deprecation\":{\"fineTune\":\"butr\",\"inference\":\"pnazzm\"},\"lifecycleStatus\":\"GenerallyAvailable\",\"format\":\"mpxttdbhrbnlankx\",\"name\":\"skpbhenbtkcxywn\",\"version\":\"nrs\",\"callRateLimit\":{\"count\":43.24222,\"renewalPeriod\":76.7722,\"rules\":[]}}]}") - .toObject(AccountModelListResult.class); - Assertions.assertEquals("vxodpu", model.nextLink()); - Assertions.assertEquals("khrs", model.value().get(0).format()); - Assertions.assertEquals("iwkuofos", model.value().get(0).name()); - Assertions.assertEquals("hsauuimjmvxied", model.value().get(0).version()); - Assertions.assertEquals("ydagfuaxbe", model.value().get(0).baseModel().format()); - Assertions.assertEquals("iu", model.value().get(0).baseModel().name()); - Assertions.assertEquals("ktwh", model.value().get(0).baseModel().version()); - Assertions.assertEquals(334875262, model.value().get(0).maxCapacity()); - Assertions.assertEquals("wqsmbsur", model.value().get(0).capabilities().get("xim")); - Assertions.assertEquals("rvkdvjsllrm", model.value().get(0).finetuneCapabilities().get("vdfwatkpn")); - Assertions.assertEquals("spkwlhzdobpxjm", model.value().get(0).deprecation().fineTune()); - Assertions.assertEquals("bvvnchrkcciw", model.value().get(0).deprecation().inference()); - Assertions.assertEquals(ModelLifecycleStatus.GENERALLY_AVAILABLE, model.value().get(0).lifecycleStatus()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AccountModelListResult model = - new AccountModelListResult() - .withNextLink("vxodpu") - .withValue( - Arrays - .asList( - new AccountModelInner() - .withFormat("khrs") - .withName("iwkuofos") - .withVersion("hsauuimjmvxied") - .withBaseModel( - new DeploymentModel().withFormat("ydagfuaxbe").withName("iu").withVersion("ktwh")) - .withMaxCapacity(334875262) - .withCapabilities( - mapOf("xim", "wqsmbsur", "stkiiuxhqyud", "ryocfsfksymdd", "rq", "o", "oczvy", "b")) - .withFinetuneCapabilities( - mapOf("vdfwatkpn", "rvkdvjsllrm", "wiqzbqjvsovmyo", "ulexxbczwtr")) - .withDeprecation( - new ModelDeprecationInfo() - .withFineTune("spkwlhzdobpxjm") - .withInference("bvvnchrkcciw")) - .withLifecycleStatus(ModelLifecycleStatus.GENERALLY_AVAILABLE), - new AccountModelInner() - .withFormat("ygevqzntypmrbpiz") - .withName("r") - .withVersion("sdpydnfyhxdeoejz") - .withBaseModel(new DeploymentModel().withFormat("f").withName("aos").withVersion("xc")) - .withMaxCapacity(771742090) - .withCapabilities( - mapOf("eggzfb", "hocohslkev", "ithlvmezyvshxm", "hfmvfaxkffe", "gigr", "sbbzo")) - .withFinetuneCapabilities(mapOf("jx", "ur", "koen", "jnspydp", "nvudwtiukb", "ou")) - .withDeprecation( - new ModelDeprecationInfo().withFineTune("gkpocipazyxoe").withInference("kgjn")) - .withLifecycleStatus(ModelLifecycleStatus.PREVIEW), - new AccountModelInner() - .withFormat("lihkaetcktvfc") - .withName("fsnkymuctq") - .withVersion("fbebrjcxer") - .withBaseModel( - new DeploymentModel() - .withFormat("gzfbishcbk") - .withName("jdeyeamdpha") - .withVersion("lpbuxwgipwhonowk")) - .withMaxCapacity(69341003) - .withCapabilities( - mapOf("bin", "kix", "iyqzrnk", "eputtmrywnuzoqf", "qnwvlrya", "qvyxlwhzlsicoho")) - .withFinetuneCapabilities( - mapOf("mqhgyxzkonocuk", "heun", "szfkbe", "klyaxuconu", "jmwvvj", "pewr")) - .withDeprecation( - new ModelDeprecationInfo().withFineTune("cxsenhwlrsff").withInference("pwvlqdq")) - .withLifecycleStatus(ModelLifecycleStatus.PREVIEW), - new AccountModelInner() - .withFormat("mpxttdbhrbnlankx") - .withName("skpbhenbtkcxywn") - .withVersion("nrs") - .withBaseModel( - new DeploymentModel() - .withFormat("vjrbirphxepcyvah") - .withName("ljkyqxjvuuj") - .withVersion("idokgjlj")) - .withMaxCapacity(831407974) - .withCapabilities( - mapOf( - "szzhbijhtxfvgxbf", - "ltbgsncghkj", - "ec", - "mxnehmp", - "gr", - "godebfqkkrbmpu", - "ispnqzahmgkbrp", - "wflzlfbxzpuzy")) - .withFinetuneCapabilities(mapOf("rgvtqag", "hibnuqqkpika", "bfs", "buynhijggm")) - .withDeprecation( - new ModelDeprecationInfo().withFineTune("butr").withInference("pnazzm")) - .withLifecycleStatus(ModelLifecycleStatus.GENERALLY_AVAILABLE))); - model = BinaryData.fromObject(model).toObject(AccountModelListResult.class); - Assertions.assertEquals("vxodpu", model.nextLink()); - Assertions.assertEquals("khrs", model.value().get(0).format()); - Assertions.assertEquals("iwkuofos", model.value().get(0).name()); - Assertions.assertEquals("hsauuimjmvxied", model.value().get(0).version()); - Assertions.assertEquals("ydagfuaxbe", model.value().get(0).baseModel().format()); - Assertions.assertEquals("iu", model.value().get(0).baseModel().name()); - Assertions.assertEquals("ktwh", model.value().get(0).baseModel().version()); - Assertions.assertEquals(334875262, model.value().get(0).maxCapacity()); - Assertions.assertEquals("wqsmbsur", model.value().get(0).capabilities().get("xim")); - Assertions.assertEquals("rvkdvjsllrm", model.value().get(0).finetuneCapabilities().get("vdfwatkpn")); - Assertions.assertEquals("spkwlhzdobpxjm", model.value().get(0).deprecation().fineTune()); - Assertions.assertEquals("bvvnchrkcciw", model.value().get(0).deprecation().inference()); - Assertions.assertEquals(ModelLifecycleStatus.GENERALLY_AVAILABLE, model.value().get(0).lifecycleStatus()); - } - - @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/AccountSkuListResultInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountSkuListResultInnerTests.java deleted file mode 100644 index 00c4d6b74a10..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountSkuListResultInnerTests.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.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\":\"utqxlngx\",\"sku\":{\"name\":\"fgugnxkrxdqmid\",\"tier\":\"Basic\",\"size\":\"rvqdra\",\"family\":\"jybige\",\"capacity\":1279126864}},{\"resourceType\":\"bowsk\",\"sku\":{\"name\":\"yktz\",\"tier\":\"Basic\",\"size\":\"y\",\"family\":\"qyw\",\"capacity\":1211142115}},{\"resourceType\":\"vynhzgpphrcg\",\"sku\":{\"name\":\"cocpecfvmmcoofsx\",\"tier\":\"Enterprise\",\"size\":\"gbmqjqabcypmiv\",\"family\":\"lzu\",\"capacity\":211064208}},{\"resourceType\":\"wnfnbacf\",\"sku\":{\"name\":\"nlebxetqgtzxd\",\"tier\":\"Enterprise\",\"size\":\"qqwx\",\"family\":\"feallnwsu\",\"capacity\":141642169}}]}") - .toObject(AccountSkuListResultInner.class); - Assertions.assertEquals("utqxlngx", model.value().get(0).resourceType()); - Assertions.assertEquals("fgugnxkrxdqmid", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.BASIC, model.value().get(0).sku().tier()); - Assertions.assertEquals("rvqdra", model.value().get(0).sku().size()); - Assertions.assertEquals("jybige", model.value().get(0).sku().family()); - Assertions.assertEquals(1279126864, 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("utqxlngx") - .withSku( - new Sku() - .withName("fgugnxkrxdqmid") - .withTier(SkuTier.BASIC) - .withSize("rvqdra") - .withFamily("jybige") - .withCapacity(1279126864)), - new AccountSku() - .withResourceType("bowsk") - .withSku( - new Sku() - .withName("yktz") - .withTier(SkuTier.BASIC) - .withSize("y") - .withFamily("qyw") - .withCapacity(1211142115)), - new AccountSku() - .withResourceType("vynhzgpphrcg") - .withSku( - new Sku() - .withName("cocpecfvmmcoofsx") - .withTier(SkuTier.ENTERPRISE) - .withSize("gbmqjqabcypmiv") - .withFamily("lzu") - .withCapacity(211064208)), - new AccountSku() - .withResourceType("wnfnbacf") - .withSku( - new Sku() - .withName("nlebxetqgtzxd") - .withTier(SkuTier.ENTERPRISE) - .withSize("qqwx") - .withFamily("feallnwsu") - .withCapacity(141642169)))); - model = BinaryData.fromObject(model).toObject(AccountSkuListResultInner.class); - Assertions.assertEquals("utqxlngx", model.value().get(0).resourceType()); - Assertions.assertEquals("fgugnxkrxdqmid", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.BASIC, model.value().get(0).sku().tier()); - Assertions.assertEquals("rvqdra", model.value().get(0).sku().size()); - Assertions.assertEquals("jybige", model.value().get(0).sku().family()); - Assertions.assertEquals(1279126864, 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 49379c1e0252..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountSkuTests.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.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\":\"jampmngnzscxaqw\",\"sku\":{\"name\":\"chcbonqvpkvlrxnj\",\"tier\":\"Basic\",\"size\":\"ipheoflokeyyien\",\"family\":\"dlwtgrhpdj\",\"capacity\":523400535}}") - .toObject(AccountSku.class); - Assertions.assertEquals("jampmngnzscxaqw", model.resourceType()); - Assertions.assertEquals("chcbonqvpkvlrxnj", model.sku().name()); - Assertions.assertEquals(SkuTier.BASIC, model.sku().tier()); - Assertions.assertEquals("ipheoflokeyyien", model.sku().size()); - Assertions.assertEquals("dlwtgrhpdj", model.sku().family()); - Assertions.assertEquals(523400535, model.sku().capacity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AccountSku model = - new AccountSku() - .withResourceType("jampmngnzscxaqw") - .withSku( - new Sku() - .withName("chcbonqvpkvlrxnj") - .withTier(SkuTier.BASIC) - .withSize("ipheoflokeyyien") - .withFamily("dlwtgrhpdj") - .withCapacity(523400535)); - model = BinaryData.fromObject(model).toObject(AccountSku.class); - Assertions.assertEquals("jampmngnzscxaqw", model.resourceType()); - Assertions.assertEquals("chcbonqvpkvlrxnj", model.sku().name()); - Assertions.assertEquals(SkuTier.BASIC, model.sku().tier()); - Assertions.assertEquals("ipheoflokeyyien", model.sku().size()); - Assertions.assertEquals("dlwtgrhpdj", model.sku().family()); - Assertions.assertEquals(523400535, 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 5e34d62a6582..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsDeleteMockTests.java +++ /dev/null @@ -1,61 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AccountsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("akufgmjz", "wr", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListModelsMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListModelsMockTests.java deleted file mode 100644 index 471626763870..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListModelsMockTests.java +++ /dev/null @@ -1,80 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.AccountModel; -import com.azure.resourcemanager.cognitiveservices.models.ModelLifecycleStatus; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AccountsListModelsMockTests { - @Test - public void testListModels() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"baseModel\":{\"format\":\"qwkyhkobop\",\"name\":\"edkowepbqpcrfk\",\"version\":\"ccsnjvcdwxlpq\",\"callRateLimit\":{\"count\":9.936148,\"renewalPeriod\":19.544666,\"rules\":[]}},\"maxCapacity\":819440507,\"capabilities\":{\"gwfqatmt\":\"i\"},\"finetuneCapabilities\":{\"gikdgsz\":\"mdvy\",\"birryuzhl\":\"w\",\"qrvqq\":\"kj\"},\"deprecation\":{\"fineTune\":\"jinrvgoupmfiibfg\",\"inference\":\"ioolvrwxkvtkkgll\"},\"lifecycleStatus\":\"Preview\",\"format\":\"vjayvblmhvkzu\",\"name\":\"xvvy\",\"version\":\"s\",\"callRateLimit\":{\"count\":70.21916,\"renewalPeriod\":77.12166,\"rules\":[]}}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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.accounts().listModels("ccelve", "rypqlmfeo", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("vjayvblmhvkzu", response.iterator().next().format()); - Assertions.assertEquals("xvvy", response.iterator().next().name()); - Assertions.assertEquals("s", response.iterator().next().version()); - Assertions.assertEquals("qwkyhkobop", response.iterator().next().baseModel().format()); - Assertions.assertEquals("edkowepbqpcrfk", response.iterator().next().baseModel().name()); - Assertions.assertEquals("ccsnjvcdwxlpq", response.iterator().next().baseModel().version()); - Assertions.assertEquals(819440507, response.iterator().next().maxCapacity()); - Assertions.assertEquals("i", response.iterator().next().capabilities().get("gwfqatmt")); - Assertions.assertEquals("mdvy", response.iterator().next().finetuneCapabilities().get("gikdgsz")); - Assertions.assertEquals("jinrvgoupmfiibfg", response.iterator().next().deprecation().fineTune()); - Assertions.assertEquals("ioolvrwxkvtkkgll", response.iterator().next().deprecation().inference()); - Assertions.assertEquals(ModelLifecycleStatus.PREVIEW, response.iterator().next().lifecycleStatus()); - } -} 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 4c38f6a70c6f..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListSkusWithResponseMockTests.java +++ /dev/null @@ -1,67 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.AccountSkuListResult; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AccountsListSkusWithResponseMockTests { - @Test - public void testListSkusWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"resourceType\":\"fi\"},{\"resourceType\":\"botzingamvppho\"},{\"resourceType\":\"zudphqamvdkfw\"},{\"resourceType\":\"cvtbv\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("kndxdigrjgu", "fzdm", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("fi", response.value().get(0).resourceType()); - } -} 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 64531a423705..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListUsagesWithResponseMockTests.java +++ /dev/null @@ -1,77 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -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.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AccountsListUsagesWithResponseMockTests { - @Test - public void testListUsagesWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"unit\":\"Bytes\",\"quotaPeriod\":\"uq\",\"limit\":92.17927923376674,\"currentValue\":83.973841997124,\"nextResetTime\":\"dnkfx\",\"status\":\"Unknown\"},{\"unit\":\"CountPerSecond\",\"quotaPeriod\":\"rmuhapfcq\",\"limit\":35.749186293792256,\"currentValue\":59.310411991053805,\"nextResetTime\":\"svuo\",\"status\":\"Included\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("yhmtnvyqiat", "zwpcnpwzcjaesg", "v", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(UnitType.BYTES, response.value().get(0).unit()); - Assertions.assertEquals("uq", response.value().get(0).quotaPeriod()); - Assertions.assertEquals(92.17927923376674D, response.value().get(0).limit()); - Assertions.assertEquals(83.973841997124D, response.value().get(0).currentValue()); - Assertions.assertEquals("dnkfx", response.value().get(0).nextResetTime()); - Assertions.assertEquals(QuotaUsageStatus.UNKNOWN, 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 cc3a67240c9e..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AzureEntityResourceTests.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.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/CheckDomainAvailabilityParameterTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CheckDomainAvailabilityParameterTests.java deleted file mode 100644 index 4249d80c4004..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CheckDomainAvailabilityParameterTests.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.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\":\"bpvjymjhx\",\"type\":\"j\",\"kind\":\"gudivkrtswbxqz\"}") - .toObject(CheckDomainAvailabilityParameter.class); - Assertions.assertEquals("bpvjymjhx", model.subdomainName()); - Assertions.assertEquals("j", model.type()); - Assertions.assertEquals("gudivkrtswbxqz", model.kind()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CheckDomainAvailabilityParameter model = - new CheckDomainAvailabilityParameter() - .withSubdomainName("bpvjymjhx") - .withType("j") - .withKind("gudivkrtswbxqz"); - model = BinaryData.fromObject(model).toObject(CheckDomainAvailabilityParameter.class); - Assertions.assertEquals("bpvjymjhx", model.subdomainName()); - Assertions.assertEquals("j", model.type()); - Assertions.assertEquals("gudivkrtswbxqz", 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 18945d3487ca..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CheckSkuAvailabilityParameterTests.java +++ /dev/null @@ -1,37 +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\":[\"uwbc\",\"nwbmeh\",\"seyvj\"],\"kind\":\"srtslhspkdeem\",\"type\":\"ofmxagkvtmelmqkr\"}") - .toObject(CheckSkuAvailabilityParameter.class); - Assertions.assertEquals("uwbc", model.skus().get(0)); - Assertions.assertEquals("srtslhspkdeem", model.kind()); - Assertions.assertEquals("ofmxagkvtmelmqkr", model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CheckSkuAvailabilityParameter model = - new CheckSkuAvailabilityParameter() - .withSkus(Arrays.asList("uwbc", "nwbmeh", "seyvj")) - .withKind("srtslhspkdeem") - .withType("ofmxagkvtmelmqkr"); - model = BinaryData.fromObject(model).toObject(CheckSkuAvailabilityParameter.class); - Assertions.assertEquals("uwbc", model.skus().get(0)); - Assertions.assertEquals("srtslhspkdeem", model.kind()); - Assertions.assertEquals("ofmxagkvtmelmqkr", 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 00fcd7455eb9..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentCostTests.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.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\":\"dmoizpostmg\",\"overageMeterId\":\"fbunrmfqjhhk\"}") - .toObject(CommitmentCost.class); - Assertions.assertEquals("dmoizpostmg", model.commitmentMeterId()); - Assertions.assertEquals("fbunrmfqjhhk", model.overageMeterId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CommitmentCost model = - new CommitmentCost().withCommitmentMeterId("dmoizpostmg").withOverageMeterId("fbunrmfqjhhk"); - model = BinaryData.fromObject(model).toObject(CommitmentCost.class); - Assertions.assertEquals("dmoizpostmg", model.commitmentMeterId()); - Assertions.assertEquals("fbunrmfqjhhk", 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 aa2c46fd0b30..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPeriodTests.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.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\":\"ofncckwyfzqwhxxb\",\"count\":397594857,\"quota\":{\"quantity\":1881000145918379423,\"unit\":\"qztpp\"},\"startDate\":\"o\",\"endDate\":\"or\"}") - .toObject(CommitmentPeriod.class); - Assertions.assertEquals("ofncckwyfzqwhxxb", model.tier()); - Assertions.assertEquals(397594857, model.count()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CommitmentPeriod model = new CommitmentPeriod().withTier("ofncckwyfzqwhxxb").withCount(397594857); - model = BinaryData.fromObject(model).toObject(CommitmentPeriod.class); - Assertions.assertEquals("ofncckwyfzqwhxxb", model.tier()); - Assertions.assertEquals(397594857, 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 62991a2a5a4f..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanAccountAssociationInnerTests.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.fluent.models.CommitmentPlanAccountAssociationInner; -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\":\"kby\",\"properties\":{\"accountId\":\"wpfhpagmhrskd\"},\"id\":\"nfd\",\"name\":\"doakgtdlmkkzevdl\",\"type\":\"ewpusdsttwvogvb\"}") - .toObject(CommitmentPlanAccountAssociationInner.class); - Assertions.assertEquals("wpfhpagmhrskd", model.accountId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CommitmentPlanAccountAssociationInner model = - new CommitmentPlanAccountAssociationInner().withAccountId("wpfhpagmhrskd"); - model = BinaryData.fromObject(model).toObject(CommitmentPlanAccountAssociationInner.class); - Assertions.assertEquals("wpfhpagmhrskd", model.accountId()); - } -} 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 042619581b72..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanAccountAssociationListResultTests.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.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\":\"eburu\",\"value\":[{\"etag\":\"s\",\"properties\":{\"accountId\":\"xwabmqoe\"},\"id\":\"kif\",\"name\":\"vtpuqujmqlgk\",\"type\":\"btndo\"},{\"etag\":\"gbjcntujitcjed\",\"properties\":{\"accountId\":\"waezkojvd\"},\"id\":\"pzfoqoui\",\"name\":\"ybxarzgszu\",\"type\":\"oxciqopidoamcio\"},{\"etag\":\"haz\",\"properties\":{\"accountId\":\"nz\"},\"id\":\"onlwntoeg\",\"name\":\"kdwbwhkszz\",\"type\":\"mrv\"},{\"etag\":\"tvb\",\"properties\":{\"accountId\":\"sfraoyzko\"},\"id\":\"wtl\",\"name\":\"nguxawqaldsy\",\"type\":\"uximerqfobw\"}]}") - .toObject(CommitmentPlanAccountAssociationListResult.class); - Assertions.assertEquals("eburu", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CommitmentPlanAccountAssociationListResult model = - new CommitmentPlanAccountAssociationListResult().withNextLink("eburu"); - model = BinaryData.fromObject(model).toObject(CommitmentPlanAccountAssociationListResult.class); - Assertions.assertEquals("eburu", 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 f05b81c6fdce..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanAccountAssociationPropertiesTests.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.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\":\"jdcngqqm\"}") - .toObject(CommitmentPlanAccountAssociationProperties.class); - Assertions.assertEquals("jdcngqqm", model.accountId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CommitmentPlanAccountAssociationProperties model = - new CommitmentPlanAccountAssociationProperties().withAccountId("jdcngqqm"); - model = BinaryData.fromObject(model).toObject(CommitmentPlanAccountAssociationProperties.class); - Assertions.assertEquals("jdcngqqm", 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 0d03240be53e..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanAssociationTests.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.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 bdecc2f62876..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanInnerTests.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.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\":\"ulpjr\",\"kind\":\"ag\",\"sku\":{\"name\":\"vimjwos\",\"tier\":\"Premium\",\"size\":\"tcs\",\"family\":\"cktqumiekkezzi\",\"capacity\":270423154},\"tags\":{\"qidbqfatpxllrxcy\":\"jhdgqggebdunyga\",\"dmjsjqb\":\"moadsuvarmy\"},\"location\":\"hyxxrwlycoduhpk\",\"properties\":{\"provisioningState\":\"Failed\",\"commitmentPlanGuid\":\"areqna\",\"hostingModel\":\"ConnectedContainer\",\"planType\":\"gjhkycubeddg\",\"current\":{\"tier\":\"fwqmzqalkrmn\",\"count\":1174672424,\"startDate\":\"acqqudfnbyxbaaab\",\"endDate\":\"vayffimrzrt\"},\"autoRenew\":true,\"next\":{\"tier\":\"sexnevfdnw\",\"count\":2059840008,\"startDate\":\"zsyyceuzso\",\"endDate\":\"judpfrxt\"},\"last\":{\"tier\":\"zvaytdwkqbr\",\"count\":1725477484,\"startDate\":\"xhexiilivpdti\",\"endDate\":\"q\"}},\"id\":\"d\",\"name\":\"oaxoruzfgsqu\",\"type\":\"fxrxxle\"}") - .toObject(CommitmentPlanInner.class); - Assertions.assertEquals("ag", model.kind()); - Assertions.assertEquals("vimjwos", model.sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.sku().tier()); - Assertions.assertEquals("tcs", model.sku().size()); - Assertions.assertEquals("cktqumiekkezzi", model.sku().family()); - Assertions.assertEquals(270423154, model.sku().capacity()); - Assertions.assertEquals("jhdgqggebdunyga", model.tags().get("qidbqfatpxllrxcy")); - Assertions.assertEquals("hyxxrwlycoduhpk", model.location()); - Assertions.assertEquals("areqna", model.properties().commitmentPlanGuid()); - Assertions.assertEquals(HostingModel.CONNECTED_CONTAINER, model.properties().hostingModel()); - Assertions.assertEquals("gjhkycubeddg", model.properties().planType()); - Assertions.assertEquals("fwqmzqalkrmn", model.properties().current().tier()); - Assertions.assertEquals(1174672424, model.properties().current().count()); - Assertions.assertEquals(true, model.properties().autoRenew()); - Assertions.assertEquals("sexnevfdnw", model.properties().next().tier()); - Assertions.assertEquals(2059840008, model.properties().next().count()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CommitmentPlanInner model = - new CommitmentPlanInner() - .withKind("ag") - .withSku( - new Sku() - .withName("vimjwos") - .withTier(SkuTier.PREMIUM) - .withSize("tcs") - .withFamily("cktqumiekkezzi") - .withCapacity(270423154)) - .withTags(mapOf("qidbqfatpxllrxcy", "jhdgqggebdunyga", "dmjsjqb", "moadsuvarmy")) - .withLocation("hyxxrwlycoduhpk") - .withProperties( - new CommitmentPlanProperties() - .withCommitmentPlanGuid("areqna") - .withHostingModel(HostingModel.CONNECTED_CONTAINER) - .withPlanType("gjhkycubeddg") - .withCurrent(new CommitmentPeriod().withTier("fwqmzqalkrmn").withCount(1174672424)) - .withAutoRenew(true) - .withNext(new CommitmentPeriod().withTier("sexnevfdnw").withCount(2059840008))); - model = BinaryData.fromObject(model).toObject(CommitmentPlanInner.class); - Assertions.assertEquals("ag", model.kind()); - Assertions.assertEquals("vimjwos", model.sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.sku().tier()); - Assertions.assertEquals("tcs", model.sku().size()); - Assertions.assertEquals("cktqumiekkezzi", model.sku().family()); - Assertions.assertEquals(270423154, model.sku().capacity()); - Assertions.assertEquals("jhdgqggebdunyga", model.tags().get("qidbqfatpxllrxcy")); - Assertions.assertEquals("hyxxrwlycoduhpk", model.location()); - Assertions.assertEquals("areqna", model.properties().commitmentPlanGuid()); - Assertions.assertEquals(HostingModel.CONNECTED_CONTAINER, model.properties().hostingModel()); - Assertions.assertEquals("gjhkycubeddg", model.properties().planType()); - Assertions.assertEquals("fwqmzqalkrmn", model.properties().current().tier()); - Assertions.assertEquals(1174672424, model.properties().current().count()); - Assertions.assertEquals(true, model.properties().autoRenew()); - Assertions.assertEquals("sexnevfdnw", model.properties().next().tier()); - Assertions.assertEquals(2059840008, model.properties().next().count()); - } - - @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 8d893aad0fc4..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanListResultTests.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.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\":\"hwflu\",\"value\":[{\"etag\":\"hrkwo\",\"kind\":\"yvoqa\",\"sku\":{\"name\":\"iexpbtgiwbwo\",\"tier\":\"Free\",\"size\":\"shrtdtkcnqxwb\",\"family\":\"kulpiujwaasi\",\"capacity\":172575084},\"tags\":{\"wcciuqgbdbu\":\"byuqerpqlp\"},\"location\":\"uvfbtkuwh\",\"properties\":{\"provisioningState\":\"Failed\",\"commitmentPlanGuid\":\"ojoxafnndlp\",\"hostingModel\":\"DisconnectedContainer\",\"planType\":\"o\",\"autoRenew\":true},\"id\":\"h\",\"name\":\"pkkpw\",\"type\":\"reqnovvqfov\"},{\"etag\":\"ywsuwsy\",\"kind\":\"ndsytgadg\",\"sku\":{\"name\":\"aeaeneqnzarrw\",\"tier\":\"Premium\",\"size\":\"ijfqkacewiipfp\",\"family\":\"ji\",\"capacity\":1113434704},\"tags\":{\"saknynfsyn\":\"tohqkvpuvksgp\"},\"location\":\"ph\",\"properties\":{\"provisioningState\":\"Canceled\",\"commitmentPlanGuid\":\"dlqiyntorzih\",\"hostingModel\":\"DisconnectedContainer\",\"planType\":\"jswsrmslyz\",\"autoRenew\":true},\"id\":\"ckqqzqioxiysui\",\"name\":\"zynkedya\",\"type\":\"rwyhqmibzyhwitsm\"},{\"etag\":\"ynpcdpumnzgmwznm\",\"kind\":\"iknsorgjh\",\"sku\":{\"name\":\"ldtlwwr\",\"tier\":\"Standard\",\"size\":\"tncvokot\",\"family\":\"xdy\",\"capacity\":2008770544},\"tags\":{\"hadoocrk\":\"cogjltdtbn\",\"amqgxqquezikyw\":\"cikhnv\"},\"location\":\"xkalla\",\"properties\":{\"provisioningState\":\"Creating\",\"commitmentPlanGuid\":\"uipiccjzk\",\"hostingModel\":\"Web\",\"planType\":\"vvcnayr\",\"autoRenew\":true},\"id\":\"mueedndrdvstk\",\"name\":\"qqtch\",\"type\":\"alm\"},{\"etag\":\"d\",\"kind\":\"ygdvwv\",\"sku\":{\"name\":\"iohgwxrtfud\",\"tier\":\"Premium\",\"size\":\"gyqagvrvmnpkuk\",\"family\":\"i\",\"capacity\":2068705398},\"tags\":{\"hfjx\":\"gwimfn\",\"rey\":\"mszkkfo\"},\"location\":\"zi\",\"properties\":{\"provisioningState\":\"Succeeded\",\"commitmentPlanGuid\":\"n\",\"hostingModel\":\"DisconnectedContainer\",\"planType\":\"xwczelpcire\",\"autoRenew\":false},\"id\":\"nwabfatkldd\",\"name\":\"bjhwuaan\",\"type\":\"zjosp\"}]}") - .toObject(CommitmentPlanListResult.class); - Assertions.assertEquals("hwflu", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CommitmentPlanListResult model = new CommitmentPlanListResult().withNextLink("hwflu"); - model = BinaryData.fromObject(model).toObject(CommitmentPlanListResult.class); - Assertions.assertEquals("hwflu", 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 94b13137dbd0..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanPropertiesTests.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.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\":\"Creating\",\"commitmentPlanGuid\":\"mxjezwlw\",\"hostingModel\":\"DisconnectedContainer\",\"planType\":\"qlcvydy\",\"current\":{\"tier\":\"dooaojkniodko\",\"count\":354248500,\"quota\":{\"quantity\":8980911642598746949,\"unit\":\"emmsbvdkc\"},\"startDate\":\"dtjinfw\",\"endDate\":\"fltkacjv\"},\"autoRenew\":false,\"next\":{\"tier\":\"foakgg\",\"count\":1236120195,\"quota\":{\"quantity\":2099147795702198960,\"unit\":\"pulpqblylsyxk\"},\"startDate\":\"nsj\",\"endDate\":\"vti\"},\"last\":{\"tier\":\"sdszue\",\"count\":1236978734,\"quota\":{\"quantity\":6849457451153472340,\"unit\":\"beyvpnqicvinvkjj\"},\"startDate\":\"xrbuukzclew\",\"endDate\":\"mlwpazt\"}}") - .toObject(CommitmentPlanProperties.class); - Assertions.assertEquals("mxjezwlw", model.commitmentPlanGuid()); - Assertions.assertEquals(HostingModel.DISCONNECTED_CONTAINER, model.hostingModel()); - Assertions.assertEquals("qlcvydy", model.planType()); - Assertions.assertEquals("dooaojkniodko", model.current().tier()); - Assertions.assertEquals(354248500, model.current().count()); - Assertions.assertEquals(false, model.autoRenew()); - Assertions.assertEquals("foakgg", model.next().tier()); - Assertions.assertEquals(1236120195, model.next().count()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CommitmentPlanProperties model = - new CommitmentPlanProperties() - .withCommitmentPlanGuid("mxjezwlw") - .withHostingModel(HostingModel.DISCONNECTED_CONTAINER) - .withPlanType("qlcvydy") - .withCurrent(new CommitmentPeriod().withTier("dooaojkniodko").withCount(354248500)) - .withAutoRenew(false) - .withNext(new CommitmentPeriod().withTier("foakgg").withCount(1236120195)); - model = BinaryData.fromObject(model).toObject(CommitmentPlanProperties.class); - Assertions.assertEquals("mxjezwlw", model.commitmentPlanGuid()); - Assertions.assertEquals(HostingModel.DISCONNECTED_CONTAINER, model.hostingModel()); - Assertions.assertEquals("qlcvydy", model.planType()); - Assertions.assertEquals("dooaojkniodko", model.current().tier()); - Assertions.assertEquals(354248500, model.current().count()); - Assertions.assertEquals(false, model.autoRenew()); - Assertions.assertEquals("foakgg", model.next().tier()); - Assertions.assertEquals(1236120195, 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 98ff9a47466f..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdateAssociationMockTests.java +++ /dev/null @@ -1,72 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlanAccountAssociation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CommitmentPlansCreateOrUpdateAssociationMockTests { - @Test - public void testCreateOrUpdateAssociation() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"etag\":\"zqkjjeokbzefe\",\"properties\":{\"accountId\":\"cczurtlei\"},\"id\":\"q\",\"name\":\"bkwvzg\",\"type\":\"zvd\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("dhohsdtmcdzsuf") - .withExistingCommitmentPlan("qgqqihedsvqwthmk", "ibcysihsgqc") - .withAccountId("dbevwqqxeysko") - .create(); - - Assertions.assertEquals("cczurtlei", response.accountId()); - } -} 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 9967dfda7b57..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdatePlanMockTests.java +++ /dev/null @@ -1,122 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -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.ByteBuffer; -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 org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CommitmentPlansCreateOrUpdatePlanMockTests { - @Test - public void testCreateOrUpdatePlan() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"etag\":\"vruzslzojhpctfnm\",\"kind\":\"otngfdgu\",\"sku\":{\"name\":\"yzihgrkyuizabsn\",\"tier\":\"Enterprise\",\"size\":\"hojeevy\",\"family\":\"hsgz\",\"capacity\":296401749},\"tags\":{\"tnluankrr\":\"omfgbeglqgleohib\",\"qqxlajr\":\"xeeebtijvacvbmqz\",\"uyxoaf\":\"wxacevehj\"},\"location\":\"oqltfae\",\"properties\":{\"provisioningState\":\"Succeeded\",\"commitmentPlanGuid\":\"fgvxirpghriypoqe\",\"hostingModel\":\"DisconnectedContainer\",\"planType\":\"h\",\"current\":{\"tier\":\"rlpyznuciqdsmexi\",\"count\":1841265855,\"startDate\":\"xtyasiibmiyb\",\"endDate\":\"ustgnljhnmgixhc\"},\"autoRenew\":false,\"next\":{\"tier\":\"foudor\",\"count\":199814192,\"startDate\":\"prot\",\"endDate\":\"pundmbxhug\"},\"last\":{\"tier\":\"k\",\"count\":1134791831,\"startDate\":\"rb\",\"endDate\":\"tp\"}},\"id\":\"dtzfjltfvnzcy\",\"name\":\"t\",\"type\":\"tpvopvpbdb\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("vacqpbtuodxesz") - .withExistingResourceGroup("vizbfhfo") - .withRegion("kcxk") - .withTags(mapOf("q", "xzsrzpge", "wwpgdakchzyvlixq", "yb")) - .withKind("lzkwrrwoy") - .withSku( - new Sku() - .withName("ucwyhahno") - .withTier(SkuTier.STANDARD) - .withSize("ywuhpsvfuur") - .withFamily("lwexxwl") - .withCapacity(1269982634)) - .withProperties( - new CommitmentPlanProperties() - .withCommitmentPlanGuid("mysu") - .withHostingModel(HostingModel.CONNECTED_CONTAINER) - .withPlanType("rntvlwijp") - .withCurrent(new CommitmentPeriod().withTier("exoqqpwcyyufm").withCount(1093515731)) - .withAutoRenew(true) - .withNext(new CommitmentPeriod().withTier("ndy").withCount(1212474723))) - .create(); - - Assertions.assertEquals("otngfdgu", response.kind()); - Assertions.assertEquals("yzihgrkyuizabsn", response.sku().name()); - Assertions.assertEquals(SkuTier.ENTERPRISE, response.sku().tier()); - Assertions.assertEquals("hojeevy", response.sku().size()); - Assertions.assertEquals("hsgz", response.sku().family()); - Assertions.assertEquals(296401749, response.sku().capacity()); - Assertions.assertEquals("omfgbeglqgleohib", response.tags().get("tnluankrr")); - Assertions.assertEquals("oqltfae", response.location()); - Assertions.assertEquals("fgvxirpghriypoqe", response.properties().commitmentPlanGuid()); - Assertions.assertEquals(HostingModel.DISCONNECTED_CONTAINER, response.properties().hostingModel()); - Assertions.assertEquals("h", response.properties().planType()); - Assertions.assertEquals("rlpyznuciqdsmexi", response.properties().current().tier()); - Assertions.assertEquals(1841265855, response.properties().current().count()); - Assertions.assertEquals(false, response.properties().autoRenew()); - Assertions.assertEquals("foudor", response.properties().next().tier()); - Assertions.assertEquals(199814192, response.properties().next().count()); - } - - @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 9914086dcb35..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,127 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -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.ByteBuffer; -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 org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CommitmentPlansCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"etag\":\"orxvxcjzhqiz\",\"kind\":\"pxtgqscjav\",\"sku\":{\"name\":\"juhdqazkmtgguwpi\",\"tier\":\"Basic\",\"size\":\"civmmg\",\"family\":\"cf\",\"capacity\":1456716709},\"tags\":{\"fvpgshoxgsg\":\"kneuvyinzqo\"},\"location\":\"fgzdjtxvz\",\"properties\":{\"provisioningState\":\"Deleting\",\"commitmentPlanGuid\":\"gaqvlgafcqusrd\",\"hostingModel\":\"Web\",\"planType\":\"wsdtutnwl\",\"current\":{\"tier\":\"cvuzhyrmewipmve\",\"count\":2074046475,\"startDate\":\"uqgsj\",\"endDate\":\"undxgketw\"},\"autoRenew\":false,\"next\":{\"tier\":\"hfjmhvv\",\"count\":1386736873,\"startDate\":\"mun\",\"endDate\":\"sx\"},\"last\":{\"tier\":\"fbuzjyihs\",\"count\":554244740,\"startDate\":\"dyp\",\"endDate\":\"yue\"}},\"id\":\"slynsqyrpfoo\",\"name\":\"rlttymsjnygqdnfw\",\"type\":\"zdzgtilaxhnfhqly\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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( - "brta", - "metttwgd", - "lqxihhrmooiz", - new CommitmentPlanInner() - .withKind("y") - .withSku( - new Sku() - .withName("etoge") - .withTier(SkuTier.STANDARD) - .withSize("slhvnhlab") - .withFamily("nk") - .withCapacity(1176259759)) - .withTags(mapOf("rgaehvvibrxjj", "b")) - .withLocation("oqbeitpkxzt") - .withProperties( - new CommitmentPlanProperties() - .withCommitmentPlanGuid("lftidgfcwqmpim") - .withHostingModel(HostingModel.DISCONNECTED_CONTAINER) - .withPlanType("hemjy") - .withCurrent(new CommitmentPeriod().withTier("uj").withCount(84498484)) - .withAutoRenew(true) - .withNext(new CommitmentPeriod().withTier("nvkcdmxzrpoa").withCount(990046461))), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("pxtgqscjav", response.kind()); - Assertions.assertEquals("juhdqazkmtgguwpi", response.sku().name()); - Assertions.assertEquals(SkuTier.BASIC, response.sku().tier()); - Assertions.assertEquals("civmmg", response.sku().size()); - Assertions.assertEquals("cf", response.sku().family()); - Assertions.assertEquals(1456716709, response.sku().capacity()); - Assertions.assertEquals("kneuvyinzqo", response.tags().get("fvpgshoxgsg")); - Assertions.assertEquals("fgzdjtxvz", response.location()); - Assertions.assertEquals("gaqvlgafcqusrd", response.properties().commitmentPlanGuid()); - Assertions.assertEquals(HostingModel.WEB, response.properties().hostingModel()); - Assertions.assertEquals("wsdtutnwl", response.properties().planType()); - Assertions.assertEquals("cvuzhyrmewipmve", response.properties().current().tier()); - Assertions.assertEquals(2074046475, response.properties().current().count()); - Assertions.assertEquals(false, response.properties().autoRenew()); - Assertions.assertEquals("hfjmhvv", response.properties().next().tier()); - Assertions.assertEquals(1386736873, response.properties().next().count()); - } - - @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 83dcd32c3980..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeleteAssociationMockTests.java +++ /dev/null @@ -1,61 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CommitmentPlansDeleteAssociationMockTests { - @Test - public void testDeleteAssociation() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("cu", "chxgs", "boldforobwj", 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 c168cd005e2b..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeleteMockTests.java +++ /dev/null @@ -1,61 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CommitmentPlansDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("ijouwivkxoyzunb", "xxrtikvc", "wpgclrcivt", 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 10b7e27a12fa..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeletePlanMockTests.java +++ /dev/null @@ -1,61 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CommitmentPlansDeletePlanMockTests { - @Test - public void testDeletePlan() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("oxfrkenxpmyyefr", "mpdnqqskawa", 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 fb6a60fa99b6..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetAssociationWithResponseMockTests.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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlanAccountAssociation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CommitmentPlansGetAssociationWithResponseMockTests { - @Test - public void testGetAssociationWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"etag\":\"cxjmonfdgnwncyp\",\"properties\":{\"accountId\":\"w\"},\"id\":\"tvuqjctzenkeifzz\",\"name\":\"mkdasv\",\"type\":\"lyhb\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("xlpm", "erbdk", "lvidizozs", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("w", 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 6926670a94e7..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,87 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -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.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CommitmentPlansGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"etag\":\"kzmegnitgvkxlz\",\"kind\":\"drf\",\"sku\":{\"name\":\"cealzxwh\",\"tier\":\"Standard\",\"size\":\"ymo\",\"family\":\"hlwigdivbkbxg\",\"capacity\":1748093072},\"tags\":{\"e\":\"uwasqvd\",\"uxakjsqzhzbezk\":\"y\",\"kgfmocwahpq\":\"imsidxasicddyvvj\",\"jhhn\":\"atjeaahh\"},\"location\":\"zybbj\",\"properties\":{\"provisioningState\":\"Moving\",\"commitmentPlanGuid\":\"syxkyxvxevblb\",\"hostingModel\":\"DisconnectedContainer\",\"planType\":\"ljlageuaulxu\",\"current\":{\"tier\":\"jbnkpp\",\"count\":915753980,\"startDate\":\"lsvxeizz\",\"endDate\":\"klnsrmffey\"},\"autoRenew\":false,\"next\":{\"tier\":\"piymerteea\",\"count\":1192403212,\"startDate\":\"ekkkzd\",\"endDate\":\"tkgdojbmxva\"},\"last\":{\"tier\":\"fdeesvecuijpxtx\",\"count\":1101105605,\"startDate\":\"tujwsawdd\",\"endDate\":\"babxvitit\"}},\"id\":\"tzeexav\",\"name\":\"xtfglecdmdqb\",\"type\":\"pypqtgsfj\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("qvmmbn", "qfr", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("drf", response.kind()); - Assertions.assertEquals("cealzxwh", response.sku().name()); - Assertions.assertEquals(SkuTier.STANDARD, response.sku().tier()); - Assertions.assertEquals("ymo", response.sku().size()); - Assertions.assertEquals("hlwigdivbkbxg", response.sku().family()); - Assertions.assertEquals(1748093072, response.sku().capacity()); - Assertions.assertEquals("uwasqvd", response.tags().get("e")); - Assertions.assertEquals("zybbj", response.location()); - Assertions.assertEquals("syxkyxvxevblb", response.properties().commitmentPlanGuid()); - Assertions.assertEquals(HostingModel.DISCONNECTED_CONTAINER, response.properties().hostingModel()); - Assertions.assertEquals("ljlageuaulxu", response.properties().planType()); - Assertions.assertEquals("jbnkpp", response.properties().current().tier()); - Assertions.assertEquals(915753980, response.properties().current().count()); - Assertions.assertEquals(false, response.properties().autoRenew()); - Assertions.assertEquals("piymerteea", response.properties().next().tier()); - Assertions.assertEquals(1192403212, 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 d71311824057..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetWithResponseMockTests.java +++ /dev/null @@ -1,87 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -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.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CommitmentPlansGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"etag\":\"jnaeois\",\"kind\":\"hmgorffukiscv\",\"sku\":{\"name\":\"zhwplefaxvxilc\",\"tier\":\"Basic\",\"size\":\"hnze\",\"family\":\"xtjjfzqlqhycav\",\"capacity\":1258622098},\"tags\":{\"nlrariaawiuagy\":\"dbeesmie\",\"ojocqwogf\":\"wqfbylyrfgiagt\",\"uxylfsbtkadpy\":\"zjvusfzldmo\"},\"location\":\"wn\",\"properties\":{\"provisioningState\":\"Accepted\",\"commitmentPlanGuid\":\"u\",\"hostingModel\":\"DisconnectedContainer\",\"planType\":\"cto\",\"current\":{\"tier\":\"isofieypefojyqd\",\"count\":219137261,\"startDate\":\"cp\",\"endDate\":\"wkhihihlhzdsqt\"},\"autoRenew\":false,\"next\":{\"tier\":\"nowc\",\"count\":1143830782,\"startDate\":\"vecactx\",\"endDate\":\"oteyowc\"},\"last\":{\"tier\":\"ovekqvgqouwi\",\"count\":979743334,\"startDate\":\"wyivqikf\",\"endDate\":\"vhrfsphuagrt\"}},\"id\":\"ikteusqczkvyk\",\"name\":\"xubyjaffmmfblcqc\",\"type\":\"ubgq\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("dhcxgkmoy", "cdyuibhmfdnbzyd", "f", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("hmgorffukiscv", response.kind()); - Assertions.assertEquals("zhwplefaxvxilc", response.sku().name()); - Assertions.assertEquals(SkuTier.BASIC, response.sku().tier()); - Assertions.assertEquals("hnze", response.sku().size()); - Assertions.assertEquals("xtjjfzqlqhycav", response.sku().family()); - Assertions.assertEquals(1258622098, response.sku().capacity()); - Assertions.assertEquals("dbeesmie", response.tags().get("nlrariaawiuagy")); - Assertions.assertEquals("wn", response.location()); - Assertions.assertEquals("u", response.properties().commitmentPlanGuid()); - Assertions.assertEquals(HostingModel.DISCONNECTED_CONTAINER, response.properties().hostingModel()); - Assertions.assertEquals("cto", response.properties().planType()); - Assertions.assertEquals("isofieypefojyqd", response.properties().current().tier()); - Assertions.assertEquals(219137261, response.properties().current().count()); - Assertions.assertEquals(false, response.properties().autoRenew()); - Assertions.assertEquals("nowc", response.properties().next().tier()); - Assertions.assertEquals(1143830782, 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 e9379432706e..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListAssociationsMockTests.java +++ /dev/null @@ -1,68 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlanAccountAssociation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CommitmentPlansListAssociationsMockTests { - @Test - public void testListAssociations() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"etag\":\"lnzonzlrpiqywn\",\"properties\":{\"accountId\":\"tszcofizehtdhgb\"},\"id\":\"k\",\"name\":\"reljeamur\",\"type\":\"zmlovuanash\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("ujrtrhqvwr", "vk", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("tszcofizehtdhgb", 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 7655f4d0a726..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListByResourceGroupMockTests.java +++ /dev/null @@ -1,86 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -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.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CommitmentPlansListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"etag\":\"xvodhtnsir\",\"kind\":\"hzmme\",\"sku\":{\"name\":\"kdlpa\",\"tier\":\"Basic\",\"size\":\"x\",\"family\":\"ilcfxwmdboxd\",\"capacity\":1260487269},\"tags\":{\"cc\":\"ufqobrjlnac\",\"kizvytn\":\"knh\",\"aaeranokqgukk\":\"zvulj\",\"oylaxxul\":\"qnvb\"},\"location\":\"isdos\",\"properties\":{\"provisioningState\":\"Deleting\",\"commitmentPlanGuid\":\"vgjrwhr\",\"hostingModel\":\"DisconnectedContainer\",\"planType\":\"ytdc\",\"current\":{\"tier\":\"ccknfnwmbtmvp\",\"count\":1129070507,\"startDate\":\"ttzaefed\",\"endDate\":\"hchrphkmcrjdqn\"},\"autoRenew\":true,\"next\":{\"tier\":\"bg\",\"count\":130529973,\"startDate\":\"kdghrjeuutlwx\",\"endDate\":\"w\"},\"last\":{\"tier\":\"kvbwnhhtqlgeh\",\"count\":1490409574,\"startDate\":\"ifhpf\",\"endDate\":\"ajvgcxtxjcsheafi\"}},\"id\":\"ltugsresmkssjhoi\",\"name\":\"txfkfweg\",\"type\":\"rhptilluc\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("cbslhhx", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("hzmme", response.iterator().next().kind()); - Assertions.assertEquals("kdlpa", response.iterator().next().sku().name()); - Assertions.assertEquals(SkuTier.BASIC, response.iterator().next().sku().tier()); - Assertions.assertEquals("x", response.iterator().next().sku().size()); - Assertions.assertEquals("ilcfxwmdboxd", response.iterator().next().sku().family()); - Assertions.assertEquals(1260487269, response.iterator().next().sku().capacity()); - Assertions.assertEquals("ufqobrjlnac", response.iterator().next().tags().get("cc")); - Assertions.assertEquals("isdos", response.iterator().next().location()); - Assertions.assertEquals("vgjrwhr", response.iterator().next().properties().commitmentPlanGuid()); - Assertions - .assertEquals(HostingModel.DISCONNECTED_CONTAINER, response.iterator().next().properties().hostingModel()); - Assertions.assertEquals("ytdc", response.iterator().next().properties().planType()); - Assertions.assertEquals("ccknfnwmbtmvp", response.iterator().next().properties().current().tier()); - Assertions.assertEquals(1129070507, response.iterator().next().properties().current().count()); - Assertions.assertEquals(true, response.iterator().next().properties().autoRenew()); - Assertions.assertEquals("bg", response.iterator().next().properties().next().tier()); - Assertions.assertEquals(130529973, 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 9a49d7ee456a..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListMockTests.java +++ /dev/null @@ -1,86 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -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.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CommitmentPlansListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"etag\":\"qtmldgxo\",\"kind\":\"irclnpk\",\"sku\":{\"name\":\"ayzri\",\"tier\":\"Free\",\"size\":\"awfvjlboxqvkjl\",\"family\":\"ho\",\"capacity\":298942523},\"tags\":{\"raauzzpt\":\"dwdigumb\",\"ysdzhez\":\"a\"},\"location\":\"vaiqyuvvf\",\"properties\":{\"provisioningState\":\"Creating\",\"commitmentPlanGuid\":\"hqyikvy\",\"hostingModel\":\"ConnectedContainer\",\"planType\":\"avluwmncs\",\"current\":{\"tier\":\"jfybvpoekrsgsgb\",\"count\":1153864546,\"startDate\":\"gnjdgkynscliqhz\",\"endDate\":\"xnkomtkubo\"},\"autoRenew\":false,\"next\":{\"tier\":\"dxzxhi\",\"count\":1876865651,\"startDate\":\"cev\",\"endDate\":\"gtltdhlf\"},\"last\":{\"tier\":\"jpykvgtrdcnifmzz\",\"count\":1409785918,\"startDate\":\"rnysux\",\"endDate\":\"rafwgckhocxvdf\"}},\"id\":\"fwafqrouda\",\"name\":\"pavehhr\",\"type\":\"kbunzoz\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("gzuriglaecxndt", "cokpv", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("irclnpk", response.iterator().next().kind()); - Assertions.assertEquals("ayzri", response.iterator().next().sku().name()); - Assertions.assertEquals(SkuTier.FREE, response.iterator().next().sku().tier()); - Assertions.assertEquals("awfvjlboxqvkjl", response.iterator().next().sku().size()); - Assertions.assertEquals("ho", response.iterator().next().sku().family()); - Assertions.assertEquals(298942523, response.iterator().next().sku().capacity()); - Assertions.assertEquals("dwdigumb", response.iterator().next().tags().get("raauzzpt")); - Assertions.assertEquals("vaiqyuvvf", response.iterator().next().location()); - Assertions.assertEquals("hqyikvy", response.iterator().next().properties().commitmentPlanGuid()); - Assertions - .assertEquals(HostingModel.CONNECTED_CONTAINER, response.iterator().next().properties().hostingModel()); - Assertions.assertEquals("avluwmncs", response.iterator().next().properties().planType()); - Assertions.assertEquals("jfybvpoekrsgsgb", response.iterator().next().properties().current().tier()); - Assertions.assertEquals(1153864546, response.iterator().next().properties().current().count()); - Assertions.assertEquals(false, response.iterator().next().properties().autoRenew()); - Assertions.assertEquals("dxzxhi", response.iterator().next().properties().next().tier()); - Assertions.assertEquals(1876865651, 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 867b7a8d3246..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListPlansBySubscriptionMockTests.java +++ /dev/null @@ -1,85 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -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.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CommitmentPlansListPlansBySubscriptionMockTests { - @Test - public void testListPlansBySubscription() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"etag\":\"tgdqohmcwsldriz\",\"kind\":\"pwbralllibphbqz\",\"sku\":{\"name\":\"zakakankjpdn\",\"tier\":\"Premium\",\"size\":\"joylh\",\"family\":\"muoyxprimr\",\"capacity\":2035956497},\"tags\":{\"eislstvasylwx\":\"ecj\",\"eoohguufuzboyj\":\"zaum\"},\"location\":\"hwtzolb\",\"properties\":{\"provisioningState\":\"Accepted\",\"commitmentPlanGuid\":\"dxmeb\",\"hostingModel\":\"Web\",\"planType\":\"jpahlxvea\",\"current\":{\"tier\":\"xnmwmqtibxyijddt\",\"count\":1410442260,\"startDate\":\"adijaeukmrsie\",\"endDate\":\"pndzaapmudqmeq\"},\"autoRenew\":false,\"next\":{\"tier\":\"bu\",\"count\":1062514292,\"startDate\":\"eb\",\"endDate\":\"bpmzzn\"},\"last\":{\"tier\":\"fyaqitm\",\"count\":528448638,\"startDate\":\"qaqhvseufu\",\"endDate\":\"rxpdlcgqlsi\"}},\"id\":\"mjqfrddgamquhio\",\"name\":\"rsjuivfcdisyir\",\"type\":\"xzhczexrxz\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("pwbralllibphbqz", response.iterator().next().kind()); - Assertions.assertEquals("zakakankjpdn", response.iterator().next().sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, response.iterator().next().sku().tier()); - Assertions.assertEquals("joylh", response.iterator().next().sku().size()); - Assertions.assertEquals("muoyxprimr", response.iterator().next().sku().family()); - Assertions.assertEquals(2035956497, response.iterator().next().sku().capacity()); - Assertions.assertEquals("ecj", response.iterator().next().tags().get("eislstvasylwx")); - Assertions.assertEquals("hwtzolb", response.iterator().next().location()); - Assertions.assertEquals("dxmeb", response.iterator().next().properties().commitmentPlanGuid()); - Assertions.assertEquals(HostingModel.WEB, response.iterator().next().properties().hostingModel()); - Assertions.assertEquals("jpahlxvea", response.iterator().next().properties().planType()); - Assertions.assertEquals("xnmwmqtibxyijddt", response.iterator().next().properties().current().tier()); - Assertions.assertEquals(1410442260, response.iterator().next().properties().current().count()); - Assertions.assertEquals(false, response.iterator().next().properties().autoRenew()); - Assertions.assertEquals("bu", response.iterator().next().properties().next().tier()); - Assertions.assertEquals(1062514292, 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 71fb79c3e8e8..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentQuotaTests.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.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\":4786890397912480430,\"unit\":\"ctobg\"}") - .toObject(CommitmentQuota.class); - Assertions.assertEquals(4786890397912480430L, model.quantity()); - Assertions.assertEquals("ctobg", model.unit()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CommitmentQuota model = new CommitmentQuota().withQuantity(4786890397912480430L).withUnit("ctobg"); - model = BinaryData.fromObject(model).toObject(CommitmentQuota.class); - Assertions.assertEquals(4786890397912480430L, model.quantity()); - Assertions.assertEquals("ctobg", 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 d8811177009b..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentTierInnerTests.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.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\":\"c\",\"skuName\":\"ynqwwncwzzhxgk\",\"hostingModel\":\"ConnectedContainer\",\"planType\":\"ucnapkteoellwp\",\"tier\":\"d\",\"maxCount\":1046571541,\"quota\":{\"quantity\":816546176101077379,\"unit\":\"ceopzfqrhhuaopp\"},\"cost\":{\"commitmentMeterId\":\"eqx\",\"overageMeterId\":\"z\"}}") - .toObject(CommitmentTierInner.class); - Assertions.assertEquals("c", model.kind()); - Assertions.assertEquals("ynqwwncwzzhxgk", model.skuName()); - Assertions.assertEquals(HostingModel.CONNECTED_CONTAINER, model.hostingModel()); - Assertions.assertEquals("ucnapkteoellwp", model.planType()); - Assertions.assertEquals("d", model.tier()); - Assertions.assertEquals(1046571541, model.maxCount()); - Assertions.assertEquals(816546176101077379L, model.quota().quantity()); - Assertions.assertEquals("ceopzfqrhhuaopp", model.quota().unit()); - Assertions.assertEquals("eqx", model.cost().commitmentMeterId()); - Assertions.assertEquals("z", model.cost().overageMeterId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CommitmentTierInner model = - new CommitmentTierInner() - .withKind("c") - .withSkuName("ynqwwncwzzhxgk") - .withHostingModel(HostingModel.CONNECTED_CONTAINER) - .withPlanType("ucnapkteoellwp") - .withTier("d") - .withMaxCount(1046571541) - .withQuota(new CommitmentQuota().withQuantity(816546176101077379L).withUnit("ceopzfqrhhuaopp")) - .withCost(new CommitmentCost().withCommitmentMeterId("eqx").withOverageMeterId("z")); - model = BinaryData.fromObject(model).toObject(CommitmentTierInner.class); - Assertions.assertEquals("c", model.kind()); - Assertions.assertEquals("ynqwwncwzzhxgk", model.skuName()); - Assertions.assertEquals(HostingModel.CONNECTED_CONTAINER, model.hostingModel()); - Assertions.assertEquals("ucnapkteoellwp", model.planType()); - Assertions.assertEquals("d", model.tier()); - Assertions.assertEquals(1046571541, model.maxCount()); - Assertions.assertEquals(816546176101077379L, model.quota().quantity()); - Assertions.assertEquals("ceopzfqrhhuaopp", model.quota().unit()); - Assertions.assertEquals("eqx", model.cost().commitmentMeterId()); - Assertions.assertEquals("z", 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 974bca670115..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentTierListResultTests.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.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\":\"rbpbewtghfgblcg\",\"value\":[{\"kind\":\"lvqhjkbegibtnmx\",\"skuName\":\"bwwaloa\",\"hostingModel\":\"DisconnectedContainer\",\"planType\":\"wrtz\",\"tier\":\"zg\",\"maxCount\":598094792,\"quota\":{\"quantity\":4114340895697399622,\"unit\":\"ngmtsavjcb\"},\"cost\":{\"commitmentMeterId\":\"qpsrknftguvri\",\"overageMeterId\":\"prwmdyvxqt\"}},{\"kind\":\"riwwroy\",\"skuName\":\"exrmcqibycnojvk\",\"hostingModel\":\"DisconnectedContainer\",\"planType\":\"qsgzvahapj\",\"tier\":\"hpvgqz\",\"maxCount\":256612038,\"quota\":{\"quantity\":8796817644563958079,\"unit\":\"lmwlxkvugfhzo\"},\"cost\":{\"commitmentMeterId\":\"jvzunluthnnp\",\"overageMeterId\":\"xipeilpjzuaejx\"}},{\"kind\":\"ltskzbbtd\",\"skuName\":\"mv\",\"hostingModel\":\"Web\",\"planType\":\"pwo\",\"tier\":\"hkfpbs\",\"maxCount\":657936288,\"quota\":{\"quantity\":1603603856747313899,\"unit\":\"us\"},\"cost\":{\"commitmentMeterId\":\"ouwaboekqvkeln\",\"overageMeterId\":\"vbxwyjsflhh\"}},{\"kind\":\"aln\",\"skuName\":\"xisxyawjoyaqcsl\",\"hostingModel\":\"ConnectedContainer\",\"planType\":\"iidzyexzne\",\"tier\":\"xhnrztfolhb\",\"maxCount\":297001975,\"quota\":{\"quantity\":6939449275608814243,\"unit\":\"lp\"},\"cost\":{\"commitmentMeterId\":\"dtpnapnyiropuhp\",\"overageMeterId\":\"vpgylgqgitxmed\"}}]}") - .toObject(CommitmentTierListResult.class); - Assertions.assertEquals("rbpbewtghfgblcg", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CommitmentTierListResult model = new CommitmentTierListResult().withNextLink("rbpbewtghfgblcg"); - model = BinaryData.fromObject(model).toObject(CommitmentTierListResult.class); - Assertions.assertEquals("rbpbewtghfgblcg", 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 56aaca53b3f0..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentTiersListMockTests.java +++ /dev/null @@ -1,77 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentTier; -import com.azure.resourcemanager.cognitiveservices.models.HostingModel; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CommitmentTiersListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"kind\":\"qjlihhyuspska\",\"skuName\":\"vlmfwdgzxulucv\",\"hostingModel\":\"DisconnectedContainer\",\"planType\":\"sreuzvxurisjnh\",\"tier\":\"txifqj\",\"maxCount\":1170712777,\"quota\":{\"quantity\":2004834361163016327,\"unit\":\"lw\"},\"cost\":{\"commitmentMeterId\":\"sutrgjup\",\"overageMeterId\":\"utpwoqhihejqgw\"}}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("a", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("qjlihhyuspska", response.iterator().next().kind()); - Assertions.assertEquals("vlmfwdgzxulucv", response.iterator().next().skuName()); - Assertions.assertEquals(HostingModel.DISCONNECTED_CONTAINER, response.iterator().next().hostingModel()); - Assertions.assertEquals("sreuzvxurisjnh", response.iterator().next().planType()); - Assertions.assertEquals("txifqj", response.iterator().next().tier()); - Assertions.assertEquals(1170712777, response.iterator().next().maxCount()); - Assertions.assertEquals(2004834361163016327L, response.iterator().next().quota().quantity()); - Assertions.assertEquals("lw", response.iterator().next().quota().unit()); - Assertions.assertEquals("sutrgjup", response.iterator().next().cost().commitmentMeterId()); - Assertions.assertEquals("utpwoqhihejqgw", response.iterator().next().cost().overageMeterId()); - } -} 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 cb82f752be7a..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeletedAccountsPurgeMockTests.java +++ /dev/null @@ -1,61 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DeletedAccountsPurgeMockTests { - @Test - public void testPurge() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("upkvipmdsc", "xqupevzhf", "totxhojujb", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentInnerTests.java deleted file mode 100644 index 82ec86adc796..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentInnerTests.java +++ /dev/null @@ -1,52 +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.DeploymentInner; -import com.azure.resourcemanager.cognitiveservices.models.DeploymentModel; -import com.azure.resourcemanager.cognitiveservices.models.DeploymentProperties; -import com.azure.resourcemanager.cognitiveservices.models.DeploymentScaleSettings; -import com.azure.resourcemanager.cognitiveservices.models.DeploymentScaleType; -import org.junit.jupiter.api.Assertions; - -public final class DeploymentInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeploymentInner model = - BinaryData - .fromString( - "{\"etag\":\"ilvpnppfuflrwd\",\"properties\":{\"provisioningState\":\"Succeeded\",\"model\":{\"format\":\"jrxs\",\"name\":\"afcnih\",\"version\":\"qapnedgfbcv\"},\"scaleSettings\":{\"scaleType\":\"Standard\",\"capacity\":1489059266,\"activeCapacity\":346770564},\"capabilities\":{\"sotbob\":\"vdrhvoo\",\"ld\":\"dopcjwvnh\",\"twuoegrpkhjwni\":\"mgxcxrslpm\"},\"raiPolicyName\":\"sluicpdggkzz\",\"callRateLimit\":{\"count\":62.88767,\"renewalPeriod\":89.78058,\"rules\":[]}},\"id\":\"modfvuefywsbpfvm\",\"name\":\"yhrfouyftaakcpw\",\"type\":\"yzvqt\"}") - .toObject(DeploymentInner.class); - Assertions.assertEquals("jrxs", model.properties().model().format()); - Assertions.assertEquals("afcnih", model.properties().model().name()); - Assertions.assertEquals("qapnedgfbcv", model.properties().model().version()); - Assertions.assertEquals(DeploymentScaleType.STANDARD, model.properties().scaleSettings().scaleType()); - Assertions.assertEquals(1489059266, model.properties().scaleSettings().capacity()); - Assertions.assertEquals("sluicpdggkzz", model.properties().raiPolicyName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeploymentInner model = - new DeploymentInner() - .withProperties( - new DeploymentProperties() - .withModel( - new DeploymentModel().withFormat("jrxs").withName("afcnih").withVersion("qapnedgfbcv")) - .withScaleSettings( - new DeploymentScaleSettings() - .withScaleType(DeploymentScaleType.STANDARD) - .withCapacity(1489059266)) - .withRaiPolicyName("sluicpdggkzz")); - model = BinaryData.fromObject(model).toObject(DeploymentInner.class); - Assertions.assertEquals("jrxs", model.properties().model().format()); - Assertions.assertEquals("afcnih", model.properties().model().name()); - Assertions.assertEquals("qapnedgfbcv", model.properties().model().version()); - Assertions.assertEquals(DeploymentScaleType.STANDARD, model.properties().scaleSettings().scaleType()); - Assertions.assertEquals(1489059266, model.properties().scaleSettings().capacity()); - Assertions.assertEquals("sluicpdggkzz", model.properties().raiPolicyName()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentListResultTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentListResultTests.java deleted file mode 100644 index 6213423a23b5..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentListResultTests.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.DeploymentListResult; -import org.junit.jupiter.api.Assertions; - -public final class DeploymentListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeploymentListResult model = - BinaryData - .fromString( - "{\"nextLink\":\"qxn\",\"value\":[{\"etag\":\"xhuri\",\"properties\":{\"provisioningState\":\"Moving\",\"capabilities\":{},\"raiPolicyName\":\"nkbebxmuby\"},\"id\":\"twlrbqt\",\"name\":\"oievseotgqrlltm\",\"type\":\"wlauwzizxbmpg\"},{\"etag\":\"fuzmuvpbtt\",\"properties\":{\"provisioningState\":\"Accepted\",\"capabilities\":{},\"raiPolicyName\":\"ebmnzbtbhjpglk\"},\"id\":\"ohdneuel\",\"name\":\"phsdyhto\",\"type\":\"fikdowwqu\"},{\"etag\":\"zx\",\"properties\":{\"provisioningState\":\"Succeeded\",\"capabilities\":{},\"raiPolicyName\":\"zonosgg\"},\"id\":\"c\",\"name\":\"hfwdsjnkaljutiis\",\"type\":\"acffgdkzzewkfvhq\"}]}") - .toObject(DeploymentListResult.class); - Assertions.assertEquals("qxn", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeploymentListResult model = new DeploymentListResult().withNextLink("qxn"); - model = BinaryData.fromObject(model).toObject(DeploymentListResult.class); - Assertions.assertEquals("qxn", model.nextLink()); - } -} 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 f53c252c5c4f..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentScaleSettingsTests.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.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\":\"Standard\",\"capacity\":812505700,\"activeCapacity\":1391684752}") - .toObject(DeploymentScaleSettings.class); - Assertions.assertEquals(DeploymentScaleType.STANDARD, model.scaleType()); - Assertions.assertEquals(812505700, model.capacity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeploymentScaleSettings model = - new DeploymentScaleSettings().withScaleType(DeploymentScaleType.STANDARD).withCapacity(812505700); - model = BinaryData.fromObject(model).toObject(DeploymentScaleSettings.class); - Assertions.assertEquals(DeploymentScaleType.STANDARD, model.scaleType()); - Assertions.assertEquals(812505700, model.capacity()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsCreateOrUpdateMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsCreateOrUpdateMockTests.java deleted file mode 100644 index 695351a80395..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,92 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.Deployment; -import com.azure.resourcemanager.cognitiveservices.models.DeploymentModel; -import com.azure.resourcemanager.cognitiveservices.models.DeploymentProperties; -import com.azure.resourcemanager.cognitiveservices.models.DeploymentScaleSettings; -import com.azure.resourcemanager.cognitiveservices.models.DeploymentScaleType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DeploymentsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"etag\":\"trnegvmnvuqeqvld\",\"properties\":{\"provisioningState\":\"Succeeded\",\"model\":{\"format\":\"bkkd\",\"name\":\"lves\",\"version\":\"jlxr\"},\"scaleSettings\":{\"scaleType\":\"Manual\",\"capacity\":646254417,\"activeCapacity\":848547164},\"capabilities\":{\"evufuztck\":\"hpxlktwkuziycs\",\"wmmrq\":\"yhjtqedcgzu\",\"zgkrvqe\":\"zrrjvpgly\"},\"raiPolicyName\":\"toepryu\",\"callRateLimit\":{\"count\":13.608098,\"renewalPeriod\":23.045176,\"rules\":[]}},\"id\":\"dmovzvfva\",\"name\":\"wzqa\",\"type\":\"f\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - CognitiveServicesManager manager = - CognitiveServicesManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Deployment response = - manager - .deployments() - .define("widf") - .withExistingAccount("uqypfcvle", "chpqbmfpjba") - .withProperties( - new DeploymentProperties() - .withModel( - new DeploymentModel() - .withFormat("fhoqca") - .withName("wdaomdjvlpjxxkzb") - .withVersion("sgeivsiy")) - .withScaleSettings( - new DeploymentScaleSettings() - .withScaleType(DeploymentScaleType.STANDARD) - .withCapacity(1333047825)) - .withRaiPolicyName("lvofqzhvfcibyfmo")) - .create(); - - Assertions.assertEquals("bkkd", response.properties().model().format()); - Assertions.assertEquals("lves", response.properties().model().name()); - Assertions.assertEquals("jlxr", response.properties().model().version()); - Assertions.assertEquals(DeploymentScaleType.MANUAL, response.properties().scaleSettings().scaleType()); - Assertions.assertEquals(646254417, response.properties().scaleSettings().capacity()); - Assertions.assertEquals("toepryu", response.properties().raiPolicyName()); - } -} 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 2d944e1b6ca3..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsDeleteMockTests.java +++ /dev/null @@ -1,63 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DeploymentsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("zdwvvbalxl", "lchpodbzevwrdn", "fukuvsjcswsmystu", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsGetWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsGetWithResponseMockTests.java deleted file mode 100644 index 17e0abb41070..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsGetWithResponseMockTests.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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.Deployment; -import com.azure.resourcemanager.cognitiveservices.models.DeploymentScaleType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DeploymentsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"etag\":\"mywwtkgkxnyed\",\"properties\":{\"provisioningState\":\"Accepted\",\"model\":{\"format\":\"dtj\",\"name\":\"wbcihxuuwh\",\"version\":\"yxccyb\"},\"scaleSettings\":{\"scaleType\":\"Standard\",\"capacity\":184122584,\"activeCapacity\":240734224},\"capabilities\":{\"fkyrk\":\"xgwjplmagstcyoh\"},\"raiPolicyName\":\"dg\",\"callRateLimit\":{\"count\":49.6279,\"renewalPeriod\":99.05967,\"rules\":[]}},\"id\":\"nwqjnoba\",\"name\":\"yhddvia\",\"type\":\"egfnmntfpmvmemfn\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - CognitiveServicesManager manager = - CognitiveServicesManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Deployment response = - manager - .deployments() - .getWithResponse("goorbteo", "bfhjxakvvjgsl", "r", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("dtj", response.properties().model().format()); - Assertions.assertEquals("wbcihxuuwh", response.properties().model().name()); - Assertions.assertEquals("yxccyb", response.properties().model().version()); - Assertions.assertEquals(DeploymentScaleType.STANDARD, response.properties().scaleSettings().scaleType()); - Assertions.assertEquals(184122584, response.properties().scaleSettings().capacity()); - Assertions.assertEquals("dg", response.properties().raiPolicyName()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsListMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsListMockTests.java deleted file mode 100644 index 83cefa4c3ba4..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsListMockTests.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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.Deployment; -import com.azure.resourcemanager.cognitiveservices.models.DeploymentScaleType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DeploymentsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"etag\":\"bdyhgkfminsgowz\",\"properties\":{\"provisioningState\":\"Moving\",\"model\":{\"format\":\"ktlahbqa\",\"name\":\"xtgzukxitmmqtgqq\",\"version\":\"hrnxrxc\"},\"scaleSettings\":{\"scaleType\":\"Manual\",\"capacity\":1960010520,\"activeCapacity\":164554341},\"capabilities\":{\"jlfrq\":\"zfvazi\"},\"raiPolicyName\":\"bajlka\",\"callRateLimit\":{\"count\":79.44123,\"renewalPeriod\":26.433247,\"rules\":[]}},\"id\":\"pidkqqfkuvscxkdm\",\"name\":\"igovi\",\"type\":\"rxkpmloazuruoc\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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().list("fgcviz", "zdwlvwlyoupfgfb", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ktlahbqa", response.iterator().next().properties().model().format()); - Assertions.assertEquals("xtgzukxitmmqtgqq", response.iterator().next().properties().model().name()); - Assertions.assertEquals("hrnxrxc", response.iterator().next().properties().model().version()); - Assertions - .assertEquals( - DeploymentScaleType.MANUAL, response.iterator().next().properties().scaleSettings().scaleType()); - Assertions.assertEquals(1960010520, response.iterator().next().properties().scaleSettings().capacity()); - Assertions.assertEquals("bajlka", response.iterator().next().properties().raiPolicyName()); - } -} 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 87a0bb62eab0..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DomainAvailabilityInnerTests.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.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\":false,\"reason\":\"fauvjfdxx\",\"subdomainName\":\"e\",\"type\":\"t\",\"kind\":\"aqtdoqmcbx\"}") - .toObject(DomainAvailabilityInner.class); - Assertions.assertEquals(false, model.isSubdomainAvailable()); - Assertions.assertEquals("fauvjfdxx", model.reason()); - Assertions.assertEquals("e", model.subdomainName()); - Assertions.assertEquals("t", model.type()); - Assertions.assertEquals("aqtdoqmcbx", model.kind()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DomainAvailabilityInner model = - new DomainAvailabilityInner() - .withIsSubdomainAvailable(false) - .withReason("fauvjfdxx") - .withSubdomainName("e") - .withType("t") - .withKind("aqtdoqmcbx"); - model = BinaryData.fromObject(model).toObject(DomainAvailabilityInner.class); - Assertions.assertEquals(false, model.isSubdomainAvailable()); - Assertions.assertEquals("fauvjfdxx", model.reason()); - Assertions.assertEquals("e", model.subdomainName()); - Assertions.assertEquals("t", model.type()); - Assertions.assertEquals("aqtdoqmcbx", 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 018243ac6768..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/IdentityTests.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.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()); - } - - @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/MetricNameTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/MetricNameTests.java deleted file mode 100644 index a32a0d22013e..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/MetricNameTests.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.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\":\"hltrpmopjmcmatuo\",\"localizedValue\":\"hfuiuaodsfc\"}") - .toObject(MetricName.class); - Assertions.assertEquals("hltrpmopjmcmatuo", model.value()); - Assertions.assertEquals("hfuiuaodsfc", model.localizedValue()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MetricName model = new MetricName().withValue("hltrpmopjmcmatuo").withLocalizedValue("hfuiuaodsfc"); - model = BinaryData.fromObject(model).toObject(MetricName.class); - Assertions.assertEquals("hltrpmopjmcmatuo", model.value()); - Assertions.assertEquals("hfuiuaodsfc", model.localizedValue()); - } -} 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 c2ed958b657e..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ModelDeprecationInfoTests.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.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\":\"rupqsxvnmicy\",\"inference\":\"ceoveilovno\"}") - .toObject(ModelDeprecationInfo.class); - Assertions.assertEquals("rupqsxvnmicy", model.fineTune()); - Assertions.assertEquals("ceoveilovno", model.inference()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ModelDeprecationInfo model = - new ModelDeprecationInfo().withFineTune("rupqsxvnmicy").withInference("ceoveilovno"); - model = BinaryData.fromObject(model).toObject(ModelDeprecationInfo.class); - Assertions.assertEquals("rupqsxvnmicy", model.fineTune()); - Assertions.assertEquals("ceoveilovno", model.inference()); - } -} 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 1bc604b36d68..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/MultiRegionSettingsTests.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.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 b71a2f6df264..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkRuleSetTests.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.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\",\"ipRules\":[{\"value\":\"lsuuvmkjozkrwfnd\"}],\"virtualNetworkRules\":[{\"id\":\"jpslwejd\",\"state\":\"wryoqpsoacc\",\"ignoreMissingVnetServiceEndpoint\":true},{\"id\":\"akl\",\"state\":\"ahbc\",\"ignoreMissingVnetServiceEndpoint\":true}]}") - .toObject(NetworkRuleSet.class); - Assertions.assertEquals(NetworkRuleAction.DENY, model.defaultAction()); - Assertions.assertEquals("lsuuvmkjozkrwfnd", 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) - .withIpRules(Arrays.asList(new IpRule().withValue("lsuuvmkjozkrwfnd"))) - .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("lsuuvmkjozkrwfnd", 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/OperationDisplayTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OperationDisplayTests.java deleted file mode 100644 index 4fb8a0c3449e..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OperationDisplayTests.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.OperationDisplay; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = - BinaryData - .fromString( - "{\"provider\":\"rqjbhckfrl\",\"resource\":\"xsbkyvpyca\",\"operation\":\"z\",\"description\":\"zka\"}") - .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 4e5e15e07627..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OperationInnerTests.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.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\":\"fqkquj\",\"isDataAction\":true,\"display\":{\"provider\":\"onobglaocqx\",\"resource\":\"cmgyud\",\"operation\":\"tlmoyrx\",\"description\":\"fudwpznt\"},\"origin\":\"user,system\",\"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 dc17330b2ac2..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OperationListResultTests.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.OperationListResult; - -public final class OperationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationListResult model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"fcnj\",\"isDataAction\":false,\"display\":{\"provider\":\"dhbt\",\"resource\":\"phywpnvj\",\"operation\":\"qnermclfplphoxu\",\"description\":\"rpabg\"},\"origin\":\"user\",\"actionType\":\"Internal\"}],\"nextLink\":\"tazqugxywpmueefj\"}") - .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 f717dad508d5..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OperationsListMockTests.java +++ /dev/null @@ -1,64 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.Operation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class OperationsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"name\":\"cx\",\"isDataAction\":false,\"display\":{\"provider\":\"sofbshrn\",\"resource\":\"buswdvzyy\",\"operation\":\"cnunvjsr\",\"description\":\"f\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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 28b7bb08f2ca..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PatchResourceTagsAndSkuTests.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.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\":\"lt\",\"tier\":\"Enterprise\",\"size\":\"cwsobqwcs\",\"family\":\"nwdcfhu\",\"capacity\":1491398356},\"tags\":{\"vtvudutncormr\":\"uvglsbjjcanvx\",\"f\":\"xqtvcofu\",\"u\":\"vkg\"}}") - .toObject(PatchResourceTagsAndSku.class); - Assertions.assertEquals("uvglsbjjcanvx", model.tags().get("vtvudutncormr")); - Assertions.assertEquals("lt", model.sku().name()); - Assertions.assertEquals(SkuTier.ENTERPRISE, model.sku().tier()); - Assertions.assertEquals("cwsobqwcs", model.sku().size()); - Assertions.assertEquals("nwdcfhu", model.sku().family()); - Assertions.assertEquals(1491398356, model.sku().capacity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PatchResourceTagsAndSku model = - new PatchResourceTagsAndSku() - .withTags(mapOf("vtvudutncormr", "uvglsbjjcanvx", "f", "xqtvcofu", "u", "vkg")) - .withSku( - new Sku() - .withName("lt") - .withTier(SkuTier.ENTERPRISE) - .withSize("cwsobqwcs") - .withFamily("nwdcfhu") - .withCapacity(1491398356)); - model = BinaryData.fromObject(model).toObject(PatchResourceTagsAndSku.class); - Assertions.assertEquals("uvglsbjjcanvx", model.tags().get("vtvudutncormr")); - Assertions.assertEquals("lt", model.sku().name()); - Assertions.assertEquals(SkuTier.ENTERPRISE, model.sku().tier()); - Assertions.assertEquals("cwsobqwcs", model.sku().size()); - Assertions.assertEquals("nwdcfhu", model.sku().family()); - Assertions.assertEquals(1491398356, model.sku().capacity()); - } - - @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 63282d7de40f..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PatchResourceTagsTests.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.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\":{\"tor\":\"knnqvsaznq\",\"a\":\"dsg\",\"wjue\":\"mkycgra\"}}") - .toObject(PatchResourceTags.class); - Assertions.assertEquals("knnqvsaznq", model.tags().get("tor")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PatchResourceTags model = - new PatchResourceTags().withTags(mapOf("tor", "knnqvsaznq", "a", "dsg", "wjue", "mkycgra")); - model = BinaryData.fromObject(model).toObject(PatchResourceTags.class); - Assertions.assertEquals("knnqvsaznq", model.tags().get("tor")); - } - - @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 178d76a2108c..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionInnerTests.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.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\":\"ayhuy\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"odepoogin\",\"actionsRequired\":\"amiheognarxz\"},\"provisioningState\":\"Creating\",\"groupIds\":[\"tusivyevcciqihn\"]},\"location\":\"gbwjzrnf\",\"etag\":\"xgispemvtzfkufu\",\"id\":\"ljofxqeofjaeqjh\",\"name\":\"jbasvmsmjqulngs\",\"type\":\"tnb\"}") - .toObject(PrivateEndpointConnectionInner.class); - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.APPROVED, - model.properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("odepoogin", model.properties().privateLinkServiceConnectionState().description()); - Assertions - .assertEquals("amiheognarxz", model.properties().privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("tusivyevcciqihn", model.properties().groupIds().get(0)); - Assertions.assertEquals("gbwjzrnf", 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.APPROVED) - .withDescription("odepoogin") - .withActionsRequired("amiheognarxz")) - .withGroupIds(Arrays.asList("tusivyevcciqihn"))) - .withLocation("gbwjzrnf"); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionInner.class); - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.APPROVED, - model.properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("odepoogin", model.properties().privateLinkServiceConnectionState().description()); - Assertions - .assertEquals("amiheognarxz", model.properties().privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("tusivyevcciqihn", model.properties().groupIds().get(0)); - Assertions.assertEquals("gbwjzrnf", 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 9315d4cb644e..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionListResultInnerTests.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.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.PrivateEndpointConnectionListResultInner; -import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointConnectionProperties; -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\":{\"provisioningState\":\"Creating\",\"groupIds\":[]},\"location\":\"sfxobl\",\"etag\":\"k\",\"id\":\"lmpewwwfbkr\",\"name\":\"rn\",\"type\":\"vshqjohxcr\"},{\"properties\":{\"provisioningState\":\"Deleting\",\"groupIds\":[]},\"location\":\"ruvw\",\"etag\":\"sqfsubcgjbirxb\",\"id\":\"ybsrfbjfdtwss\",\"name\":\"t\",\"type\":\"tpvjzbexilzznfqq\"}]}") - .toObject(PrivateEndpointConnectionListResultInner.class); - Assertions.assertEquals("sfxobl", 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().withGroupIds(Arrays.asList())) - .withLocation("sfxobl"), - new PrivateEndpointConnectionInner() - .withProperties(new PrivateEndpointConnectionProperties().withGroupIds(Arrays.asList())) - .withLocation("ruvw"))); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionListResultInner.class); - Assertions.assertEquals("sfxobl", 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 33f5d2e356df..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionPropertiesTests.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.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 87db55e35223..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsCreateOrUpdateMockTests.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.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -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.ByteBuffer; -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 org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"privateEndpoint\":{\"id\":\"mduvw\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"xwmygdxpgpqc\",\"actionsRequired\":\"sze\"},\"provisioningState\":\"Succeeded\",\"groupIds\":[\"crxgibb\",\"axconfozauo\",\"sukokwbqplhl\",\"nuuepzlrp\"]},\"location\":\"soldweyuqdunv\",\"etag\":\"nrwrbiork\",\"id\":\"alywjhhgdn\",\"name\":\"xmsivfomiloxggdu\",\"type\":\"iqndieuzaofj\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("cbhernntiewdj") - .withExistingAccount("jkqa", "qgzsles") - .withRegion("lfg") - .withProperties( - new PrivateEndpointConnectionProperties() - .withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("kmr") - .withActionsRequired("mvvhmxtdrjfuta")) - .withGroupIds(Arrays.asList("vewzcj", "nmwcpmgu", "adraufactkahzo", "ajjziuxxpshne"))) - .create(); - - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.PENDING, - response.properties().privateLinkServiceConnectionState().status()); - Assertions - .assertEquals("xwmygdxpgpqc", response.properties().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("sze", response.properties().privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("crxgibb", response.properties().groupIds().get(0)); - Assertions.assertEquals("soldweyuqdunv", 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 744c0943e134..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsDeleteMockTests.java +++ /dev/null @@ -1,63 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("fqjbvleo", "fmluiqtqzfavyvn", "qybaryeua", 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 5d2dfec27e38..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java +++ /dev/null @@ -1,80 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointConnection; -import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointServiceConnectionStatus; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"privateEndpoint\":{\"id\":\"lgzi\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"stgktst\",\"actionsRequired\":\"xeclzedqbcvhzlhp\"},\"provisioningState\":\"Deleting\",\"groupIds\":[\"dlwwqfbumlkxt\"]},\"location\":\"fsmlmbtxhwgfw\",\"etag\":\"tawc\",\"id\":\"ezbrhubskh\",\"name\":\"dyg\",\"type\":\"ookk\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("kgxywr", "kpyklyhp", "uodpv", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.APPROVED, - response.properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("stgktst", response.properties().privateLinkServiceConnectionState().description()); - Assertions - .assertEquals( - "xeclzedqbcvhzlhp", response.properties().privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("dlwwqfbumlkxt", response.properties().groupIds().get(0)); - Assertions.assertEquals("fsmlmbtxhwgfw", 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 dc724e5de640..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsListWithResponseMockTests.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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointConnectionListResult; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsListWithResponseMockTests { - @Test - public void testListWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"location\":\"xvydfceacvlhvygd\",\"etag\":\"t\",\"id\":\"mrtwna\",\"name\":\"jslb\",\"type\":\"wkojgcyztsfmzn\"},{\"location\":\"ph\",\"etag\":\"qnrnrpxehuwryk\",\"id\":\"gaifmvik\",\"name\":\"bydvkhbejdz\",\"type\":\"xcv\"},{\"location\":\"njivolvtnovq\",\"etag\":\"gemjdftuljltdu\",\"id\":\"eamtmcz\",\"name\":\"o\",\"type\":\"ejwcwwqiok\"},{\"location\":\"mojmsvpkjprvkw\",\"etag\":\"zqljyxgtczh\",\"id\":\"ydbsd\",\"name\":\"hmkxmaehvbb\",\"type\":\"uripltfnhtba\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("pnfqntcyp", "xjvfoimwksl", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("xvydfceacvlhvygd", 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 23106c0f467b..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourceListResultInnerTests.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.PrivateLinkResourceListResultInner; -import com.azure.resourcemanager.cognitiveservices.models.PrivateLinkResource; -import com.azure.resourcemanager.cognitiveservices.models.PrivateLinkResourceProperties; -import java.util.Arrays; - -public final class PrivateLinkResourceListResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceListResultInner model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"groupId\":\"qtaruoujmkcjhwq\",\"requiredMembers\":[],\"requiredZoneNames\":[],\"displayName\":\"ybn\"},\"id\":\"jewgdrjerv\",\"name\":\"aen\",\"type\":\"pehindoygm\"},{\"properties\":{\"groupId\":\"hnzdndslgnayqi\",\"requiredMembers\":[],\"requiredZoneNames\":[],\"displayName\":\"uhavhql\"},\"id\":\"thuma\",\"name\":\"olbgycduiertgccy\",\"type\":\"vaolpsslqlf\"}]}") - .toObject(PrivateLinkResourceListResultInner.class); - } - - @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())), - new PrivateLinkResource() - .withProperties( - new PrivateLinkResourceProperties().withRequiredZoneNames(Arrays.asList())))); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceListResultInner.class); - } -} 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 8a09e30e76e7..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourcePropertiesTests.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.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\":\"ets\",\"requiredMembers\":[\"zhedplvwiw\",\"bmwmbesldnkw\",\"tppjflcx\"],\"requiredZoneNames\":[\"okonzmnsikvmkqz\",\"qqkdltfzxmhhvhgu\",\"eodkwobda\"],\"displayName\":\"tibqdxbxwakb\"}") - .toObject(PrivateLinkResourceProperties.class); - Assertions.assertEquals("okonzmnsikvmkqz", model.requiredZoneNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceProperties model = - new PrivateLinkResourceProperties() - .withRequiredZoneNames(Arrays.asList("okonzmnsikvmkqz", "qqkdltfzxmhhvhgu", "eodkwobda")); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceProperties.class); - Assertions.assertEquals("okonzmnsikvmkqz", 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 71ad6215ab2c..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourceTests.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.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\":\"n\",\"requiredMembers\":[\"lzpswiydm\",\"wyhzdx\",\"sadbz\"],\"requiredZoneNames\":[\"dfznudaodv\",\"zbn\",\"blylpstdbh\",\"xsrz\"],\"displayName\":\"ucerscdntnevfi\"},\"id\":\"jmygtdsslswtmwer\",\"name\":\"ofz\",\"type\":\"yqsemwa\"}") - .toObject(PrivateLinkResource.class); - Assertions.assertEquals("dfznudaodv", 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("dfznudaodv", "zbn", "blylpstdbh", "xsrz"))); - model = BinaryData.fromObject(model).toObject(PrivateLinkResource.class); - Assertions.assertEquals("dfznudaodv", 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 60f422b79b6e..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourcesListWithResponseMockTests.java +++ /dev/null @@ -1,67 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.PrivateLinkResourceListResult; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateLinkResourcesListWithResponseMockTests { - @Test - public void testListWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"id\":\"pwoqo\",\"name\":\"macjekn\",\"type\":\"zshq\"},{\"id\":\"impevf\",\"name\":\"mblrrilbywd\",\"type\":\"smiccwrwfscj\"},{\"id\":\"ynszquji\",\"name\":\"dvoqyt\",\"type\":\"byowbblgyavutp\"},{\"id\":\"joxoism\",\"name\":\"ksbpimlqoljx\",\"type\":\"cgxxlxs\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("hvcyyysfg", "otcubi", com.azure.core.util.Context.NONE) - .getValue(); - } -} 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 4a3658064810..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkServiceConnectionStateTests.java +++ /dev/null @@ -1,37 +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/RegionSettingTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RegionSettingTests.java deleted file mode 100644 index 26c38bed71cd..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RegionSettingTests.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.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 3a4b1f1eaf4b..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RequestMatchPatternTests.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.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 8fc02af6d0de..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProvidersCheckDomainAvailabilityWithResponseMockTests.java +++ /dev/null @@ -1,80 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.CheckDomainAvailabilityParameter; -import com.azure.resourcemanager.cognitiveservices.models.DomainAvailability; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ResourceProvidersCheckDomainAvailabilityWithResponseMockTests { - @Test - public void testCheckDomainAvailabilityWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"isSubdomainAvailable\":true,\"reason\":\"fssnrbgyefrymsga\",\"subdomainName\":\"fmwncotmrfh\",\"type\":\"ctymoxoftp\",\"kind\":\"iwyczuh\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("bomvzzbtdcqv") - .withType("niyujv") - .withKind("l"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(true, response.isSubdomainAvailable()); - Assertions.assertEquals("fssnrbgyefrymsga", response.reason()); - Assertions.assertEquals("fmwncotmrfh", response.subdomainName()); - Assertions.assertEquals("ctymoxoftp", response.type()); - Assertions.assertEquals("iwyczuh", 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 cbbddea9f605..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProvidersCheckSkuAvailabilityWithResponseMockTests.java +++ /dev/null @@ -1,83 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.CheckSkuAvailabilityParameter; -import com.azure.resourcemanager.cognitiveservices.models.SkuAvailabilityListResult; -import java.nio.ByteBuffer; -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 org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ResourceProvidersCheckSkuAvailabilityWithResponseMockTests { - @Test - public void testCheckSkuAvailabilityWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"kind\":\"pjbi\",\"type\":\"jmfxumvf\",\"skuName\":\"uyovw\",\"skuAvailable\":true,\"reason\":\"fezzxscyhwzdg\",\"message\":\"ujb\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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( - "qg", - new CheckSkuAvailabilityParameter() - .withSkus(Arrays.asList("yzirtxdyuxzejn", "psew", "ioilqukrydxtq")) - .withKind("ieoxorggufhyaomt") - .withType("ghhavgrvkffo"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("pjbi", response.value().get(0).kind()); - Assertions.assertEquals("jmfxumvf", response.value().get(0).type()); - Assertions.assertEquals("uyovw", response.value().get(0).skuName()); - Assertions.assertEquals(true, response.value().get(0).skuAvailable()); - Assertions.assertEquals("fezzxscyhwzdg", response.value().get(0).reason()); - Assertions.assertEquals("ujb", response.value().get(0).message()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceSkuListResultTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceSkuListResultTests.java deleted file mode 100644 index 04df5dccf265..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceSkuListResultTests.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.ResourceSkuInner; -import com.azure.resourcemanager.cognitiveservices.models.ResourceSkuListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ResourceSkuListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceSkuListResult model = - BinaryData - .fromString( - "{\"value\":[{\"resourceType\":\"wmdwzjeiachboo\",\"name\":\"lnrosfqp\",\"tier\":\"ehzzvypyqrim\",\"kind\":\"npvswjdkirso\",\"locations\":[\"xhcr\",\"nohjt\"],\"restrictions\":[]},{\"resourceType\":\"dsoifiyipj\",\"name\":\"qwpgrjbzn\",\"tier\":\"cjxvsnbyxqab\",\"kind\":\"ocpcy\",\"locations\":[\"rzafbljjgpbtoqcj\",\"klj\"],\"restrictions\":[]},{\"resourceType\":\"idtqajzyu\",\"name\":\"kudjkrlkhb\",\"tier\":\"fepgzgq\",\"kind\":\"zloc\",\"locations\":[\"paierh\"],\"restrictions\":[]},{\"resourceType\":\"glu\",\"name\":\"a\",\"tier\":\"j\",\"kind\":\"dxob\",\"locations\":[\"xkqpxo\",\"ajionpimexgstxg\"],\"restrictions\":[]}],\"nextLink\":\"gmaajrm\"}") - .toObject(ResourceSkuListResult.class); - Assertions.assertEquals("wmdwzjeiachboo", model.value().get(0).resourceType()); - Assertions.assertEquals("lnrosfqp", model.value().get(0).name()); - Assertions.assertEquals("ehzzvypyqrim", model.value().get(0).tier()); - Assertions.assertEquals("npvswjdkirso", model.value().get(0).kind()); - Assertions.assertEquals("xhcr", model.value().get(0).locations().get(0)); - Assertions.assertEquals("gmaajrm", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceSkuListResult model = - new ResourceSkuListResult() - .withValue( - Arrays - .asList( - new ResourceSkuInner() - .withResourceType("wmdwzjeiachboo") - .withName("lnrosfqp") - .withTier("ehzzvypyqrim") - .withKind("npvswjdkirso") - .withLocations(Arrays.asList("xhcr", "nohjt")) - .withRestrictions(Arrays.asList()), - new ResourceSkuInner() - .withResourceType("dsoifiyipj") - .withName("qwpgrjbzn") - .withTier("cjxvsnbyxqab") - .withKind("ocpcy") - .withLocations(Arrays.asList("rzafbljjgpbtoqcj", "klj")) - .withRestrictions(Arrays.asList()), - new ResourceSkuInner() - .withResourceType("idtqajzyu") - .withName("kudjkrlkhb") - .withTier("fepgzgq") - .withKind("zloc") - .withLocations(Arrays.asList("paierh")) - .withRestrictions(Arrays.asList()), - new ResourceSkuInner() - .withResourceType("glu") - .withName("a") - .withTier("j") - .withKind("dxob") - .withLocations(Arrays.asList("xkqpxo", "ajionpimexgstxg")) - .withRestrictions(Arrays.asList()))) - .withNextLink("gmaajrm"); - model = BinaryData.fromObject(model).toObject(ResourceSkuListResult.class); - Assertions.assertEquals("wmdwzjeiachboo", model.value().get(0).resourceType()); - Assertions.assertEquals("lnrosfqp", model.value().get(0).name()); - Assertions.assertEquals("ehzzvypyqrim", model.value().get(0).tier()); - Assertions.assertEquals("npvswjdkirso", model.value().get(0).kind()); - Assertions.assertEquals("xhcr", model.value().get(0).locations().get(0)); - Assertions.assertEquals("gmaajrm", model.nextLink()); - } -} 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 cb5d2b9351a0..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceSkuRestrictionInfoTests.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.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\":[\"a\"],\"zones\":[\"z\",\"yvvtpgvdfgio\"]}") - .toObject(ResourceSkuRestrictionInfo.class); - Assertions.assertEquals("a", model.locations().get(0)); - Assertions.assertEquals("z", model.zones().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceSkuRestrictionInfo model = - new ResourceSkuRestrictionInfo() - .withLocations(Arrays.asList("a")) - .withZones(Arrays.asList("z", "yvvtpgvdfgio")); - model = BinaryData.fromObject(model).toObject(ResourceSkuRestrictionInfo.class); - Assertions.assertEquals("a", model.locations().get(0)); - Assertions.assertEquals("z", 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 2459d0208fd0..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuAvailabilityListResultInnerTests.java +++ /dev/null @@ -1,65 +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\":\"ljuahaquhcdh\",\"type\":\"ualaexqpvfadmw\",\"skuName\":\"crgvxpvgom\",\"skuAvailable\":false,\"reason\":\"isgwbnbbeldawkz\",\"message\":\"liourqhak\"},{\"kind\":\"hashsfwxosow\",\"type\":\"cugicjoox\",\"skuName\":\"ebwpucwwfvo\",\"skuAvailable\":false,\"reason\":\"euecivyhzceuoj\",\"message\":\"rw\"},{\"kind\":\"eiotwmcdytdx\",\"type\":\"txnrjaw\",\"skuName\":\"wgxhn\",\"skuAvailable\":true,\"reason\":\"fbkp\",\"message\":\"gklwn\"}]}") - .toObject(SkuAvailabilityListResultInner.class); - Assertions.assertEquals("ljuahaquhcdh", model.value().get(0).kind()); - Assertions.assertEquals("ualaexqpvfadmw", model.value().get(0).type()); - Assertions.assertEquals("crgvxpvgom", model.value().get(0).skuName()); - Assertions.assertEquals(false, model.value().get(0).skuAvailable()); - Assertions.assertEquals("isgwbnbbeldawkz", model.value().get(0).reason()); - Assertions.assertEquals("liourqhak", 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("ljuahaquhcdh") - .withType("ualaexqpvfadmw") - .withSkuName("crgvxpvgom") - .withSkuAvailable(false) - .withReason("isgwbnbbeldawkz") - .withMessage("liourqhak"), - new SkuAvailability() - .withKind("hashsfwxosow") - .withType("cugicjoox") - .withSkuName("ebwpucwwfvo") - .withSkuAvailable(false) - .withReason("euecivyhzceuoj") - .withMessage("rw"), - new SkuAvailability() - .withKind("eiotwmcdytdx") - .withType("txnrjaw") - .withSkuName("wgxhn") - .withSkuAvailable(true) - .withReason("fbkp") - .withMessage("gklwn"))); - model = BinaryData.fromObject(model).toObject(SkuAvailabilityListResultInner.class); - Assertions.assertEquals("ljuahaquhcdh", model.value().get(0).kind()); - Assertions.assertEquals("ualaexqpvfadmw", model.value().get(0).type()); - Assertions.assertEquals("crgvxpvgom", model.value().get(0).skuName()); - Assertions.assertEquals(false, model.value().get(0).skuAvailable()); - Assertions.assertEquals("isgwbnbbeldawkz", model.value().get(0).reason()); - Assertions.assertEquals("liourqhak", 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 c6df8e5f0efd..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuAvailabilityTests.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.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\":\"hjdauwhvylwz\",\"type\":\"dhxujznbmpo\",\"skuName\":\"wpr\",\"skuAvailable\":false,\"reason\":\"eualupjmkhf\",\"message\":\"bbcswsrtjri\"}") - .toObject(SkuAvailability.class); - Assertions.assertEquals("hjdauwhvylwz", model.kind()); - Assertions.assertEquals("dhxujznbmpo", model.type()); - Assertions.assertEquals("wpr", model.skuName()); - Assertions.assertEquals(false, model.skuAvailable()); - Assertions.assertEquals("eualupjmkhf", model.reason()); - Assertions.assertEquals("bbcswsrtjri", model.message()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuAvailability model = - new SkuAvailability() - .withKind("hjdauwhvylwz") - .withType("dhxujznbmpo") - .withSkuName("wpr") - .withSkuAvailable(false) - .withReason("eualupjmkhf") - .withMessage("bbcswsrtjri"); - model = BinaryData.fromObject(model).toObject(SkuAvailability.class); - Assertions.assertEquals("hjdauwhvylwz", model.kind()); - Assertions.assertEquals("dhxujznbmpo", model.type()); - Assertions.assertEquals("wpr", model.skuName()); - Assertions.assertEquals(false, model.skuAvailable()); - Assertions.assertEquals("eualupjmkhf", model.reason()); - Assertions.assertEquals("bbcswsrtjri", 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 3a0811cd7fb9..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuCapabilityTests.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.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 41d522d8a815..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuChangeInfoTests.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.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/SkuTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuTests.java deleted file mode 100644 index 8c3da6ed2ff2..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuTests.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.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 494f17b1d47b..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UsageListResultInnerTests.java +++ /dev/null @@ -1,83 +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( - "{\"value\":[{\"unit\":\"Seconds\",\"name\":{\"value\":\"jpqyegu\",\"localizedValue\":\"hb\"},\"quotaPeriod\":\"hejjz\",\"limit\":70.33604475808148,\"currentValue\":63.32915383545625,\"nextResetTime\":\"slfhotwm\",\"status\":\"InOverage\"},{\"unit\":\"Milliseconds\",\"name\":{\"value\":\"jnpg\",\"localizedValue\":\"ftadehxnltyfs\"},\"quotaPeriod\":\"pusuesn\",\"limit\":42.583161707778174,\"currentValue\":20.416251033380174,\"nextResetTime\":\"orxzdmohctbqvud\",\"status\":\"Blocked\"},{\"unit\":\"Count\",\"name\":{\"value\":\"owgujjugwdkcglhs\",\"localizedValue\":\"zj\"},\"quotaPeriod\":\"ggd\",\"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\"}]}") - .toObject(UsageListResultInner.class); - Assertions.assertEquals(UnitType.SECONDS, model.value().get(0).unit()); - Assertions.assertEquals("jpqyegu", model.value().get(0).name().value()); - Assertions.assertEquals("hb", model.value().get(0).name().localizedValue()); - Assertions.assertEquals("hejjz", model.value().get(0).quotaPeriod()); - Assertions.assertEquals(70.33604475808148D, model.value().get(0).limit()); - Assertions.assertEquals(63.32915383545625D, model.value().get(0).currentValue()); - Assertions.assertEquals("slfhotwm", model.value().get(0).nextResetTime()); - Assertions.assertEquals(QuotaUsageStatus.IN_OVERAGE, model.value().get(0).status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UsageListResultInner model = - new UsageListResultInner() - .withValue( - Arrays - .asList( - new Usage() - .withUnit(UnitType.SECONDS) - .withName(new MetricName().withValue("jpqyegu").withLocalizedValue("hb")) - .withQuotaPeriod("hejjz") - .withLimit(70.33604475808148D) - .withCurrentValue(63.32915383545625D) - .withNextResetTime("slfhotwm") - .withStatus(QuotaUsageStatus.IN_OVERAGE), - new Usage() - .withUnit(UnitType.MILLISECONDS) - .withName(new MetricName().withValue("jnpg").withLocalizedValue("ftadehxnltyfs")) - .withQuotaPeriod("pusuesn") - .withLimit(42.583161707778174D) - .withCurrentValue(20.416251033380174D) - .withNextResetTime("orxzdmohctbqvud") - .withStatus(QuotaUsageStatus.BLOCKED), - new Usage() - .withUnit(UnitType.COUNT) - .withName(new MetricName().withValue("owgujjugwdkcglhs").withLocalizedValue("zj")) - .withQuotaPeriod("ggd") - .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))); - model = BinaryData.fromObject(model).toObject(UsageListResultInner.class); - Assertions.assertEquals(UnitType.SECONDS, model.value().get(0).unit()); - Assertions.assertEquals("jpqyegu", model.value().get(0).name().value()); - Assertions.assertEquals("hb", model.value().get(0).name().localizedValue()); - Assertions.assertEquals("hejjz", model.value().get(0).quotaPeriod()); - Assertions.assertEquals(70.33604475808148D, model.value().get(0).limit()); - Assertions.assertEquals(63.32915383545625D, model.value().get(0).currentValue()); - Assertions.assertEquals("slfhotwm", model.value().get(0).nextResetTime()); - Assertions.assertEquals(QuotaUsageStatus.IN_OVERAGE, 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 212a61392d34..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UsageTests.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.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\":\"Milliseconds\",\"name\":{\"value\":\"kqsleyyvxy\",\"localizedValue\":\"pkc\"},\"quotaPeriod\":\"tpngjcrcczsqpjh\",\"limit\":15.683771184024254,\"currentValue\":5.670664395942426,\"nextResetTime\":\"sounqecanoaeu\",\"status\":\"Included\"}") - .toObject(Usage.class); - Assertions.assertEquals(UnitType.MILLISECONDS, model.unit()); - Assertions.assertEquals("kqsleyyvxy", model.name().value()); - Assertions.assertEquals("pkc", model.name().localizedValue()); - Assertions.assertEquals("tpngjcrcczsqpjh", model.quotaPeriod()); - Assertions.assertEquals(15.683771184024254D, model.limit()); - Assertions.assertEquals(5.670664395942426D, model.currentValue()); - Assertions.assertEquals("sounqecanoaeu", model.nextResetTime()); - Assertions.assertEquals(QuotaUsageStatus.INCLUDED, model.status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Usage model = - 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); - model = BinaryData.fromObject(model).toObject(Usage.class); - Assertions.assertEquals(UnitType.MILLISECONDS, model.unit()); - Assertions.assertEquals("kqsleyyvxy", model.name().value()); - Assertions.assertEquals("pkc", model.name().localizedValue()); - Assertions.assertEquals("tpngjcrcczsqpjh", model.quotaPeriod()); - Assertions.assertEquals(15.683771184024254D, model.limit()); - Assertions.assertEquals(5.670664395942426D, model.currentValue()); - Assertions.assertEquals("sounqecanoaeu", model.nextResetTime()); - Assertions.assertEquals(QuotaUsageStatus.INCLUDED, model.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 94052c2c7cac..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UserAssignedIdentityTests.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.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/UserOwnedStorageTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UserOwnedStorageTests.java deleted file mode 100644 index d911290e5f20..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UserOwnedStorageTests.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.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 3b9844f19136..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/VirtualNetworkRuleTests.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.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()); - } -}