From 77aff33dbcd3458ff6b79e1d3106cd1b329feab8 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 2 Dec 2022 23:43:32 +0000 Subject: [PATCH] CodeGen from PR 21716 in Azure/azure-rest-api-specs Merge 2048e3a7658a74bd4b2ad3db372ce7de4fb13ec3 into 878fe925bc9f48b7b1451be3e6842bf44f938c34 --- .../CHANGELOG.md | 4 +- .../README.md | 4 +- .../SAMPLE.md | 351 ++- .../pom.xml | 2 +- .../CognitiveServicesManager.java | 4 +- .../fluent/CommitmentPlansClient.java | 471 +++ .../fluent/models/AccountModelInner.java | 54 + ...CommitmentPlanAccountAssociationInner.java | 97 + ...tmentPlanAccountAssociationProperties.java | 50 + .../fluent/models/CommitmentPlanInner.java | 111 + .../implementation/AccountModelImpl.java | 14 + ...CognitiveServicesManagementClientImpl.java | 2 +- .../CommitmentPlanAccountAssociationImpl.java | 164 + .../implementation/CommitmentPlanImpl.java | 102 +- .../CommitmentPlansClientImpl.java | 2712 ++++++++++++++++- .../implementation/CommitmentPlansImpl.java | 278 +- .../models/AccountModel.java | 14 + .../models/AccountProperties.java | 47 + .../models/CommitmentPlan.java | 132 +- .../CommitmentPlanAccountAssociation.java | 172 ++ ...tmentPlanAccountAssociationListResult.java | 71 + .../models/CommitmentPlanAssociation.java | 76 + .../models/CommitmentPlanProperties.java | 41 + .../CommitmentPlanProvisioningState.java | 53 + .../models/CommitmentPlans.java | 290 +- .../models/ModelLifecycleStatus.java | 38 + .../models/MultiRegionSettings.java | 80 + .../models/PatchResourceTags.java | 53 + .../models/PatchResourceTagsAndSku.java | 63 + .../models/RegionSetting.java | 102 + .../models/RoutingMethods.java | 41 + .../generated/AccountsCreateSamples.java | 4 +- .../generated/AccountsDeleteSamples.java | 2 +- .../AccountsGetByResourceGroupSamples.java | 2 +- .../AccountsListByResourceGroupSamples.java | 2 +- .../generated/AccountsListKeysSamples.java | 2 +- .../generated/AccountsListModelsSamples.java | 2 +- .../generated/AccountsListSamples.java | 2 +- .../generated/AccountsListSkusSamples.java | 2 +- .../generated/AccountsListUsagesSamples.java | 2 +- .../AccountsRegenerateKeySamples.java | 2 +- .../generated/AccountsUpdateSamples.java | 2 +- ...PlansCreateOrUpdateAssociationSamples.java | 26 + ...mitmentPlansCreateOrUpdatePlanSamples.java | 39 + .../CommitmentPlansCreateOrUpdateSamples.java | 25 +- ...mmitmentPlansDeleteAssociationSamples.java | 26 + .../CommitmentPlansDeletePlanSamples.java | 23 + .../CommitmentPlansDeleteSamples.java | 2 +- .../CommitmentPlansGetAssociationSamples.java | 25 + ...mitmentPlansGetByResourceGroupSamples.java | 24 + .../generated/CommitmentPlansGetSamples.java | 2 +- ...ommitmentPlansListAssociationsSamples.java | 23 + ...itmentPlansListByResourceGroupSamples.java | 23 + ...ntPlansListPlansBySubscriptionSamples.java | 23 + .../generated/CommitmentPlansListSamples.java | 2 +- .../CommitmentPlansUpdatePlanSamples.java | 42 + .../generated/CommitmentTiersListSamples.java | 2 +- .../generated/DeletedAccountsGetSamples.java | 2 +- .../generated/DeletedAccountsListSamples.java | 2 +- .../DeletedAccountsPurgeSamples.java | 2 +- .../DeploymentsCreateOrUpdateSamples.java | 2 +- .../generated/DeploymentsDeleteSamples.java | 2 +- .../generated/DeploymentsGetSamples.java | 2 +- .../generated/DeploymentsListSamples.java | 2 +- .../generated/OperationsListSamples.java | 2 +- ...pointConnectionsCreateOrUpdateSamples.java | 2 +- ...ivateEndpointConnectionsDeleteSamples.java | 2 +- .../PrivateEndpointConnectionsGetSamples.java | 2 +- ...PrivateEndpointConnectionsListSamples.java | 2 +- .../PrivateLinkResourcesListSamples.java | 2 +- ...roviderCheckDomainAvailabilitySamples.java | 2 +- ...ceProviderCheckSkuAvailabilitySamples.java | 2 +- .../generated/ResourceSkusListSamples.java | 2 +- .../AccountModelListResultTests.java | 132 - .../AccountSkuListResultInnerTests.java | 56 - .../generated/AccountSkuTests.java | 50 - .../generated/AccountsDeleteMockTests.java | 62 - .../AccountsListModelsMockTests.java | 77 - ...AccountsListSkusWithResponseMockTests.java | 68 - ...countsListUsagesWithResponseMockTests.java | 75 - .../generated/AzureEntityResourceTests.java | 26 - ...CheckDomainAvailabilityParameterTests.java | 36 - .../CheckSkuAvailabilityParameterTests.java | 37 - .../generated/CommitmentCostTests.java | 31 - .../generated/CommitmentPeriodTests.java | 31 - .../generated/CommitmentPlanInnerTests.java | 52 - .../CommitmentPlanListResultTests.java | 29 - .../CommitmentPlanPropertiesTests.java | 49 - ...nsCreateOrUpdateWithResponseMockTests.java | 87 - .../CommitmentPlansDeleteMockTests.java | 62 - ...mmitmentPlansGetWithResponseMockTests.java | 75 - .../CommitmentPlansListMockTests.java | 76 - .../generated/CommitmentQuotaTests.java | 30 - .../generated/CommitmentTierInnerTests.java | 60 - .../CommitmentTierListResultTests.java | 29 - .../CommitmentTiersListMockTests.java | 78 - .../DeletedAccountsPurgeMockTests.java | 62 - .../generated/DeploymentInnerTests.java | 56 - .../generated/DeploymentListResultTests.java | 29 - .../DeploymentScaleSettingsTests.java | 32 - .../DeploymentsCreateOrUpdateMockTests.java | 89 - .../generated/DeploymentsDeleteMockTests.java | 62 - .../DeploymentsGetWithResponseMockTests.java | 74 - .../generated/DeploymentsListMockTests.java | 76 - .../DomainAvailabilityInnerTests.java | 43 - .../generated/IdentityTests.java | 48 - .../generated/IpRuleTests.java | 25 - .../generated/MetricNameTests.java | 30 - .../generated/ModelDeprecationInfoTests.java | 30 - .../generated/NetworkRuleSetTests.java | 55 - .../generated/OperationDisplayTests.java | 26 - .../generated/OperationInnerTests.java | 27 - .../generated/OperationListResultTests.java | 26 - .../generated/OperationsListMockTests.java | 65 - .../PrivateEndpointConnectionInnerTests.java | 61 - ...ndpointConnectionListResultInnerTests.java | 39 - ...vateEndpointConnectionPropertiesTests.java | 51 - ...intConnectionsCreateOrUpdateMockTests.java | 93 - ...ateEndpointConnectionsDeleteMockTests.java | 62 - ...ntConnectionsGetWithResponseMockTests.java | 79 - ...tConnectionsListWithResponseMockTests.java | 71 - .../generated/PrivateEndpointTests.java | 22 - ...ivateLinkResourceListResultInnerTests.java | 39 - .../PrivateLinkResourcePropertiesTests.java | 32 - .../generated/PrivateLinkResourceTests.java | 36 - ...inkResourcesListWithResponseMockTests.java | 64 - ...rivateLinkServiceConnectionStateTests.java | 38 - .../generated/RequestMatchPatternTests.java | 30 - ...mainAvailabilityWithResponseMockTests.java | 78 - ...kSkuAvailabilityWithResponseMockTests.java | 84 - .../generated/ResourceSkuListResultTests.java | 74 - .../ResourceSkuRestrictionInfoTests.java | 35 - .../SkuAvailabilityListResultInnerTests.java | 73 - .../generated/SkuAvailabilityTests.java | 46 - .../generated/SkuCapabilityTests.java | 30 - .../generated/SkuChangeInfoTests.java | 37 - .../cognitiveservices/generated/SkuTests.java | 44 - .../generated/UsageListResultInnerTests.java | 70 - .../generated/UsageTests.java | 54 - .../generated/UserAssignedIdentityTests.java | 25 - .../generated/UserOwnedStorageTests.java | 31 - .../generated/VirtualNetworkRuleTests.java | 36 - 142 files changed, 5881 insertions(+), 3772 deletions(-) create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentPlanAccountAssociationInner.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentPlanAccountAssociationProperties.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlanAccountAssociationImpl.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanAccountAssociation.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanAccountAssociationListResult.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanAssociation.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanProvisioningState.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelLifecycleStatus.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/MultiRegionSettings.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PatchResourceTags.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PatchResourceTagsAndSku.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RegionSetting.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RoutingMethods.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdateAssociationSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdatePlanSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeleteAssociationSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeletePlanSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetAssociationSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetByResourceGroupSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListAssociationsSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListByResourceGroupSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListPlansBySubscriptionSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansUpdatePlanSamples.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountModelListResultTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountSkuListResultInnerTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountSkuTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsDeleteMockTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListModelsMockTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListSkusWithResponseMockTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListUsagesWithResponseMockTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AzureEntityResourceTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CheckDomainAvailabilityParameterTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CheckSkuAvailabilityParameterTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentCostTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPeriodTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanInnerTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanListResultTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanPropertiesTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdateWithResponseMockTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeleteMockTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetWithResponseMockTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListMockTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentQuotaTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentTierInnerTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentTierListResultTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentTiersListMockTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeletedAccountsPurgeMockTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentInnerTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentListResultTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentScaleSettingsTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsCreateOrUpdateMockTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsDeleteMockTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsGetWithResponseMockTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsListMockTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DomainAvailabilityInnerTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/IdentityTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/IpRuleTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/MetricNameTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ModelDeprecationInfoTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkRuleSetTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OperationDisplayTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OperationInnerTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OperationListResultTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OperationsListMockTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionInnerTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionListResultInnerTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionPropertiesTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsCreateOrUpdateMockTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsDeleteMockTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsListWithResponseMockTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourceListResultInnerTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourcePropertiesTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourceTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourcesListWithResponseMockTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkServiceConnectionStateTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RequestMatchPatternTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProvidersCheckDomainAvailabilityWithResponseMockTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProvidersCheckSkuAvailabilityWithResponseMockTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceSkuListResultTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceSkuRestrictionInfoTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuAvailabilityListResultInnerTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuAvailabilityTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuCapabilityTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuChangeInfoTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UsageListResultInnerTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UsageTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UserAssignedIdentityTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UserOwnedStorageTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/VirtualNetworkRuleTests.java diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/CHANGELOG.md b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/CHANGELOG.md index ba87c3196fa93..c2bf2f8dd72e2 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/CHANGELOG.md +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.7 (Unreleased) +## 1.0.0-beta.1 (2022-12-02) + +- 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). ### Features Added diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/README.md b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/README.md index e33851191ad14..8c16c810db41f 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-10. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for CognitiveServices Management SDK. Cognitive Services Management Client. Package tag package-2022-12. 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-beta.6 + 1.0.0-beta.7 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/SAMPLE.md b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/SAMPLE.md index 56e26e074be3c..0caa8640591c6 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/SAMPLE.md +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/SAMPLE.md @@ -18,9 +18,19 @@ ## CommitmentPlans - [CreateOrUpdate](#commitmentplans_createorupdate) +- [CreateOrUpdateAssociation](#commitmentplans_createorupdateassociation) +- [CreateOrUpdatePlan](#commitmentplans_createorupdateplan) - [Delete](#commitmentplans_delete) +- [DeleteAssociation](#commitmentplans_deleteassociation) +- [DeletePlan](#commitmentplans_deleteplan) - [Get](#commitmentplans_get) +- [GetAssociation](#commitmentplans_getassociation) +- [GetByResourceGroup](#commitmentplans_getbyresourcegroup) - [List](#commitmentplans_list) +- [ListAssociations](#commitmentplans_listassociations) +- [ListByResourceGroup](#commitmentplans_listbyresourcegroup) +- [ListPlansBySubscription](#commitmentplans_listplansbysubscription) +- [UpdatePlan](#commitmentplans_updateplan) ## CommitmentTiers @@ -78,7 +88,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-10-01/examples/CreateAccountMin.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/CreateAccountMin.json */ /** * Sample code: Create Account Min. @@ -99,7 +109,7 @@ public final class AccountsCreateSamples { } /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/CreateAccount.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/CreateAccount.json */ /** * Sample code: Create Account. @@ -144,7 +154,7 @@ import com.azure.core.util.Context; /** Samples for Accounts Delete. */ public final class AccountsDeleteSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/DeleteAccount.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/DeleteAccount.json */ /** * Sample code: Delete Account. @@ -165,7 +175,7 @@ import com.azure.core.util.Context; /** Samples for Accounts GetByResourceGroup. */ public final class AccountsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/GetAccount.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/GetAccount.json */ /** * Sample code: Get Account. @@ -186,7 +196,7 @@ import com.azure.core.util.Context; /** Samples for Accounts List. */ public final class AccountsListSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/ListAccountsBySubscription.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/ListAccountsBySubscription.json */ /** * Sample code: List Accounts by Subscription. @@ -208,7 +218,7 @@ import com.azure.core.util.Context; /** Samples for Accounts ListByResourceGroup. */ public final class AccountsListByResourceGroupSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/ListAccountsByResourceGroup.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/ListAccountsByResourceGroup.json */ /** * Sample code: List Accounts by Resource Group. @@ -230,7 +240,7 @@ import com.azure.core.util.Context; /** Samples for Accounts ListKeys. */ public final class AccountsListKeysSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/ListKeys.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/ListKeys.json */ /** * Sample code: List Keys. @@ -251,7 +261,7 @@ import com.azure.core.util.Context; /** Samples for Accounts ListModels. */ public final class AccountsListModelsSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/ListAccountModels.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/ListAccountModels.json */ /** * Sample code: List AccountModels. @@ -272,7 +282,7 @@ import com.azure.core.util.Context; /** Samples for Accounts ListSkus. */ public final class AccountsListSkusSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/ListSkus.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/ListSkus.json */ /** * Sample code: List SKUs. @@ -293,7 +303,7 @@ import com.azure.core.util.Context; /** Samples for Accounts ListUsages. */ public final class AccountsListUsagesSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/GetUsages.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/GetUsages.json */ /** * Sample code: Get Usages. @@ -316,7 +326,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-10-01/examples/RegenerateKey.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/RegenerateKey.json */ /** * Sample code: Regenerate Keys. @@ -342,7 +352,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-10-01/examples/UpdateAccount.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/UpdateAccount.json */ /** * Sample code: Update Account. @@ -360,6 +370,8 @@ public final class AccountsUpdateSamples { ### CommitmentPlans_CreateOrUpdate ```java +import com.azure.core.util.Context; +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; @@ -367,7 +379,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-10-01/examples/PutCommitmentPlan.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/PutCommitmentPlan.json */ /** * Sample code: PutCommitmentPlan. @@ -377,12 +389,78 @@ public final class CommitmentPlansCreateOrUpdateSamples { public static void putCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { manager .commitmentPlans() - .define("commitmentPlanName") - .withExistingAccount("resourceGroupName", "accountName") + .createOrUpdateWithResponse( + "resourceGroupName", + "accountName", + "commitmentPlanName", + new CommitmentPlanInner() + .withProperties( + new CommitmentPlanProperties() + .withHostingModel(HostingModel.WEB) + .withPlanType("Speech2Text") + .withCurrent(new CommitmentPeriod().withTier("T1")) + .withAutoRenew(true)), + Context.NONE); + } +} +``` + +### CommitmentPlans_CreateOrUpdateAssociation + +```java +/** 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 + */ + /** + * Sample code: PutCommitmentPlan. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void putCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager + .commitmentPlans() + .defineAssociation("commitmentPlanAssociationName") + .withExistingCommitmentPlan("resourceGroupName", "commitmentPlanName") + .withAccountId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.CognitiveServices/accounts/accountName") + .create(); + } +} +``` + +### CommitmentPlans_CreateOrUpdatePlan + +```java +import com.azure.resourcemanager.cognitiveservices.models.CommitmentPeriod; +import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlanProperties; +import com.azure.resourcemanager.cognitiveservices.models.HostingModel; +import com.azure.resourcemanager.cognitiveservices.models.Sku; + +/** Samples for CommitmentPlans CreateOrUpdatePlan. */ +public final class CommitmentPlansCreateOrUpdatePlanSamples { + /* + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/CreateSharedCommitmentPlan.json + */ + /** + * Sample code: Create Commitment Plan. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void createCommitmentPlan( + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager + .commitmentPlans() + .definePlan("commitmentPlanName") + .withExistingResourceGroup("resourceGroupName") + .withRegion("West US") + .withKind("SpeechServices") + .withSku(new Sku().withName("S0")) .withProperties( new CommitmentPlanProperties() .withHostingModel(HostingModel.WEB) - .withPlanType("Speech2Text") + .withPlanType("STT") .withCurrent(new CommitmentPeriod().withTier("T1")) .withAutoRenew(true)) .create(); @@ -398,7 +476,7 @@ import com.azure.core.util.Context; /** Samples for CommitmentPlans Delete. */ public final class CommitmentPlansDeleteSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/DeleteCommitmentPlan.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/DeleteCommitmentPlan.json */ /** * Sample code: DeleteCommitmentPlan. @@ -412,6 +490,53 @@ public final class CommitmentPlansDeleteSamples { } ``` +### CommitmentPlans_DeleteAssociation + +```java +import com.azure.core.util.Context; + +/** 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 + */ + /** + * Sample code: DeleteCommitmentPlan. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void deleteCommitmentPlan( + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager + .commitmentPlans() + .deleteAssociation( + "resourceGroupName", "commitmentPlanName", "commitmentPlanAssociationName", Context.NONE); + } +} +``` + +### CommitmentPlans_DeletePlan + +```java +import com.azure.core.util.Context; + +/** 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 + */ + /** + * Sample code: Delete Commitment Plan. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void deleteCommitmentPlan( + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.commitmentPlans().deletePlan("resourceGroupName", "commitmentPlanName", Context.NONE); + } +} +``` + ### CommitmentPlans_Get ```java @@ -420,7 +545,7 @@ import com.azure.core.util.Context; /** Samples for CommitmentPlans Get. */ public final class CommitmentPlansGetSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/GetCommitmentPlan.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/GetCommitmentPlan.json */ /** * Sample code: GetCommitmentPlan. @@ -435,6 +560,53 @@ public final class CommitmentPlansGetSamples { } ``` +### CommitmentPlans_GetAssociation + +```java +import com.azure.core.util.Context; + +/** 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 + */ + /** + * Sample code: GetCommitmentPlan. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void getCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager + .commitmentPlans() + .getAssociationWithResponse( + "resourceGroupName", "commitmentPlanName", "commitmentPlanAssociationName", Context.NONE); + } +} +``` + +### CommitmentPlans_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** 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 + */ + /** + * Sample code: Get Commitment Plan. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void getCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager + .commitmentPlans() + .getByResourceGroupWithResponse("resourceGroupName", "commitmentPlanName", Context.NONE); + } +} +``` + ### CommitmentPlans_List ```java @@ -443,7 +615,7 @@ import com.azure.core.util.Context; /** Samples for CommitmentPlans List. */ public final class CommitmentPlansListSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/ListCommitmentPlans.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/ListCommitmentPlans.json */ /** * Sample code: ListCommitmentPlans. @@ -457,6 +629,113 @@ public final class CommitmentPlansListSamples { } ``` +### CommitmentPlans_ListAssociations + +```java +import com.azure.core.util.Context; + +/** 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 + */ + /** + * Sample code: ListCommitmentPlans. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void listCommitmentPlans( + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.commitmentPlans().listAssociations("resourceGroupName", "commitmentPlanName", Context.NONE); + } +} +``` + +### CommitmentPlans_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** 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 + */ + /** + * Sample code: List Commitment Plans by Resource Group. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void listCommitmentPlansByResourceGroup( + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.commitmentPlans().listByResourceGroup("resourceGroupName", Context.NONE); + } +} +``` + +### CommitmentPlans_ListPlansBySubscription + +```java +import com.azure.core.util.Context; + +/** 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 + */ + /** + * Sample code: List Accounts by Subscription. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void listAccountsBySubscription( + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.commitmentPlans().listPlansBySubscription(Context.NONE); + } +} +``` + +### CommitmentPlans_UpdatePlan + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlan; +import java.util.HashMap; +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 + */ + /** + * Sample code: Create Commitment Plan. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void createCommitmentPlan( + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + CommitmentPlan resource = + manager + .commitmentPlans() + .getByResourceGroupWithResponse("resourceGroupName", "commitmentPlanName", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("name", "value")).apply(); + } + + @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; + } +} +``` + ### CommitmentTiers_List ```java @@ -465,7 +744,7 @@ import com.azure.core.util.Context; /** Samples for CommitmentTiers List. */ public final class CommitmentTiersListSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/ListCommitmentTiers.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/ListCommitmentTiers.json */ /** * Sample code: ListCommitmentTiers. @@ -487,7 +766,7 @@ import com.azure.core.util.Context; /** Samples for DeletedAccounts Get. */ public final class DeletedAccountsGetSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/GetDeletedAccount.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/GetDeletedAccount.json */ /** * Sample code: Get Account. @@ -508,7 +787,7 @@ import com.azure.core.util.Context; /** Samples for DeletedAccounts List. */ public final class DeletedAccountsListSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/ListDeletedAccountsBySubscription.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/ListDeletedAccountsBySubscription.json */ /** * Sample code: List Deleted Accounts by Subscription. @@ -530,7 +809,7 @@ import com.azure.core.util.Context; /** Samples for DeletedAccounts Purge. */ public final class DeletedAccountsPurgeSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/PurgeDeletedAccount.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/PurgeDeletedAccount.json */ /** * Sample code: Delete Account. @@ -554,7 +833,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-10-01/examples/PutDeployment.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/PutDeployment.json */ /** * Sample code: PutDeployment. @@ -584,7 +863,7 @@ import com.azure.core.util.Context; /** Samples for Deployments Delete. */ public final class DeploymentsDeleteSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/DeleteDeployment.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/DeleteDeployment.json */ /** * Sample code: DeleteDeployment. @@ -605,7 +884,7 @@ import com.azure.core.util.Context; /** Samples for Deployments Get. */ public final class DeploymentsGetSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/GetDeployment.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/GetDeployment.json */ /** * Sample code: GetDeployment. @@ -626,7 +905,7 @@ import com.azure.core.util.Context; /** Samples for Deployments List. */ public final class DeploymentsListSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/ListDeployments.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/ListDeployments.json */ /** * Sample code: ListDeployments. @@ -647,7 +926,7 @@ import com.azure.core.util.Context; /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/GetOperations.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/GetOperations.json */ /** * Sample code: Get Operations. @@ -670,7 +949,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-10-01/examples/PutPrivateEndpointConnection.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/PutPrivateEndpointConnection.json */ /** * Sample code: PutPrivateEndpointConnection. @@ -702,7 +981,7 @@ import com.azure.core.util.Context; /** Samples for PrivateEndpointConnections Delete. */ public final class PrivateEndpointConnectionsDeleteSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/DeletePrivateEndpointConnection.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/DeletePrivateEndpointConnection.json */ /** * Sample code: DeletePrivateEndpointConnection. @@ -726,7 +1005,7 @@ import com.azure.core.util.Context; /** Samples for PrivateEndpointConnections Get. */ public final class PrivateEndpointConnectionsGetSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/GetPrivateEndpointConnection.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/GetPrivateEndpointConnection.json */ /** * Sample code: GetPrivateEndpointConnection. @@ -750,7 +1029,7 @@ import com.azure.core.util.Context; /** Samples for PrivateEndpointConnections List. */ public final class PrivateEndpointConnectionsListSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/ListPrivateEndpointConnections.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/ListPrivateEndpointConnections.json */ /** * Sample code: GetPrivateEndpointConnection. @@ -772,7 +1051,7 @@ import com.azure.core.util.Context; /** Samples for PrivateLinkResources List. */ public final class PrivateLinkResourcesListSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/ListPrivateLinkResources.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/ListPrivateLinkResources.json */ /** * Sample code: ListPrivateLinkResources. @@ -795,7 +1074,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-10-01/examples/CheckDomainAvailability.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/CheckDomainAvailability.json */ /** * Sample code: Check SKU Availability. @@ -825,7 +1104,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-10-01/examples/CheckSkuAvailability.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/CheckSkuAvailability.json */ /** * Sample code: Check SKU Availability. @@ -855,7 +1134,7 @@ import com.azure.core.util.Context; /** Samples for ResourceSkus List. */ public final class ResourceSkusListSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/GetSkus.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/GetSkus.json */ /** * Sample code: Regenerate Keys. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/pom.xml b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/pom.xml index 2db6dfb77bbc1..65a4c2a0f4cc1 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/pom.xml +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/pom.xml @@ -13,7 +13,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-10. + This package contains Microsoft Azure SDK for CognitiveServices Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Cognitive Services Management Client. Package tag package-2022-12. 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 da66238fc21a2..cf96494fcac53 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 @@ -239,7 +239,7 @@ public CognitiveServicesManager authenticate(TokenCredential credential, AzurePr .append("-") .append("com.azure.resourcemanager.cognitiveservices") .append("/") - .append("1.0.0-beta.6"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -406,7 +406,7 @@ public Deployments deployments() { } /** - * Gets the resource collection API of CommitmentPlans. It manages CommitmentPlan. + * Gets the resource collection API of CommitmentPlans. It manages CommitmentPlan, CommitmentPlanAccountAssociation. * * @return Resource collection API of CommitmentPlans. */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/CommitmentPlansClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/CommitmentPlansClient.java index 93dd970c00c98..646b8938bea97 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/CommitmentPlansClient.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/CommitmentPlansClient.java @@ -11,7 +11,9 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentPlanAccountAssociationInner; import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentPlanInner; +import com.azure.resourcemanager.cognitiveservices.models.PatchResourceTagsAndSku; /** An instance of this class provides access to all the operations defined in CommitmentPlansClient. */ public interface CommitmentPlansClient { @@ -168,4 +170,473 @@ SyncPoller, Void> beginDelete( */ @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String accountName, String commitmentPlanName, Context context); + + /** + * Create Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlan The parameters to provide for the created commitment plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cognitive Services account commitment plan. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CommitmentPlanInner> beginCreateOrUpdatePlan( + String resourceGroupName, String commitmentPlanName, CommitmentPlanInner commitmentPlan); + + /** + * Create Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlan The parameters to provide for the created commitment plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cognitive Services account commitment plan. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CommitmentPlanInner> beginCreateOrUpdatePlan( + String resourceGroupName, String commitmentPlanName, CommitmentPlanInner commitmentPlan, Context context); + + /** + * Create Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlan The parameters to provide for the created commitment plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account commitment plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CommitmentPlanInner createOrUpdatePlan( + String resourceGroupName, String commitmentPlanName, CommitmentPlanInner commitmentPlan); + + /** + * Create Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlan The parameters to provide for the created commitment plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account commitment plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CommitmentPlanInner createOrUpdatePlan( + String resourceGroupName, String commitmentPlanName, CommitmentPlanInner commitmentPlan, Context context); + + /** + * Create Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlan The parameters to provide for the created commitment plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cognitive Services account commitment plan. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CommitmentPlanInner> beginUpdatePlan( + String resourceGroupName, String commitmentPlanName, PatchResourceTagsAndSku commitmentPlan); + + /** + * Create Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlan The parameters to provide for the created commitment plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cognitive Services account commitment plan. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CommitmentPlanInner> beginUpdatePlan( + String resourceGroupName, String commitmentPlanName, PatchResourceTagsAndSku commitmentPlan, Context context); + + /** + * Create Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlan The parameters to provide for the created commitment plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account commitment plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CommitmentPlanInner updatePlan( + String resourceGroupName, String commitmentPlanName, PatchResourceTagsAndSku commitmentPlan); + + /** + * Create Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlan The parameters to provide for the created commitment plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account commitment plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CommitmentPlanInner updatePlan( + String resourceGroupName, String commitmentPlanName, PatchResourceTagsAndSku commitmentPlan, Context context); + + /** + * Deletes a Cognitive Services commitment plan from the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeletePlan(String resourceGroupName, String commitmentPlanName); + + /** + * Deletes a Cognitive Services commitment plan from the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeletePlan( + String resourceGroupName, String commitmentPlanName, Context context); + + /** + * Deletes a Cognitive Services commitment plan from the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deletePlan(String resourceGroupName, String commitmentPlanName); + + /** + * Deletes a Cognitive Services commitment plan from the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deletePlan(String resourceGroupName, String commitmentPlanName, Context context); + + /** + * Returns a Cognitive Services commitment plan specified by the parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account commitment plan along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String commitmentPlanName, Context context); + + /** + * Returns a Cognitive Services commitment plan specified by the parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account commitment plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CommitmentPlanInner getByResourceGroup(String resourceGroupName, String commitmentPlanName); + + /** + * Returns all the resources of a particular type belonging to a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 accounts operation response as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Returns all the resources of a particular type belonging to a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 accounts operation response as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Returns all the resources of a particular type belonging to a subscription. + * + * @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 accounts operation response as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listPlansBySubscription(); + + /** + * Returns all the resources of a particular type belonging to a subscription. + * + * @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 accounts operation response as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listPlansBySubscription(Context context); + + /** + * Gets the associations of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the associations of the Cognitive Services commitment plan as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAssociations( + String resourceGroupName, String commitmentPlanName); + + /** + * Gets the associations of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the associations of the Cognitive Services commitment plan as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAssociations( + String resourceGroupName, String commitmentPlanName, Context context); + + /** + * Gets the association of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services + * Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the association of the Cognitive Services commitment plan along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getAssociationWithResponse( + String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName, Context context); + + /** + * Gets the association of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services + * Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the association of the Cognitive Services commitment plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CommitmentPlanAccountAssociationInner getAssociation( + String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName); + + /** + * Create or update the association of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services + * Account. + * @param association The commitmentPlan properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the commitment plan association. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CommitmentPlanAccountAssociationInner> + beginCreateOrUpdateAssociation( + String resourceGroupName, + String commitmentPlanName, + String commitmentPlanAssociationName, + CommitmentPlanAccountAssociationInner association); + + /** + * Create or update the association of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services + * Account. + * @param association The commitmentPlan properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the commitment plan association. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CommitmentPlanAccountAssociationInner> + beginCreateOrUpdateAssociation( + String resourceGroupName, + String commitmentPlanName, + String commitmentPlanAssociationName, + CommitmentPlanAccountAssociationInner association, + Context context); + + /** + * Create or update the association of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services + * Account. + * @param association The commitmentPlan properties. + * @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 commitment plan association. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CommitmentPlanAccountAssociationInner createOrUpdateAssociation( + String resourceGroupName, + String commitmentPlanName, + String commitmentPlanAssociationName, + CommitmentPlanAccountAssociationInner association); + + /** + * Create or update the association of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services + * Account. + * @param association The commitmentPlan properties. + * @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 commitment plan association. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CommitmentPlanAccountAssociationInner createOrUpdateAssociation( + String resourceGroupName, + String commitmentPlanName, + String commitmentPlanAssociationName, + CommitmentPlanAccountAssociationInner association, + Context context); + + /** + * Deletes the association of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services + * Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeleteAssociation( + String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName); + + /** + * Deletes the association of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services + * Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeleteAssociation( + String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName, Context context); + + /** + * Deletes the association of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services + * Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteAssociation(String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName); + + /** + * Deletes the association of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services + * Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteAssociation( + String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName, 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 78487069ec7fb..c88de0adeb335 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 @@ -8,6 +8,7 @@ import com.azure.core.management.SystemData; import com.azure.resourcemanager.cognitiveservices.models.DeploymentModel; import com.azure.resourcemanager.cognitiveservices.models.ModelDeprecationInfo; +import com.azure.resourcemanager.cognitiveservices.models.ModelLifecycleStatus; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -34,12 +35,25 @@ public final class AccountModelInner extends DeploymentModel { @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map capabilities; + /* + * The capabilities for finetune models. + */ + @JsonProperty(value = "finetuneCapabilities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map finetuneCapabilities; + /* * Cognitive Services account ModelDeprecationInfo. */ @JsonProperty(value = "deprecation") private ModelDeprecationInfo deprecation; + /* + * Model lifecycle status. + */ + @JsonProperty(value = "lifecycleStatus") + private ModelLifecycleStatus lifecycleStatus; + /* * Metadata pertaining to creation and last modification of the resource. */ @@ -110,6 +124,26 @@ public AccountModelInner withCapabilities(Map capabilities) { return this; } + /** + * Get the finetuneCapabilities property: The capabilities for finetune models. + * + * @return the finetuneCapabilities value. + */ + public Map finetuneCapabilities() { + return this.finetuneCapabilities; + } + + /** + * Set the finetuneCapabilities property: The capabilities for finetune models. + * + * @param finetuneCapabilities the finetuneCapabilities value to set. + * @return the AccountModelInner object itself. + */ + public AccountModelInner withFinetuneCapabilities(Map finetuneCapabilities) { + this.finetuneCapabilities = finetuneCapabilities; + return this; + } + /** * Get the deprecation property: Cognitive Services account ModelDeprecationInfo. * @@ -130,6 +164,26 @@ public AccountModelInner withDeprecation(ModelDeprecationInfo deprecation) { return this; } + /** + * Get the lifecycleStatus property: Model lifecycle status. + * + * @return the lifecycleStatus value. + */ + public ModelLifecycleStatus lifecycleStatus() { + return this.lifecycleStatus; + } + + /** + * Set the lifecycleStatus property: Model lifecycle status. + * + * @param lifecycleStatus the lifecycleStatus value to set. + * @return the AccountModelInner object itself. + */ + public AccountModelInner withLifecycleStatus(ModelLifecycleStatus lifecycleStatus) { + this.lifecycleStatus = lifecycleStatus; + return this; + } + /** * Get the systemData property: Metadata pertaining to creation and last modification of the resource. * diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentPlanAccountAssociationInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentPlanAccountAssociationInner.java new file mode 100644 index 0000000000000..09db37783d18d --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentPlanAccountAssociationInner.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The commitment plan association. */ +@Fluent +public final class CommitmentPlanAccountAssociationInner extends ProxyResource { + /* + * Resource Etag. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Properties of Cognitive Services account commitment plan association. + */ + @JsonProperty(value = "properties") + private CommitmentPlanAccountAssociationProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of CommitmentPlanAccountAssociationInner class. */ + public CommitmentPlanAccountAssociationInner() { + } + + /** + * Get the etag property: Resource Etag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the innerProperties property: Properties of Cognitive Services account commitment plan association. + * + * @return the innerProperties value. + */ + private CommitmentPlanAccountAssociationProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the accountId property: The Azure resource id of the account. + * + * @return the accountId value. + */ + public String accountId() { + return this.innerProperties() == null ? null : this.innerProperties().accountId(); + } + + /** + * Set the accountId property: The Azure resource id of the account. + * + * @param accountId the accountId value to set. + * @return the CommitmentPlanAccountAssociationInner object itself. + */ + public CommitmentPlanAccountAssociationInner withAccountId(String accountId) { + if (this.innerProperties() == null) { + this.innerProperties = new CommitmentPlanAccountAssociationProperties(); + } + this.innerProperties().withAccountId(accountId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentPlanAccountAssociationProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentPlanAccountAssociationProperties.java new file mode 100644 index 0000000000000..8455181b9dde1 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentPlanAccountAssociationProperties.java @@ -0,0 +1,50 @@ +// Copyright (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; + +/** The commitment plan account association properties. */ +@Fluent +public final class CommitmentPlanAccountAssociationProperties { + /* + * The Azure resource id of the account. + */ + @JsonProperty(value = "accountId") + private String accountId; + + /** Creates an instance of CommitmentPlanAccountAssociationProperties class. */ + public CommitmentPlanAccountAssociationProperties() { + } + + /** + * Get the accountId property: The Azure resource id of the account. + * + * @return the accountId value. + */ + public String accountId() { + return this.accountId; + } + + /** + * Set the accountId property: The Azure resource id of the account. + * + * @param accountId the accountId value to set. + * @return the CommitmentPlanAccountAssociationProperties object itself. + */ + public CommitmentPlanAccountAssociationProperties withAccountId(String accountId) { + this.accountId = accountId; + 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/fluent/models/CommitmentPlanInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentPlanInner.java index 915bbc65fb2ff..8779795e19931 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentPlanInner.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentPlanInner.java @@ -8,7 +8,10 @@ import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlanProperties; +import com.azure.resourcemanager.cognitiveservices.models.Sku; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; /** Cognitive Services account commitment plan. */ @Fluent @@ -25,6 +28,31 @@ public final class CommitmentPlanInner extends ProxyResource { @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) private String etag; + /* + * The Kind of the resource. + */ + @JsonProperty(value = "kind") + private String kind; + + /* + * The resource model definition representing SKU + */ + @JsonProperty(value = "sku") + private Sku sku; + + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * The geo-location where the resource lives + */ + @JsonProperty(value = "location") + private String location; + /* * Properties of Cognitive Services account commitment plan. */ @@ -53,6 +81,86 @@ public String etag() { return this.etag; } + /** + * Get the kind property: The Kind of the resource. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Set the kind property: The Kind of the resource. + * + * @param kind the kind value to set. + * @return the CommitmentPlanInner object itself. + */ + public CommitmentPlanInner withKind(String kind) { + this.kind = kind; + return this; + } + + /** + * 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 CommitmentPlanInner object itself. + */ + public CommitmentPlanInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the CommitmentPlanInner object itself. + */ + public CommitmentPlanInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The geo-location where the resource lives. + * + * @param location the location value to set. + * @return the CommitmentPlanInner object itself. + */ + public CommitmentPlanInner withLocation(String location) { + this.location = location; + return this; + } + /** * Get the properties property: Properties of Cognitive Services account commitment plan. * @@ -79,6 +187,9 @@ public CommitmentPlanInner withProperties(CommitmentPlanProperties 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/implementation/AccountModelImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountModelImpl.java index 1d8645358a165..77fb249973be8 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 @@ -10,6 +10,7 @@ import com.azure.resourcemanager.cognitiveservices.models.CallRateLimit; import com.azure.resourcemanager.cognitiveservices.models.DeploymentModel; import com.azure.resourcemanager.cognitiveservices.models.ModelDeprecationInfo; +import com.azure.resourcemanager.cognitiveservices.models.ModelLifecycleStatus; import java.util.Collections; import java.util.Map; @@ -58,10 +59,23 @@ public Map capabilities() { } } + public Map finetuneCapabilities() { + Map inner = this.innerModel().finetuneCapabilities(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + public ModelDeprecationInfo deprecation() { return this.innerModel().deprecation(); } + public ModelLifecycleStatus lifecycleStatus() { + return this.innerModel().lifecycleStatus(); + } + public SystemData systemData() { return this.innerModel().systemData(); } 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 89dca7f0cb86b..d7ee37809b2e7 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 @@ -259,7 +259,7 @@ public CommitmentPlansClient getCommitmentPlans() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2022-10-01"; + this.apiVersion = "2022-12-01"; this.accounts = new AccountsClientImpl(this); this.deletedAccounts = new DeletedAccountsClientImpl(this); this.resourceSkus = new ResourceSkusClientImpl(this); diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlanAccountAssociationImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlanAccountAssociationImpl.java new file mode 100644 index 0000000000000..4d3dc46a86a40 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlanAccountAssociationImpl.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentPlanAccountAssociationInner; +import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlanAccountAssociation; + +public final class CommitmentPlanAccountAssociationImpl + implements CommitmentPlanAccountAssociation, + CommitmentPlanAccountAssociation.Definition, + CommitmentPlanAccountAssociation.Update { + private CommitmentPlanAccountAssociationInner innerObject; + + private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String accountId() { + return this.innerModel().accountId(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public CommitmentPlanAccountAssociationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String commitmentPlanName; + + private String commitmentPlanAssociationName; + + public CommitmentPlanAccountAssociationImpl withExistingCommitmentPlan( + String resourceGroupName, String commitmentPlanName) { + this.resourceGroupName = resourceGroupName; + this.commitmentPlanName = commitmentPlanName; + return this; + } + + public CommitmentPlanAccountAssociation create() { + this.innerObject = + serviceManager + .serviceClient() + .getCommitmentPlans() + .createOrUpdateAssociation( + resourceGroupName, + commitmentPlanName, + commitmentPlanAssociationName, + this.innerModel(), + Context.NONE); + return this; + } + + public CommitmentPlanAccountAssociation create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCommitmentPlans() + .createOrUpdateAssociation( + resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, this.innerModel(), context); + return this; + } + + CommitmentPlanAccountAssociationImpl( + String name, com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerObject = new CommitmentPlanAccountAssociationInner(); + this.serviceManager = serviceManager; + this.commitmentPlanAssociationName = name; + } + + public CommitmentPlanAccountAssociationImpl update() { + return this; + } + + public CommitmentPlanAccountAssociation apply() { + this.innerObject = + serviceManager + .serviceClient() + .getCommitmentPlans() + .createOrUpdateAssociation( + resourceGroupName, + commitmentPlanName, + commitmentPlanAssociationName, + this.innerModel(), + Context.NONE); + return this; + } + + public CommitmentPlanAccountAssociation apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCommitmentPlans() + .createOrUpdateAssociation( + resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, this.innerModel(), context); + return this; + } + + CommitmentPlanAccountAssociationImpl( + CommitmentPlanAccountAssociationInner innerObject, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.commitmentPlanName = Utils.getValueFromIdByName(innerObject.id(), "commitmentPlans"); + this.commitmentPlanAssociationName = Utils.getValueFromIdByName(innerObject.id(), "accountAssociations"); + } + + public CommitmentPlanAccountAssociation refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getCommitmentPlans() + .getAssociationWithResponse( + resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, Context.NONE) + .getValue(); + return this; + } + + public CommitmentPlanAccountAssociation refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCommitmentPlans() + .getAssociationWithResponse( + resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, context) + .getValue(); + return this; + } + + public CommitmentPlanAccountAssociationImpl withAccountId(String accountId) { + this.innerModel().withAccountId(accountId); + return this; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlanImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlanImpl.java index 6620da49392fd..81b7a6f2ac6c4 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlanImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlanImpl.java @@ -4,11 +4,16 @@ package com.azure.resourcemanager.cognitiveservices.implementation; +import com.azure.core.management.Region; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentPlanInner; import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlan; import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlanProperties; +import com.azure.resourcemanager.cognitiveservices.models.PatchResourceTagsAndSku; +import com.azure.resourcemanager.cognitiveservices.models.Sku; +import java.util.Collections; +import java.util.Map; public final class CommitmentPlanImpl implements CommitmentPlan, CommitmentPlan.Definition, CommitmentPlan.Update { private CommitmentPlanInner innerObject; @@ -35,10 +40,39 @@ public String etag() { return this.innerModel().etag(); } + public String kind() { + return this.innerModel().kind(); + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String location() { + return this.innerModel().location(); + } + public CommitmentPlanProperties properties() { return this.innerModel().properties(); } + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + public String resourceGroupName() { return resourceGroupName; } @@ -53,13 +87,12 @@ private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager man private String resourceGroupName; - private String accountName; - private String commitmentPlanName; - public CommitmentPlanImpl withExistingAccount(String resourceGroupName, String accountName) { + private PatchResourceTagsAndSku updateCommitmentPlan; + + public CommitmentPlanImpl withExistingResourceGroup(String resourceGroupName) { this.resourceGroupName = resourceGroupName; - this.accountName = accountName; return this; } @@ -68,9 +101,7 @@ public CommitmentPlan create() { serviceManager .serviceClient() .getCommitmentPlans() - .createOrUpdateWithResponse( - resourceGroupName, accountName, commitmentPlanName, this.innerModel(), Context.NONE) - .getValue(); + .createOrUpdatePlan(resourceGroupName, commitmentPlanName, this.innerModel(), Context.NONE); return this; } @@ -79,9 +110,7 @@ public CommitmentPlan create(Context context) { serviceManager .serviceClient() .getCommitmentPlans() - .createOrUpdateWithResponse( - resourceGroupName, accountName, commitmentPlanName, this.innerModel(), context) - .getValue(); + .createOrUpdatePlan(resourceGroupName, commitmentPlanName, this.innerModel(), context); return this; } @@ -93,6 +122,7 @@ public CommitmentPlan create(Context context) { } public CommitmentPlanImpl update() { + this.updateCommitmentPlan = new PatchResourceTagsAndSku(); return this; } @@ -101,9 +131,7 @@ public CommitmentPlan apply() { serviceManager .serviceClient() .getCommitmentPlans() - .createOrUpdateWithResponse( - resourceGroupName, accountName, commitmentPlanName, this.innerModel(), Context.NONE) - .getValue(); + .updatePlan(resourceGroupName, commitmentPlanName, updateCommitmentPlan, Context.NONE); return this; } @@ -112,9 +140,7 @@ public CommitmentPlan apply(Context context) { serviceManager .serviceClient() .getCommitmentPlans() - .createOrUpdateWithResponse( - resourceGroupName, accountName, commitmentPlanName, this.innerModel(), context) - .getValue(); + .updatePlan(resourceGroupName, commitmentPlanName, updateCommitmentPlan, context); return this; } @@ -124,7 +150,6 @@ public CommitmentPlan apply(Context context) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.accountName = Utils.getValueFromIdByName(innerObject.id(), "accounts"); this.commitmentPlanName = Utils.getValueFromIdByName(innerObject.id(), "commitmentPlans"); } @@ -133,7 +158,7 @@ public CommitmentPlan refresh() { serviceManager .serviceClient() .getCommitmentPlans() - .getWithResponse(resourceGroupName, accountName, commitmentPlanName, Context.NONE) + .getByResourceGroupWithResponse(resourceGroupName, commitmentPlanName, Context.NONE) .getValue(); return this; } @@ -143,13 +168,52 @@ public CommitmentPlan refresh(Context context) { serviceManager .serviceClient() .getCommitmentPlans() - .getWithResponse(resourceGroupName, accountName, commitmentPlanName, context) + .getByResourceGroupWithResponse(resourceGroupName, commitmentPlanName, context) .getValue(); return this; } + public CommitmentPlanImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public CommitmentPlanImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public CommitmentPlanImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateCommitmentPlan.withTags(tags); + return this; + } + } + + public CommitmentPlanImpl withKind(String kind) { + this.innerModel().withKind(kind); + return this; + } + + public CommitmentPlanImpl withSku(Sku sku) { + if (isInCreateMode()) { + this.innerModel().withSku(sku); + return this; + } else { + this.updateCommitmentPlan.withSku(sku); + return this; + } + } + public CommitmentPlanImpl withProperties(CommitmentPlanProperties properties) { this.innerModel().withProperties(properties); return this; } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlansClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlansClientImpl.java index 9d83478b216e0..c123475fcbfc1 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 @@ -12,6 +12,7 @@ import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; @@ -32,8 +33,11 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.cognitiveservices.fluent.CommitmentPlansClient; +import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentPlanAccountAssociationInner; import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentPlanInner; +import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlanAccountAssociationListResult; import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlanListResult; +import com.azure.resourcemanager.cognitiveservices.models.PatchResourceTagsAndSku; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -128,6 +132,157 @@ Mono>> delete( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices" + + "/commitmentPlans/{commitmentPlanName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdatePlan( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("commitmentPlanName") String commitmentPlanName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") CommitmentPlanInner commitmentPlan, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices" + + "/commitmentPlans/{commitmentPlanName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updatePlan( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("commitmentPlanName") String commitmentPlanName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") PatchResourceTagsAndSku commitmentPlan, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices" + + "/commitmentPlans/{commitmentPlanName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deletePlan( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("commitmentPlanName") String commitmentPlanName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices" + + "/commitmentPlans/{commitmentPlanName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("commitmentPlanName") String commitmentPlanName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices" + + "/commitmentPlans") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/commitmentPlans") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listPlansBySubscription( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices" + + "/commitmentPlans/{commitmentPlanName}/accountAssociations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAssociations( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("commitmentPlanName") String commitmentPlanName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices" + + "/commitmentPlans/{commitmentPlanName}/accountAssociations/{commitmentPlanAssociationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getAssociation( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("commitmentPlanName") String commitmentPlanName, + @PathParam("commitmentPlanAssociationName") String commitmentPlanAssociationName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices" + + "/commitmentPlans/{commitmentPlanName}/accountAssociations/{commitmentPlanAssociationName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdateAssociation( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("commitmentPlanName") String commitmentPlanName, + @PathParam("commitmentPlanAssociationName") String commitmentPlanAssociationName, + @BodyParam("application/json") CommitmentPlanAccountAssociationInner association, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices" + + "/commitmentPlans/{commitmentPlanName}/accountAssociations/{commitmentPlanAssociationName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteAssociation( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("commitmentPlanName") String commitmentPlanName, + @PathParam("commitmentPlanAssociationName") String commitmentPlanAssociationName, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -137,6 +292,36 @@ Mono> listNext( @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listPlansByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listPlansBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAssociationsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); } /** @@ -928,69 +1113,2538 @@ public void delete(String resourceGroupName, String accountName, String commitme } /** - * Get the next page of items. + * Create Cognitive Services commitment plan. * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlan The parameters to provide for the created commitment plan. * @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 accounts operation response along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return cognitive Services account commitment plan along with {@link Response} 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.")); - } + private Mono>> createOrUpdatePlanWithResponseAsync( + String resourceGroupName, String commitmentPlanName, CommitmentPlanInner commitmentPlan) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (commitmentPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter commitmentPlanName 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 (commitmentPlan == null) { + return Mono.error(new IllegalArgumentException("Parameter commitmentPlan is required and cannot be null.")); + } else { + commitmentPlan.validate(); + } 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)) + .withContext( + context -> + service + .createOrUpdatePlan( + this.client.getEndpoint(), + resourceGroupName, + commitmentPlanName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + commitmentPlan, + accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get the next page of items. + * Create Cognitive Services commitment plan. * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlan The parameters to provide for the created commitment plan. * @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 accounts operation response along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return cognitive Services account commitment plan along with {@link Response} 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.")); - } + private Mono>> createOrUpdatePlanWithResponseAsync( + String resourceGroupName, String commitmentPlanName, CommitmentPlanInner commitmentPlan, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (commitmentPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter commitmentPlanName 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 (commitmentPlan == null) { + return Mono.error(new IllegalArgumentException("Parameter commitmentPlan is required and cannot be null.")); + } else { + commitmentPlan.validate(); + } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) + .createOrUpdatePlan( + this.client.getEndpoint(), + resourceGroupName, + commitmentPlanName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + commitmentPlan, + accept, + context); + } + + /** + * Create Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlan The parameters to provide for the created commitment plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of cognitive Services account commitment plan. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CommitmentPlanInner> beginCreateOrUpdatePlanAsync( + String resourceGroupName, String commitmentPlanName, CommitmentPlanInner commitmentPlan) { + Mono>> mono = + createOrUpdatePlanWithResponseAsync(resourceGroupName, commitmentPlanName, commitmentPlan); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CommitmentPlanInner.class, + CommitmentPlanInner.class, + this.client.getContext()); + } + + /** + * Create Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlan The parameters to provide for the created commitment plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of cognitive Services account commitment plan. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CommitmentPlanInner> beginCreateOrUpdatePlanAsync( + String resourceGroupName, String commitmentPlanName, CommitmentPlanInner commitmentPlan, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdatePlanWithResponseAsync(resourceGroupName, commitmentPlanName, commitmentPlan, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), CommitmentPlanInner.class, CommitmentPlanInner.class, context); + } + + /** + * Create Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlan The parameters to provide for the created commitment plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cognitive Services account commitment plan. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CommitmentPlanInner> beginCreateOrUpdatePlan( + String resourceGroupName, String commitmentPlanName, CommitmentPlanInner commitmentPlan) { + return beginCreateOrUpdatePlanAsync(resourceGroupName, commitmentPlanName, commitmentPlan).getSyncPoller(); + } + + /** + * Create Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlan The parameters to provide for the created commitment plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cognitive Services account commitment plan. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CommitmentPlanInner> beginCreateOrUpdatePlan( + String resourceGroupName, String commitmentPlanName, CommitmentPlanInner commitmentPlan, Context context) { + return beginCreateOrUpdatePlanAsync(resourceGroupName, commitmentPlanName, commitmentPlan, context) + .getSyncPoller(); + } + + /** + * Create Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlan The parameters to provide for the created commitment plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account commitment plan on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdatePlanAsync( + String resourceGroupName, String commitmentPlanName, CommitmentPlanInner commitmentPlan) { + return beginCreateOrUpdatePlanAsync(resourceGroupName, commitmentPlanName, commitmentPlan) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlan The parameters to provide for the created commitment plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account commitment plan on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdatePlanAsync( + String resourceGroupName, String commitmentPlanName, CommitmentPlanInner commitmentPlan, Context context) { + return beginCreateOrUpdatePlanAsync(resourceGroupName, commitmentPlanName, commitmentPlan, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlan The parameters to provide for the created commitment plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account commitment plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CommitmentPlanInner createOrUpdatePlan( + String resourceGroupName, String commitmentPlanName, CommitmentPlanInner commitmentPlan) { + return createOrUpdatePlanAsync(resourceGroupName, commitmentPlanName, commitmentPlan).block(); + } + + /** + * Create Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlan The parameters to provide for the created commitment plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account commitment plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CommitmentPlanInner createOrUpdatePlan( + String resourceGroupName, String commitmentPlanName, CommitmentPlanInner commitmentPlan, Context context) { + return createOrUpdatePlanAsync(resourceGroupName, commitmentPlanName, commitmentPlan, context).block(); + } + + /** + * Create Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlan The parameters to provide for the created commitment plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account commitment plan along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updatePlanWithResponseAsync( + String resourceGroupName, String commitmentPlanName, PatchResourceTagsAndSku commitmentPlan) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (commitmentPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter commitmentPlanName 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 (commitmentPlan == null) { + return Mono.error(new IllegalArgumentException("Parameter commitmentPlan is required and cannot be null.")); + } else { + commitmentPlan.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updatePlan( + this.client.getEndpoint(), + resourceGroupName, + commitmentPlanName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + commitmentPlan, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlan The parameters to provide for the created commitment plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account commitment plan along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updatePlanWithResponseAsync( + String resourceGroupName, String commitmentPlanName, PatchResourceTagsAndSku commitmentPlan, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (commitmentPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter commitmentPlanName 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 (commitmentPlan == null) { + return Mono.error(new IllegalArgumentException("Parameter commitmentPlan is required and cannot be null.")); + } else { + commitmentPlan.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updatePlan( + this.client.getEndpoint(), + resourceGroupName, + commitmentPlanName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + commitmentPlan, + accept, + context); + } + + /** + * Create Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlan The parameters to provide for the created commitment plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of cognitive Services account commitment plan. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CommitmentPlanInner> beginUpdatePlanAsync( + String resourceGroupName, String commitmentPlanName, PatchResourceTagsAndSku commitmentPlan) { + Mono>> mono = + updatePlanWithResponseAsync(resourceGroupName, commitmentPlanName, commitmentPlan); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CommitmentPlanInner.class, + CommitmentPlanInner.class, + this.client.getContext()); + } + + /** + * Create Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlan The parameters to provide for the created commitment plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of cognitive Services account commitment plan. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CommitmentPlanInner> beginUpdatePlanAsync( + String resourceGroupName, String commitmentPlanName, PatchResourceTagsAndSku commitmentPlan, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updatePlanWithResponseAsync(resourceGroupName, commitmentPlanName, commitmentPlan, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), CommitmentPlanInner.class, CommitmentPlanInner.class, context); + } + + /** + * Create Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlan The parameters to provide for the created commitment plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cognitive Services account commitment plan. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CommitmentPlanInner> beginUpdatePlan( + String resourceGroupName, String commitmentPlanName, PatchResourceTagsAndSku commitmentPlan) { + return beginUpdatePlanAsync(resourceGroupName, commitmentPlanName, commitmentPlan).getSyncPoller(); + } + + /** + * Create Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlan The parameters to provide for the created commitment plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cognitive Services account commitment plan. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CommitmentPlanInner> beginUpdatePlan( + String resourceGroupName, String commitmentPlanName, PatchResourceTagsAndSku commitmentPlan, Context context) { + return beginUpdatePlanAsync(resourceGroupName, commitmentPlanName, commitmentPlan, context).getSyncPoller(); + } + + /** + * Create Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlan The parameters to provide for the created commitment plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account commitment plan on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updatePlanAsync( + String resourceGroupName, String commitmentPlanName, PatchResourceTagsAndSku commitmentPlan) { + return beginUpdatePlanAsync(resourceGroupName, commitmentPlanName, commitmentPlan) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlan The parameters to provide for the created commitment plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account commitment plan on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updatePlanAsync( + String resourceGroupName, String commitmentPlanName, PatchResourceTagsAndSku commitmentPlan, Context context) { + return beginUpdatePlanAsync(resourceGroupName, commitmentPlanName, commitmentPlan, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlan The parameters to provide for the created commitment plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account commitment plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CommitmentPlanInner updatePlan( + String resourceGroupName, String commitmentPlanName, PatchResourceTagsAndSku commitmentPlan) { + return updatePlanAsync(resourceGroupName, commitmentPlanName, commitmentPlan).block(); + } + + /** + * Create Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlan The parameters to provide for the created commitment plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account commitment plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CommitmentPlanInner updatePlan( + String resourceGroupName, String commitmentPlanName, PatchResourceTagsAndSku commitmentPlan, Context context) { + return updatePlanAsync(resourceGroupName, commitmentPlanName, commitmentPlan, context).block(); + } + + /** + * Deletes a Cognitive Services commitment plan from the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deletePlanWithResponseAsync( + String resourceGroupName, String commitmentPlanName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (commitmentPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter commitmentPlanName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deletePlan( + this.client.getEndpoint(), + resourceGroupName, + commitmentPlanName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a Cognitive Services commitment plan from the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deletePlanWithResponseAsync( + String resourceGroupName, String commitmentPlanName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (commitmentPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter commitmentPlanName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deletePlan( + this.client.getEndpoint(), + resourceGroupName, + commitmentPlanName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes a Cognitive Services commitment plan from the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeletePlanAsync( + String resourceGroupName, String commitmentPlanName) { + Mono>> mono = deletePlanWithResponseAsync(resourceGroupName, commitmentPlanName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a Cognitive Services commitment plan from the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeletePlanAsync( + String resourceGroupName, String commitmentPlanName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deletePlanWithResponseAsync(resourceGroupName, commitmentPlanName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a Cognitive Services commitment plan from the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeletePlan(String resourceGroupName, String commitmentPlanName) { + return beginDeletePlanAsync(resourceGroupName, commitmentPlanName).getSyncPoller(); + } + + /** + * Deletes a Cognitive Services commitment plan from the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeletePlan( + String resourceGroupName, String commitmentPlanName, Context context) { + return beginDeletePlanAsync(resourceGroupName, commitmentPlanName, context).getSyncPoller(); + } + + /** + * Deletes a Cognitive Services commitment plan from the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deletePlanAsync(String resourceGroupName, String commitmentPlanName) { + return beginDeletePlanAsync(resourceGroupName, commitmentPlanName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Cognitive Services commitment plan from the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deletePlanAsync(String resourceGroupName, String commitmentPlanName, Context context) { + return beginDeletePlanAsync(resourceGroupName, commitmentPlanName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Cognitive Services commitment plan from the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deletePlan(String resourceGroupName, String commitmentPlanName) { + deletePlanAsync(resourceGroupName, commitmentPlanName).block(); + } + + /** + * Deletes a Cognitive Services commitment plan from the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deletePlan(String resourceGroupName, String commitmentPlanName, Context context) { + deletePlanAsync(resourceGroupName, commitmentPlanName, context).block(); + } + + /** + * Returns a Cognitive Services commitment plan specified by the parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account commitment plan along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String commitmentPlanName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (commitmentPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter commitmentPlanName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + commitmentPlanName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns a Cognitive Services commitment plan specified by the parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account commitment plan along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String commitmentPlanName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (commitmentPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter commitmentPlanName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + commitmentPlanName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Returns a Cognitive Services commitment plan specified by the parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account commitment plan on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String commitmentPlanName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, commitmentPlanName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns a Cognitive Services commitment plan specified by the parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account commitment plan along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String commitmentPlanName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, commitmentPlanName, context).block(); + } + + /** + * Returns a Cognitive Services commitment plan specified by the parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account commitment plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CommitmentPlanInner getByResourceGroup(String resourceGroupName, String commitmentPlanName) { + return getByResourceGroupWithResponse(resourceGroupName, commitmentPlanName, Context.NONE).getValue(); + } + + /** + * Returns all the resources of a particular type belonging to a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 accounts operation response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns all the resources of a particular type belonging to a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 accounts operation response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns all the resources of a particular type belonging to a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 accounts operation response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listPlansByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Returns all the resources of a particular type belonging to a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 accounts operation response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listPlansByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns all the resources of a particular type belonging to a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 accounts operation response as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Returns all the resources of a particular type belonging to a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 accounts operation response as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Returns all the resources of a particular type belonging to a subscription. + * + * @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 accounts operation response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPlansBySubscriptionSinglePageAsync() { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listPlansBySubscription( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns all the resources of a particular type belonging to a subscription. + * + * @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 accounts operation response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPlansBySubscriptionSinglePageAsync(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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listPlansBySubscription( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns all the resources of a particular type belonging to a subscription. + * + * @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 accounts operation response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listPlansBySubscriptionAsync() { + return new PagedFlux<>( + () -> listPlansBySubscriptionSinglePageAsync(), + nextLink -> listPlansBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Returns all the resources of a particular type belonging to a subscription. + * + * @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 accounts operation response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listPlansBySubscriptionAsync(Context context) { + return new PagedFlux<>( + () -> listPlansBySubscriptionSinglePageAsync(context), + nextLink -> listPlansBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns all the resources of a particular type belonging to a subscription. + * + * @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 accounts operation response as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listPlansBySubscription() { + return new PagedIterable<>(listPlansBySubscriptionAsync()); + } + + /** + * Returns all the resources of a particular type belonging to a subscription. + * + * @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 accounts operation response as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listPlansBySubscription(Context context) { + return new PagedIterable<>(listPlansBySubscriptionAsync(context)); + } + + /** + * Gets the associations of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the associations of the Cognitive Services commitment plan along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAssociationsSinglePageAsync( + String resourceGroupName, String commitmentPlanName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (commitmentPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter commitmentPlanName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listAssociations( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + commitmentPlanName, + 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())); + } + + /** + * Gets the associations of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the associations of the Cognitive Services commitment plan along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAssociationsSinglePageAsync( + String resourceGroupName, String commitmentPlanName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (commitmentPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter commitmentPlanName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAssociations( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + commitmentPlanName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the associations of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the associations of the Cognitive Services commitment plan as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAssociationsAsync( + String resourceGroupName, String commitmentPlanName) { + return new PagedFlux<>( + () -> listAssociationsSinglePageAsync(resourceGroupName, commitmentPlanName), + nextLink -> listAssociationsNextSinglePageAsync(nextLink)); + } + + /** + * Gets the associations of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the associations of the Cognitive Services commitment plan as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAssociationsAsync( + String resourceGroupName, String commitmentPlanName, Context context) { + return new PagedFlux<>( + () -> listAssociationsSinglePageAsync(resourceGroupName, commitmentPlanName, context), + nextLink -> listAssociationsNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the associations of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the associations of the Cognitive Services commitment plan as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAssociations( + String resourceGroupName, String commitmentPlanName) { + return new PagedIterable<>(listAssociationsAsync(resourceGroupName, commitmentPlanName)); + } + + /** + * Gets the associations of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the associations of the Cognitive Services commitment plan as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAssociations( + String resourceGroupName, String commitmentPlanName, Context context) { + return new PagedIterable<>(listAssociationsAsync(resourceGroupName, commitmentPlanName, context)); + } + + /** + * Gets the association of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services + * Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the association of the Cognitive Services commitment plan along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAssociationWithResponseAsync( + String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (commitmentPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter commitmentPlanName is required and cannot be null.")); + } + if (commitmentPlanAssociationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter commitmentPlanAssociationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getAssociation( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + commitmentPlanName, + commitmentPlanAssociationName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the association of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services + * Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the association of the Cognitive Services commitment plan along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAssociationWithResponseAsync( + String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (commitmentPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter commitmentPlanName is required and cannot be null.")); + } + if (commitmentPlanAssociationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter commitmentPlanAssociationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getAssociation( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + commitmentPlanName, + commitmentPlanAssociationName, + accept, + context); + } + + /** + * Gets the association of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services + * Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the association of the Cognitive Services commitment plan on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAssociationAsync( + String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName) { + return getAssociationWithResponseAsync(resourceGroupName, commitmentPlanName, commitmentPlanAssociationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the association of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services + * Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the association of the Cognitive Services commitment plan along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAssociationWithResponse( + String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName, Context context) { + return getAssociationWithResponseAsync( + resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, context) + .block(); + } + + /** + * Gets the association of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services + * Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the association of the Cognitive Services commitment plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CommitmentPlanAccountAssociationInner getAssociation( + String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName) { + return getAssociationWithResponse( + resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, Context.NONE) + .getValue(); + } + + /** + * Create or update the association of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services + * Account. + * @param association The commitmentPlan properties. + * @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 commitment plan association along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateAssociationWithResponseAsync( + String resourceGroupName, + String commitmentPlanName, + String commitmentPlanAssociationName, + CommitmentPlanAccountAssociationInner association) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (commitmentPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter commitmentPlanName is required and cannot be null.")); + } + if (commitmentPlanAssociationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter commitmentPlanAssociationName is required and cannot be null.")); + } + if (association == null) { + return Mono.error(new IllegalArgumentException("Parameter association is required and cannot be null.")); + } else { + association.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdateAssociation( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + commitmentPlanName, + commitmentPlanAssociationName, + association, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update the association of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services + * Account. + * @param association The commitmentPlan properties. + * @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 commitment plan association along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateAssociationWithResponseAsync( + String resourceGroupName, + String commitmentPlanName, + String commitmentPlanAssociationName, + CommitmentPlanAccountAssociationInner association, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (commitmentPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter commitmentPlanName is required and cannot be null.")); + } + if (commitmentPlanAssociationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter commitmentPlanAssociationName is required and cannot be null.")); + } + if (association == null) { + return Mono.error(new IllegalArgumentException("Parameter association is required and cannot be null.")); + } else { + association.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdateAssociation( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + commitmentPlanName, + commitmentPlanAssociationName, + association, + accept, + context); + } + + /** + * Create or update the association of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services + * Account. + * @param association The commitmentPlan properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the commitment plan association. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CommitmentPlanAccountAssociationInner> + beginCreateOrUpdateAssociationAsync( + String resourceGroupName, + String commitmentPlanName, + String commitmentPlanAssociationName, + CommitmentPlanAccountAssociationInner association) { + Mono>> mono = + createOrUpdateAssociationWithResponseAsync( + resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, association); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CommitmentPlanAccountAssociationInner.class, + CommitmentPlanAccountAssociationInner.class, + this.client.getContext()); + } + + /** + * Create or update the association of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services + * Account. + * @param association The commitmentPlan properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the commitment plan association. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CommitmentPlanAccountAssociationInner> + beginCreateOrUpdateAssociationAsync( + String resourceGroupName, + String commitmentPlanName, + String commitmentPlanAssociationName, + CommitmentPlanAccountAssociationInner association, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateAssociationWithResponseAsync( + resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, association, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CommitmentPlanAccountAssociationInner.class, + CommitmentPlanAccountAssociationInner.class, + context); + } + + /** + * Create or update the association of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services + * Account. + * @param association The commitmentPlan properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the commitment plan association. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CommitmentPlanAccountAssociationInner> + beginCreateOrUpdateAssociation( + String resourceGroupName, + String commitmentPlanName, + String commitmentPlanAssociationName, + CommitmentPlanAccountAssociationInner association) { + return beginCreateOrUpdateAssociationAsync( + resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, association) + .getSyncPoller(); + } + + /** + * Create or update the association of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services + * Account. + * @param association The commitmentPlan properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the commitment plan association. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CommitmentPlanAccountAssociationInner> + beginCreateOrUpdateAssociation( + String resourceGroupName, + String commitmentPlanName, + String commitmentPlanAssociationName, + CommitmentPlanAccountAssociationInner association, + Context context) { + return beginCreateOrUpdateAssociationAsync( + resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, association, context) + .getSyncPoller(); + } + + /** + * Create or update the association of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services + * Account. + * @param association The commitmentPlan properties. + * @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 commitment plan association on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAssociationAsync( + String resourceGroupName, + String commitmentPlanName, + String commitmentPlanAssociationName, + CommitmentPlanAccountAssociationInner association) { + return beginCreateOrUpdateAssociationAsync( + resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, association) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the association of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services + * Account. + * @param association The commitmentPlan properties. + * @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 commitment plan association on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAssociationAsync( + String resourceGroupName, + String commitmentPlanName, + String commitmentPlanAssociationName, + CommitmentPlanAccountAssociationInner association, + Context context) { + return beginCreateOrUpdateAssociationAsync( + resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, association, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the association of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services + * Account. + * @param association The commitmentPlan properties. + * @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 commitment plan association. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CommitmentPlanAccountAssociationInner createOrUpdateAssociation( + String resourceGroupName, + String commitmentPlanName, + String commitmentPlanAssociationName, + CommitmentPlanAccountAssociationInner association) { + return createOrUpdateAssociationAsync( + resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, association) + .block(); + } + + /** + * Create or update the association of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services + * Account. + * @param association The commitmentPlan properties. + * @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 commitment plan association. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CommitmentPlanAccountAssociationInner createOrUpdateAssociation( + String resourceGroupName, + String commitmentPlanName, + String commitmentPlanAssociationName, + CommitmentPlanAccountAssociationInner association, + Context context) { + return createOrUpdateAssociationAsync( + resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, association, context) + .block(); + } + + /** + * Deletes the association of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services + * Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteAssociationWithResponseAsync( + String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (commitmentPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter commitmentPlanName is required and cannot be null.")); + } + if (commitmentPlanAssociationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter commitmentPlanAssociationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteAssociation( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + commitmentPlanName, + commitmentPlanAssociationName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the association of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services + * Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteAssociationWithResponseAsync( + String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (commitmentPlanName == null) { + return Mono + .error(new IllegalArgumentException("Parameter commitmentPlanName is required and cannot be null.")); + } + if (commitmentPlanAssociationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter commitmentPlanAssociationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteAssociation( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + commitmentPlanName, + commitmentPlanAssociationName, + accept, + context); + } + + /** + * Deletes the association of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services + * Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAssociationAsync( + String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName) { + Mono>> mono = + deleteAssociationWithResponseAsync(resourceGroupName, commitmentPlanName, commitmentPlanAssociationName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes the association of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services + * Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAssociationAsync( + String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteAssociationWithResponseAsync( + resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the association of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services + * Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteAssociation( + String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName) { + return beginDeleteAssociationAsync(resourceGroupName, commitmentPlanName, commitmentPlanAssociationName) + .getSyncPoller(); + } + + /** + * Deletes the association of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services + * Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteAssociation( + String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName, Context context) { + return beginDeleteAssociationAsync( + resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, context) + .getSyncPoller(); + } + + /** + * Deletes the association of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services + * Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAssociationAsync( + String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName) { + return beginDeleteAssociationAsync(resourceGroupName, commitmentPlanName, commitmentPlanAssociationName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the association of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services + * Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAssociationAsync( + String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName, Context context) { + return beginDeleteAssociationAsync( + resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the association of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services + * Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteAssociation( + String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName) { + deleteAssociationAsync(resourceGroupName, commitmentPlanName, commitmentPlanAssociationName).block(); + } + + /** + * Deletes the association of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services + * Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteAssociation( + String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName, Context context) { + deleteAssociationAsync(resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, context).block(); + } + + /** + * 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 accounts operation response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 accounts operation response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 accounts operation response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPlansByResourceGroupNextSinglePageAsync(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.listPlansByResourceGroupNext(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 accounts operation response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPlansByResourceGroupNextSinglePageAsync( + 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 + .listPlansByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 accounts operation response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPlansBySubscriptionNextSinglePageAsync(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.listPlansBySubscriptionNext(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 accounts operation response along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPlansBySubscriptionNextSinglePageAsync( + 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 + .listPlansBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 Commitment Plan Account Association operation response along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAssociationsNextSinglePageAsync( + 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.listAssociationsNext(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 Commitment Plan Account Association operation response along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAssociationsNextSinglePageAsync( + 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 + .listAssociationsNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlansImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlansImpl.java index febee052fcc81..4702d1b31663d 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlansImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlansImpl.java @@ -10,8 +10,10 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.cognitiveservices.fluent.CommitmentPlansClient; +import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentPlanAccountAssociationInner; import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentPlanInner; import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlan; +import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlanAccountAssociation; import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlans; public final class CommitmentPlansImpl implements CommitmentPlans { @@ -62,6 +64,39 @@ public CommitmentPlan get(String resourceGroupName, String accountName, String c } } + public Response createOrUpdateWithResponse( + String resourceGroupName, + String accountName, + String commitmentPlanName, + CommitmentPlanInner commitmentPlan, + Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateWithResponse( + resourceGroupName, accountName, commitmentPlanName, commitmentPlan, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CommitmentPlanImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CommitmentPlan createOrUpdate( + String resourceGroupName, String accountName, String commitmentPlanName, CommitmentPlanInner commitmentPlan) { + CommitmentPlanInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, accountName, commitmentPlanName, commitmentPlan); + if (inner != null) { + return new CommitmentPlanImpl(inner, this.manager()); + } else { + return null; + } + } + public void delete(String resourceGroupName, String accountName, String commitmentPlanName) { this.serviceClient().delete(resourceGroupName, accountName, commitmentPlanName); } @@ -70,6 +105,113 @@ public void delete(String resourceGroupName, String accountName, String commitme this.serviceClient().delete(resourceGroupName, accountName, commitmentPlanName, context); } + public void deletePlan(String resourceGroupName, String commitmentPlanName) { + this.serviceClient().deletePlan(resourceGroupName, commitmentPlanName); + } + + public void deletePlan(String resourceGroupName, String commitmentPlanName, Context context) { + this.serviceClient().deletePlan(resourceGroupName, commitmentPlanName, context); + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String commitmentPlanName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, commitmentPlanName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CommitmentPlanImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CommitmentPlan getByResourceGroup(String resourceGroupName, String commitmentPlanName) { + CommitmentPlanInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, commitmentPlanName); + if (inner != null) { + return new CommitmentPlanImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new CommitmentPlanImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new CommitmentPlanImpl(inner1, this.manager())); + } + + public PagedIterable listPlansBySubscription() { + PagedIterable inner = this.serviceClient().listPlansBySubscription(); + return Utils.mapPage(inner, inner1 -> new CommitmentPlanImpl(inner1, this.manager())); + } + + public PagedIterable listPlansBySubscription(Context context) { + PagedIterable inner = this.serviceClient().listPlansBySubscription(context); + return Utils.mapPage(inner, inner1 -> new CommitmentPlanImpl(inner1, this.manager())); + } + + public PagedIterable listAssociations( + String resourceGroupName, String commitmentPlanName) { + PagedIterable inner = + this.serviceClient().listAssociations(resourceGroupName, commitmentPlanName); + return Utils.mapPage(inner, inner1 -> new CommitmentPlanAccountAssociationImpl(inner1, this.manager())); + } + + public PagedIterable listAssociations( + String resourceGroupName, String commitmentPlanName, Context context) { + PagedIterable inner = + this.serviceClient().listAssociations(resourceGroupName, commitmentPlanName, context); + return Utils.mapPage(inner, inner1 -> new CommitmentPlanAccountAssociationImpl(inner1, this.manager())); + } + + public Response getAssociationWithResponse( + String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName, Context context) { + Response inner = + this + .serviceClient() + .getAssociationWithResponse( + resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CommitmentPlanAccountAssociationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CommitmentPlanAccountAssociation getAssociation( + String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName) { + CommitmentPlanAccountAssociationInner inner = + this.serviceClient().getAssociation(resourceGroupName, commitmentPlanName, commitmentPlanAssociationName); + if (inner != null) { + return new CommitmentPlanAccountAssociationImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteAssociation( + String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName) { + this.serviceClient().deleteAssociation(resourceGroupName, commitmentPlanName, commitmentPlanAssociationName); + } + + public void deleteAssociation( + String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName, Context context) { + this + .serviceClient() + .deleteAssociation(resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, context); + } + public CommitmentPlan getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { @@ -79,12 +221,25 @@ public CommitmentPlan getById(String id) { String .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String accountName = Utils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { + String commitmentPlanName = Utils.getValueFromIdByName(id, "commitmentPlans"); + if (commitmentPlanName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'commitmentPlans'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, commitmentPlanName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { throw LOGGER .logExceptionAsError( new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } String commitmentPlanName = Utils.getValueFromIdByName(id, "commitmentPlans"); if (commitmentPlanName == null) { @@ -94,10 +249,10 @@ public CommitmentPlan getById(String id) { String .format("The resource ID '%s' is not valid. Missing path segment 'commitmentPlans'.", id))); } - return this.getWithResponse(resourceGroupName, accountName, commitmentPlanName, Context.NONE).getValue(); + return this.getByResourceGroupWithResponse(resourceGroupName, commitmentPlanName, context); } - public Response getByIdWithResponse(String id, Context context) { + public CommitmentPlanAccountAssociation getAssociationById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER @@ -106,12 +261,37 @@ public Response getByIdWithResponse(String id, Context context) String .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String accountName = Utils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { + String commitmentPlanName = Utils.getValueFromIdByName(id, "commitmentPlans"); + if (commitmentPlanName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'commitmentPlans'.", id))); + } + String commitmentPlanAssociationName = Utils.getValueFromIdByName(id, "accountAssociations"); + if (commitmentPlanAssociationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'accountAssociations'.", id))); + } + return this + .getAssociationWithResponse( + resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, Context.NONE) + .getValue(); + } + + public Response getAssociationByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { throw LOGGER .logExceptionAsError( new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } String commitmentPlanName = Utils.getValueFromIdByName(id, "commitmentPlans"); if (commitmentPlanName == null) { @@ -121,10 +301,20 @@ public Response getByIdWithResponse(String id, Context context) String .format("The resource ID '%s' is not valid. Missing path segment 'commitmentPlans'.", id))); } - return this.getWithResponse(resourceGroupName, accountName, commitmentPlanName, context); + String commitmentPlanAssociationName = Utils.getValueFromIdByName(id, "accountAssociations"); + if (commitmentPlanAssociationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'accountAssociations'.", id))); + } + return this + .getAssociationWithResponse(resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, context); } - public void deleteById(String id) { + public void deletePlanById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER @@ -133,12 +323,25 @@ public void deleteById(String id) { String .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String accountName = Utils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { + String commitmentPlanName = Utils.getValueFromIdByName(id, "commitmentPlans"); + if (commitmentPlanName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'commitmentPlans'.", id))); + } + this.deletePlan(resourceGroupName, commitmentPlanName, Context.NONE); + } + + public void deletePlanByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { throw LOGGER .logExceptionAsError( new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } String commitmentPlanName = Utils.getValueFromIdByName(id, "commitmentPlans"); if (commitmentPlanName == null) { @@ -148,10 +351,10 @@ public void deleteById(String id) { String .format("The resource ID '%s' is not valid. Missing path segment 'commitmentPlans'.", id))); } - this.delete(resourceGroupName, accountName, commitmentPlanName, Context.NONE); + this.deletePlan(resourceGroupName, commitmentPlanName, context); } - public void deleteByIdWithResponse(String id, Context context) { + public void deleteAssociationById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER @@ -160,12 +363,34 @@ public void deleteByIdWithResponse(String id, Context context) { String .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String accountName = Utils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { + String commitmentPlanName = Utils.getValueFromIdByName(id, "commitmentPlans"); + if (commitmentPlanName == null) { throw LOGGER .logExceptionAsError( new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + String + .format("The resource ID '%s' is not valid. Missing path segment 'commitmentPlans'.", id))); + } + String commitmentPlanAssociationName = Utils.getValueFromIdByName(id, "accountAssociations"); + if (commitmentPlanAssociationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'accountAssociations'.", id))); + } + this.deleteAssociation(resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, Context.NONE); + } + + public void deleteAssociationByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } String commitmentPlanName = Utils.getValueFromIdByName(id, "commitmentPlans"); if (commitmentPlanName == null) { @@ -175,7 +400,16 @@ public void deleteByIdWithResponse(String id, Context context) { String .format("The resource ID '%s' is not valid. Missing path segment 'commitmentPlans'.", id))); } - this.delete(resourceGroupName, accountName, commitmentPlanName, context); + String commitmentPlanAssociationName = Utils.getValueFromIdByName(id, "accountAssociations"); + if (commitmentPlanAssociationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'accountAssociations'.", id))); + } + this.deleteAssociation(resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, context); } private CommitmentPlansClient serviceClient() { @@ -186,7 +420,11 @@ private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager man return this.serviceManager; } - public CommitmentPlanImpl define(String name) { + public CommitmentPlanImpl definePlan(String name) { return new CommitmentPlanImpl(name, this.manager()); } + + public CommitmentPlanAccountAssociationImpl defineAssociation(String name) { + return new CommitmentPlanAccountAssociationImpl(name, this.manager()); + } } 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 2da36ca0c3b47..4d3314b5778d5 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 @@ -59,6 +59,13 @@ public interface AccountModel { */ Map capabilities(); + /** + * Gets the finetuneCapabilities property: The capabilities for finetune models. + * + * @return the finetuneCapabilities value. + */ + Map finetuneCapabilities(); + /** * Gets the deprecation property: Cognitive Services account ModelDeprecationInfo. * @@ -66,6 +73,13 @@ public interface AccountModel { */ ModelDeprecationInfo deprecation(); + /** + * Gets the lifecycleStatus property: Model lifecycle status. + * + * @return the lifecycleStatus value. + */ + ModelLifecycleStatus lifecycleStatus(); + /** * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. * 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 c5103cf087735..0ebeb26ab1a2d 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 @@ -166,6 +166,18 @@ public final class AccountProperties { @JsonProperty(value = "scheduledPurgeDate", access = JsonProperty.Access.WRITE_ONLY) private String scheduledPurgeDate; + /* + * The multiregion settings of Cognitive Services account. + */ + @JsonProperty(value = "locations") + private MultiRegionSettings locations; + + /* + * The commitment plan associations of Cognitive Services account. + */ + @JsonProperty(value = "commitmentPlanAssociations", access = JsonProperty.Access.WRITE_ONLY) + private List commitmentPlanAssociations; + /** Creates an instance of AccountProperties class. */ public AccountProperties() { } @@ -530,6 +542,35 @@ public String scheduledPurgeDate() { return this.scheduledPurgeDate; } + /** + * Get the locations property: The multiregion settings of Cognitive Services account. + * + * @return the locations value. + */ + public MultiRegionSettings locations() { + return this.locations; + } + + /** + * Set the locations property: The multiregion settings of Cognitive Services account. + * + * @param locations the locations value to set. + * @return the AccountProperties object itself. + */ + public AccountProperties withLocations(MultiRegionSettings locations) { + this.locations = locations; + return this; + } + + /** + * Get the commitmentPlanAssociations property: The commitment plan associations of Cognitive Services account. + * + * @return the commitmentPlanAssociations value. + */ + public List commitmentPlanAssociations() { + return this.commitmentPlanAssociations; + } + /** * Validates the instance. * @@ -563,5 +604,11 @@ public void validate() { if (quotaLimit() != null) { quotaLimit().validate(); } + if (locations() != null) { + locations().validate(); + } + if (commitmentPlanAssociations() != null) { + commitmentPlanAssociations().forEach(e -> e.validate()); + } } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlan.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlan.java index e35c770bcd2cc..e754f5d4a59e5 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlan.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlan.java @@ -4,9 +4,11 @@ package com.azure.resourcemanager.cognitiveservices.models; +import com.azure.core.management.Region; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentPlanInner; +import java.util.Map; /** An immutable client-side representation of CommitmentPlan. */ public interface CommitmentPlan { @@ -45,6 +47,34 @@ public interface CommitmentPlan { */ String etag(); + /** + * Gets the kind property: The Kind of the resource. + * + * @return the kind value. + */ + String kind(); + + /** + * Gets the sku property: The resource model definition representing SKU. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + /** * Gets the properties property: Properties of Cognitive Services account commitment plan. * @@ -52,6 +82,20 @@ public interface CommitmentPlan { */ CommitmentPlanProperties properties(); + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + /** * Gets the name of the resource group. * @@ -68,29 +112,33 @@ public interface CommitmentPlan { /** The entirety of the CommitmentPlan definition. */ interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + extends DefinitionStages.Blank, DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } /** The CommitmentPlan definition stages. */ interface DefinitionStages { /** The first stage of the CommitmentPlan definition. */ - interface Blank extends WithParentResource { + interface Blank extends WithResourceGroup { } /** The stage of the CommitmentPlan definition allowing to specify parent resource. */ - interface WithParentResource { + interface WithResourceGroup { /** - * Specifies resourceGroupName, accountName. + * Specifies resourceGroupName. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. * @return the next definition stage. */ - WithCreate withExistingAccount(String resourceGroupName, String accountName); + WithCreate withExistingResourceGroup(String resourceGroupName); } /** * The stage of the CommitmentPlan 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.WithLocation, + DefinitionStages.WithTags, + DefinitionStages.WithKind, + DefinitionStages.WithSku, + DefinitionStages.WithProperties { /** * Executes the create request. * @@ -106,6 +154,54 @@ interface WithCreate extends DefinitionStages.WithProperties { */ CommitmentPlan create(Context context); } + /** The stage of the CommitmentPlan definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + /** The stage of the CommitmentPlan definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the CommitmentPlan definition allowing to specify kind. */ + interface WithKind { + /** + * Specifies the kind property: The Kind of the resource.. + * + * @param kind The Kind of the resource. + * @return the next definition stage. + */ + WithCreate withKind(String kind); + } + /** The stage of the CommitmentPlan 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 CommitmentPlan definition allowing to specify properties. */ interface WithProperties { /** @@ -125,7 +221,7 @@ interface WithProperties { CommitmentPlan.Update update(); /** The template for CommitmentPlan update. */ - interface Update extends UpdateStages.WithProperties { + interface Update extends UpdateStages.WithTags, UpdateStages.WithSku { /** * Executes the update request. * @@ -143,15 +239,25 @@ interface Update extends UpdateStages.WithProperties { } /** The CommitmentPlan update stages. */ interface UpdateStages { - /** The stage of the CommitmentPlan update allowing to specify properties. */ - interface WithProperties { + /** The stage of the CommitmentPlan update allowing to specify tags. */ + interface WithTags { /** - * Specifies the properties property: Properties of Cognitive Services account commitment plan.. + * Specifies the tags property: Resource tags.. * - * @param properties Properties of Cognitive Services account commitment plan. + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the CommitmentPlan 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 withProperties(CommitmentPlanProperties properties); + Update withSku(Sku sku); } } /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanAccountAssociation.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanAccountAssociation.java new file mode 100644 index 0000000000000..cfbed570114d4 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanAccountAssociation.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentPlanAccountAssociationInner; + +/** An immutable client-side representation of CommitmentPlanAccountAssociation. */ +public interface CommitmentPlanAccountAssociation { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: Resource Etag. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the accountId property: The Azure resource id of the account. + * + * @return the accountId value. + */ + String accountId(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentPlanAccountAssociationInner + * object. + * + * @return the inner object. + */ + CommitmentPlanAccountAssociationInner innerModel(); + + /** The entirety of the CommitmentPlanAccountAssociation definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The CommitmentPlanAccountAssociation definition stages. */ + interface DefinitionStages { + /** The first stage of the CommitmentPlanAccountAssociation definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the CommitmentPlanAccountAssociation definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, commitmentPlanName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @return the next definition stage. + */ + WithCreate withExistingCommitmentPlan(String resourceGroupName, String commitmentPlanName); + } + /** + * The stage of the CommitmentPlanAccountAssociation 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.WithAccountId { + /** + * Executes the create request. + * + * @return the created resource. + */ + CommitmentPlanAccountAssociation create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + CommitmentPlanAccountAssociation create(Context context); + } + /** The stage of the CommitmentPlanAccountAssociation definition allowing to specify accountId. */ + interface WithAccountId { + /** + * Specifies the accountId property: The Azure resource id of the account.. + * + * @param accountId The Azure resource id of the account. + * @return the next definition stage. + */ + WithCreate withAccountId(String accountId); + } + } + /** + * Begins update for the CommitmentPlanAccountAssociation resource. + * + * @return the stage of resource update. + */ + CommitmentPlanAccountAssociation.Update update(); + + /** The template for CommitmentPlanAccountAssociation update. */ + interface Update extends UpdateStages.WithAccountId { + /** + * Executes the update request. + * + * @return the updated resource. + */ + CommitmentPlanAccountAssociation apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + CommitmentPlanAccountAssociation apply(Context context); + } + /** The CommitmentPlanAccountAssociation update stages. */ + interface UpdateStages { + /** The stage of the CommitmentPlanAccountAssociation update allowing to specify accountId. */ + interface WithAccountId { + /** + * Specifies the accountId property: The Azure resource id of the account.. + * + * @param accountId The Azure resource id of the account. + * @return the next definition stage. + */ + Update withAccountId(String accountId); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + CommitmentPlanAccountAssociation refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + CommitmentPlanAccountAssociation refresh(Context context); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanAccountAssociationListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanAccountAssociationListResult.java new file mode 100644 index 0000000000000..74dcbf74a5a03 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanAccountAssociationListResult.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentPlanAccountAssociationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of cognitive services Commitment Plan Account Association operation response. */ +@Fluent +public final class CommitmentPlanAccountAssociationListResult { + /* + * The link used to get the next page of Commitment Plan Account Association. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * Gets the list of Cognitive Services Commitment Plan Account Association and their properties. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** Creates an instance of CommitmentPlanAccountAssociationListResult class. */ + public CommitmentPlanAccountAssociationListResult() { + } + + /** + * Get the nextLink property: The link used to get the next page of Commitment Plan Account Association. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link used to get the next page of Commitment Plan Account Association. + * + * @param nextLink the nextLink value to set. + * @return the CommitmentPlanAccountAssociationListResult object itself. + */ + public CommitmentPlanAccountAssociationListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: Gets the list of Cognitive Services Commitment Plan Account Association and their + * properties. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanAssociation.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanAssociation.java new file mode 100644 index 0000000000000..64aaec42db7f2 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanAssociation.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The commitment plan association. */ +@Fluent +public final class CommitmentPlanAssociation { + /* + * The Azure resource id of the commitment plan. + */ + @JsonProperty(value = "commitmentPlanId") + private String commitmentPlanId; + + /* + * The location of of the commitment plan. + */ + @JsonProperty(value = "commitmentPlanLocation") + private String commitmentPlanLocation; + + /** Creates an instance of CommitmentPlanAssociation class. */ + public CommitmentPlanAssociation() { + } + + /** + * Get the commitmentPlanId property: The Azure resource id of the commitment plan. + * + * @return the commitmentPlanId value. + */ + public String commitmentPlanId() { + return this.commitmentPlanId; + } + + /** + * Set the commitmentPlanId property: The Azure resource id of the commitment plan. + * + * @param commitmentPlanId the commitmentPlanId value to set. + * @return the CommitmentPlanAssociation object itself. + */ + public CommitmentPlanAssociation withCommitmentPlanId(String commitmentPlanId) { + this.commitmentPlanId = commitmentPlanId; + return this; + } + + /** + * Get the commitmentPlanLocation property: The location of of the commitment plan. + * + * @return the commitmentPlanLocation value. + */ + public String commitmentPlanLocation() { + return this.commitmentPlanLocation; + } + + /** + * Set the commitmentPlanLocation property: The location of of the commitment plan. + * + * @param commitmentPlanLocation the commitmentPlanLocation value to set. + * @return the CommitmentPlanAssociation object itself. + */ + public CommitmentPlanAssociation withCommitmentPlanLocation(String commitmentPlanLocation) { + this.commitmentPlanLocation = commitmentPlanLocation; + 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 43091ad93137f..33502bed63d03 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 @@ -10,6 +10,18 @@ /** Properties of Cognitive Services account commitment plan. */ @Fluent public final class CommitmentPlanProperties { + /* + * Gets the status of the resource at the time the operation was called. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private CommitmentPlanProvisioningState provisioningState; + + /* + * Commitment plan guid. + */ + @JsonProperty(value = "commitmentPlanGuid") + private String commitmentPlanGuid; + /* * Account hosting model. */ @@ -50,6 +62,35 @@ public final class CommitmentPlanProperties { public CommitmentPlanProperties() { } + /** + * Get the provisioningState property: Gets the status of the resource at the time the operation was called. + * + * @return the provisioningState value. + */ + public CommitmentPlanProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the commitmentPlanGuid property: Commitment plan guid. + * + * @return the commitmentPlanGuid value. + */ + public String commitmentPlanGuid() { + return this.commitmentPlanGuid; + } + + /** + * Set the commitmentPlanGuid property: Commitment plan guid. + * + * @param commitmentPlanGuid the commitmentPlanGuid value to set. + * @return the CommitmentPlanProperties object itself. + */ + public CommitmentPlanProperties withCommitmentPlanGuid(String commitmentPlanGuid) { + this.commitmentPlanGuid = commitmentPlanGuid; + return this; + } + /** * Get the hostingModel property: Account hosting model. * diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanProvisioningState.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanProvisioningState.java new file mode 100644 index 0000000000000..51b6cf4323436 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanProvisioningState.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; + +/** Gets the status of the resource at the time the operation was called. */ +public final class CommitmentPlanProvisioningState extends ExpandableStringEnum { + /** Static value Accepted for CommitmentPlanProvisioningState. */ + public static final CommitmentPlanProvisioningState ACCEPTED = fromString("Accepted"); + + /** Static value Creating for CommitmentPlanProvisioningState. */ + public static final CommitmentPlanProvisioningState CREATING = fromString("Creating"); + + /** Static value Deleting for CommitmentPlanProvisioningState. */ + public static final CommitmentPlanProvisioningState DELETING = fromString("Deleting"); + + /** Static value Moving for CommitmentPlanProvisioningState. */ + public static final CommitmentPlanProvisioningState MOVING = fromString("Moving"); + + /** Static value Failed for CommitmentPlanProvisioningState. */ + public static final CommitmentPlanProvisioningState FAILED = fromString("Failed"); + + /** Static value Succeeded for CommitmentPlanProvisioningState. */ + public static final CommitmentPlanProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Canceled for CommitmentPlanProvisioningState. */ + public static final CommitmentPlanProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates or finds a CommitmentPlanProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding CommitmentPlanProvisioningState. + */ + @JsonCreator + public static CommitmentPlanProvisioningState fromString(String name) { + return fromString(name, CommitmentPlanProvisioningState.class); + } + + /** + * Gets known CommitmentPlanProvisioningState values. + * + * @return known CommitmentPlanProvisioningState values. + */ + public static Collection values() { + return values(CommitmentPlanProvisioningState.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlans.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlans.java index 256200cf41c75..073451e1c7002 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlans.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlans.java @@ -7,6 +7,7 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; +import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentPlanInner; /** Resource collection API of CommitmentPlans. */ public interface CommitmentPlans { @@ -65,6 +66,41 @@ Response getWithResponse( */ CommitmentPlan get(String resourceGroupName, String accountName, String commitmentPlanName); + /** + * Update the state of specified commitmentPlans associated with the Cognitive Services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlan The commitmentPlan properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account commitment plan along with {@link Response}. + */ + Response createOrUpdateWithResponse( + String resourceGroupName, + String accountName, + String commitmentPlanName, + CommitmentPlanInner commitmentPlan, + Context context); + + /** + * Update the state of specified commitmentPlans associated with the Cognitive Services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlan The commitmentPlan properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account commitment plan. + */ + CommitmentPlan createOrUpdate( + String resourceGroupName, String accountName, String commitmentPlanName, CommitmentPlanInner commitmentPlan); + /** * Deletes the specified commitmentPlan associated with the Cognitive Services account. * @@ -91,48 +127,276 @@ Response getWithResponse( void delete(String resourceGroupName, String accountName, String commitmentPlanName, Context context); /** - * Gets the specified commitmentPlans associated with the Cognitive Services account. + * Deletes a Cognitive Services commitment plan from the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deletePlan(String resourceGroupName, String commitmentPlanName); + + /** + * Deletes a Cognitive Services commitment plan from the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deletePlan(String resourceGroupName, String commitmentPlanName, Context context); + + /** + * Returns a Cognitive Services commitment plan specified by the parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account commitment plan along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String commitmentPlanName, Context context); + + /** + * Returns a Cognitive Services commitment plan specified by the parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account commitment plan. + */ + CommitmentPlan getByResourceGroup(String resourceGroupName, String commitmentPlanName); + + /** + * Returns all the resources of a particular type belonging to a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 accounts operation response as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Returns all the resources of a particular type belonging to a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 accounts operation response as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Returns all the resources of a particular type belonging to a subscription. + * + * @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 accounts operation response as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listPlansBySubscription(); + + /** + * Returns all the resources of a particular type belonging to a subscription. + * + * @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 accounts operation response as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listPlansBySubscription(Context context); + + /** + * Gets the associations of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the associations of the Cognitive Services commitment plan as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listAssociations( + String resourceGroupName, String commitmentPlanName); + + /** + * Gets the associations of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the associations of the Cognitive Services commitment plan as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listAssociations( + String resourceGroupName, String commitmentPlanName, Context context); + + /** + * Gets the association of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services + * Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the association of the Cognitive Services commitment plan along with {@link Response}. + */ + Response getAssociationWithResponse( + String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName, Context context); + + /** + * Gets the association of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services + * Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the association of the Cognitive Services commitment plan. + */ + CommitmentPlanAccountAssociation getAssociation( + String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName); + + /** + * Deletes the association of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services + * Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteAssociation(String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName); + + /** + * Deletes the association of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services + * Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteAssociation( + String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName, Context context); + + /** + * Returns a Cognitive Services commitment plan specified by the parameters. * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified commitmentPlans associated with the Cognitive Services account along with {@link Response}. + * @return cognitive Services account commitment plan along with {@link Response}. */ CommitmentPlan getById(String id); /** - * Gets the specified commitmentPlans associated with the Cognitive Services account. + * Returns a Cognitive Services commitment plan specified by the parameters. * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified commitmentPlans associated with the Cognitive Services account along with {@link Response}. + * @return cognitive Services account commitment plan along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); /** - * Deletes the specified commitmentPlan associated with the Cognitive Services account. + * Gets the association of the Cognitive Services commitment plan. * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the association of the Cognitive Services commitment plan along with {@link Response}. */ - void deleteById(String id); + CommitmentPlanAccountAssociation getAssociationById(String id); /** - * Deletes the specified commitmentPlan associated with the Cognitive Services account. + * Gets the association of the Cognitive Services commitment plan. * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the association of the Cognitive Services commitment plan along with {@link Response}. */ - void deleteByIdWithResponse(String id, Context context); + Response getAssociationByIdWithResponse(String id, Context context); + + /** + * Deletes a Cognitive Services commitment plan from the resource group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deletePlanById(String id); + + /** + * Deletes a Cognitive Services commitment plan from the resource group. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deletePlanByIdWithResponse(String id, Context context); + + /** + * Deletes the association of the Cognitive Services commitment plan. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteAssociationById(String id); + + /** + * Deletes the association of the Cognitive Services commitment plan. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteAssociationByIdWithResponse(String id, Context context); /** * Begins definition for a new CommitmentPlan resource. @@ -140,5 +404,13 @@ Response getWithResponse( * @param name resource name. * @return the first stage of the new CommitmentPlan definition. */ - CommitmentPlan.DefinitionStages.Blank define(String name); + CommitmentPlan.DefinitionStages.Blank definePlan(String name); + + /** + * Begins definition for a new CommitmentPlanAccountAssociation resource. + * + * @param name resource name. + * @return the first stage of the new CommitmentPlanAccountAssociation definition. + */ + CommitmentPlanAccountAssociation.DefinitionStages.Blank defineAssociation(String name); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelLifecycleStatus.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelLifecycleStatus.java new file mode 100644 index 0000000000000..0836c61577bda --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelLifecycleStatus.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.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Model lifecycle status. */ +public final class ModelLifecycleStatus extends ExpandableStringEnum { + /** Static value GenerallyAvailable for ModelLifecycleStatus. */ + public static final ModelLifecycleStatus GENERALLY_AVAILABLE = fromString("GenerallyAvailable"); + + /** Static value Preview for ModelLifecycleStatus. */ + public static final ModelLifecycleStatus PREVIEW = fromString("Preview"); + + /** + * Creates or finds a ModelLifecycleStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ModelLifecycleStatus. + */ + @JsonCreator + public static ModelLifecycleStatus fromString(String name) { + return fromString(name, ModelLifecycleStatus.class); + } + + /** + * Gets known ModelLifecycleStatus values. + * + * @return known ModelLifecycleStatus values. + */ + public static Collection values() { + return values(ModelLifecycleStatus.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/MultiRegionSettings.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/MultiRegionSettings.java new file mode 100644 index 0000000000000..65c01e1ce13e2 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/MultiRegionSettings.java @@ -0,0 +1,80 @@ +// Copyright (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.util.List; + +/** The multiregion settings Cognitive Services account. */ +@Fluent +public final class MultiRegionSettings { + /* + * Multiregion routing methods. + */ + @JsonProperty(value = "routingMethod") + private RoutingMethods routingMethod; + + /* + * The regions property. + */ + @JsonProperty(value = "regions") + private List regions; + + /** Creates an instance of MultiRegionSettings class. */ + public MultiRegionSettings() { + } + + /** + * Get the routingMethod property: Multiregion routing methods. + * + * @return the routingMethod value. + */ + public RoutingMethods routingMethod() { + return this.routingMethod; + } + + /** + * Set the routingMethod property: Multiregion routing methods. + * + * @param routingMethod the routingMethod value to set. + * @return the MultiRegionSettings object itself. + */ + public MultiRegionSettings withRoutingMethod(RoutingMethods routingMethod) { + this.routingMethod = routingMethod; + return this; + } + + /** + * Get the regions property: The regions property. + * + * @return the regions value. + */ + public List regions() { + return this.regions; + } + + /** + * Set the regions property: The regions property. + * + * @param regions the regions value to set. + * @return the MultiRegionSettings object itself. + */ + public MultiRegionSettings withRegions(List regions) { + this.regions = regions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (regions() != null) { + regions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PatchResourceTags.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PatchResourceTags.java new file mode 100644 index 0000000000000..7fe846cda260f --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PatchResourceTags.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.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The object being used to update tags of a resource, in general used for PATCH operations. */ +@Fluent +public class PatchResourceTags { + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of PatchResourceTags class. */ + public PatchResourceTags() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the PatchResourceTags object itself. + */ + public PatchResourceTags withTags(Map tags) { + this.tags = tags; + 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/PatchResourceTagsAndSku.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PatchResourceTagsAndSku.java new file mode 100644 index 0000000000000..88fd533cf6a8b --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PatchResourceTagsAndSku.java @@ -0,0 +1,63 @@ +// Copyright (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.util.Map; + +/** The object being used to update tags and sku of a resource, in general used for PATCH operations. */ +@Fluent +public final class PatchResourceTagsAndSku extends PatchResourceTags { + /* + * The resource model definition representing SKU + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** Creates an instance of PatchResourceTagsAndSku class. */ + public PatchResourceTagsAndSku() { + } + + /** + * 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 PatchResourceTagsAndSku object itself. + */ + public PatchResourceTagsAndSku withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** {@inheritDoc} */ + @Override + public PatchResourceTagsAndSku withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (sku() != null) { + sku().validate(); + } + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RegionSetting.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RegionSetting.java new file mode 100644 index 0000000000000..0fdf3c5d61a87 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RegionSetting.java @@ -0,0 +1,102 @@ +// Copyright (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 call rate limit Cognitive Services account. */ +@Fluent +public final class RegionSetting { + /* + * Name of the region. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A value for priority or weighted routing methods. + */ + @JsonProperty(value = "value") + private Float value; + + /* + * Maps the region to the regional custom subdomain. + */ + @JsonProperty(value = "customsubdomain") + private String customsubdomain; + + /** Creates an instance of RegionSetting class. */ + public RegionSetting() { + } + + /** + * Get the name property: Name of the region. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the region. + * + * @param name the name value to set. + * @return the RegionSetting object itself. + */ + public RegionSetting withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: A value for priority or weighted routing methods. + * + * @return the value value. + */ + public Float value() { + return this.value; + } + + /** + * Set the value property: A value for priority or weighted routing methods. + * + * @param value the value value to set. + * @return the RegionSetting object itself. + */ + public RegionSetting withValue(Float value) { + this.value = value; + return this; + } + + /** + * Get the customsubdomain property: Maps the region to the regional custom subdomain. + * + * @return the customsubdomain value. + */ + public String customsubdomain() { + return this.customsubdomain; + } + + /** + * Set the customsubdomain property: Maps the region to the regional custom subdomain. + * + * @param customsubdomain the customsubdomain value to set. + * @return the RegionSetting object itself. + */ + public RegionSetting withCustomsubdomain(String customsubdomain) { + this.customsubdomain = customsubdomain; + 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/RoutingMethods.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RoutingMethods.java new file mode 100644 index 0000000000000..9e29261207610 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RoutingMethods.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Multiregion routing methods. */ +public final class RoutingMethods extends ExpandableStringEnum { + /** Static value Priority for RoutingMethods. */ + public static final RoutingMethods PRIORITY = fromString("Priority"); + + /** Static value Weighted for RoutingMethods. */ + public static final RoutingMethods WEIGHTED = fromString("Weighted"); + + /** Static value Performance for RoutingMethods. */ + public static final RoutingMethods PERFORMANCE = fromString("Performance"); + + /** + * Creates or finds a RoutingMethods from its string representation. + * + * @param name a name to look for. + * @return the corresponding RoutingMethods. + */ + @JsonCreator + public static RoutingMethods fromString(String name) { + return fromString(name, RoutingMethods.class); + } + + /** + * Gets known RoutingMethods values. + * + * @return known RoutingMethods values. + */ + public static Collection values() { + return values(RoutingMethods.class); + } +} 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 bbd1dfa1f9681..fed45f0e4f7bb 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-10-01/examples/CreateAccountMin.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-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-10-01/examples/CreateAccount.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-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 6b57ee132445a..d080fc5e60fa7 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 @@ -9,7 +9,7 @@ /** Samples for Accounts Delete. */ public final class AccountsDeleteSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/DeleteAccount.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-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 b948911cae46d..b212baa3a3944 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 @@ -9,7 +9,7 @@ /** Samples for Accounts GetByResourceGroup. */ public final class AccountsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/GetAccount.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-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 590b70e4aa65e..7a68f731ea91e 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 @@ -9,7 +9,7 @@ /** Samples for Accounts ListByResourceGroup. */ public final class AccountsListByResourceGroupSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/ListAccountsByResourceGroup.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-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 ef1bc0a886f53..74c8768e8ce49 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 @@ -9,7 +9,7 @@ /** Samples for Accounts ListKeys. */ public final class AccountsListKeysSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/ListKeys.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-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 ea7b851e23a06..af740327cb01a 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 @@ -9,7 +9,7 @@ /** Samples for Accounts ListModels. */ public final class AccountsListModelsSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/ListAccountModels.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-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 e651fb4f8e161..89bdc52cb8f4f 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 @@ -9,7 +9,7 @@ /** Samples for Accounts List. */ public final class AccountsListSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/ListAccountsBySubscription.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-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 46981e983e0aa..8f5aec4d503b6 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 @@ -9,7 +9,7 @@ /** Samples for Accounts ListSkus. */ public final class AccountsListSkusSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/ListSkus.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-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 8ecadc21a7bfc..3e77d5f6349ac 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 @@ -9,7 +9,7 @@ /** Samples for Accounts ListUsages. */ public final class AccountsListUsagesSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/GetUsages.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-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 b3511e0a021c4..dd6e82ebee35a 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 @@ -11,7 +11,7 @@ /** Samples for Accounts RegenerateKey. */ public final class AccountsRegenerateKeySamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/RegenerateKey.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-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 df2109ad7d36d..22ce2adb3d561 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 @@ -11,7 +11,7 @@ /** Samples for Accounts Update. */ public final class AccountsUpdateSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/UpdateAccount.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-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 new file mode 100644 index 0000000000000..2216be556bb42 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdateAssociationSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** Samples for CommitmentPlans CreateOrUpdateAssociation. */ +public final class CommitmentPlansCreateOrUpdateAssociationSamples { + /* + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/CreateSharedCommitmentPlanAssociation.json + */ + /** + * Sample code: PutCommitmentPlan. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void putCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager + .commitmentPlans() + .defineAssociation("commitmentPlanAssociationName") + .withExistingCommitmentPlan("resourceGroupName", "commitmentPlanName") + .withAccountId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.CognitiveServices/accounts/accountName") + .create(); + } +} 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 new file mode 100644 index 0000000000000..97e4a464e7e9b --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdatePlanSamples.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.generated; + +import com.azure.resourcemanager.cognitiveservices.models.CommitmentPeriod; +import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlanProperties; +import com.azure.resourcemanager.cognitiveservices.models.HostingModel; +import com.azure.resourcemanager.cognitiveservices.models.Sku; + +/** Samples for CommitmentPlans CreateOrUpdatePlan. */ +public final class CommitmentPlansCreateOrUpdatePlanSamples { + /* + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/CreateSharedCommitmentPlan.json + */ + /** + * Sample code: Create Commitment Plan. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void createCommitmentPlan( + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager + .commitmentPlans() + .definePlan("commitmentPlanName") + .withExistingResourceGroup("resourceGroupName") + .withRegion("West US") + .withKind("SpeechServices") + .withSku(new Sku().withName("S0")) + .withProperties( + new CommitmentPlanProperties() + .withHostingModel(HostingModel.WEB) + .withPlanType("STT") + .withCurrent(new CommitmentPeriod().withTier("T1")) + .withAutoRenew(true)) + .create(); + } +} 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 a1c0ba4d0cd7d..5adc6fa69d29a 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 @@ -4,6 +4,8 @@ package com.azure.resourcemanager.cognitiveservices.generated; +import com.azure.core.util.Context; +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; @@ -11,7 +13,7 @@ /** Samples for CommitmentPlans CreateOrUpdate. */ public final class CommitmentPlansCreateOrUpdateSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/PutCommitmentPlan.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/PutCommitmentPlan.json */ /** * Sample code: PutCommitmentPlan. @@ -21,14 +23,17 @@ public final class CommitmentPlansCreateOrUpdateSamples { public static void putCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { manager .commitmentPlans() - .define("commitmentPlanName") - .withExistingAccount("resourceGroupName", "accountName") - .withProperties( - new CommitmentPlanProperties() - .withHostingModel(HostingModel.WEB) - .withPlanType("Speech2Text") - .withCurrent(new CommitmentPeriod().withTier("T1")) - .withAutoRenew(true)) - .create(); + .createOrUpdateWithResponse( + "resourceGroupName", + "accountName", + "commitmentPlanName", + new CommitmentPlanInner() + .withProperties( + new CommitmentPlanProperties() + .withHostingModel(HostingModel.WEB) + .withPlanType("Speech2Text") + .withCurrent(new CommitmentPeriod().withTier("T1")) + .withAutoRenew(true)), + Context.NONE); } } 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 new file mode 100644 index 0000000000000..3236fe8847b37 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeleteAssociationSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.Context; + +/** 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 + */ + /** + * Sample code: DeleteCommitmentPlan. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void deleteCommitmentPlan( + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager + .commitmentPlans() + .deleteAssociation( + "resourceGroupName", "commitmentPlanName", "commitmentPlanAssociationName", Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..243170f01d958 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeletePlanSamples.java @@ -0,0 +1,23 @@ +// Copyright (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.Context; + +/** 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 + */ + /** + * Sample code: Delete Commitment Plan. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void deleteCommitmentPlan( + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.commitmentPlans().deletePlan("resourceGroupName", "commitmentPlanName", Context.NONE); + } +} 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 1f990ef6bf426..66d9eaf6d4c7e 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 @@ -9,7 +9,7 @@ /** Samples for CommitmentPlans Delete. */ public final class CommitmentPlansDeleteSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/DeleteCommitmentPlan.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-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 new file mode 100644 index 0000000000000..48a73a2e53bf3 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetAssociationSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.Context; + +/** 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 + */ + /** + * Sample code: GetCommitmentPlan. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void getCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager + .commitmentPlans() + .getAssociationWithResponse( + "resourceGroupName", "commitmentPlanName", "commitmentPlanAssociationName", Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..65ed0d323af3d --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetByResourceGroupSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.Context; + +/** 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 + */ + /** + * Sample code: Get Commitment Plan. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void getCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager + .commitmentPlans() + .getByResourceGroupWithResponse("resourceGroupName", "commitmentPlanName", Context.NONE); + } +} 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 1ed01da89e88d..10d1205b3ec31 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 @@ -9,7 +9,7 @@ /** Samples for CommitmentPlans Get. */ public final class CommitmentPlansGetSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/GetCommitmentPlan.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-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 new file mode 100644 index 0000000000000..65e48361b5ca0 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListAssociationsSamples.java @@ -0,0 +1,23 @@ +// Copyright (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.Context; + +/** 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 + */ + /** + * Sample code: ListCommitmentPlans. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void listCommitmentPlans( + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.commitmentPlans().listAssociations("resourceGroupName", "commitmentPlanName", Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..204069bd7cc08 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (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.Context; + +/** 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 + */ + /** + * Sample code: List Commitment Plans by Resource Group. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void listCommitmentPlansByResourceGroup( + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.commitmentPlans().listByResourceGroup("resourceGroupName", Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..253727fe8230a --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListPlansBySubscriptionSamples.java @@ -0,0 +1,23 @@ +// Copyright (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.Context; + +/** 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 + */ + /** + * Sample code: List Accounts by Subscription. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void listAccountsBySubscription( + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.commitmentPlans().listPlansBySubscription(Context.NONE); + } +} 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 1b567cf3ffa35..495caaca03c0d 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 @@ -9,7 +9,7 @@ /** Samples for CommitmentPlans List. */ public final class CommitmentPlansListSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/ListCommitmentPlans.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-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 new file mode 100644 index 0000000000000..b06ac527a45ab --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansUpdatePlanSamples.java @@ -0,0 +1,42 @@ +// Copyright (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.Context; +import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlan; +import java.util.HashMap; +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 + */ + /** + * Sample code: Create Commitment Plan. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void createCommitmentPlan( + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + CommitmentPlan resource = + manager + .commitmentPlans() + .getByResourceGroupWithResponse("resourceGroupName", "commitmentPlanName", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("name", "value")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentTiersListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentTiersListSamples.java index c683696f988c3..18f2eeda39b69 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 @@ -9,7 +9,7 @@ /** Samples for CommitmentTiers List. */ public final class CommitmentTiersListSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/ListCommitmentTiers.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-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 f4aa70987a490..a56023c4d6279 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 @@ -9,7 +9,7 @@ /** Samples for DeletedAccounts Get. */ public final class DeletedAccountsGetSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/GetDeletedAccount.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-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 1aa46dfcd2ccc..e686ed9e95aac 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 @@ -9,7 +9,7 @@ /** Samples for DeletedAccounts List. */ public final class DeletedAccountsListSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/ListDeletedAccountsBySubscription.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-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 d006003f97ceb..2b3298d3e85d9 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 @@ -9,7 +9,7 @@ /** Samples for DeletedAccounts Purge. */ public final class DeletedAccountsPurgeSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/PurgeDeletedAccount.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-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 8c7c7fda2882a..10995e624d7a3 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-10-01/examples/PutDeployment.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-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 9e24dfa0a1b31..7e44af5df6d1b 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 @@ -9,7 +9,7 @@ /** Samples for Deployments Delete. */ public final class DeploymentsDeleteSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/DeleteDeployment.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-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 958b45e64d7c7..44010051d82a2 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 @@ -9,7 +9,7 @@ /** Samples for Deployments Get. */ public final class DeploymentsGetSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/GetDeployment.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-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 97156e1d96dd5..4c3d68f6ef475 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 @@ -9,7 +9,7 @@ /** Samples for Deployments List. */ public final class DeploymentsListSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/ListDeployments.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/ListDeployments.json */ /** * Sample code: ListDeployments. 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 1ffd907c213d7..1d4c3fbe45f41 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 @@ -9,7 +9,7 @@ /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/GetOperations.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-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 32a1e8086361b..7029e663029ec 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-10-01/examples/PutPrivateEndpointConnection.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-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 d1461a4352b78..574e9d7dde186 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 @@ -9,7 +9,7 @@ /** Samples for PrivateEndpointConnections Delete. */ public final class PrivateEndpointConnectionsDeleteSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/DeletePrivateEndpointConnection.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-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 01ee998590b0e..111f4b281c8df 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 @@ -9,7 +9,7 @@ /** Samples for PrivateEndpointConnections Get. */ public final class PrivateEndpointConnectionsGetSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/GetPrivateEndpointConnection.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-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 f45df2c508b68..b737ecb142a4d 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 @@ -9,7 +9,7 @@ /** Samples for PrivateEndpointConnections List. */ public final class PrivateEndpointConnectionsListSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/ListPrivateEndpointConnections.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-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 05c0c2cf3dd17..4ff6ade3b1d19 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 @@ -9,7 +9,7 @@ /** Samples for PrivateLinkResources List. */ public final class PrivateLinkResourcesListSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/ListPrivateLinkResources.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-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 dc76740eb0059..5ef293fb0253b 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 @@ -10,7 +10,7 @@ /** Samples for ResourceProvider CheckDomainAvailability. */ public final class ResourceProviderCheckDomainAvailabilitySamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/CheckDomainAvailability.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-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 6ce691587d8ad..59ffb1e172816 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 @@ -11,7 +11,7 @@ /** Samples for ResourceProvider CheckSkuAvailability. */ public final class ResourceProviderCheckSkuAvailabilitySamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/CheckSkuAvailability.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-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 b5d44cdcbf14c..8e77a557932ff 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 @@ -9,7 +9,7 @@ /** Samples for ResourceSkus List. */ public final class ResourceSkusListSamples { /* - * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-10-01/examples/GetSkus.json + * x-ms-original-file: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2022-12-01/examples/GetSkus.json */ /** * Sample code: Regenerate Keys. 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 a1167506ef102..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountModelListResultTests.java +++ /dev/null @@ -1,132 +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 java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AccountModelListResultTests { - @Test - public void testDeserialize() { - AccountModelListResult model = - BinaryData - .fromString( - "{\"nextLink\":\"dslfhotwmcy\",\"value\":[{\"baseModel\":{\"format\":\"jnpg\",\"name\":\"ftadehxnltyfs\",\"version\":\"pusuesn\"},\"maxCapacity\":332314223,\"capabilities\":{\"xzdmohctb\":\"avo\"},\"deprecation\":{\"fineTune\":\"dwxdndnv\",\"inference\":\"gujjugwdkcglh\"},\"format\":\"zj\",\"name\":\"ggd\",\"version\":\"ixhbkuofqweykhm\",\"callRateLimit\":{\"count\":37.98073,\"renewalPeriod\":34.070343,\"rules\":[]}},{\"baseModel\":{\"format\":\"whybcib\",\"name\":\"vdcsitynn\",\"version\":\"mdectehfiqscjey\"},\"maxCapacity\":1237692135,\"capabilities\":{\"kqsleyyvxy\":\"kgqhcjrefovg\",\"cr\":\"jpkcattpng\",\"ajvnysounqe\":\"czsqpjhvm\"},\"deprecation\":{\"fineTune\":\"oaeupfhyhltrpmo\",\"inference\":\"mcmatuokthfuiu\"},\"format\":\"sfcpkvxodpuozm\",\"name\":\"ydagfuaxbe\",\"version\":\"iu\",\"callRateLimit\":{\"count\":79.920334,\"renewalPeriod\":75.16582,\"rules\":[]}},{\"baseModel\":{\"format\":\"wz\",\"name\":\"q\",\"version\":\"bsureximo\"},\"maxCapacity\":1027022233,\"capabilities\":{\"uxh\":\"fksymddystki\",\"czvyifq\":\"yudxorrqnbp\"},\"deprecation\":{\"fineTune\":\"dvjsllrmvvdf\",\"inference\":\"t\"},\"format\":\"pulexxbczw\",\"name\":\"uwiqzb\",\"version\":\"vsovmyokac\",\"callRateLimit\":{\"count\":2.3299038,\"renewalPeriod\":94.998985,\"rules\":[]}},{\"baseModel\":{\"format\":\"bpxjmfl\",\"name\":\"vnchrkcci\",\"version\":\"zjuqkhrsaj\"},\"maxCapacity\":481973669,\"capabilities\":{\"sauuimj\":\"oskg\",\"rfbyaosvexcso\":\"vxieduugidyj\",\"vleggzfbuhfmvfax\":\"pclhocohslk\",\"hl\":\"ffeii\"},\"deprecation\":{\"fineTune\":\"zy\",\"inference\":\"hxmzsbbzoggig\"},\"format\":\"burvjxxjnspy\",\"name\":\"tko\",\"version\":\"kouknvudwtiu\",\"callRateLimit\":{\"count\":13.5182085,\"renewalPeriod\":78.78897,\"rules\":[]}}]}") - .toObject(AccountModelListResult.class); - Assertions.assertEquals("dslfhotwmcy", model.nextLink()); - Assertions.assertEquals("zj", model.value().get(0).format()); - Assertions.assertEquals("ggd", model.value().get(0).name()); - Assertions.assertEquals("ixhbkuofqweykhm", model.value().get(0).version()); - Assertions.assertEquals("jnpg", model.value().get(0).baseModel().format()); - Assertions.assertEquals("ftadehxnltyfs", model.value().get(0).baseModel().name()); - Assertions.assertEquals("pusuesn", model.value().get(0).baseModel().version()); - Assertions.assertEquals(332314223, model.value().get(0).maxCapacity()); - Assertions.assertEquals("avo", model.value().get(0).capabilities().get("xzdmohctb")); - Assertions.assertEquals("dwxdndnv", model.value().get(0).deprecation().fineTune()); - Assertions.assertEquals("gujjugwdkcglh", model.value().get(0).deprecation().inference()); - } - - @Test - public void testSerialize() { - AccountModelListResult model = - new AccountModelListResult() - .withNextLink("dslfhotwmcy") - .withValue( - Arrays - .asList( - new AccountModelInner() - .withFormat("zj") - .withName("ggd") - .withVersion("ixhbkuofqweykhm") - .withBaseModel( - new DeploymentModel() - .withFormat("jnpg") - .withName("ftadehxnltyfs") - .withVersion("pusuesn")) - .withMaxCapacity(332314223) - .withCapabilities(mapOf("xzdmohctb", "avo")) - .withDeprecation( - new ModelDeprecationInfo().withFineTune("dwxdndnv").withInference("gujjugwdkcglh")), - new AccountModelInner() - .withFormat("sfcpkvxodpuozm") - .withName("ydagfuaxbe") - .withVersion("iu") - .withBaseModel( - new DeploymentModel() - .withFormat("whybcib") - .withName("vdcsitynn") - .withVersion("mdectehfiqscjey")) - .withMaxCapacity(1237692135) - .withCapabilities( - mapOf("kqsleyyvxy", "kgqhcjrefovg", "cr", "jpkcattpng", "ajvnysounqe", "czsqpjhvm")) - .withDeprecation( - new ModelDeprecationInfo() - .withFineTune("oaeupfhyhltrpmo") - .withInference("mcmatuokthfuiu")), - new AccountModelInner() - .withFormat("pulexxbczw") - .withName("uwiqzb") - .withVersion("vsovmyokac") - .withBaseModel( - new DeploymentModel().withFormat("wz").withName("q").withVersion("bsureximo")) - .withMaxCapacity(1027022233) - .withCapabilities(mapOf("uxh", "fksymddystki", "czvyifq", "yudxorrqnbp")) - .withDeprecation( - new ModelDeprecationInfo().withFineTune("dvjsllrmvvdf").withInference("t")), - new AccountModelInner() - .withFormat("burvjxxjnspy") - .withName("tko") - .withVersion("kouknvudwtiu") - .withBaseModel( - new DeploymentModel() - .withFormat("bpxjmfl") - .withName("vnchrkcci") - .withVersion("zjuqkhrsaj")) - .withMaxCapacity(481973669) - .withCapabilities( - mapOf( - "sauuimj", - "oskg", - "rfbyaosvexcso", - "vxieduugidyj", - "vleggzfbuhfmvfax", - "pclhocohslk", - "hl", - "ffeii")) - .withDeprecation( - new ModelDeprecationInfo().withFineTune("zy").withInference("hxmzsbbzoggig")))); - model = BinaryData.fromObject(model).toObject(AccountModelListResult.class); - Assertions.assertEquals("dslfhotwmcy", model.nextLink()); - Assertions.assertEquals("zj", model.value().get(0).format()); - Assertions.assertEquals("ggd", model.value().get(0).name()); - Assertions.assertEquals("ixhbkuofqweykhm", model.value().get(0).version()); - Assertions.assertEquals("jnpg", model.value().get(0).baseModel().format()); - Assertions.assertEquals("ftadehxnltyfs", model.value().get(0).baseModel().name()); - Assertions.assertEquals("pusuesn", model.value().get(0).baseModel().version()); - Assertions.assertEquals(332314223, model.value().get(0).maxCapacity()); - Assertions.assertEquals("avo", model.value().get(0).capabilities().get("xzdmohctb")); - Assertions.assertEquals("dwxdndnv", model.value().get(0).deprecation().fineTune()); - Assertions.assertEquals("gujjugwdkcglh", model.value().get(0).deprecation().inference()); - } - - @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 54f46f57a15e6..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountSkuListResultInnerTests.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.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; -import org.junit.jupiter.api.Test; - -public final class AccountSkuListResultInnerTests { - @Test - public void testDeserialize() { - AccountSkuListResultInner model = - BinaryData - .fromString( - "{\"value\":[{\"resourceType\":\"w\",\"sku\":{\"name\":\"m\",\"tier\":\"Enterprise\",\"size\":\"z\",\"family\":\"vvtpgvdfgio\",\"capacity\":1858576873}}]}") - .toObject(AccountSkuListResultInner.class); - Assertions.assertEquals("w", model.value().get(0).resourceType()); - Assertions.assertEquals("m", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.ENTERPRISE, model.value().get(0).sku().tier()); - Assertions.assertEquals("z", model.value().get(0).sku().size()); - Assertions.assertEquals("vvtpgvdfgio", model.value().get(0).sku().family()); - Assertions.assertEquals(1858576873, model.value().get(0).sku().capacity()); - } - - @Test - public void testSerialize() { - AccountSkuListResultInner model = - new AccountSkuListResultInner() - .withValue( - Arrays - .asList( - new AccountSku() - .withResourceType("w") - .withSku( - new Sku() - .withName("m") - .withTier(SkuTier.ENTERPRISE) - .withSize("z") - .withFamily("vvtpgvdfgio") - .withCapacity(1858576873)))); - model = BinaryData.fromObject(model).toObject(AccountSkuListResultInner.class); - Assertions.assertEquals("w", model.value().get(0).resourceType()); - Assertions.assertEquals("m", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.ENTERPRISE, model.value().get(0).sku().tier()); - Assertions.assertEquals("z", model.value().get(0).sku().size()); - Assertions.assertEquals("vvtpgvdfgio", model.value().get(0).sku().family()); - Assertions.assertEquals(1858576873, 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 ea953e6245aed..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountSkuTests.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.AccountSku; -import com.azure.resourcemanager.cognitiveservices.models.Sku; -import com.azure.resourcemanager.cognitiveservices.models.SkuTier; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AccountSkuTests { - @Test - public void testDeserialize() { - AccountSku model = - BinaryData - .fromString( - "{\"resourceType\":\"utqxlngx\",\"sku\":{\"name\":\"fgugnxkrxdqmid\",\"tier\":\"Basic\",\"size\":\"rvqdra\",\"family\":\"jybige\",\"capacity\":1279126864}}") - .toObject(AccountSku.class); - Assertions.assertEquals("utqxlngx", model.resourceType()); - Assertions.assertEquals("fgugnxkrxdqmid", model.sku().name()); - Assertions.assertEquals(SkuTier.BASIC, model.sku().tier()); - Assertions.assertEquals("rvqdra", model.sku().size()); - Assertions.assertEquals("jybige", model.sku().family()); - Assertions.assertEquals(1279126864, model.sku().capacity()); - } - - @Test - public void testSerialize() { - AccountSku model = - new AccountSku() - .withResourceType("utqxlngx") - .withSku( - new Sku() - .withName("fgugnxkrxdqmid") - .withTier(SkuTier.BASIC) - .withSize("rvqdra") - .withFamily("jybige") - .withCapacity(1279126864)); - model = BinaryData.fromObject(model).toObject(AccountSku.class); - Assertions.assertEquals("utqxlngx", model.resourceType()); - Assertions.assertEquals("fgugnxkrxdqmid", model.sku().name()); - Assertions.assertEquals(SkuTier.BASIC, model.sku().tier()); - Assertions.assertEquals("rvqdra", model.sku().size()); - Assertions.assertEquals("jybige", model.sku().family()); - Assertions.assertEquals(1279126864, 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 84f3d6241a33f..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsDeleteMockTests.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.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.core.util.Context; -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("obyu", "erpqlpqwcciuqg", 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 ee4f3f3557782..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListModelsMockTests.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.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.AccountModel; -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\":\"ramxjezwlwnw\",\"name\":\"qlcvydy\",\"version\":\"tdooaoj\",\"callRateLimit\":{\"count\":20.04649,\"renewalPeriod\":45.65934,\"rules\":[]}},\"maxCapacity\":2101936696,\"capabilities\":{\"emmsbvdkc\":\"nuj\",\"fw\":\"odtji\",\"jvefkdlfoakggkfp\":\"lfltka\",\"qjnsjervtia\":\"gaowpulpqblylsyx\"},\"deprecation\":{\"fineTune\":\"dszue\",\"inference\":\"sbzkf\"},\"format\":\"yvpnqicvinvkjj\",\"name\":\"xrbuukzclew\",\"version\":\"mlwpazt\",\"callRateLimit\":{\"count\":10.191661,\"renewalPeriod\":83.19924,\"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("xoruzfgsquyfxrx", "l", Context.NONE); - - Assertions.assertEquals("yvpnqicvinvkjj", response.iterator().next().format()); - Assertions.assertEquals("xrbuukzclew", response.iterator().next().name()); - Assertions.assertEquals("mlwpazt", response.iterator().next().version()); - Assertions.assertEquals("ramxjezwlwnw", response.iterator().next().baseModel().format()); - Assertions.assertEquals("qlcvydy", response.iterator().next().baseModel().name()); - Assertions.assertEquals("tdooaoj", response.iterator().next().baseModel().version()); - Assertions.assertEquals(2101936696, response.iterator().next().maxCapacity()); - Assertions.assertEquals("nuj", response.iterator().next().capabilities().get("emmsbvdkc")); - Assertions.assertEquals("dszue", response.iterator().next().deprecation().fineTune()); - Assertions.assertEquals("sbzkf", response.iterator().next().deprecation().inference()); - } -} 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 c9505595cb907..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListSkusWithResponseMockTests.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.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -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\":\"p\"},{\"resourceType\":\"gymare\"},{\"resourceType\":\"jxqugjhky\"}]}"; - - 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("hhyxxrw", "yc", Context.NONE).getValue(); - - Assertions.assertEquals("p", 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 029d204b3bc01..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListUsagesWithResponseMockTests.java +++ /dev/null @@ -1,75 +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.core.util.Context; -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\":\"Percent\",\"quotaPeriod\":\"aabjyvayffimrz\",\"limit\":73.46061669897502,\"currentValue\":17.91741455628265,\"nextResetTime\":\"exn\",\"status\":\"Included\"},{\"unit\":\"Seconds\",\"quotaPeriod\":\"wmewzsyy\",\"limit\":25.41338781575959,\"currentValue\":89.18262876334961,\"nextResetTime\":\"judpfrxt\",\"status\":\"Included\"},{\"unit\":\"Seconds\",\"quotaPeriod\":\"tdwkqbrq\",\"limit\":22.47264634737206,\"currentValue\":0.7295389823285925,\"nextResetTime\":\"iilivpdtiirqtd\",\"status\":\"InOverage\"}]}"; - - 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("beddgssofw", "mzqa", "krmnjijpxacqqud", Context.NONE).getValue(); - - Assertions.assertEquals(UnitType.PERCENT, response.value().get(0).unit()); - Assertions.assertEquals("aabjyvayffimrz", response.value().get(0).quotaPeriod()); - Assertions.assertEquals(73.46061669897502D, response.value().get(0).limit()); - Assertions.assertEquals(17.91741455628265D, response.value().get(0).currentValue()); - Assertions.assertEquals("exn", response.value().get(0).nextResetTime()); - Assertions.assertEquals(QuotaUsageStatus.INCLUDED, response.value().get(0).status()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AzureEntityResourceTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AzureEntityResourceTests.java deleted file mode 100644 index 3ef855827eacd..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AzureEntityResourceTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.AzureEntityResource; -import org.junit.jupiter.api.Test; - -public final class AzureEntityResourceTests { - @Test - public void testDeserialize() { - AzureEntityResource model = - BinaryData - .fromString( - "{\"etag\":\"kvwrwjfeu\",\"id\":\"nhutjeltmrldhugj\",\"name\":\"zdatqxhocdg\",\"type\":\"ablgphuticndvk\"}") - .toObject(AzureEntityResource.class); - } - - @Test - public void testSerialize() { - 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 cc11997f4dd47..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CheckDomainAvailabilityParameterTests.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.CheckDomainAvailabilityParameter; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class CheckDomainAvailabilityParameterTests { - @Test - public void testDeserialize() { - CheckDomainAvailabilityParameter model = - BinaryData - .fromString("{\"subdomainName\":\"xcug\",\"type\":\"cjooxdjebwpucwwf\",\"kind\":\"vbvmeu\"}") - .toObject(CheckDomainAvailabilityParameter.class); - Assertions.assertEquals("xcug", model.subdomainName()); - Assertions.assertEquals("cjooxdjebwpucwwf", model.type()); - Assertions.assertEquals("vbvmeu", model.kind()); - } - - @Test - public void testSerialize() { - CheckDomainAvailabilityParameter model = - new CheckDomainAvailabilityParameter() - .withSubdomainName("xcug") - .withType("cjooxdjebwpucwwf") - .withKind("vbvmeu"); - model = BinaryData.fromObject(model).toObject(CheckDomainAvailabilityParameter.class); - Assertions.assertEquals("xcug", model.subdomainName()); - Assertions.assertEquals("cjooxdjebwpucwwf", model.type()); - Assertions.assertEquals("vbvmeu", 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 ba5130384e47a..0000000000000 --- 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; -import org.junit.jupiter.api.Test; - -public final class CheckSkuAvailabilityParameterTests { - @Test - public void testDeserialize() { - CheckSkuAvailabilityParameter model = - BinaryData - .fromString("{\"skus\":[\"sucocmnyyazttbtw\",\"rq\"],\"kind\":\"uedck\",\"type\":\"ywbiexzfeyueax\"}") - .toObject(CheckSkuAvailabilityParameter.class); - Assertions.assertEquals("sucocmnyyazttbtw", model.skus().get(0)); - Assertions.assertEquals("uedck", model.kind()); - Assertions.assertEquals("ywbiexzfeyueax", model.type()); - } - - @Test - public void testSerialize() { - CheckSkuAvailabilityParameter model = - new CheckSkuAvailabilityParameter() - .withSkus(Arrays.asList("sucocmnyyazttbtw", "rq")) - .withKind("uedck") - .withType("ywbiexzfeyueax"); - model = BinaryData.fromObject(model).toObject(CheckSkuAvailabilityParameter.class); - Assertions.assertEquals("sucocmnyyazttbtw", model.skus().get(0)); - Assertions.assertEquals("uedck", model.kind()); - Assertions.assertEquals("ywbiexzfeyueax", 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 9e7a987ef3b8a..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentCostTests.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.CommitmentCost; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class CommitmentCostTests { - @Test - public void testDeserialize() { - CommitmentCost model = - BinaryData - .fromString("{\"commitmentMeterId\":\"liourqhak\",\"overageMeterId\":\"hashsfwxosow\"}") - .toObject(CommitmentCost.class); - Assertions.assertEquals("liourqhak", model.commitmentMeterId()); - Assertions.assertEquals("hashsfwxosow", model.overageMeterId()); - } - - @Test - public void testSerialize() { - CommitmentCost model = - new CommitmentCost().withCommitmentMeterId("liourqhak").withOverageMeterId("hashsfwxosow"); - model = BinaryData.fromObject(model).toObject(CommitmentCost.class); - Assertions.assertEquals("liourqhak", model.commitmentMeterId()); - Assertions.assertEquals("hashsfwxosow", 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 0c4e182fa0bc0..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPeriodTests.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.CommitmentPeriod; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class CommitmentPeriodTests { - @Test - public void testDeserialize() { - CommitmentPeriod model = - BinaryData - .fromString( - "{\"tier\":\"oqac\",\"count\":1486476697,\"quota\":{\"quantity\":5359591244102758807,\"unit\":\"iwbwoenwashrtdtk\"},\"startDate\":\"qxwbpokulpiu\",\"endDate\":\"aasipqi\"}") - .toObject(CommitmentPeriod.class); - Assertions.assertEquals("oqac", model.tier()); - Assertions.assertEquals(1486476697, model.count()); - } - - @Test - public void testSerialize() { - CommitmentPeriod model = new CommitmentPeriod().withTier("oqac").withCount(1486476697); - model = BinaryData.fromObject(model).toObject(CommitmentPeriod.class); - Assertions.assertEquals("oqac", model.tier()); - Assertions.assertEquals(1486476697, model.count()); - } -} 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 5d7fca8930bcc..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanInnerTests.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.CommitmentPlanInner; -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; -import org.junit.jupiter.api.Test; - -public final class CommitmentPlanInnerTests { - @Test - public void testDeserialize() { - CommitmentPlanInner model = - BinaryData - .fromString( - "{\"etag\":\"gbhcohfwdsj\",\"properties\":{\"hostingModel\":\"Web\",\"planType\":\"utiiswacf\",\"current\":{\"tier\":\"k\",\"count\":655957615,\"startDate\":\"fvhqc\",\"endDate\":\"ilvpnppfuflrwd\"},\"autoRenew\":false,\"next\":{\"tier\":\"yjrxsagafcnih\",\"count\":728963944,\"startDate\":\"nedgfbc\",\"endDate\":\"cvqvpkeqdcv\"},\"last\":{\"tier\":\"vo\",\"count\":1383619855,\"startDate\":\"bobzdopcjwvnhd\",\"endDate\":\"wmgxcxrsl\"}},\"id\":\"mutwuoe\",\"name\":\"rpkhjwn\",\"type\":\"yqsluic\"}") - .toObject(CommitmentPlanInner.class); - Assertions.assertEquals(HostingModel.WEB, model.properties().hostingModel()); - Assertions.assertEquals("utiiswacf", model.properties().planType()); - Assertions.assertEquals("k", model.properties().current().tier()); - Assertions.assertEquals(655957615, model.properties().current().count()); - Assertions.assertEquals(false, model.properties().autoRenew()); - Assertions.assertEquals("yjrxsagafcnih", model.properties().next().tier()); - Assertions.assertEquals(728963944, model.properties().next().count()); - } - - @Test - public void testSerialize() { - CommitmentPlanInner model = - new CommitmentPlanInner() - .withProperties( - new CommitmentPlanProperties() - .withHostingModel(HostingModel.WEB) - .withPlanType("utiiswacf") - .withCurrent(new CommitmentPeriod().withTier("k").withCount(655957615)) - .withAutoRenew(false) - .withNext(new CommitmentPeriod().withTier("yjrxsagafcnih").withCount(728963944))); - model = BinaryData.fromObject(model).toObject(CommitmentPlanInner.class); - Assertions.assertEquals(HostingModel.WEB, model.properties().hostingModel()); - Assertions.assertEquals("utiiswacf", model.properties().planType()); - Assertions.assertEquals("k", model.properties().current().tier()); - Assertions.assertEquals(655957615, model.properties().current().count()); - Assertions.assertEquals(false, model.properties().autoRenew()); - Assertions.assertEquals("yjrxsagafcnih", model.properties().next().tier()); - Assertions.assertEquals(728963944, model.properties().next().count()); - } -} 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 7edfd45ac6213..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanListResultTests.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.CommitmentPlanListResult; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class CommitmentPlanListResultTests { - @Test - public void testDeserialize() { - CommitmentPlanListResult model = - BinaryData - .fromString( - "{\"nextLink\":\"emwabnet\",\"value\":[{\"etag\":\"h\",\"properties\":{\"hostingModel\":\"ConnectedContainer\",\"planType\":\"wiwubm\",\"autoRenew\":false},\"id\":\"dnkwwtppjflcxog\",\"name\":\"okonzmnsikvmkqz\",\"type\":\"qqkdltfzxmhhvhgu\"},{\"etag\":\"dkwobdagx\",\"properties\":{\"hostingModel\":\"DisconnectedContainer\",\"planType\":\"xbxwa\",\"autoRenew\":true},\"id\":\"ndlkzgxhurip\",\"name\":\"bpodxunkbebxm\",\"type\":\"byyntwlrbqt\"},{\"etag\":\"evseotgqrlltmuwl\",\"properties\":{\"hostingModel\":\"DisconnectedContainer\",\"planType\":\"zxb\",\"autoRenew\":false},\"id\":\"fuzmuvpbtt\",\"name\":\"um\",\"type\":\"rp\"},{\"etag\":\"bmnzbtbhjpgl\",\"properties\":{\"hostingModel\":\"DisconnectedContainer\",\"planType\":\"dneu\",\"autoRenew\":false},\"id\":\"dyhtozfikdowwquu\",\"name\":\"xzxcl\",\"type\":\"ithhqzon\"}]}") - .toObject(CommitmentPlanListResult.class); - Assertions.assertEquals("emwabnet", model.nextLink()); - } - - @Test - public void testSerialize() { - CommitmentPlanListResult model = new CommitmentPlanListResult().withNextLink("emwabnet"); - model = BinaryData.fromObject(model).toObject(CommitmentPlanListResult.class); - Assertions.assertEquals("emwabnet", 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 460b7c2793591..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanPropertiesTests.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.CommitmentPeriod; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlanProperties; -import com.azure.resourcemanager.cognitiveservices.models.HostingModel; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class CommitmentPlanPropertiesTests { - @Test - public void testDeserialize() { - CommitmentPlanProperties model = - BinaryData - .fromString( - "{\"hostingModel\":\"Web\",\"planType\":\"kzzlvmbmpaxmodf\",\"current\":{\"tier\":\"fy\",\"count\":1201307728,\"quota\":{\"quantity\":4032235244253302526,\"unit\":\"yhrfouyftaakcpw\"},\"startDate\":\"zvqtmnubexkp\",\"endDate\":\"smond\"},\"autoRenew\":true,\"next\":{\"tier\":\"vypomgkopkwho\",\"count\":107340083,\"quota\":{\"quantity\":4279032137659144852,\"unit\":\"ysmocmbqfqvmkcxo\"},\"startDate\":\"pvhelxprg\",\"endDate\":\"atddc\"},\"last\":{\"tier\":\"cuejrjxgci\",\"count\":792920613,\"quota\":{\"quantity\":3019773513658765057,\"unit\":\"sdqrhzoymibmrq\"},\"startDate\":\"bahwfl\",\"endDate\":\"zdtmhrkwofy\"}}") - .toObject(CommitmentPlanProperties.class); - Assertions.assertEquals(HostingModel.WEB, model.hostingModel()); - Assertions.assertEquals("kzzlvmbmpaxmodf", model.planType()); - Assertions.assertEquals("fy", model.current().tier()); - Assertions.assertEquals(1201307728, model.current().count()); - Assertions.assertEquals(true, model.autoRenew()); - Assertions.assertEquals("vypomgkopkwho", model.next().tier()); - Assertions.assertEquals(107340083, model.next().count()); - } - - @Test - public void testSerialize() { - CommitmentPlanProperties model = - new CommitmentPlanProperties() - .withHostingModel(HostingModel.WEB) - .withPlanType("kzzlvmbmpaxmodf") - .withCurrent(new CommitmentPeriod().withTier("fy").withCount(1201307728)) - .withAutoRenew(true) - .withNext(new CommitmentPeriod().withTier("vypomgkopkwho").withCount(107340083)); - model = BinaryData.fromObject(model).toObject(CommitmentPlanProperties.class); - Assertions.assertEquals(HostingModel.WEB, model.hostingModel()); - Assertions.assertEquals("kzzlvmbmpaxmodf", model.planType()); - Assertions.assertEquals("fy", model.current().tier()); - Assertions.assertEquals(1201307728, model.current().count()); - Assertions.assertEquals(true, model.autoRenew()); - Assertions.assertEquals("vypomgkopkwho", model.next().tier()); - Assertions.assertEquals(107340083, model.next().count()); - } -} 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 0dd39f9b3df88..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdateWithResponseMockTests.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.CommitmentPeriod; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlan; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlanProperties; -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 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\":\"cgxxlxs\",\"properties\":{\"hostingModel\":\"DisconnectedContainer\",\"planType\":\"izqzdwlvwlyou\",\"current\":{\"tier\":\"fbkjubdyhgkfmi\",\"count\":87584157,\"startDate\":\"zfttsttktlahb\",\"endDate\":\"ctxtgzukxi\"},\"autoRenew\":false,\"next\":{\"tier\":\"gqqqxh\",\"count\":848186431,\"startDate\":\"cpjuisa\",\"endDate\":\"k\"},\"last\":{\"tier\":\"fvazivjlfrqttba\",\"count\":2078837978,\"startDate\":\"nwxyiop\",\"endDate\":\"kqqfk\"}},\"id\":\"vscx\",\"name\":\"dmligovibrxk\",\"type\":\"mloazuru\"}"; - - 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() - .define("alywjhhgdn") - .withExistingAccount("wzsoldweyuqdunv", "nnrwrbiork") - .withProperties( - new CommitmentPlanProperties() - .withHostingModel(HostingModel.DISCONNECTED_CONTAINER) - .withPlanType("fi") - .withCurrent(new CommitmentPeriod().withTier("ieuzaofjchvcyyy").withCount(1812829551)) - .withAutoRenew(false) - .withNext(new CommitmentPeriod().withTier("ev").withCount(716188449))) - .create(); - - Assertions.assertEquals(HostingModel.DISCONNECTED_CONTAINER, response.properties().hostingModel()); - Assertions.assertEquals("izqzdwlvwlyou", response.properties().planType()); - Assertions.assertEquals("fbkjubdyhgkfmi", response.properties().current().tier()); - Assertions.assertEquals(87584157, response.properties().current().count()); - Assertions.assertEquals(false, response.properties().autoRenew()); - Assertions.assertEquals("gqqqxh", response.properties().next().tier()); - Assertions.assertEquals(848186431, response.properties().next().count()); - } -} 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 b77ea62b3d37c..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeleteMockTests.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.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.core.util.Context; -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("axconfozauo", "sukokwbqplhl", "nuuepzlrp", Context.NONE); - } -} 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 36dc2715272ac..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetWithResponseMockTests.java +++ /dev/null @@ -1,75 +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.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlan; -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 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\":\"zslesjcbher\",\"properties\":{\"hostingModel\":\"Web\",\"planType\":\"w\",\"current\":{\"tier\":\"vbquwr\",\"count\":1619568012,\"startDate\":\"gohbuffkmrq\",\"endDate\":\"vvhmxtdrj\"},\"autoRenew\":false,\"next\":{\"tier\":\"oe\",\"count\":1362727879,\"startDate\":\"zcjznmwcpmgua\",\"endDate\":\"raufactkahzova\"},\"last\":{\"tier\":\"iuxxpshneekulfg\",\"count\":1157333655,\"startDate\":\"kwdlenrdsutujba\",\"endDate\":\"juohminyflnorw\"}},\"id\":\"duvwpklvxwmygd\",\"name\":\"pgpqchiszepnnb\",\"type\":\"crxgibb\"}"; - - 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("qtqzfavyv", "qqybarye", "ayjkqa", Context.NONE).getValue(); - - Assertions.assertEquals(HostingModel.WEB, response.properties().hostingModel()); - Assertions.assertEquals("w", response.properties().planType()); - Assertions.assertEquals("vbquwr", response.properties().current().tier()); - Assertions.assertEquals(1619568012, response.properties().current().count()); - Assertions.assertEquals(false, response.properties().autoRenew()); - Assertions.assertEquals("oe", response.properties().next().tier()); - Assertions.assertEquals(1362727879, response.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 7cffcba5d6cce..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListMockTests.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.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlan; -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 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\":\"rvkwc\",\"properties\":{\"hostingModel\":\"ConnectedContainer\",\"planType\":\"yxgtczh\",\"current\":{\"tier\":\"bsdshmkxmaehvbbx\",\"count\":870827030,\"startDate\":\"tfnhtbaxkgxywr\",\"endDate\":\"pyklyhpluodpvru\"},\"autoRenew\":false,\"next\":{\"tier\":\"ibthostgktstvd\",\"count\":318971885,\"startDate\":\"edqbc\",\"endDate\":\"zlhp\"},\"last\":{\"tier\":\"qkdlw\",\"count\":1812491441,\"startDate\":\"mlkxtrqjfs\",\"endDate\":\"mbtxhwgf\"}},\"id\":\"srtawcoezbr\",\"name\":\"ubskhudygoookkq\",\"type\":\"qjbvleorfmlu\"}]}"; - - 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("ssxmojms", "p", Context.NONE); - - Assertions - .assertEquals(HostingModel.CONNECTED_CONTAINER, response.iterator().next().properties().hostingModel()); - Assertions.assertEquals("yxgtczh", response.iterator().next().properties().planType()); - Assertions.assertEquals("bsdshmkxmaehvbbx", response.iterator().next().properties().current().tier()); - Assertions.assertEquals(870827030, response.iterator().next().properties().current().count()); - Assertions.assertEquals(false, response.iterator().next().properties().autoRenew()); - Assertions.assertEquals("ibthostgktstvd", response.iterator().next().properties().next().tier()); - Assertions.assertEquals(318971885, 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 89a70f7a0cb7f..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentQuotaTests.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.CommitmentQuota; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class CommitmentQuotaTests { - @Test - public void testDeserialize() { - CommitmentQuota model = - BinaryData - .fromString("{\"quantity\":8988719472980860271,\"unit\":\"wkz\"}") - .toObject(CommitmentQuota.class); - Assertions.assertEquals(8988719472980860271L, model.quantity()); - Assertions.assertEquals("wkz", model.unit()); - } - - @Test - public void testSerialize() { - CommitmentQuota model = new CommitmentQuota().withQuantity(8988719472980860271L).withUnit("wkz"); - model = BinaryData.fromObject(model).toObject(CommitmentQuota.class); - Assertions.assertEquals(8988719472980860271L, model.quantity()); - Assertions.assertEquals("wkz", 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 a023d5b627540..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentTierInnerTests.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.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; -import org.junit.jupiter.api.Test; - -public final class CommitmentTierInnerTests { - @Test - public void testDeserialize() { - CommitmentTierInner model = - BinaryData - .fromString( - "{\"kind\":\"seyvj\",\"skuName\":\"rts\",\"hostingModel\":\"DisconnectedContainer\",\"planType\":\"kdeemaofmxagkvtm\",\"tier\":\"mqkrhahvljuahaqu\",\"maxCount\":1423191748,\"quota\":{\"quantity\":4716171323603349027,\"unit\":\"laexqp\"},\"cost\":{\"commitmentMeterId\":\"dmwsrcrgvxpvgomz\",\"overageMeterId\":\"misgwbnb\"}}") - .toObject(CommitmentTierInner.class); - Assertions.assertEquals("seyvj", model.kind()); - Assertions.assertEquals("rts", model.skuName()); - Assertions.assertEquals(HostingModel.DISCONNECTED_CONTAINER, model.hostingModel()); - Assertions.assertEquals("kdeemaofmxagkvtm", model.planType()); - Assertions.assertEquals("mqkrhahvljuahaqu", model.tier()); - Assertions.assertEquals(1423191748, model.maxCount()); - Assertions.assertEquals(4716171323603349027L, model.quota().quantity()); - Assertions.assertEquals("laexqp", model.quota().unit()); - Assertions.assertEquals("dmwsrcrgvxpvgomz", model.cost().commitmentMeterId()); - Assertions.assertEquals("misgwbnb", model.cost().overageMeterId()); - } - - @Test - public void testSerialize() { - CommitmentTierInner model = - new CommitmentTierInner() - .withKind("seyvj") - .withSkuName("rts") - .withHostingModel(HostingModel.DISCONNECTED_CONTAINER) - .withPlanType("kdeemaofmxagkvtm") - .withTier("mqkrhahvljuahaqu") - .withMaxCount(1423191748) - .withQuota(new CommitmentQuota().withQuantity(4716171323603349027L).withUnit("laexqp")) - .withCost( - new CommitmentCost().withCommitmentMeterId("dmwsrcrgvxpvgomz").withOverageMeterId("misgwbnb")); - model = BinaryData.fromObject(model).toObject(CommitmentTierInner.class); - Assertions.assertEquals("seyvj", model.kind()); - Assertions.assertEquals("rts", model.skuName()); - Assertions.assertEquals(HostingModel.DISCONNECTED_CONTAINER, model.hostingModel()); - Assertions.assertEquals("kdeemaofmxagkvtm", model.planType()); - Assertions.assertEquals("mqkrhahvljuahaqu", model.tier()); - Assertions.assertEquals(1423191748, model.maxCount()); - Assertions.assertEquals(4716171323603349027L, model.quota().quantity()); - Assertions.assertEquals("laexqp", model.quota().unit()); - Assertions.assertEquals("dmwsrcrgvxpvgomz", model.cost().commitmentMeterId()); - Assertions.assertEquals("misgwbnb", 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 dd4123516d3b6..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentTierListResultTests.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.CommitmentTierListResult; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class CommitmentTierListResultTests { - @Test - public void testDeserialize() { - CommitmentTierListResult model = - BinaryData - .fromString( - "{\"nextLink\":\"cnjbkcnxdhbt\",\"value\":[{\"kind\":\"ywpnvjt\",\"skuName\":\"nermcl\",\"hostingModel\":\"ConnectedContainer\",\"planType\":\"hoxus\",\"tier\":\"pabgyeps\",\"maxCount\":1974668378,\"quota\":{\"quantity\":8786442375186160656,\"unit\":\"xywpmueefjzwfqkq\"},\"cost\":{\"commitmentMeterId\":\"dsuyonobgla\",\"overageMeterId\":\"qxtccmgyudx\"}},{\"kind\":\"lmoyrx\",\"skuName\":\"fudwpznt\",\"hostingModel\":\"DisconnectedContainer\",\"planType\":\"hl\",\"tier\":\"jbhckfrlhr\",\"maxCount\":1228255689,\"quota\":{\"quantity\":1967797899884280622,\"unit\":\"ca\"},\"cost\":{\"commitmentMeterId\":\"bpzkafkuwbc\",\"overageMeterId\":\"wbme\"}}]}") - .toObject(CommitmentTierListResult.class); - Assertions.assertEquals("cnjbkcnxdhbt", model.nextLink()); - } - - @Test - public void testSerialize() { - CommitmentTierListResult model = new CommitmentTierListResult().withNextLink("cnjbkcnxdhbt"); - model = BinaryData.fromObject(model).toObject(CommitmentTierListResult.class); - Assertions.assertEquals("cnjbkcnxdhbt", 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 afb471e81e9ef..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentTiersListMockTests.java +++ /dev/null @@ -1,78 +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.core.util.Context; -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\":\"tvsexsowuel\",\"skuName\":\"hhahhxvrhmzkwpjg\",\"hostingModel\":\"ConnectedContainer\",\"planType\":\"ughftqsx\",\"tier\":\"xujxuknd\",\"maxCount\":723225967,\"quota\":{\"quantity\":8116661577265939603,\"unit\":\"ufzdmsyq\"},\"cost\":{\"commitmentMeterId\":\"hwhbotzingamv\",\"overageMeterId\":\"ho\"}}]}"; - - 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("jnalghf", Context.NONE); - - Assertions.assertEquals("tvsexsowuel", response.iterator().next().kind()); - Assertions.assertEquals("hhahhxvrhmzkwpjg", response.iterator().next().skuName()); - Assertions.assertEquals(HostingModel.CONNECTED_CONTAINER, response.iterator().next().hostingModel()); - Assertions.assertEquals("ughftqsx", response.iterator().next().planType()); - Assertions.assertEquals("xujxuknd", response.iterator().next().tier()); - Assertions.assertEquals(723225967, response.iterator().next().maxCount()); - Assertions.assertEquals(8116661577265939603L, response.iterator().next().quota().quantity()); - Assertions.assertEquals("ufzdmsyq", response.iterator().next().quota().unit()); - Assertions.assertEquals("hwhbotzingamv", response.iterator().next().cost().commitmentMeterId()); - Assertions.assertEquals("ho", 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 eb884dbeafc2c..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeletedAccountsPurgeMockTests.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.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.core.util.Context; -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("zr", "rdgrtw", "enuuzkopbm", 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 1fa2788af1e0e..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentInnerTests.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.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; -import org.junit.jupiter.api.Test; - -public final class DeploymentInnerTests { - @Test - public void testDeserialize() { - DeploymentInner model = - BinaryData - .fromString( - "{\"etag\":\"xc\",\"properties\":{\"provisioningState\":\"Moving\",\"model\":{\"format\":\"asrru\",\"name\":\"bhsqfsubcgjbirxb\",\"version\":\"bsrfbj\"},\"scaleSettings\":{\"scaleType\":\"Standard\",\"capacity\":1365200524,\"activeCapacity\":772106102},\"capabilities\":{\"exilzznfqqnvwpmq\":\"vjz\",\"r\":\"aruoujmkcjhwqyt\"},\"raiPolicyName\":\"n\",\"callRateLimit\":{\"count\":84.0863,\"renewalPeriod\":97.183586,\"rules\":[]}},\"id\":\"ervnaenqpehi\",\"name\":\"doy\",\"type\":\"mifthnzdnd\"}") - .toObject(DeploymentInner.class); - Assertions.assertEquals("asrru", model.properties().model().format()); - Assertions.assertEquals("bhsqfsubcgjbirxb", model.properties().model().name()); - Assertions.assertEquals("bsrfbj", model.properties().model().version()); - Assertions.assertEquals(DeploymentScaleType.STANDARD, model.properties().scaleSettings().scaleType()); - Assertions.assertEquals(1365200524, model.properties().scaleSettings().capacity()); - Assertions.assertEquals("n", model.properties().raiPolicyName()); - } - - @Test - public void testSerialize() { - DeploymentInner model = - new DeploymentInner() - .withProperties( - new DeploymentProperties() - .withModel( - new DeploymentModel() - .withFormat("asrru") - .withName("bhsqfsubcgjbirxb") - .withVersion("bsrfbj")) - .withScaleSettings( - new DeploymentScaleSettings() - .withScaleType(DeploymentScaleType.STANDARD) - .withCapacity(1365200524)) - .withRaiPolicyName("n")); - model = BinaryData.fromObject(model).toObject(DeploymentInner.class); - Assertions.assertEquals("asrru", model.properties().model().format()); - Assertions.assertEquals("bhsqfsubcgjbirxb", model.properties().model().name()); - Assertions.assertEquals("bsrfbj", model.properties().model().version()); - Assertions.assertEquals(DeploymentScaleType.STANDARD, model.properties().scaleSettings().scaleType()); - Assertions.assertEquals(1365200524, model.properties().scaleSettings().capacity()); - Assertions.assertEquals("n", 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 2b76dcecc58fb..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentListResultTests.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.DeploymentListResult; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class DeploymentListResultTests { - @Test - public void testDeserialize() { - DeploymentListResult model = - BinaryData - .fromString( - "{\"nextLink\":\"tpnapnyiropuhpig\",\"value\":[{\"etag\":\"gqgitxmedjvcsl\",\"properties\":{\"provisioningState\":\"Accepted\",\"capabilities\":{},\"raiPolicyName\":\"zzhxgktrm\"},\"id\":\"cnapkteoell\",\"name\":\"pt\",\"type\":\"d\"},{\"etag\":\"fqbuaceopzf\",\"properties\":{\"provisioningState\":\"Moving\",\"capabilities\":{},\"raiPolicyName\":\"ppcqeqxolz\"},\"id\":\"hzxct\",\"name\":\"bgbkdmoizpost\",\"type\":\"grcfb\"},{\"etag\":\"mfqjhhkxbp\",\"properties\":{\"provisioningState\":\"Failed\",\"capabilities\":{},\"raiPolicyName\":\"j\"},\"id\":\"gudivkrtswbxqz\",\"name\":\"szjfauvjfdxxivet\",\"type\":\"t\"},{\"etag\":\"qtdo\",\"properties\":{\"provisioningState\":\"Failed\",\"capabilities\":{},\"raiPolicyName\":\"xyslqbh\"},\"id\":\"xoblytkbl\",\"name\":\"pe\",\"type\":\"wwfbkrvrnsvshq\"}]}") - .toObject(DeploymentListResult.class); - Assertions.assertEquals("tpnapnyiropuhpig", model.nextLink()); - } - - @Test - public void testSerialize() { - DeploymentListResult model = new DeploymentListResult().withNextLink("tpnapnyiropuhpig"); - model = BinaryData.fromObject(model).toObject(DeploymentListResult.class); - Assertions.assertEquals("tpnapnyiropuhpig", 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 a8ea234ad225f..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentScaleSettingsTests.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.DeploymentScaleSettings; -import com.azure.resourcemanager.cognitiveservices.models.DeploymentScaleType; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class DeploymentScaleSettingsTests { - @Test - public void testDeserialize() { - DeploymentScaleSettings model = - BinaryData - .fromString("{\"scaleType\":\"Standard\",\"capacity\":893686819,\"activeCapacity\":158092972}") - .toObject(DeploymentScaleSettings.class); - Assertions.assertEquals(DeploymentScaleType.STANDARD, model.scaleType()); - Assertions.assertEquals(893686819, model.capacity()); - } - - @Test - public void testSerialize() { - DeploymentScaleSettings model = - new DeploymentScaleSettings().withScaleType(DeploymentScaleType.STANDARD).withCapacity(893686819); - model = BinaryData.fromObject(model).toObject(DeploymentScaleSettings.class); - Assertions.assertEquals(DeploymentScaleType.STANDARD, model.scaleType()); - Assertions.assertEquals(893686819, 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 78683d98d1e32..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.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\":\"yftumrtwna\",\"properties\":{\"provisioningState\":\"Succeeded\",\"model\":{\"format\":\"wkojgcyztsfmzn\",\"name\":\"eqphchqnrnr\",\"version\":\"ehuwrykqgaifmvik\"},\"scaleSettings\":{\"scaleType\":\"Manual\",\"capacity\":2009278020,\"activeCapacity\":741141390},\"capabilities\":{\"hnjivo\":\"znxcvds\"},\"raiPolicyName\":\"tnovqfzgemjdftul\",\"callRateLimit\":{\"count\":54.28624,\"renewalPeriod\":33.39791,\"rules\":[]}},\"id\":\"amtmcz\",\"name\":\"o\",\"type\":\"ejwcwwqiok\"}"; - - 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("hirctymoxoftpipi") - .withExistingAccount("rymsgaojfmw", "cotmr") - .withProperties( - new DeploymentProperties() - .withModel( - new DeploymentModel().withFormat("ihhyuspskasd").withName("mfwdgzxu").withVersion("cvpa")) - .withScaleSettings( - new DeploymentScaleSettings() - .withScaleType(DeploymentScaleType.STANDARD) - .withCapacity(866301348)) - .withRaiPolicyName("g")) - .create(); - - Assertions.assertEquals("wkojgcyztsfmzn", response.properties().model().format()); - Assertions.assertEquals("eqphchqnrnr", response.properties().model().name()); - Assertions.assertEquals("ehuwrykqgaifmvik", response.properties().model().version()); - Assertions.assertEquals(DeploymentScaleType.MANUAL, response.properties().scaleSettings().scaleType()); - Assertions.assertEquals(2009278020, response.properties().scaleSettings().capacity()); - Assertions.assertEquals("tnovqfzgemjdftul", 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 f1e9e4b2f5237..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsDeleteMockTests.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.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.core.util.Context; -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("qvpn", "yujviylwdshfssn", "bgye", 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 dd4af4e159c18..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsGetWithResponseMockTests.java +++ /dev/null @@ -1,74 +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.core.util.Context; -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\":\"ycnunvjsrtk\",\"properties\":{\"provisioningState\":\"Deleting\",\"model\":{\"format\":\"qg\",\"name\":\"yzirtxdyuxzejn\",\"version\":\"sewgioilqukr\"},\"scaleSettings\":{\"scaleType\":\"Standard\",\"capacity\":2118513593,\"activeCapacity\":323647852},\"capabilities\":{\"yaomtb\":\"rgguf\",\"pjbi\":\"hhavgrvkffovjz\"},\"raiPolicyName\":\"jmfxumvf\",\"callRateLimit\":{\"count\":6.4399242,\"renewalPeriod\":49.07215,\"rules\":[]}},\"id\":\"xnbkfezzxscyhwzd\",\"name\":\"irujbz\",\"type\":\"omvzzbtd\"}"; - - 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("hqxvcxgfrpdsofbs", "rnsvbuswd", "z", Context.NONE).getValue(); - - Assertions.assertEquals("qg", response.properties().model().format()); - Assertions.assertEquals("yzirtxdyuxzejn", response.properties().model().name()); - Assertions.assertEquals("sewgioilqukr", response.properties().model().version()); - Assertions.assertEquals(DeploymentScaleType.STANDARD, response.properties().scaleSettings().scaleType()); - Assertions.assertEquals(2118513593, response.properties().scaleSettings().capacity()); - Assertions.assertEquals("jmfxumvf", 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 b0b2fb4ee45ba..0000000000000 --- 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.core.util.Context; -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\":\"dntwjchrdgo\",\"properties\":{\"provisioningState\":\"Succeeded\",\"model\":{\"format\":\"ctondz\",\"name\":\"uu\",\"version\":\"dlwggytsbwtovv\"},\"scaleSettings\":{\"scaleType\":\"Manual\",\"capacity\":800109726,\"activeCapacity\":405729519},\"capabilities\":{\"knpirgnepttwq\":\"x\",\"mqnrojlpijnkr\":\"sniffc\",\"zronasxift\":\"frddhcrati\",\"zh\":\"zq\"},\"raiPolicyName\":\"wesgogczh\",\"callRateLimit\":{\"count\":12.991881,\"renewalPeriod\":55.12035,\"rules\":[]}},\"id\":\"gnyhmossxkkg\",\"name\":\"h\",\"type\":\"rghxjb\"}]}"; - - 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("iwii", "htywubxcbihwq", Context.NONE); - - Assertions.assertEquals("ctondz", response.iterator().next().properties().model().format()); - Assertions.assertEquals("uu", response.iterator().next().properties().model().name()); - Assertions.assertEquals("dlwggytsbwtovv", response.iterator().next().properties().model().version()); - Assertions - .assertEquals( - DeploymentScaleType.MANUAL, response.iterator().next().properties().scaleSettings().scaleType()); - Assertions.assertEquals(800109726, response.iterator().next().properties().scaleSettings().capacity()); - Assertions.assertEquals("wesgogczh", 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 c2f1ebb328115..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DomainAvailabilityInnerTests.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.fluent.models.DomainAvailabilityInner; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class DomainAvailabilityInnerTests { - @Test - public void testDeserialize() { - DomainAvailabilityInner model = - BinaryData - .fromString( - "{\"isSubdomainAvailable\":true,\"reason\":\"yhz\",\"subdomainName\":\"uojgj\",\"type\":\"jueiotwmcdytd\",\"kind\":\"it\"}") - .toObject(DomainAvailabilityInner.class); - Assertions.assertEquals(true, model.isSubdomainAvailable()); - Assertions.assertEquals("yhz", model.reason()); - Assertions.assertEquals("uojgj", model.subdomainName()); - Assertions.assertEquals("jueiotwmcdytd", model.type()); - Assertions.assertEquals("it", model.kind()); - } - - @Test - public void testSerialize() { - DomainAvailabilityInner model = - new DomainAvailabilityInner() - .withIsSubdomainAvailable(true) - .withReason("yhz") - .withSubdomainName("uojgj") - .withType("jueiotwmcdytd") - .withKind("it"); - model = BinaryData.fromObject(model).toObject(DomainAvailabilityInner.class); - Assertions.assertEquals(true, model.isSubdomainAvailable()); - Assertions.assertEquals("yhz", model.reason()); - Assertions.assertEquals("uojgj", model.subdomainName()); - Assertions.assertEquals("jueiotwmcdytd", model.type()); - Assertions.assertEquals("it", 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 af595369ad676..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/IdentityTests.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.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; -import org.junit.jupiter.api.Test; - -public final class IdentityTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 14209b1f57838..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/IpRuleTests.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.IpRule; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class IpRuleTests { - @Test - public void testDeserialize() { - IpRule model = BinaryData.fromString("{\"value\":\"fdfdosygexpa\"}").toObject(IpRule.class); - Assertions.assertEquals("fdfdosygexpa", model.value()); - } - - @Test - public void testSerialize() { - 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 17024324ed0cd..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/MetricNameTests.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.MetricName; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class MetricNameTests { - @Test - public void testDeserialize() { - MetricName model = - BinaryData - .fromString("{\"value\":\"pqyegualhbxxh\",\"localizedValue\":\"jzzvdud\"}") - .toObject(MetricName.class); - Assertions.assertEquals("pqyegualhbxxh", model.value()); - Assertions.assertEquals("jzzvdud", model.localizedValue()); - } - - @Test - public void testSerialize() { - MetricName model = new MetricName().withValue("pqyegualhbxxh").withLocalizedValue("jzzvdud"); - model = BinaryData.fromObject(model).toObject(MetricName.class); - Assertions.assertEquals("pqyegualhbxxh", model.value()); - Assertions.assertEquals("jzzvdud", 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 21cd82fad32e4..0000000000000 --- 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; -import org.junit.jupiter.api.Test; - -public final class ModelDeprecationInfoTests { - @Test - public void testDeserialize() { - ModelDeprecationInfo model = - BinaryData - .fromString("{\"fineTune\":\"enhwlrs\",\"inference\":\"rzpwvlqdqgbiq\"}") - .toObject(ModelDeprecationInfo.class); - Assertions.assertEquals("enhwlrs", model.fineTune()); - Assertions.assertEquals("rzpwvlqdqgbiq", model.inference()); - } - - @Test - public void testSerialize() { - ModelDeprecationInfo model = new ModelDeprecationInfo().withFineTune("enhwlrs").withInference("rzpwvlqdqgbiq"); - model = BinaryData.fromObject(model).toObject(ModelDeprecationInfo.class); - Assertions.assertEquals("enhwlrs", model.fineTune()); - Assertions.assertEquals("rzpwvlqdqgbiq", model.inference()); - } -} 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 791d7d218fc4f..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkRuleSetTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.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; -import org.junit.jupiter.api.Test; - -public final class NetworkRuleSetTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 141b87be90d57..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OperationDisplayTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.OperationDisplay; -import org.junit.jupiter.api.Test; - -public final class OperationDisplayTests { - @Test - public void testDeserialize() { - OperationDisplay model = - BinaryData - .fromString( - "{\"provider\":\"tkcxywnytnrsy\",\"resource\":\"qidybyx\",\"operation\":\"fclhaaxdbabphlwr\",\"description\":\"fkts\"}") - .toObject(OperationDisplay.class); - } - - @Test - public void testSerialize() { - 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 3f878fd173a8b..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OperationInnerTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.OperationInner; -import com.azure.resourcemanager.cognitiveservices.models.OperationDisplay; -import org.junit.jupiter.api.Test; - -public final class OperationInnerTests { - @Test - public void testDeserialize() { - OperationInner model = - BinaryData - .fromString( - "{\"name\":\"ynhijggme\",\"isDataAction\":true,\"display\":{\"provider\":\"rbu\",\"resource\":\"cvpnazzmhjrunmpx\",\"operation\":\"dbhrbnlankxm\",\"description\":\"k\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") - .toObject(OperationInner.class); - } - - @Test - public void testSerialize() { - 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 8dc694d6fc325..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OperationListResultTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.OperationListResult; -import org.junit.jupiter.api.Test; - -public final class OperationListResultTests { - @Test - public void testDeserialize() { - OperationListResult model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"kaet\",\"isDataAction\":true,\"display\":{\"provider\":\"civfsnkymuctq\",\"resource\":\"fbebrjcxer\",\"operation\":\"wutttxfvjrbi\",\"description\":\"hxepcyvahfnlj\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"uujqgidokgjljyo\",\"isDataAction\":true,\"display\":{\"provider\":\"tbgsncghkj\",\"resource\":\"zz\",\"operation\":\"ijhtxf\",\"description\":\"xbf\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"mpvecxgodebfqk\",\"isDataAction\":true,\"display\":{\"provider\":\"ukgri\",\"resource\":\"lzlfbxzpuz\",\"operation\":\"ispnqzahmgkbrp\",\"description\":\"dhibnuq\"},\"origin\":\"system\",\"actionType\":\"Internal\"}],\"nextLink\":\"drgvtqagn\"}") - .toObject(OperationListResult.class); - } - - @Test - public void testSerialize() { - 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 0de433b5baf47..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OperationsListMockTests.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.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.core.util.Context; -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\":\"bodacizsjq\",\"isDataAction\":true,\"display\":{\"provider\":\"ibdeibq\",\"resource\":\"qkgh\",\"operation\":\"ndzwmkrefa\",\"description\":\"jorwkqnyhgbij\"},\"origin\":\"user\",\"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(Context.NONE); - } -} 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 4934266b31fdd..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionInnerTests.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.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; -import org.junit.jupiter.api.Test; - -public final class PrivateEndpointConnectionInnerTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 651085a33c9f0..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionListResultInnerTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.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; -import org.junit.jupiter.api.Test; - -public final class PrivateEndpointConnectionListResultInnerTests { - @Test - public void testDeserialize() { - PrivateEndpointConnectionListResultInner model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"groupIds\":[]},\"location\":\"xhniskxfbkpycgk\",\"etag\":\"ndnhj\",\"id\":\"auwhvylwzbtdhx\",\"name\":\"jznb\",\"type\":\"pow\"}]}") - .toObject(PrivateEndpointConnectionListResultInner.class); - Assertions.assertEquals("xhniskxfbkpycgk", model.value().get(0).location()); - } - - @Test - public void testSerialize() { - PrivateEndpointConnectionListResultInner model = - new PrivateEndpointConnectionListResultInner() - .withValue( - Arrays - .asList( - new PrivateEndpointConnectionInner() - .withProperties(new PrivateEndpointConnectionProperties().withGroupIds(Arrays.asList())) - .withLocation("xhniskxfbkpycgk"))); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionListResultInner.class); - Assertions.assertEquals("xhniskxfbkpycgk", 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 90a2323840ba0..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionPropertiesTests.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.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; -import org.junit.jupiter.api.Test; - -public final class PrivateEndpointConnectionPropertiesTests { - @Test - public void testDeserialize() { - 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)); - } - - @Test - public void testSerialize() { - 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 5d05915c6da3e..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,93 +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\":\"taugzxnfaa\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"tnkdmkqj\",\"actionsRequired\":\"wuenvr\"},\"provisioningState\":\"Succeeded\",\"groupIds\":[\"aibrebqaaysjkixq\",\"nqttezl\",\"fffiak\",\"jpqqmted\"]},\"location\":\"mjihyeozphv\",\"etag\":\"uyqncygupkvipmd\",\"id\":\"cwxqu\",\"name\":\"evzhfsto\",\"type\":\"xhojuj\"}"; - - 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("gfipnsxk") - .withExistingAccount("t", "jqppyostronzmy") - .withRegion("znoigbrn") - .withProperties( - new PrivateEndpointConnectionProperties() - .withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("tsgumhj") - .withActionsRequired("ikkx")) - .withGroupIds(Arrays.asList("bq", "vuzlm", "felfktg", "lcrpw"))) - .create(); - - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.PENDING, - response.properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("tnkdmkqj", response.properties().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("wuenvr", response.properties().privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("aibrebqaaysjkixq", response.properties().groupIds().get(0)); - Assertions.assertEquals("mjihyeozphv", 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 855bb231fe4fe..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsDeleteMockTests.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.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.core.util.Context; -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("htpwij", "hyjsvfycx", "bfvoowvrv", 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 2dff4bdf22c38..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java +++ /dev/null @@ -1,79 +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.core.util.Context; -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\":\"goupmfiibfg\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"olvrw\",\"actionsRequired\":\"v\"},\"provisioningState\":\"Succeeded\",\"groupIds\":[\"lqwjygvjayvblm\",\"vkzuhbxvvyhgso\",\"byrqufeg\",\"uvwzfbnh\"]},\"location\":\"tlpdn\",\"etag\":\"tvgbmhrixkwmy\",\"id\":\"jejveg\",\"name\":\"hbpnaixexccbd\",\"type\":\"eaxhcexdrrvqahqk\"}"; - - 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("tmdvypgikdgs", "ywkbirryuzhlhkjo", "rvqqaatj", Context.NONE) - .getValue(); - - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.APPROVED, - response.properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("olvrw", response.properties().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("v", response.properties().privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("lqwjygvjayvblm", response.properties().groupIds().get(0)); - Assertions.assertEquals("tlpdn", 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 af9d48734bde3..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsListWithResponseMockTests.java +++ /dev/null @@ -1,71 +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.core.util.Context; -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\":\"nvyq\",\"etag\":\"tkzwpcnpwzc\",\"id\":\"a\",\"name\":\"sgvvsccyajguq\",\"type\":\"hwyg\"},{\"location\":\"nk\",\"etag\":\"usemdwzrmuhap\",\"id\":\"cqdpsqxqvpsvuoym\",\"name\":\"ccelve\",\"type\":\"rypqlmfeo\"},{\"location\":\"wkyhkobopgxe\",\"etag\":\"owepbqpcrfkb\",\"id\":\"ccsnjvcdwxlpq\",\"name\":\"kftnkhtjsyin\",\"type\":\"wfqatmtd\"}]}"; - - 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("zqzudph", "amvdkfwynwcvtbv", Context.NONE) - .getValue(); - - Assertions.assertEquals("nvyq", 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 16ce72b37e812..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpoint; -import org.junit.jupiter.api.Test; - -public final class PrivateEndpointTests { - @Test - public void testDeserialize() { - PrivateEndpoint model = BinaryData.fromString("{\"id\":\"eebvmgxsab\"}").toObject(PrivateEndpoint.class); - } - - @Test - public void testSerialize() { - 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 1c3fff5a9b0dc..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourceListResultInnerTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.PrivateLinkResourceListResultInner; -import com.azure.resourcemanager.cognitiveservices.models.PrivateLinkResource; -import com.azure.resourcemanager.cognitiveservices.models.PrivateLinkResourceProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Test; - -public final class PrivateLinkResourceListResultInnerTests { - @Test - public void testDeserialize() { - PrivateLinkResourceListResultInner model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"groupId\":\"qlveualupjmkh\",\"requiredMembers\":[],\"requiredZoneNames\":[],\"displayName\":\"bcswsrt\"},\"id\":\"riplrbpbewtg\",\"name\":\"fgb\",\"type\":\"c\"},{\"properties\":{\"groupId\":\"zvlvqhjkbegib\",\"requiredMembers\":[],\"requiredZoneNames\":[],\"displayName\":\"iebwwaloayqcgwrt\"},\"id\":\"j\",\"name\":\"zg\",\"type\":\"yzm\"}]}") - .toObject(PrivateLinkResourceListResultInner.class); - } - - @Test - public void testSerialize() { - 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 e02d05baca3cc..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourcePropertiesTests.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.PrivateLinkResourceProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class PrivateLinkResourcePropertiesTests { - @Test - public void testDeserialize() { - PrivateLinkResourceProperties model = - BinaryData - .fromString( - "{\"groupId\":\"ozuhkfp\",\"requiredMembers\":[\"yofd\",\"luu\",\"dttouwaboekqvkel\",\"smv\"],\"requiredZoneNames\":[\"yjsflhhcaalnji\",\"isxyawjoyaqcslyj\",\"kiidzyex\",\"nelixhnrztfo\"],\"displayName\":\"bnxknalaulppg\"}") - .toObject(PrivateLinkResourceProperties.class); - Assertions.assertEquals("yjsflhhcaalnji", model.requiredZoneNames().get(0)); - } - - @Test - public void testSerialize() { - PrivateLinkResourceProperties model = - new PrivateLinkResourceProperties() - .withRequiredZoneNames(Arrays.asList("yjsflhhcaalnji", "isxyawjoyaqcslyj", "kiidzyex", "nelixhnrztfo")); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceProperties.class); - Assertions.assertEquals("yjsflhhcaalnji", 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 09dc522a85592..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourceTests.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.PrivateLinkResource; -import com.azure.resourcemanager.cognitiveservices.models.PrivateLinkResourceProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class PrivateLinkResourceTests { - @Test - public void testDeserialize() { - PrivateLinkResource model = - BinaryData - .fromString( - "{\"properties\":{\"groupId\":\"ongmtsa\",\"requiredMembers\":[\"bp\",\"xqpsrknftguv\",\"iuhprwmdyvxqta\",\"riwwroy\"],\"requiredZoneNames\":[\"xrmcqibycnojvk\",\"mefqsgzvahapjyzh\",\"vgqzcjrvxd\",\"zlmwlxkvugfhz\"],\"displayName\":\"awjvzunluthnnp\"},\"id\":\"nxipeil\",\"name\":\"jzuaejxdultskzbb\",\"type\":\"dzumveekg\"}") - .toObject(PrivateLinkResource.class); - Assertions.assertEquals("xrmcqibycnojvk", model.properties().requiredZoneNames().get(0)); - } - - @Test - public void testSerialize() { - PrivateLinkResource model = - new PrivateLinkResource() - .withProperties( - new PrivateLinkResourceProperties() - .withRequiredZoneNames( - Arrays.asList("xrmcqibycnojvk", "mefqsgzvahapjyzh", "vgqzcjrvxd", "zlmwlxkvugfhz"))); - model = BinaryData.fromObject(model).toObject(PrivateLinkResource.class); - Assertions.assertEquals("xrmcqibycnojvk", 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 76293c6600951..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourcesListWithResponseMockTests.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.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -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\":\"lsttpkiwkkbnuj\",\"name\":\"ywvtylbfpnc\",\"type\":\"rd\"}]}"; - - 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("ypelmcu", "hixbjxyfwnyl", 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 9f6709f7438be..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkServiceConnectionStateTests.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.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.cognitiveservices.models.PrivateLinkServiceConnectionState; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class PrivateLinkServiceConnectionStateTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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/RequestMatchPatternTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RequestMatchPatternTests.java deleted file mode 100644 index 718b6345533bc..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RequestMatchPatternTests.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.RequestMatchPattern; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class RequestMatchPatternTests { - @Test - public void testDeserialize() { - RequestMatchPattern model = - BinaryData - .fromString("{\"path\":\"hsgcbacphejkot\",\"method\":\"qgoulznd\"}") - .toObject(RequestMatchPattern.class); - Assertions.assertEquals("hsgcbacphejkot", model.path()); - Assertions.assertEquals("qgoulznd", model.method()); - } - - @Test - public void testSerialize() { - 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 74e5e697525c1..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProvidersCheckDomainAvailabilityWithResponseMockTests.java +++ /dev/null @@ -1,78 +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.core.util.Context; -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\":false,\"reason\":\"fpwpjylwbt\",\"subdomainName\":\"flsjc\",\"type\":\"szfjvfbgofelja\",\"kind\":\"qmqhldvriii\"}"; - - 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("rgz").withType("frl").withKind("szrnwo"), - Context.NONE) - .getValue(); - - Assertions.assertEquals(false, response.isSubdomainAvailable()); - Assertions.assertEquals("fpwpjylwbt", response.reason()); - Assertions.assertEquals("flsjc", response.subdomainName()); - Assertions.assertEquals("szfjvfbgofelja", response.type()); - Assertions.assertEquals("qmqhldvriii", 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 cd62ca5762ae9..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProvidersCheckSkuAvailabilityWithResponseMockTests.java +++ /dev/null @@ -1,84 +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.core.util.Context; -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\":\"ikayuhqlbjbsybb\",\"type\":\"r\",\"skuName\":\"ldgmfpgvmpip\",\"skuAvailable\":false,\"reason\":\"haq\",\"message\":\"ss\"},{\"kind\":\"u\",\"type\":\"bdsrez\",\"skuName\":\"rhneuyowq\",\"skuAvailable\":false,\"reason\":\"t\",\"message\":\"ib\"},{\"kind\":\"cgpik\",\"type\":\"imejzanl\",\"skuName\":\"xi\",\"skuAvailable\":false,\"reason\":\"bzonok\",\"message\":\"rjqc\"}]}"; - - 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( - "xzsjabib", - new CheckSkuAvailabilityParameter() - .withSkus(Arrays.asList("stawfsdjpvkv", "bjxbkzbzk", "vncjabudurgk", "kmokz")) - .withKind("jjklff") - .withType("mouwqlgzrfzeey"), - Context.NONE) - .getValue(); - - Assertions.assertEquals("ikayuhqlbjbsybb", response.value().get(0).kind()); - Assertions.assertEquals("r", response.value().get(0).type()); - Assertions.assertEquals("ldgmfpgvmpip", response.value().get(0).skuName()); - Assertions.assertEquals(false, response.value().get(0).skuAvailable()); - Assertions.assertEquals("haq", response.value().get(0).reason()); - Assertions.assertEquals("ss", 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 16c952c216825..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceSkuListResultTests.java +++ /dev/null @@ -1,74 +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; -import org.junit.jupiter.api.Test; - -public final class ResourceSkuListResultTests { - @Test - public void testDeserialize() { - ResourceSkuListResult model = - BinaryData - .fromString( - "{\"value\":[{\"resourceType\":\"muouqfp\",\"name\":\"zw\",\"tier\":\"g\",\"kind\":\"tnwu\",\"locations\":[\"a\",\"x\"],\"restrictions\":[]},{\"resourceType\":\"uckyf\",\"name\":\"rfidfvzwdz\",\"tier\":\"tymw\",\"kind\":\"dkfthwxmnt\",\"locations\":[\"aop\",\"km\",\"jcmmxdcufufsrp\",\"mzidnsezcxtb\"],\"restrictions\":[]},{\"resourceType\":\"yc\",\"name\":\"newmdwzjeiachbo\",\"tier\":\"flnrosfqpteehzz\",\"kind\":\"pyqr\",\"locations\":[\"inpvswjdkirsoodq\"],\"restrictions\":[]},{\"resourceType\":\"mnoh\",\"name\":\"ckwhds\",\"tier\":\"fiyipjxsqwpgrj\",\"kind\":\"norcjxvsnbyxqab\",\"locations\":[\"cpc\",\"shurzafbljjgpbto\"],\"restrictions\":[]}],\"nextLink\":\"klj\"}") - .toObject(ResourceSkuListResult.class); - Assertions.assertEquals("muouqfp", model.value().get(0).resourceType()); - Assertions.assertEquals("zw", model.value().get(0).name()); - Assertions.assertEquals("g", model.value().get(0).tier()); - Assertions.assertEquals("tnwu", model.value().get(0).kind()); - Assertions.assertEquals("a", model.value().get(0).locations().get(0)); - Assertions.assertEquals("klj", model.nextLink()); - } - - @Test - public void testSerialize() { - ResourceSkuListResult model = - new ResourceSkuListResult() - .withValue( - Arrays - .asList( - new ResourceSkuInner() - .withResourceType("muouqfp") - .withName("zw") - .withTier("g") - .withKind("tnwu") - .withLocations(Arrays.asList("a", "x")) - .withRestrictions(Arrays.asList()), - new ResourceSkuInner() - .withResourceType("uckyf") - .withName("rfidfvzwdz") - .withTier("tymw") - .withKind("dkfthwxmnt") - .withLocations(Arrays.asList("aop", "km", "jcmmxdcufufsrp", "mzidnsezcxtb")) - .withRestrictions(Arrays.asList()), - new ResourceSkuInner() - .withResourceType("yc") - .withName("newmdwzjeiachbo") - .withTier("flnrosfqpteehzz") - .withKind("pyqr") - .withLocations(Arrays.asList("inpvswjdkirsoodq")) - .withRestrictions(Arrays.asList()), - new ResourceSkuInner() - .withResourceType("mnoh") - .withName("ckwhds") - .withTier("fiyipjxsqwpgrj") - .withKind("norcjxvsnbyxqab") - .withLocations(Arrays.asList("cpc", "shurzafbljjgpbto")) - .withRestrictions(Arrays.asList()))) - .withNextLink("klj"); - model = BinaryData.fromObject(model).toObject(ResourceSkuListResult.class); - Assertions.assertEquals("muouqfp", model.value().get(0).resourceType()); - Assertions.assertEquals("zw", model.value().get(0).name()); - Assertions.assertEquals("g", model.value().get(0).tier()); - Assertions.assertEquals("tnwu", model.value().get(0).kind()); - Assertions.assertEquals("a", model.value().get(0).locations().get(0)); - Assertions.assertEquals("klj", 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 dcc919780f49c..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceSkuRestrictionInfoTests.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.ResourceSkuRestrictionInfo; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ResourceSkuRestrictionInfoTests { - @Test - public void testDeserialize() { - ResourceSkuRestrictionInfo model = - BinaryData - .fromString( - "{\"locations\":[\"dntwndeicbtw\",\"pzaoqvuhr\",\"cffcyddglmj\"],\"zones\":[\"qkwpyeicxmqc\",\"wqvhkhixuigdt\",\"pbobjo\"]}") - .toObject(ResourceSkuRestrictionInfo.class); - Assertions.assertEquals("dntwndeicbtw", model.locations().get(0)); - Assertions.assertEquals("qkwpyeicxmqc", model.zones().get(0)); - } - - @Test - public void testSerialize() { - ResourceSkuRestrictionInfo model = - new ResourceSkuRestrictionInfo() - .withLocations(Arrays.asList("dntwndeicbtw", "pzaoqvuhr", "cffcyddglmj")) - .withZones(Arrays.asList("qkwpyeicxmqc", "wqvhkhixuigdt", "pbobjo")); - model = BinaryData.fromObject(model).toObject(ResourceSkuRestrictionInfo.class); - Assertions.assertEquals("dntwndeicbtw", model.locations().get(0)); - Assertions.assertEquals("qkwpyeicxmqc", 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 c6f2cdb3128ac..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuAvailabilityListResultInnerTests.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.SkuAvailabilityListResultInner; -import com.azure.resourcemanager.cognitiveservices.models.SkuAvailability; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class SkuAvailabilityListResultInnerTests { - @Test - public void testDeserialize() { - SkuAvailabilityListResultInner model = - BinaryData - .fromString( - "{\"value\":[{\"kind\":\"jwbhqwalmuz\",\"type\":\"xaepdkzjancuxr\",\"skuName\":\"wbavxbniwdj\",\"skuAvailable\":false,\"reason\":\"s\",\"message\":\"pgn\"},{\"kind\":\"txhp\",\"type\":\"bzpfzab\",\"skuName\":\"cuh\",\"skuAvailable\":false,\"reason\":\"tyq\",\"message\":\"lbbovplw\"},{\"kind\":\"hvgyuguosvmk\",\"type\":\"sxqu\",\"skuName\":\"fpl\",\"skuAvailable\":true,\"reason\":\"xnkjzkdesl\",\"message\":\"lopwiyig\"},{\"kind\":\"pkdwzbai\",\"type\":\"bbaumnyquped\",\"skuName\":\"jn\",\"skuAvailable\":true,\"reason\":\"hsmtxpsiebtfhvp\",\"message\":\"apskrdqm\"}]}") - .toObject(SkuAvailabilityListResultInner.class); - Assertions.assertEquals("jwbhqwalmuz", model.value().get(0).kind()); - Assertions.assertEquals("xaepdkzjancuxr", model.value().get(0).type()); - Assertions.assertEquals("wbavxbniwdj", model.value().get(0).skuName()); - Assertions.assertEquals(false, model.value().get(0).skuAvailable()); - Assertions.assertEquals("s", model.value().get(0).reason()); - Assertions.assertEquals("pgn", model.value().get(0).message()); - } - - @Test - public void testSerialize() { - SkuAvailabilityListResultInner model = - new SkuAvailabilityListResultInner() - .withValue( - Arrays - .asList( - new SkuAvailability() - .withKind("jwbhqwalmuz") - .withType("xaepdkzjancuxr") - .withSkuName("wbavxbniwdj") - .withSkuAvailable(false) - .withReason("s") - .withMessage("pgn"), - new SkuAvailability() - .withKind("txhp") - .withType("bzpfzab") - .withSkuName("cuh") - .withSkuAvailable(false) - .withReason("tyq") - .withMessage("lbbovplw"), - new SkuAvailability() - .withKind("hvgyuguosvmk") - .withType("sxqu") - .withSkuName("fpl") - .withSkuAvailable(true) - .withReason("xnkjzkdesl") - .withMessage("lopwiyig"), - new SkuAvailability() - .withKind("pkdwzbai") - .withType("bbaumnyquped") - .withSkuName("jn") - .withSkuAvailable(true) - .withReason("hsmtxpsiebtfhvp") - .withMessage("apskrdqm"))); - model = BinaryData.fromObject(model).toObject(SkuAvailabilityListResultInner.class); - Assertions.assertEquals("jwbhqwalmuz", model.value().get(0).kind()); - Assertions.assertEquals("xaepdkzjancuxr", model.value().get(0).type()); - Assertions.assertEquals("wbavxbniwdj", model.value().get(0).skuName()); - Assertions.assertEquals(false, model.value().get(0).skuAvailable()); - Assertions.assertEquals("s", model.value().get(0).reason()); - Assertions.assertEquals("pgn", 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 25630a0dab07e..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuAvailabilityTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.SkuAvailability; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class SkuAvailabilityTests { - @Test - public void testDeserialize() { - SkuAvailability model = - BinaryData - .fromString( - "{\"kind\":\"jdhtldwkyzxu\",\"type\":\"kn\",\"skuName\":\"scwsv\",\"skuAvailable\":true,\"reason\":\"ogtwrupqsxvnmi\",\"message\":\"kvceoveilovnotyf\"}") - .toObject(SkuAvailability.class); - Assertions.assertEquals("jdhtldwkyzxu", model.kind()); - Assertions.assertEquals("kn", model.type()); - Assertions.assertEquals("scwsv", model.skuName()); - Assertions.assertEquals(true, model.skuAvailable()); - Assertions.assertEquals("ogtwrupqsxvnmi", model.reason()); - Assertions.assertEquals("kvceoveilovnotyf", model.message()); - } - - @Test - public void testSerialize() { - SkuAvailability model = - new SkuAvailability() - .withKind("jdhtldwkyzxu") - .withType("kn") - .withSkuName("scwsv") - .withSkuAvailable(true) - .withReason("ogtwrupqsxvnmi") - .withMessage("kvceoveilovnotyf"); - model = BinaryData.fromObject(model).toObject(SkuAvailability.class); - Assertions.assertEquals("jdhtldwkyzxu", model.kind()); - Assertions.assertEquals("kn", model.type()); - Assertions.assertEquals("scwsv", model.skuName()); - Assertions.assertEquals(true, model.skuAvailable()); - Assertions.assertEquals("ogtwrupqsxvnmi", model.reason()); - Assertions.assertEquals("kvceoveilovnotyf", 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 9a1cfa5bfb28a..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuCapabilityTests.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.SkuCapability; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class SkuCapabilityTests { - @Test - public void testDeserialize() { - SkuCapability model = - BinaryData - .fromString("{\"name\":\"jwyahuxinpmqnja\",\"value\":\"ixjsprozvcputeg\"}") - .toObject(SkuCapability.class); - Assertions.assertEquals("jwyahuxinpmqnja", model.name()); - Assertions.assertEquals("ixjsprozvcputeg", model.value()); - } - - @Test - public void testSerialize() { - 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 75b8db04be459..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuChangeInfoTests.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.SkuChangeInfo; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class SkuChangeInfoTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 4ae046328802a..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.Sku; -import com.azure.resourcemanager.cognitiveservices.models.SkuTier; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class SkuTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 dbaca0ebe3e83..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UsageListResultInnerTests.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.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; -import org.junit.jupiter.api.Test; - -public final class UsageListResultInnerTests { - @Test - public void testDeserialize() { - UsageListResultInner model = - BinaryData - .fromString( - "{\"value\":[{\"unit\":\"CountPerSecond\",\"name\":{\"value\":\"anyktzlcuiywg\",\"localizedValue\":\"wgndrvynhzgpp\"},\"quotaPeriod\":\"cgyncocpecf\",\"limit\":21.537221408230444,\"currentValue\":22.03047256463684,\"nextResetTime\":\"xlzevgbmqjqabcy\",\"status\":\"Unknown\"},{\"unit\":\"Count\",\"name\":{\"value\":\"zuvccfwnfnbacfio\",\"localizedValue\":\"ebxetqgtzxdp\"},\"quotaPeriod\":\"bqqwxrj\",\"limit\":7.9074598312850135,\"currentValue\":52.081645304185756,\"nextResetTime\":\"ubisnjampmng\",\"status\":\"Blocked\"}]}") - .toObject(UsageListResultInner.class); - Assertions.assertEquals(UnitType.COUNT_PER_SECOND, model.value().get(0).unit()); - Assertions.assertEquals("anyktzlcuiywg", model.value().get(0).name().value()); - Assertions.assertEquals("wgndrvynhzgpp", model.value().get(0).name().localizedValue()); - Assertions.assertEquals("cgyncocpecf", model.value().get(0).quotaPeriod()); - Assertions.assertEquals(21.537221408230444D, model.value().get(0).limit()); - Assertions.assertEquals(22.03047256463684D, model.value().get(0).currentValue()); - Assertions.assertEquals("xlzevgbmqjqabcy", model.value().get(0).nextResetTime()); - Assertions.assertEquals(QuotaUsageStatus.UNKNOWN, model.value().get(0).status()); - } - - @Test - public void testSerialize() { - UsageListResultInner model = - new UsageListResultInner() - .withValue( - Arrays - .asList( - new Usage() - .withUnit(UnitType.COUNT_PER_SECOND) - .withName( - new MetricName().withValue("anyktzlcuiywg").withLocalizedValue("wgndrvynhzgpp")) - .withQuotaPeriod("cgyncocpecf") - .withLimit(21.537221408230444D) - .withCurrentValue(22.03047256463684D) - .withNextResetTime("xlzevgbmqjqabcy") - .withStatus(QuotaUsageStatus.UNKNOWN), - new Usage() - .withUnit(UnitType.COUNT) - .withName( - new MetricName().withValue("zuvccfwnfnbacfio").withLocalizedValue("ebxetqgtzxdp")) - .withQuotaPeriod("bqqwxrj") - .withLimit(7.9074598312850135D) - .withCurrentValue(52.081645304185756D) - .withNextResetTime("ubisnjampmng") - .withStatus(QuotaUsageStatus.BLOCKED))); - model = BinaryData.fromObject(model).toObject(UsageListResultInner.class); - Assertions.assertEquals(UnitType.COUNT_PER_SECOND, model.value().get(0).unit()); - Assertions.assertEquals("anyktzlcuiywg", model.value().get(0).name().value()); - Assertions.assertEquals("wgndrvynhzgpp", model.value().get(0).name().localizedValue()); - Assertions.assertEquals("cgyncocpecf", model.value().get(0).quotaPeriod()); - Assertions.assertEquals(21.537221408230444D, model.value().get(0).limit()); - Assertions.assertEquals(22.03047256463684D, model.value().get(0).currentValue()); - Assertions.assertEquals("xlzevgbmqjqabcy", model.value().get(0).nextResetTime()); - Assertions.assertEquals(QuotaUsageStatus.UNKNOWN, 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 88cf394ecf469..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UsageTests.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.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; -import org.junit.jupiter.api.Test; - -public final class UsageTests { - @Test - public void testDeserialize() { - Usage model = - BinaryData - .fromString( - "{\"unit\":\"Percent\",\"name\":{\"value\":\"wooc\",\"localizedValue\":\"bonqvpkvlrxnjeas\"},\"quotaPeriod\":\"pheoflokeyy\",\"limit\":8.258695733393173,\"currentValue\":56.75923754933715,\"nextResetTime\":\"tgrhpdjpjumas\",\"status\":\"Included\"}") - .toObject(Usage.class); - Assertions.assertEquals(UnitType.PERCENT, model.unit()); - Assertions.assertEquals("wooc", model.name().value()); - Assertions.assertEquals("bonqvpkvlrxnjeas", model.name().localizedValue()); - Assertions.assertEquals("pheoflokeyy", model.quotaPeriod()); - Assertions.assertEquals(8.258695733393173D, model.limit()); - Assertions.assertEquals(56.75923754933715D, model.currentValue()); - Assertions.assertEquals("tgrhpdjpjumas", model.nextResetTime()); - Assertions.assertEquals(QuotaUsageStatus.INCLUDED, model.status()); - } - - @Test - public void testSerialize() { - Usage model = - new Usage() - .withUnit(UnitType.PERCENT) - .withName(new MetricName().withValue("wooc").withLocalizedValue("bonqvpkvlrxnjeas")) - .withQuotaPeriod("pheoflokeyy") - .withLimit(8.258695733393173D) - .withCurrentValue(56.75923754933715D) - .withNextResetTime("tgrhpdjpjumas") - .withStatus(QuotaUsageStatus.INCLUDED); - model = BinaryData.fromObject(model).toObject(Usage.class); - Assertions.assertEquals(UnitType.PERCENT, model.unit()); - Assertions.assertEquals("wooc", model.name().value()); - Assertions.assertEquals("bonqvpkvlrxnjeas", model.name().localizedValue()); - Assertions.assertEquals("pheoflokeyy", model.quotaPeriod()); - Assertions.assertEquals(8.258695733393173D, model.limit()); - Assertions.assertEquals(56.75923754933715D, model.currentValue()); - Assertions.assertEquals("tgrhpdjpjumas", 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 920c92492cceb..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UserAssignedIdentityTests.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.UserAssignedIdentity; -import org.junit.jupiter.api.Test; - -public final class UserAssignedIdentityTests { - @Test - public void testDeserialize() { - UserAssignedIdentity model = - BinaryData - .fromString("{\"principalId\":\"vyq\",\"clientId\":\"wby\"}") - .toObject(UserAssignedIdentity.class); - } - - @Test - public void testSerialize() { - 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 6cd530cd8ac29..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UserOwnedStorageTests.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.UserOwnedStorage; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class UserOwnedStorageTests { - @Test - public void testDeserialize() { - UserOwnedStorage model = - BinaryData - .fromString("{\"resourceId\":\"zitonpeqfpjkjl\",\"identityClientId\":\"fpdvhpfxxypi\"}") - .toObject(UserOwnedStorage.class); - Assertions.assertEquals("zitonpeqfpjkjl", model.resourceId()); - Assertions.assertEquals("fpdvhpfxxypi", model.identityClientId()); - } - - @Test - public void testSerialize() { - 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 ac67fdb9a7809..0000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/VirtualNetworkRuleTests.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.VirtualNetworkRule; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class VirtualNetworkRuleTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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()); - } -}