diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/CHANGELOG.md b/sdk/loadtesting/azure-resourcemanager-loadtesting/CHANGELOG.md index 8353acfec02e..f4ae8d4ca5dd 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/CHANGELOG.md +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/CHANGELOG.md @@ -1,14 +1,112 @@ # Release History -## 1.2.0-beta.1 (Unreleased) +## 1.2.0-beta.1 (2025-04-29) -### Features Added +- Azure Resource Manager Load Test client library for Java. This package contains Microsoft Azure SDK for Load Test Management SDK. LoadTest client provides access to LoadTest Resource and it's status operations. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Breaking Changes -### Bugs Fixed +#### `models.Origin` was removed + +#### `models.LoadTestResourceListResult` was removed + +#### `models.LoadTestResourcePatchRequestBody` was removed + +#### `models.PagedOutboundEnvironmentEndpoint` was removed + +#### `models.Operations` was removed + +#### `models.ActionType` was removed + +#### `models.Quotas` was removed + +#### `models.OperationDisplay` was removed + +#### `models.OperationListResult` was removed + +#### `models.QuotaResourceListResult` was removed + +#### `models.Operation` was removed + +#### `models.LoadTests` was removed + +#### `LoadTestManager` was modified + +* `loadTests()` was removed +* `fluent.LoadTestClient serviceClient()` -> `fluent.LoadTestMgmtClient serviceClient()` +* `operations()` was removed +* `quotas()` was removed + +#### `models.ManagedServiceIdentity` was modified + +* `java.util.UUID principalId()` -> `java.lang.String principalId()` +* `java.util.UUID tenantId()` -> `java.lang.String tenantId()` + +#### `models.LoadTestResource$Definition` was modified + +* `withDescription(java.lang.String)` was removed +* `withEncryption(models.EncryptionProperties)` was removed + +#### `models.LoadTestResource$Update` was modified + +* `withEncryption(models.EncryptionProperties)` was removed +* `withDescription(java.lang.String)` was removed + +#### `models.UserAssignedIdentity` was modified + +* `java.util.UUID principalId()` -> `java.lang.String principalId()` +* `java.util.UUID clientId()` -> `java.lang.String clientId()` + +#### `models.LoadTestResource` was modified + +* `description()` was removed +* `encryption()` was removed +* `provisioningState()` was removed +* `dataPlaneUri()` was removed + +#### `models.QuotaResource` was modified + +* `limit()` was removed +* `provisioningState()` was removed +* `usage()` was removed + +### Features Added + +* `implementation.models.PagedOutboundEnvironmentEndpoint` was added + +* `models.ResourceProviders` was added + +* `implementation.models.LoadTestResourceListResult` was added + +* `implementation.models.QuotaResourceListResult` was added + +* `models.LoadTestResourceUpdateProperties` was added + +* `models.LoadTestResourceUpdate` was added + +* `models.LoadTestProperties` was added + +* `models.QuotaResourceProperties` was added + +#### `LoadTestManager` was modified + +* `resourceProviders()` was added + +#### `models.LoadTestResource$Definition` was modified + +* `withProperties(models.LoadTestProperties)` was added + +#### `models.LoadTestResource$Update` was modified + +* `withProperties(models.LoadTestResourceUpdateProperties)` was added + +#### `models.LoadTestResource` was modified + +* `properties()` was added + +#### `models.QuotaResource` was modified -### Other Changes +* `properties()` was added ## 1.1.0 (2024-12-12) diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/README.md b/sdk/loadtesting/azure-resourcemanager-loadtesting/README.md index 9f7adaaee29b..23418f812223 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/README.md +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/README.md @@ -1,8 +1,8 @@ -# Azure Resource Manager LoadTest client library for Java +# Azure Resource Manager Load Test client library for Java -Azure Resource Manager LoadTest client library for Java. +Azure Resource Manager Load Test client library for Java. -This package contains Microsoft Azure SDK for LoadTest Management SDK. LoadTest client provides access to LoadTest Resource and it's status operations. Package tag package-2022-12-01. 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 Load Test Management SDK. LoadTest client provides access to LoadTest Resource and it's status operations. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -52,7 +52,7 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java -AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); @@ -60,7 +60,7 @@ LoadTestManager manager = LoadTestManager .authenticate(credential, profile); ``` -The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. See [Authentication][authenticate] for more options. @@ -100,5 +100,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ - - diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/SAMPLE.md b/sdk/loadtesting/azure-resourcemanager-loadtesting/SAMPLE.md index f7a963ca47df..8572b31ff32e 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/SAMPLE.md +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/SAMPLE.md @@ -1,157 +1,115 @@ # Code snippets and samples -## LoadTests +## ResourceProvider -- [CreateOrUpdate](#loadtests_createorupdate) -- [Delete](#loadtests_delete) -- [GetByResourceGroup](#loadtests_getbyresourcegroup) -- [List](#loadtests_list) -- [ListByResourceGroup](#loadtests_listbyresourcegroup) -- [ListOutboundNetworkDependenciesEndpoints](#loadtests_listoutboundnetworkdependenciesendpoints) -- [Update](#loadtests_update) - -## Operations - -- [List](#operations_list) - -## Quotas - -- [CheckAvailability](#quotas_checkavailability) -- [Get](#quotas_get) -- [List](#quotas_list) -### LoadTests_CreateOrUpdate - -```java -/** - * Samples for LoadTests CreateOrUpdate. - */ -public final class LoadTestsCreateOrUpdateSamples { - /* - * x-ms-original-file: - * specification/loadtestservice/resource-manager/Microsoft.LoadTestService/stable/2022-12-01/examples/ - * LoadTests_CreateOrUpdate.json - */ - /** - * Sample code: Create a LoadTestResource. - * - * @param manager Entry point to LoadTestManager. - */ - public static void createALoadTestResource(com.azure.resourcemanager.loadtesting.LoadTestManager manager) { - manager.loadTests() - .define("myLoadTest") - .withRegion((String) null) - .withExistingResourceGroup("dummyrg") - .create(); - } -} -``` - -### LoadTests_Delete +- [CheckAvailabilityQuota](#resourceprovider_checkavailabilityquota) +- [CreateOrUpdateLoadtest](#resourceprovider_createorupdateloadtest) +- [Delete](#resourceprovider_delete) +- [GetByResourceGroup](#resourceprovider_getbyresourcegroup) +- [GetQuota](#resourceprovider_getquota) +- [List](#resourceprovider_list) +- [ListByResourceGroup](#resourceprovider_listbyresourcegroup) +- [ListQuota](#resourceprovider_listquota) +- [OutboundNetworkDependenciesEndpoints](#resourceprovider_outboundnetworkdependenciesendpoints) +- [UpdateLoadtest](#resourceprovider_updateloadtest) +### ResourceProvider_CheckAvailabilityQuota ```java /** - * Samples for LoadTests Delete. + * Samples for ResourceProvider GetQuota. */ -public final class LoadTestsDeleteSamples { +public final class ResourceProviderGetQuotaSamples { /* - * x-ms-original-file: - * specification/loadtestservice/resource-manager/Microsoft.LoadTestService/stable/2022-12-01/examples/ - * LoadTests_Delete.json + * x-ms-original-file: 2024-12-01-preview/Quotas_Get.json */ /** - * Sample code: Delete a LoadTestResource. + * Sample code: Get the available quota for a quota bucket per region per subscription. * * @param manager Entry point to LoadTestManager. */ - public static void deleteALoadTestResource(com.azure.resourcemanager.loadtesting.LoadTestManager manager) { - manager.loadTests().delete("dummyrg", "myLoadTest", com.azure.core.util.Context.NONE); + public static void getTheAvailableQuotaForAQuotaBucketPerRegionPerSubscription( + com.azure.resourcemanager.loadtesting.LoadTestManager manager) { + manager.resourceProviders().getQuotaWithResponse("westus", "testQuotaBucket", com.azure.core.util.Context.NONE); } } ``` -### LoadTests_GetByResourceGroup +### ResourceProvider_CreateOrUpdateLoadtest ```java /** - * Samples for LoadTests GetByResourceGroup. + * Samples for ResourceProvider List. */ -public final class LoadTestsGetByResourceGroupSamples { +public final class ResourceProviderListSamples { /* - * x-ms-original-file: - * specification/loadtestservice/resource-manager/Microsoft.LoadTestService/stable/2022-12-01/examples/LoadTests_Get - * .json + * x-ms-original-file: 2024-12-01-preview/LoadTests_ListBySubscription.json */ /** - * Sample code: Get a LoadTestResource. + * Sample code: List LoadTestResource resources by subscription ID. * * @param manager Entry point to LoadTestManager. */ - public static void getALoadTestResource(com.azure.resourcemanager.loadtesting.LoadTestManager manager) { - manager.loadTests().getByResourceGroupWithResponse("dummyrg", "myLoadTest", com.azure.core.util.Context.NONE); + public static void + listLoadTestResourceResourcesBySubscriptionID(com.azure.resourcemanager.loadtesting.LoadTestManager manager) { + manager.resourceProviders().list(com.azure.core.util.Context.NONE); } } ``` -### LoadTests_List +### ResourceProvider_Delete ```java /** - * Samples for LoadTests List. + * Samples for ResourceProvider ListByResourceGroup. */ -public final class LoadTestsListSamples { +public final class ResourceProviderListByResourceGroupSamples { /* - * x-ms-original-file: - * specification/loadtestservice/resource-manager/Microsoft.LoadTestService/stable/2022-12-01/examples/ - * LoadTests_ListBySubscription.json + * x-ms-original-file: 2024-12-01-preview/LoadTests_ListByResourceGroup.json */ /** - * Sample code: List LoadTestResource resources by subscription ID. + * Sample code: List LoadTestResource resources by resource group. * * @param manager Entry point to LoadTestManager. */ public static void - listLoadTestResourceResourcesBySubscriptionID(com.azure.resourcemanager.loadtesting.LoadTestManager manager) { - manager.loadTests().list(com.azure.core.util.Context.NONE); + listLoadTestResourceResourcesByResourceGroup(com.azure.resourcemanager.loadtesting.LoadTestManager manager) { + manager.resourceProviders().listByResourceGroup("dummyrg", com.azure.core.util.Context.NONE); } } ``` -### LoadTests_ListByResourceGroup +### ResourceProvider_GetByResourceGroup ```java /** - * Samples for LoadTests ListByResourceGroup. + * Samples for ResourceProvider ListQuota. */ -public final class LoadTestsListByResourceGroupSamples { +public final class ResourceProviderListQuotaSamples { /* - * x-ms-original-file: - * specification/loadtestservice/resource-manager/Microsoft.LoadTestService/stable/2022-12-01/examples/ - * LoadTests_ListByResourceGroup.json + * x-ms-original-file: 2024-12-01-preview/Quotas_List.json */ /** - * Sample code: List LoadTestResource resources by resource group. + * Sample code: List quotas for a given subscription Id. * * @param manager Entry point to LoadTestManager. */ public static void - listLoadTestResourceResourcesByResourceGroup(com.azure.resourcemanager.loadtesting.LoadTestManager manager) { - manager.loadTests().listByResourceGroup("dummyrg", com.azure.core.util.Context.NONE); + listQuotasForAGivenSubscriptionId(com.azure.resourcemanager.loadtesting.LoadTestManager manager) { + manager.resourceProviders().listQuota("westus", com.azure.core.util.Context.NONE); } } ``` -### LoadTests_ListOutboundNetworkDependenciesEndpoints +### ResourceProvider_GetQuota ```java /** - * Samples for LoadTests ListOutboundNetworkDependenciesEndpoints. + * Samples for ResourceProvider OutboundNetworkDependenciesEndpoints. */ -public final class LoadTestsListOutboundNetworkDependenciesEndpointsSamples { +public final class ResourceProviderOutboundNetworkDependenciesEndpointsSamples { /* - * x-ms-original-file: - * specification/loadtestservice/resource-manager/Microsoft.LoadTestService/stable/2022-12-01/examples/ - * LoadTests_ListOutboundNetworkDependenciesEndpoints.json + * x-ms-original-file: 2024-12-01-preview/LoadTests_ListOutboundNetworkDependenciesEndpoints.json */ /** * Sample code: Lists the endpoints that agents may call as part of load testing. @@ -160,76 +118,106 @@ public final class LoadTestsListOutboundNetworkDependenciesEndpointsSamples { */ public static void listsTheEndpointsThatAgentsMayCallAsPartOfLoadTesting( com.azure.resourcemanager.loadtesting.LoadTestManager manager) { - manager.loadTests() - .listOutboundNetworkDependenciesEndpoints("default-azureloadtest-japaneast", "sampleloadtest", + manager.resourceProviders() + .outboundNetworkDependenciesEndpoints("default-azureloadtest-japaneast", "sampleloadtest", com.azure.core.util.Context.NONE); } } ``` -### LoadTests_Update +### ResourceProvider_List ```java -import com.azure.resourcemanager.loadtesting.models.LoadTestResource; +import com.azure.resourcemanager.loadtesting.models.EncryptionProperties; +import com.azure.resourcemanager.loadtesting.models.EncryptionPropertiesIdentity; +import com.azure.resourcemanager.loadtesting.models.LoadTestProperties; +import com.azure.resourcemanager.loadtesting.models.ManagedServiceIdentity; +import com.azure.resourcemanager.loadtesting.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.loadtesting.models.Type; +import com.azure.resourcemanager.loadtesting.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; /** - * Samples for LoadTests Update. + * Samples for ResourceProvider CreateOrUpdateLoadtest. */ -public final class LoadTestsUpdateSamples { +public final class ResourceProviderCreateOrUpdateLoadtestSamples { /* - * x-ms-original-file: - * specification/loadtestservice/resource-manager/Microsoft.LoadTestService/stable/2022-12-01/examples/ - * LoadTests_Update.json + * x-ms-original-file: 2024-12-01-preview/LoadTests_CreateOrUpdate.json */ /** - * Sample code: Update a LoadTestResource. + * Sample code: Create a LoadTestResource. * * @param manager Entry point to LoadTestManager. */ - public static void updateALoadTestResource(com.azure.resourcemanager.loadtesting.LoadTestManager manager) { - LoadTestResource resource = manager.loadTests() - .getByResourceGroupWithResponse("dummyrg", "myLoadTest", com.azure.core.util.Context.NONE) - .getValue(); - resource.update().apply(); + public static void createALoadTestResource(com.azure.resourcemanager.loadtesting.LoadTestManager manager) { + manager.resourceProviders() + .define("myLoadTest") + .withRegion("westus") + .withExistingResourceGroup("dummyrg") + .withTags(mapOf("Team", "Dev Exp")) + .withProperties(new LoadTestProperties().withDescription("This is new load test resource") + .withEncryption(new EncryptionProperties().withIdentity(new EncryptionPropertiesIdentity() + .withType(Type.USER_ASSIGNED) + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1")) + .withKeyUrl("fakeTokenPlaceholder"))) + .withIdentity(new ManagedServiceIdentity() + .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1", + new UserAssignedIdentity()))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } } ``` -### Operations_List +### ResourceProvider_ListByResourceGroup ```java /** - * Samples for Operations List. + * Samples for ResourceProvider GetByResourceGroup. */ -public final class OperationsListSamples { +public final class ResourceProviderGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/loadtestservice/resource-manager/Microsoft.LoadTestService/stable/2022-12-01/examples/ - * Operations_List.json + * x-ms-original-file: 2024-12-01-preview/LoadTests_Get.json */ /** - * Sample code: List the operations for the provider. + * Sample code: Get a LoadTestResource. * * @param manager Entry point to LoadTestManager. */ - public static void listTheOperationsForTheProvider(com.azure.resourcemanager.loadtesting.LoadTestManager manager) { - manager.operations().list(com.azure.core.util.Context.NONE); + public static void getALoadTestResource(com.azure.resourcemanager.loadtesting.LoadTestManager manager) { + manager.resourceProviders() + .getByResourceGroupWithResponse("dummyrg", "myLoadTest", com.azure.core.util.Context.NONE); } } ``` -### Quotas_CheckAvailability +### ResourceProvider_ListQuota ```java +import com.azure.resourcemanager.loadtesting.models.QuotaBucketRequest; +import com.azure.resourcemanager.loadtesting.models.QuotaBucketRequestPropertiesDimensions; /** - * Samples for Quotas CheckAvailability. + * Samples for ResourceProvider CheckAvailabilityQuota. */ -public final class QuotasCheckAvailabilitySamples { +public final class ResourceProviderCheckAvailabilityQuotaSamples { /* - * x-ms-original-file: - * specification/loadtestservice/resource-manager/Microsoft.LoadTestService/stable/2022-12-01/examples/ - * Quotas_CheckAvailability.json + * x-ms-original-file: 2024-12-01-preview/Quotas_CheckAvailability.json */ /** * Sample code: Check Quota Availability on quota bucket per region per subscription. @@ -238,56 +226,94 @@ public final class QuotasCheckAvailabilitySamples { */ public static void checkQuotaAvailabilityOnQuotaBucketPerRegionPerSubscription( com.azure.resourcemanager.loadtesting.LoadTestManager manager) { - manager.quotas() - .checkAvailabilityWithResponse("westus", "testQuotaBucket", null, com.azure.core.util.Context.NONE); + manager.resourceProviders() + .checkAvailabilityQuotaWithResponse("westus", "testQuotaBucket", + new QuotaBucketRequest().withCurrentUsage(20) + .withCurrentQuota(40) + .withNewQuota(50) + .withDimensions( + new QuotaBucketRequestPropertiesDimensions().withSubscriptionId("testsubscriptionId") + .withLocation("westus")), + com.azure.core.util.Context.NONE); } } ``` -### Quotas_Get +### ResourceProvider_OutboundNetworkDependenciesEndpoints ```java /** - * Samples for Quotas Get. + * Samples for ResourceProvider Delete. */ -public final class QuotasGetSamples { +public final class ResourceProviderDeleteSamples { /* - * x-ms-original-file: - * specification/loadtestservice/resource-manager/Microsoft.LoadTestService/stable/2022-12-01/examples/Quotas_Get. - * json + * x-ms-original-file: 2024-12-01-preview/LoadTests_Delete.json */ /** - * Sample code: Get the available quota for a quota bucket per region per subscription. + * Sample code: Delete a LoadTestResource. * * @param manager Entry point to LoadTestManager. */ - public static void getTheAvailableQuotaForAQuotaBucketPerRegionPerSubscription( - com.azure.resourcemanager.loadtesting.LoadTestManager manager) { - manager.quotas().getWithResponse("westus", "testQuotaBucket", com.azure.core.util.Context.NONE); + public static void deleteALoadTestResource(com.azure.resourcemanager.loadtesting.LoadTestManager manager) { + manager.resourceProviders().delete("dummyrg", "myLoadTest", com.azure.core.util.Context.NONE); } } ``` -### Quotas_List +### ResourceProvider_UpdateLoadtest ```java +import com.azure.resourcemanager.loadtesting.models.EncryptionProperties; +import com.azure.resourcemanager.loadtesting.models.EncryptionPropertiesIdentity; +import com.azure.resourcemanager.loadtesting.models.LoadTestResource; +import com.azure.resourcemanager.loadtesting.models.LoadTestResourceUpdateProperties; +import com.azure.resourcemanager.loadtesting.models.ManagedServiceIdentity; +import com.azure.resourcemanager.loadtesting.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.loadtesting.models.Type; +import com.azure.resourcemanager.loadtesting.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; + /** - * Samples for Quotas List. + * Samples for ResourceProvider UpdateLoadtest. */ -public final class QuotasListSamples { +public final class ResourceProviderUpdateLoadtestSamples { /* - * x-ms-original-file: - * specification/loadtestservice/resource-manager/Microsoft.LoadTestService/stable/2022-12-01/examples/Quotas_List. - * json + * x-ms-original-file: 2024-12-01-preview/LoadTests_Update.json */ /** - * Sample code: List quotas for a given subscription Id. + * Sample code: Update a LoadTestResource. * * @param manager Entry point to LoadTestManager. */ - public static void - listQuotasForAGivenSubscriptionId(com.azure.resourcemanager.loadtesting.LoadTestManager manager) { - manager.quotas().list("westus", com.azure.core.util.Context.NONE); + public static void updateALoadTestResource(com.azure.resourcemanager.loadtesting.LoadTestManager manager) { + LoadTestResource resource = manager.resourceProviders() + .getByResourceGroupWithResponse("dummyrg", "myLoadTest", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("Team", "Dev Exp", "Division", "LT")) + .withIdentity(new ManagedServiceIdentity() + .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1", + new UserAssignedIdentity()))) + .withProperties(new LoadTestResourceUpdateProperties().withDescription("This is new load test resource") + .withEncryption(new EncryptionProperties() + .withIdentity(new EncryptionPropertiesIdentity().withType(Type.SYSTEM_ASSIGNED)) + .withKeyUrl("fakeTokenPlaceholder"))) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } } ``` diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/pom.xml b/sdk/loadtesting/azure-resourcemanager-loadtesting/pom.xml index 41bedac9c75b..65850d345935 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/pom.xml +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/pom.xml @@ -1,7 +1,7 @@ 4.0.0 @@ -17,8 +17,8 @@ 1.2.0-beta.1 jar - Microsoft Azure SDK for LoadTest Management - This package contains Microsoft Azure SDK for LoadTest Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. LoadTest client provides access to LoadTest Resource and it's status operations. Package tag package-2022-12-01. + Microsoft Azure SDK for Load Test Management + This package contains Microsoft Azure SDK for Load Test Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. LoadTest client provides access to LoadTest Resource and it's status operations. https://github.com/Azure/azure-sdk-for-java @@ -45,7 +45,6 @@ UTF-8 0 0 - false true diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/LoadTestManager.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/LoadTestManager.java index c2c72bcc3c5a..aa0c1cbb7a0d 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/LoadTestManager.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/LoadTestManager.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting; @@ -22,19 +22,17 @@ import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.loadtesting.fluent.LoadTestClient; -import com.azure.resourcemanager.loadtesting.implementation.LoadTestClientBuilder; -import com.azure.resourcemanager.loadtesting.implementation.LoadTestsImpl; -import com.azure.resourcemanager.loadtesting.implementation.OperationsImpl; -import com.azure.resourcemanager.loadtesting.implementation.QuotasImpl; -import com.azure.resourcemanager.loadtesting.models.LoadTests; -import com.azure.resourcemanager.loadtesting.models.Operations; -import com.azure.resourcemanager.loadtesting.models.Quotas; +import com.azure.resourcemanager.loadtesting.fluent.LoadTestMgmtClient; +import com.azure.resourcemanager.loadtesting.implementation.LoadTestMgmtClientBuilder; +import com.azure.resourcemanager.loadtesting.implementation.ResourceProvidersImpl; +import com.azure.resourcemanager.loadtesting.models.ResourceProviders; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; @@ -43,18 +41,14 @@ * LoadTest client provides access to LoadTest Resource and it's status operations. */ public final class LoadTestManager { - private Operations operations; + private ResourceProviders resourceProviders; - private LoadTests loadTests; - - private Quotas quotas; - - private final LoadTestClient clientObject; + private final LoadTestMgmtClient clientObject; private LoadTestManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); - this.clientObject = new LoadTestClientBuilder().pipeline(httpPipeline) + this.clientObject = new LoadTestMgmtClientBuilder().pipeline(httpPipeline) .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) .subscriptionId(profile.getSubscriptionId()) .defaultPollInterval(defaultPollInterval) @@ -62,11 +56,11 @@ private LoadTestManager(HttpPipeline httpPipeline, AzureProfile profile, Duratio } /** - * Creates an instance of LoadTest service API entry point. + * Creates an instance of Load Test service API entry point. * * @param credential the credential to use. * @param profile the Azure profile for client. - * @return the LoadTest service API instance. + * @return the Load Test service API instance. */ public static LoadTestManager authenticate(TokenCredential credential, AzureProfile profile) { Objects.requireNonNull(credential, "'credential' cannot be null."); @@ -75,11 +69,11 @@ public static LoadTestManager authenticate(TokenCredential credential, AzureProf } /** - * Creates an instance of LoadTest service API entry point. + * Creates an instance of Load Test service API entry point. * * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. * @param profile the Azure profile for client. - * @return the LoadTest service API instance. + * @return the Load Test service API instance. */ public static LoadTestManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); @@ -101,6 +95,9 @@ public static Configurable configure() { */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-loadtesting.properties"); private HttpClient httpClient; private HttpLogOptions httpLogOptions; @@ -198,22 +195,24 @@ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { } /** - * Creates an instance of LoadTest service API entry point. + * Creates an instance of Load Test service API entry point. * * @param credential the credential to use. * @param profile the Azure profile for client. - * @return the LoadTest service API instance. + * @return the Load Test service API instance. */ public LoadTestManager authenticate(TokenCredential credential, AzureProfile profile) { Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + StringBuilder userAgentBuilder = new StringBuilder(); userAgentBuilder.append("azsdk-java") .append("-") .append("com.azure.resourcemanager.loadtesting") .append("/") - .append("1.1.0"); + .append(clientVersion); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -260,48 +259,24 @@ public LoadTestManager authenticate(TokenCredential credential, AzureProfile pro } /** - * Gets the resource collection API of Operations. - * - * @return Resource collection API of Operations. - */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(clientObject.getOperations(), this); - } - return operations; - } - - /** - * Gets the resource collection API of LoadTests. It manages LoadTestResource. - * - * @return Resource collection API of LoadTests. - */ - public LoadTests loadTests() { - if (this.loadTests == null) { - this.loadTests = new LoadTestsImpl(clientObject.getLoadTests(), this); - } - return loadTests; - } - - /** - * Gets the resource collection API of Quotas. + * Gets the resource collection API of ResourceProviders. It manages LoadTestResource. * - * @return Resource collection API of Quotas. + * @return Resource collection API of ResourceProviders. */ - public Quotas quotas() { - if (this.quotas == null) { - this.quotas = new QuotasImpl(clientObject.getQuotas(), this); + public ResourceProviders resourceProviders() { + if (this.resourceProviders == null) { + this.resourceProviders = new ResourceProvidersImpl(clientObject.getResourceProviders(), this); } - return quotas; + return resourceProviders; } /** - * Gets wrapped service client LoadTestClient providing direct access to the underlying auto-generated API + * Gets wrapped service client LoadTestMgmtClient providing direct access to the underlying auto-generated API * implementation, based on Azure REST API. * - * @return Wrapped service client LoadTestClient. + * @return Wrapped service client LoadTestMgmtClient. */ - public LoadTestClient serviceClient() { + public LoadTestMgmtClient serviceClient() { return this.clientObject; } } diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/LoadTestClient.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/LoadTestMgmtClient.java similarity index 58% rename from sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/LoadTestClient.java rename to sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/LoadTestMgmtClient.java index 04bd36ed900b..b0c39c28548e 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/LoadTestClient.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/LoadTestMgmtClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.fluent; @@ -8,30 +8,30 @@ import java.time.Duration; /** - * The interface for LoadTestClient class. + * The interface for LoadTestMgmtClient class. */ -public interface LoadTestClient { +public interface LoadTestMgmtClient { /** - * Gets The ID of the target subscription. The value must be an UUID. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ String getEndpoint(); /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ String getApiVersion(); + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + /** * Gets The HTTP pipeline to send requests through. * @@ -47,23 +47,9 @@ public interface LoadTestClient { Duration getDefaultPollInterval(); /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - OperationsClient getOperations(); - - /** - * Gets the LoadTestsClient object to access its operations. - * - * @return the LoadTestsClient object. - */ - LoadTestsClient getLoadTests(); - - /** - * Gets the QuotasClient object to access its operations. + * Gets the ResourceProvidersClient object to access its operations. * - * @return the QuotasClient object. + * @return the ResourceProvidersClient object. */ - QuotasClient getQuotas(); + ResourceProvidersClient getResourceProviders(); } diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/OperationsClient.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/OperationsClient.java deleted file mode 100644 index 0eb93c74e637..000000000000 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/OperationsClient.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.loadtesting.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.loadtesting.fluent.models.OperationInner; - -/** - * An instance of this class provides access to all the operations defined in OperationsClient. - */ -public interface OperationsClient { - /** - * List the operations for the provider. - * - * @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 a list of REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List the operations for the provider. - * - * @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 a list of REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/QuotasClient.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/QuotasClient.java deleted file mode 100644 index bbac8ef58f39..000000000000 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/QuotasClient.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.loadtesting.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.loadtesting.fluent.models.CheckQuotaAvailabilityResponseInner; -import com.azure.resourcemanager.loadtesting.fluent.models.QuotaResourceInner; -import com.azure.resourcemanager.loadtesting.models.QuotaBucketRequest; - -/** - * An instance of this class provides access to all the operations defined in QuotasClient. - */ -public interface QuotasClient { - /** - * List quotas for a given subscription Id. - * - * @param location The name of the Azure region. - * @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 response of a QuotaResource list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String location); - - /** - * List quotas for a given subscription Id. - * - * @param location The name of the Azure region. - * @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 response of a QuotaResource list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String location, Context context); - - /** - * Get the available quota for a quota bucket per region per subscription. - * - * @param location The name of the Azure region. - * @param quotaBucketName The quota name. - * @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 available quota for a quota bucket per region per subscription along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String location, String quotaBucketName, Context context); - - /** - * Get the available quota for a quota bucket per region per subscription. - * - * @param location The name of the Azure region. - * @param quotaBucketName The quota name. - * @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 available quota for a quota bucket per region per subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - QuotaResourceInner get(String location, String quotaBucketName); - - /** - * Check Quota Availability on quota bucket per region per subscription. - * - * @param location The name of the Azure region. - * @param quotaBucketName The quota name. - * @param body The content of the action request. - * @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 check quota availability response object along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response checkAvailabilityWithResponse(String location, String quotaBucketName, - QuotaBucketRequest body, Context context); - - /** - * Check Quota Availability on quota bucket per region per subscription. - * - * @param location The name of the Azure region. - * @param quotaBucketName The quota name. - * @param body The content of the action request. - * @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 check quota availability response object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CheckQuotaAvailabilityResponseInner checkAvailability(String location, String quotaBucketName, - QuotaBucketRequest body); -} diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/LoadTestsClient.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/ResourceProvidersClient.java similarity index 67% rename from sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/LoadTestsClient.java rename to sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/ResourceProvidersClient.java index 0b923a7fa6b8..e508177fd4b2 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/LoadTestsClient.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/ResourceProvidersClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.fluent; @@ -11,14 +11,17 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.loadtesting.fluent.models.CheckQuotaAvailabilityResponseInner; import com.azure.resourcemanager.loadtesting.fluent.models.LoadTestResourceInner; import com.azure.resourcemanager.loadtesting.fluent.models.OutboundEnvironmentEndpointInner; -import com.azure.resourcemanager.loadtesting.models.LoadTestResourcePatchRequestBody; +import com.azure.resourcemanager.loadtesting.fluent.models.QuotaResourceInner; +import com.azure.resourcemanager.loadtesting.models.LoadTestResourceUpdate; +import com.azure.resourcemanager.loadtesting.models.QuotaBucketRequest; /** - * An instance of this class provides access to all the operations defined in LoadTestsClient. + * An instance of this class provides access to all the operations defined in ResourceProvidersClient. */ -public interface LoadTestsClient { +public interface ResourceProvidersClient { /** * List LoadTestResource resources by subscription ID. * @@ -99,22 +102,22 @@ Response getByResourceGroupWithResponse(String resourceGr * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param loadTestName Load Test name. - * @param resource Resource create parameters. + * @param loadTestResource Resource create parameters. * @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 loadTest details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, LoadTestResourceInner> beginCreateOrUpdate(String resourceGroupName, - String loadTestName, LoadTestResourceInner resource); + SyncPoller, LoadTestResourceInner> beginCreateOrUpdateLoadtest( + String resourceGroupName, String loadTestName, LoadTestResourceInner loadTestResource); /** * Create a LoadTestResource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param loadTestName Load Test name. - * @param resource Resource create parameters. + * @param loadTestResource Resource create parameters. * @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. @@ -122,29 +125,30 @@ SyncPoller, LoadTestResourceInner> beginCreate * @return the {@link SyncPoller} for polling of loadTest details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, LoadTestResourceInner> beginCreateOrUpdate(String resourceGroupName, - String loadTestName, LoadTestResourceInner resource, Context context); + SyncPoller, LoadTestResourceInner> beginCreateOrUpdateLoadtest( + String resourceGroupName, String loadTestName, LoadTestResourceInner loadTestResource, Context context); /** * Create a LoadTestResource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param loadTestName Load Test name. - * @param resource Resource create parameters. + * @param loadTestResource Resource create parameters. * @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 loadTest details. */ @ServiceMethod(returns = ReturnType.SINGLE) - LoadTestResourceInner createOrUpdate(String resourceGroupName, String loadTestName, LoadTestResourceInner resource); + LoadTestResourceInner createOrUpdateLoadtest(String resourceGroupName, String loadTestName, + LoadTestResourceInner loadTestResource); /** * Create a LoadTestResource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param loadTestName Load Test name. - * @param resource Resource create parameters. + * @param loadTestResource Resource create parameters. * @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. @@ -152,30 +156,30 @@ SyncPoller, LoadTestResourceInner> beginCreate * @return loadTest details. */ @ServiceMethod(returns = ReturnType.SINGLE) - LoadTestResourceInner createOrUpdate(String resourceGroupName, String loadTestName, LoadTestResourceInner resource, - Context context); + LoadTestResourceInner createOrUpdateLoadtest(String resourceGroupName, String loadTestName, + LoadTestResourceInner loadTestResource, Context context); /** * Update a LoadTestResource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param loadTestName Load Test name. - * @param properties The resource properties to be updated. + * @param loadTestResourcePatchRequestBody The resource properties to be updated. * @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 loadTest details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, LoadTestResourceInner> beginUpdate(String resourceGroupName, - String loadTestName, LoadTestResourcePatchRequestBody properties); + SyncPoller, LoadTestResourceInner> beginUpdateLoadtest(String resourceGroupName, + String loadTestName, LoadTestResourceUpdate loadTestResourcePatchRequestBody); /** * Update a LoadTestResource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param loadTestName Load Test name. - * @param properties The resource properties to be updated. + * @param loadTestResourcePatchRequestBody The resource properties to be updated. * @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. @@ -183,30 +187,30 @@ SyncPoller, LoadTestResourceInner> beginUpdate * @return the {@link SyncPoller} for polling of loadTest details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, LoadTestResourceInner> beginUpdate(String resourceGroupName, - String loadTestName, LoadTestResourcePatchRequestBody properties, Context context); + SyncPoller, LoadTestResourceInner> beginUpdateLoadtest(String resourceGroupName, + String loadTestName, LoadTestResourceUpdate loadTestResourcePatchRequestBody, Context context); /** * Update a LoadTestResource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param loadTestName Load Test name. - * @param properties The resource properties to be updated. + * @param loadTestResourcePatchRequestBody The resource properties to be updated. * @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 loadTest details. */ @ServiceMethod(returns = ReturnType.SINGLE) - LoadTestResourceInner update(String resourceGroupName, String loadTestName, - LoadTestResourcePatchRequestBody properties); + LoadTestResourceInner updateLoadtest(String resourceGroupName, String loadTestName, + LoadTestResourceUpdate loadTestResourcePatchRequestBody); /** * Update a LoadTestResource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param loadTestName Load Test name. - * @param properties The resource properties to be updated. + * @param loadTestResourcePatchRequestBody The resource properties to be updated. * @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. @@ -214,8 +218,8 @@ LoadTestResourceInner update(String resourceGroupName, String loadTestName, * @return loadTest details. */ @ServiceMethod(returns = ReturnType.SINGLE) - LoadTestResourceInner update(String resourceGroupName, String loadTestName, - LoadTestResourcePatchRequestBody properties, Context context); + LoadTestResourceInner updateLoadtest(String resourceGroupName, String loadTestName, + LoadTestResourceUpdate loadTestResourcePatchRequestBody, Context context); /** * Delete a LoadTestResource. @@ -280,7 +284,7 @@ LoadTestResourceInner update(String resourceGroupName, String loadTestName, * @return values returned by the List operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listOutboundNetworkDependenciesEndpoints(String resourceGroupName, + PagedIterable outboundNetworkDependenciesEndpoints(String resourceGroupName, String loadTestName); /** @@ -295,6 +299,89 @@ PagedIterable listOutboundNetworkDependenciesE * @return values returned by the List operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listOutboundNetworkDependenciesEndpoints(String resourceGroupName, + PagedIterable outboundNetworkDependenciesEndpoints(String resourceGroupName, String loadTestName, Context context); + + /** + * Get the available quota for a quota bucket per region per subscription. + * + * @param location The name of the Azure region. + * @param quotaBucketName The quota name. + * @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 available quota for a quota bucket per region per subscription along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getQuotaWithResponse(String location, String quotaBucketName, Context context); + + /** + * Get the available quota for a quota bucket per region per subscription. + * + * @param location The name of the Azure region. + * @param quotaBucketName The quota name. + * @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 available quota for a quota bucket per region per subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + QuotaResourceInner getQuota(String location, String quotaBucketName); + + /** + * List quotas for a given subscription Id. + * + * @param location The name of the Azure region. + * @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 response of a QuotaResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listQuota(String location); + + /** + * List quotas for a given subscription Id. + * + * @param location The name of the Azure region. + * @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 response of a QuotaResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listQuota(String location, Context context); + + /** + * Check Quota Availability on quota bucket per region per subscription. + * + * @param location The name of the Azure region. + * @param quotaBucketName The quota name. + * @param quotaBucketRequest The content of the action request. + * @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 check quota availability response object along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkAvailabilityQuotaWithResponse(String location, + String quotaBucketName, QuotaBucketRequest quotaBucketRequest, Context context); + + /** + * Check Quota Availability on quota bucket per region per subscription. + * + * @param location The name of the Azure region. + * @param quotaBucketName The quota name. + * @param quotaBucketRequest The content of the action request. + * @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 check quota availability response object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckQuotaAvailabilityResponseInner checkAvailabilityQuota(String location, String quotaBucketName, + QuotaBucketRequest quotaBucketRequest); } diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/models/CheckQuotaAvailabilityResponseInner.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/models/CheckQuotaAvailabilityResponseInner.java index 5516b8cc0043..253e5007e7a1 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/models/CheckQuotaAvailabilityResponseInner.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/models/CheckQuotaAvailabilityResponseInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -15,7 +15,7 @@ /** * Check quota availability response object. */ -@Fluent +@Immutable public final class CheckQuotaAvailabilityResponseInner implements JsonSerializable { /* @@ -48,7 +48,7 @@ public final class CheckQuotaAvailabilityResponseInner /** * Creates an instance of CheckQuotaAvailabilityResponseInner class. */ - public CheckQuotaAvailabilityResponseInner() { + private CheckQuotaAvailabilityResponseInner() { } /** @@ -107,20 +107,6 @@ public Boolean isAvailable() { return this.innerProperties() == null ? null : this.innerProperties().isAvailable(); } - /** - * Set the isAvailable property: True/False indicating whether the quota request be granted based on availability. - * - * @param isAvailable the isAvailable value to set. - * @return the CheckQuotaAvailabilityResponseInner object itself. - */ - public CheckQuotaAvailabilityResponseInner withIsAvailable(Boolean isAvailable) { - if (this.innerProperties() == null) { - this.innerProperties = new CheckQuotaAvailabilityResponseProperties(); - } - this.innerProperties().withIsAvailable(isAvailable); - return this; - } - /** * Get the availabilityStatus property: Message indicating additional details to add to quota support request. * @@ -130,20 +116,6 @@ public String availabilityStatus() { return this.innerProperties() == null ? null : this.innerProperties().availabilityStatus(); } - /** - * Set the availabilityStatus property: Message indicating additional details to add to quota support request. - * - * @param availabilityStatus the availabilityStatus value to set. - * @return the CheckQuotaAvailabilityResponseInner object itself. - */ - public CheckQuotaAvailabilityResponseInner withAvailabilityStatus(String availabilityStatus) { - if (this.innerProperties() == null) { - this.innerProperties = new CheckQuotaAvailabilityResponseProperties(); - } - this.innerProperties().withAvailabilityStatus(availabilityStatus); - return this; - } - /** * Validates the instance. * diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/models/CheckQuotaAvailabilityResponseProperties.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/models/CheckQuotaAvailabilityResponseProperties.java index 3798fb5adad3..a893aa740a93 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/models/CheckQuotaAvailabilityResponseProperties.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/models/CheckQuotaAvailabilityResponseProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Check quota availability response properties. */ -@Fluent +@Immutable public final class CheckQuotaAvailabilityResponseProperties implements JsonSerializable { /* @@ -30,7 +30,7 @@ public final class CheckQuotaAvailabilityResponseProperties /** * Creates an instance of CheckQuotaAvailabilityResponseProperties class. */ - public CheckQuotaAvailabilityResponseProperties() { + private CheckQuotaAvailabilityResponseProperties() { } /** @@ -42,17 +42,6 @@ public Boolean isAvailable() { return this.isAvailable; } - /** - * Set the isAvailable property: True/False indicating whether the quota request be granted based on availability. - * - * @param isAvailable the isAvailable value to set. - * @return the CheckQuotaAvailabilityResponseProperties object itself. - */ - public CheckQuotaAvailabilityResponseProperties withIsAvailable(Boolean isAvailable) { - this.isAvailable = isAvailable; - return this; - } - /** * Get the availabilityStatus property: Message indicating additional details to add to quota support request. * @@ -62,17 +51,6 @@ public String availabilityStatus() { return this.availabilityStatus; } - /** - * Set the availabilityStatus property: Message indicating additional details to add to quota support request. - * - * @param availabilityStatus the availabilityStatus value to set. - * @return the CheckQuotaAvailabilityResponseProperties object itself. - */ - public CheckQuotaAvailabilityResponseProperties withAvailabilityStatus(String availabilityStatus) { - this.availabilityStatus = availabilityStatus; - return this; - } - /** * Validates the instance. * diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/models/LoadTestResourceInner.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/models/LoadTestResourceInner.java index c71d532575cd..97b254334bca 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/models/LoadTestResourceInner.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/models/LoadTestResourceInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.fluent.models; @@ -10,9 +10,8 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.loadtesting.models.EncryptionProperties; +import com.azure.resourcemanager.loadtesting.models.LoadTestProperties; import com.azure.resourcemanager.loadtesting.models.ManagedServiceIdentity; -import com.azure.resourcemanager.loadtesting.models.ResourceState; import java.io.IOException; import java.util.Map; @@ -24,7 +23,7 @@ public final class LoadTestResourceInner extends Resource { /* * The resource-specific properties for this resource. */ - private LoadTestProperties innerProperties; + private LoadTestProperties properties; /* * The managed service identities assigned to this resource. @@ -58,12 +57,23 @@ public LoadTestResourceInner() { } /** - * Get the innerProperties property: The resource-specific properties for this resource. + * Get the properties property: The resource-specific properties for this resource. * - * @return the innerProperties value. + * @return the properties value. */ - private LoadTestProperties innerProperties() { - return this.innerProperties; + public LoadTestProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the LoadTestResourceInner object itself. + */ + public LoadTestResourceInner withProperties(LoadTestProperties properties) { + this.properties = properties; + return this; } /** @@ -143,78 +153,14 @@ public LoadTestResourceInner withTags(Map tags) { return this; } - /** - * Get the description property: Description of the resource. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: Description of the resource. - * - * @param description the description value to set. - * @return the LoadTestResourceInner object itself. - */ - public LoadTestResourceInner withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new LoadTestProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the provisioningState property: Resource provisioning state. - * - * @return the provisioningState value. - */ - public ResourceState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the dataPlaneUri property: Resource data plane URI. - * - * @return the dataPlaneUri value. - */ - public String dataPlaneUri() { - return this.innerProperties() == null ? null : this.innerProperties().dataPlaneUri(); - } - - /** - * Get the encryption property: CMK Encryption property. - * - * @return the encryption value. - */ - public EncryptionProperties encryption() { - return this.innerProperties() == null ? null : this.innerProperties().encryption(); - } - - /** - * Set the encryption property: CMK Encryption property. - * - * @param encryption the encryption value to set. - * @return the LoadTestResourceInner object itself. - */ - public LoadTestResourceInner withEncryption(EncryptionProperties encryption) { - if (this.innerProperties() == null) { - this.innerProperties = new LoadTestProperties(); - } - this.innerProperties().withEncryption(encryption); - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } if (identity() != null) { identity().validate(); @@ -229,7 +175,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); jsonWriter.writeJsonField("identity", this.identity); return jsonWriter.writeEndObject(); } @@ -262,7 +208,7 @@ public static LoadTestResourceInner fromJson(JsonReader jsonReader) throws IOExc Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedLoadTestResourceInner.withTags(tags); } else if ("properties".equals(fieldName)) { - deserializedLoadTestResourceInner.innerProperties = LoadTestProperties.fromJson(reader); + deserializedLoadTestResourceInner.properties = LoadTestProperties.fromJson(reader); } else if ("identity".equals(fieldName)) { deserializedLoadTestResourceInner.identity = ManagedServiceIdentity.fromJson(reader); } else if ("systemData".equals(fieldName)) { diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/models/OperationInner.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/models/OperationInner.java deleted file mode 100644 index b28817582e7c..000000000000 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/models/OperationInner.java +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.loadtesting.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.loadtesting.models.ActionType; -import com.azure.resourcemanager.loadtesting.models.OperationDisplay; -import com.azure.resourcemanager.loadtesting.models.Origin; -import java.io.IOException; - -/** - * REST API Operation - * - * Details of a REST API operation, returned from the Resource Provider Operations API. - */ -@Fluent -public final class OperationInner implements JsonSerializable { - /* - * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" - */ - private String name; - - /* - * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for - * ARM/control-plane operations. - */ - private Boolean isDataAction; - - /* - * Localized display information for this particular operation. - */ - private OperationDisplay display; - - /* - * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default - * value is "user,system" - */ - private Origin origin; - - /* - * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - */ - private ActionType actionType; - - /** - * Creates an instance of OperationInner class. - */ - public OperationInner() { - } - - /** - * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane - * operations and "false" for ARM/control-plane operations. - * - * @return the isDataAction value. - */ - public Boolean isDataAction() { - return this.isDataAction; - } - - /** - * Get the display property: Localized display information for this particular operation. - * - * @return the display value. - */ - public OperationDisplay display() { - return this.display; - } - - /** - * Set the display property: Localized display information for this particular operation. - * - * @param display the display value to set. - * @return the OperationInner object itself. - */ - public OperationInner withDisplay(OperationDisplay display) { - this.display = display; - return this; - } - - /** - * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and - * audit logs UX. Default value is "user,system". - * - * @return the origin value. - */ - public Origin origin() { - return this.origin; - } - - /** - * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal - * only APIs. - * - * @return the actionType value. - */ - public ActionType actionType() { - return this.actionType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (display() != null) { - display().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("display", this.display); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationInner if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the OperationInner. - */ - public static OperationInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationInner deserializedOperationInner = new OperationInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedOperationInner.name = reader.getString(); - } else if ("isDataAction".equals(fieldName)) { - deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean); - } else if ("display".equals(fieldName)) { - deserializedOperationInner.display = OperationDisplay.fromJson(reader); - } else if ("origin".equals(fieldName)) { - deserializedOperationInner.origin = Origin.fromString(reader.getString()); - } else if ("actionType".equals(fieldName)) { - deserializedOperationInner.actionType = ActionType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationInner; - }); - } -} diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/models/OutboundEnvironmentEndpointInner.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/models/OutboundEnvironmentEndpointInner.java index 647df33911ed..c559e8463557 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/models/OutboundEnvironmentEndpointInner.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/models/OutboundEnvironmentEndpointInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.fluent.models; @@ -31,7 +31,7 @@ public final class OutboundEnvironmentEndpointInner implements JsonSerializable< /** * Creates an instance of OutboundEnvironmentEndpointInner class. */ - public OutboundEnvironmentEndpointInner() { + private OutboundEnvironmentEndpointInner() { } /** diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/models/QuotaBucketRequestProperties.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/models/QuotaBucketRequestProperties.java index 00c07a85f30b..e4a4e2b8e3ed 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/models/QuotaBucketRequestProperties.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/models/QuotaBucketRequestProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.fluent.models; diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/models/QuotaResourceInner.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/models/QuotaResourceInner.java index 0e58a78e4c68..a91376c643e3 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/models/QuotaResourceInner.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/models/QuotaResourceInner.java @@ -1,27 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.loadtesting.models.ResourceState; +import com.azure.resourcemanager.loadtesting.models.QuotaResourceProperties; import java.io.IOException; /** * Quota bucket details object. */ -@Fluent +@Immutable public final class QuotaResourceInner extends ProxyResource { /* * The resource-specific properties for this resource. */ - private QuotaResourceProperties innerProperties; + private QuotaResourceProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -46,16 +46,16 @@ public final class QuotaResourceInner extends ProxyResource { /** * Creates an instance of QuotaResourceInner class. */ - public QuotaResourceInner() { + private QuotaResourceInner() { } /** - * Get the innerProperties property: The resource-specific properties for this resource. + * Get the properties property: The resource-specific properties for this resource. * - * @return the innerProperties value. + * @return the properties value. */ - private QuotaResourceProperties innerProperties() { - return this.innerProperties; + public QuotaResourceProperties properties() { + return this.properties; } /** @@ -97,69 +97,14 @@ public String id() { return this.id; } - /** - * Get the limit property: Current quota limit of the quota bucket. - * - * @return the limit value. - */ - public Integer limit() { - return this.innerProperties() == null ? null : this.innerProperties().limit(); - } - - /** - * Set the limit property: Current quota limit of the quota bucket. - * - * @param limit the limit value to set. - * @return the QuotaResourceInner object itself. - */ - public QuotaResourceInner withLimit(Integer limit) { - if (this.innerProperties() == null) { - this.innerProperties = new QuotaResourceProperties(); - } - this.innerProperties().withLimit(limit); - return this; - } - - /** - * Get the usage property: Current quota usage of the quota bucket. - * - * @return the usage value. - */ - public Integer usage() { - return this.innerProperties() == null ? null : this.innerProperties().usage(); - } - - /** - * Set the usage property: Current quota usage of the quota bucket. - * - * @param usage the usage value to set. - * @return the QuotaResourceInner object itself. - */ - public QuotaResourceInner withUsage(Integer usage) { - if (this.innerProperties() == null) { - this.innerProperties = new QuotaResourceProperties(); - } - this.innerProperties().withUsage(usage); - return this; - } - - /** - * Get the provisioningState property: Resource provisioning state. - * - * @return the provisioningState value. - */ - public ResourceState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } @@ -169,7 +114,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -196,7 +141,7 @@ public static QuotaResourceInner fromJson(JsonReader jsonReader) throws IOExcept } else if ("type".equals(fieldName)) { deserializedQuotaResourceInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { - deserializedQuotaResourceInner.innerProperties = QuotaResourceProperties.fromJson(reader); + deserializedQuotaResourceInner.properties = QuotaResourceProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedQuotaResourceInner.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/models/package-info.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/models/package-info.java index a881e0228286..e1fe3ecccebe 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/models/package-info.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/models/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the inner data models for LoadTestClient. + * Package containing the inner data models for LoadTest. * LoadTest client provides access to LoadTest Resource and it's status operations. */ package com.azure.resourcemanager.loadtesting.fluent.models; diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/package-info.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/package-info.java index d43b42a48454..d2cabe69294d 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/package-info.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the service clients for LoadTestClient. + * Package containing the service clients for LoadTest. * LoadTest client provides access to LoadTest Resource and it's status operations. */ package com.azure.resourcemanager.loadtesting.fluent; diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/CheckQuotaAvailabilityResponseImpl.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/CheckQuotaAvailabilityResponseImpl.java index 4265a9a8e747..a347fea0f57b 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/CheckQuotaAvailabilityResponseImpl.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/CheckQuotaAvailabilityResponseImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.implementation; diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/LoadTestClientBuilder.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/LoadTestMgmtClientBuilder.java similarity index 68% rename from sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/LoadTestClientBuilder.java rename to sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/LoadTestMgmtClientBuilder.java index d9ef853fa2d1..cbeeeae8165f 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/LoadTestClientBuilder.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/LoadTestMgmtClientBuilder.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.implementation; @@ -15,39 +15,39 @@ import java.time.Duration; /** - * A builder for creating a new instance of the LoadTestClientImpl type. + * A builder for creating a new instance of the LoadTestMgmtClientImpl type. */ -@ServiceClientBuilder(serviceClients = { LoadTestClientImpl.class }) -public final class LoadTestClientBuilder { +@ServiceClientBuilder(serviceClients = { LoadTestMgmtClientImpl.class }) +public final class LoadTestMgmtClientBuilder { /* - * The ID of the target subscription. The value must be an UUID. + * Service host */ - private String subscriptionId; + private String endpoint; /** - * Sets The ID of the target subscription. The value must be an UUID. + * Sets Service host. * - * @param subscriptionId the subscriptionId value. - * @return the LoadTestClientBuilder. + * @param endpoint the endpoint value. + * @return the LoadTestMgmtClientBuilder. */ - public LoadTestClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; + public LoadTestMgmtClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; return this; } /* - * server parameter + * The ID of the target subscription. The value must be an UUID. */ - private String endpoint; + private String subscriptionId; /** - * Sets server parameter. + * Sets The ID of the target subscription. The value must be an UUID. * - * @param endpoint the endpoint value. - * @return the LoadTestClientBuilder. + * @param subscriptionId the subscriptionId value. + * @return the LoadTestMgmtClientBuilder. */ - public LoadTestClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; + public LoadTestMgmtClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; return this; } @@ -60,9 +60,9 @@ public LoadTestClientBuilder endpoint(String endpoint) { * Sets The environment to connect to. * * @param environment the environment value. - * @return the LoadTestClientBuilder. + * @return the LoadTestMgmtClientBuilder. */ - public LoadTestClientBuilder environment(AzureEnvironment environment) { + public LoadTestMgmtClientBuilder environment(AzureEnvironment environment) { this.environment = environment; return this; } @@ -76,9 +76,9 @@ public LoadTestClientBuilder environment(AzureEnvironment environment) { * Sets The HTTP pipeline to send requests through. * * @param pipeline the pipeline value. - * @return the LoadTestClientBuilder. + * @return the LoadTestMgmtClientBuilder. */ - public LoadTestClientBuilder pipeline(HttpPipeline pipeline) { + public LoadTestMgmtClientBuilder pipeline(HttpPipeline pipeline) { this.pipeline = pipeline; return this; } @@ -92,9 +92,9 @@ public LoadTestClientBuilder pipeline(HttpPipeline pipeline) { * Sets The default poll interval for long-running operation. * * @param defaultPollInterval the defaultPollInterval value. - * @return the LoadTestClientBuilder. + * @return the LoadTestMgmtClientBuilder. */ - public LoadTestClientBuilder defaultPollInterval(Duration defaultPollInterval) { + public LoadTestMgmtClientBuilder defaultPollInterval(Duration defaultPollInterval) { this.defaultPollInterval = defaultPollInterval; return this; } @@ -108,19 +108,19 @@ public LoadTestClientBuilder defaultPollInterval(Duration defaultPollInterval) { * Sets The serializer to serialize an object into a string. * * @param serializerAdapter the serializerAdapter value. - * @return the LoadTestClientBuilder. + * @return the LoadTestMgmtClientBuilder. */ - public LoadTestClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + public LoadTestMgmtClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { this.serializerAdapter = serializerAdapter; return this; } /** - * Builds an instance of LoadTestClientImpl with the provided parameters. + * Builds an instance of LoadTestMgmtClientImpl with the provided parameters. * - * @return an instance of LoadTestClientImpl. + * @return an instance of LoadTestMgmtClientImpl. */ - public LoadTestClientImpl buildClient() { + public LoadTestMgmtClientImpl buildClient() { String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; HttpPipeline localPipeline = (pipeline != null) @@ -131,8 +131,8 @@ public LoadTestClientImpl buildClient() { SerializerAdapter localSerializerAdapter = (serializerAdapter != null) ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); - LoadTestClientImpl client = new LoadTestClientImpl(localPipeline, localSerializerAdapter, - localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + LoadTestMgmtClientImpl client = new LoadTestMgmtClientImpl(localPipeline, localSerializerAdapter, + localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); return client; } } diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/LoadTestClientImpl.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/LoadTestMgmtClientImpl.java similarity index 80% rename from sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/LoadTestClientImpl.java rename to sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/LoadTestMgmtClientImpl.java index 93caab8a980a..0a636300a790 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/LoadTestClientImpl.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/LoadTestMgmtClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.implementation; @@ -23,10 +23,8 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.loadtesting.fluent.LoadTestClient; -import com.azure.resourcemanager.loadtesting.fluent.LoadTestsClient; -import com.azure.resourcemanager.loadtesting.fluent.OperationsClient; -import com.azure.resourcemanager.loadtesting.fluent.QuotasClient; +import com.azure.resourcemanager.loadtesting.fluent.LoadTestMgmtClient; +import com.azure.resourcemanager.loadtesting.fluent.ResourceProvidersClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -37,31 +35,17 @@ import reactor.core.publisher.Mono; /** - * Initializes a new instance of the LoadTestClientImpl type. + * Initializes a new instance of the LoadTestMgmtClientImpl type. */ -@ServiceClient(builder = LoadTestClientBuilder.class) -public final class LoadTestClientImpl implements LoadTestClient { +@ServiceClient(builder = LoadTestMgmtClientBuilder.class) +public final class LoadTestMgmtClientImpl implements LoadTestMgmtClient { /** - * The ID of the target subscription. The value must be an UUID. - */ - private final String subscriptionId; - - /** - * Gets The ID of the target subscription. The value must be an UUID. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** - * server parameter. + * Service host. */ private final String endpoint; /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -70,12 +54,12 @@ public String getEndpoint() { } /** - * Api Version. + * Version parameter. */ private final String apiVersion; /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ @@ -83,6 +67,20 @@ public String getApiVersion() { return this.apiVersion; } + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + /** * The HTTP pipeline to send requests through. */ @@ -126,68 +124,38 @@ public Duration getDefaultPollInterval() { } /** - * The OperationsClient object to access its operations. + * The ResourceProvidersClient object to access its operations. */ - private final OperationsClient operations; + private final ResourceProvidersClient resourceProviders; /** - * Gets the OperationsClient object to access its operations. + * Gets the ResourceProvidersClient object to access its operations. * - * @return the OperationsClient object. + * @return the ResourceProvidersClient object. */ - public OperationsClient getOperations() { - return this.operations; + public ResourceProvidersClient getResourceProviders() { + return this.resourceProviders; } /** - * The LoadTestsClient object to access its operations. - */ - private final LoadTestsClient loadTests; - - /** - * Gets the LoadTestsClient object to access its operations. - * - * @return the LoadTestsClient object. - */ - public LoadTestsClient getLoadTests() { - return this.loadTests; - } - - /** - * The QuotasClient object to access its operations. - */ - private final QuotasClient quotas; - - /** - * Gets the QuotasClient object to access its operations. - * - * @return the QuotasClient object. - */ - public QuotasClient getQuotas() { - return this.quotas; - } - - /** - * Initializes an instance of LoadTestClient client. + * Initializes an instance of LoadTestMgmtClient client. * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. + * @param endpoint Service host. * @param subscriptionId The ID of the target subscription. The value must be an UUID. - * @param endpoint server parameter. */ - LoadTestClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval, - AzureEnvironment environment, String subscriptionId, String endpoint) { + LoadTestMgmtClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval, + AzureEnvironment environment, String endpoint, String subscriptionId) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2022-12-01"; - this.operations = new OperationsClientImpl(this); - this.loadTests = new LoadTestsClientImpl(this); - this.quotas = new QuotasClientImpl(this); + this.subscriptionId = subscriptionId; + this.apiVersion = "2024-12-01-preview"; + this.resourceProviders = new ResourceProvidersClientImpl(this); } /** @@ -316,5 +284,5 @@ public Mono getBodyAsString(Charset charset) { } } - private static final ClientLogger LOGGER = new ClientLogger(LoadTestClientImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(LoadTestMgmtClientImpl.class); } diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/LoadTestResourceImpl.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/LoadTestResourceImpl.java index 6f1117689190..bd444c621750 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/LoadTestResourceImpl.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/LoadTestResourceImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.implementation; @@ -8,11 +8,11 @@ import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.loadtesting.fluent.models.LoadTestResourceInner; -import com.azure.resourcemanager.loadtesting.models.EncryptionProperties; +import com.azure.resourcemanager.loadtesting.models.LoadTestProperties; import com.azure.resourcemanager.loadtesting.models.LoadTestResource; -import com.azure.resourcemanager.loadtesting.models.LoadTestResourcePatchRequestBody; +import com.azure.resourcemanager.loadtesting.models.LoadTestResourceUpdate; +import com.azure.resourcemanager.loadtesting.models.LoadTestResourceUpdateProperties; import com.azure.resourcemanager.loadtesting.models.ManagedServiceIdentity; -import com.azure.resourcemanager.loadtesting.models.ResourceState; import java.util.Collections; import java.util.Map; @@ -47,6 +47,10 @@ public Map tags() { } } + public LoadTestProperties properties() { + return this.innerModel().properties(); + } + public ManagedServiceIdentity identity() { return this.innerModel().identity(); } @@ -55,22 +59,6 @@ public SystemData systemData() { return this.innerModel().systemData(); } - public String description() { - return this.innerModel().description(); - } - - public ResourceState provisioningState() { - return this.innerModel().provisioningState(); - } - - public String dataPlaneUri() { - return this.innerModel().dataPlaneUri(); - } - - public EncryptionProperties encryption() { - return this.innerModel().encryption(); - } - public Region region() { return Region.fromName(this.regionName()); } @@ -95,7 +83,7 @@ private com.azure.resourcemanager.loadtesting.LoadTestManager manager() { private String loadTestName; - private LoadTestResourcePatchRequestBody updateProperties; + private LoadTestResourceUpdate updateLoadTestResourcePatchRequestBody; public LoadTestResourceImpl withExistingResourceGroup(String resourceGroupName) { this.resourceGroupName = resourceGroupName; @@ -104,15 +92,15 @@ public LoadTestResourceImpl withExistingResourceGroup(String resourceGroupName) public LoadTestResource create() { this.innerObject = serviceManager.serviceClient() - .getLoadTests() - .createOrUpdate(resourceGroupName, loadTestName, this.innerModel(), Context.NONE); + .getResourceProviders() + .createOrUpdateLoadtest(resourceGroupName, loadTestName, this.innerModel(), Context.NONE); return this; } public LoadTestResource create(Context context) { this.innerObject = serviceManager.serviceClient() - .getLoadTests() - .createOrUpdate(resourceGroupName, loadTestName, this.innerModel(), context); + .getResourceProviders() + .createOrUpdateLoadtest(resourceGroupName, loadTestName, this.innerModel(), context); return this; } @@ -123,21 +111,21 @@ public LoadTestResource create(Context context) { } public LoadTestResourceImpl update() { - this.updateProperties = new LoadTestResourcePatchRequestBody(); + this.updateLoadTestResourcePatchRequestBody = new LoadTestResourceUpdate(); return this; } public LoadTestResource apply() { this.innerObject = serviceManager.serviceClient() - .getLoadTests() - .update(resourceGroupName, loadTestName, updateProperties, Context.NONE); + .getResourceProviders() + .updateLoadtest(resourceGroupName, loadTestName, updateLoadTestResourcePatchRequestBody, Context.NONE); return this; } public LoadTestResource apply(Context context) { this.innerObject = serviceManager.serviceClient() - .getLoadTests() - .update(resourceGroupName, loadTestName, updateProperties, context); + .getResourceProviders() + .updateLoadtest(resourceGroupName, loadTestName, updateLoadTestResourcePatchRequestBody, context); return this; } @@ -151,7 +139,7 @@ public LoadTestResource apply(Context context) { public LoadTestResource refresh() { this.innerObject = serviceManager.serviceClient() - .getLoadTests() + .getResourceProviders() .getByResourceGroupWithResponse(resourceGroupName, loadTestName, Context.NONE) .getValue(); return this; @@ -159,7 +147,7 @@ public LoadTestResource refresh() { public LoadTestResource refresh(Context context) { this.innerObject = serviceManager.serviceClient() - .getLoadTests() + .getResourceProviders() .getByResourceGroupWithResponse(resourceGroupName, loadTestName, context) .getValue(); return this; @@ -180,39 +168,29 @@ public LoadTestResourceImpl withTags(Map tags) { this.innerModel().withTags(tags); return this; } else { - this.updateProperties.withTags(tags); + this.updateLoadTestResourcePatchRequestBody.withTags(tags); return this; } } - public LoadTestResourceImpl withIdentity(ManagedServiceIdentity identity) { - if (isInCreateMode()) { - this.innerModel().withIdentity(identity); - return this; - } else { - this.updateProperties.withIdentity(identity); - return this; - } + public LoadTestResourceImpl withProperties(LoadTestProperties properties) { + this.innerModel().withProperties(properties); + return this; } - public LoadTestResourceImpl withDescription(String description) { + public LoadTestResourceImpl withIdentity(ManagedServiceIdentity identity) { if (isInCreateMode()) { - this.innerModel().withDescription(description); + this.innerModel().withIdentity(identity); return this; } else { - this.updateProperties.withDescription(description); + this.updateLoadTestResourcePatchRequestBody.withIdentity(identity); return this; } } - public LoadTestResourceImpl withEncryption(EncryptionProperties encryption) { - if (isInCreateMode()) { - this.innerModel().withEncryption(encryption); - return this; - } else { - this.updateProperties.withEncryption(encryption); - return this; - } + public LoadTestResourceImpl withProperties(LoadTestResourceUpdateProperties properties) { + this.updateLoadTestResourcePatchRequestBody.withProperties(properties); + return this; } private boolean isInCreateMode() { diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/OperationImpl.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/OperationImpl.java deleted file mode 100644 index ab22144c3b9d..000000000000 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/OperationImpl.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.loadtesting.implementation; - -import com.azure.resourcemanager.loadtesting.fluent.models.OperationInner; -import com.azure.resourcemanager.loadtesting.models.ActionType; -import com.azure.resourcemanager.loadtesting.models.Operation; -import com.azure.resourcemanager.loadtesting.models.OperationDisplay; -import com.azure.resourcemanager.loadtesting.models.Origin; - -public final class OperationImpl implements Operation { - private OperationInner innerObject; - - private final com.azure.resourcemanager.loadtesting.LoadTestManager serviceManager; - - OperationImpl(OperationInner innerObject, com.azure.resourcemanager.loadtesting.LoadTestManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String name() { - return this.innerModel().name(); - } - - public Boolean isDataAction() { - return this.innerModel().isDataAction(); - } - - public OperationDisplay display() { - return this.innerModel().display(); - } - - public Origin origin() { - return this.innerModel().origin(); - } - - public ActionType actionType() { - return this.innerModel().actionType(); - } - - public OperationInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.loadtesting.LoadTestManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/OperationsClientImpl.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/OperationsClientImpl.java deleted file mode 100644 index ab3661c3a973..000000000000 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/OperationsClientImpl.java +++ /dev/null @@ -1,235 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.loadtesting.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.loadtesting.fluent.OperationsClient; -import com.azure.resourcemanager.loadtesting.fluent.models.OperationInner; -import com.azure.resourcemanager.loadtesting.models.OperationListResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in OperationsClient. - */ -public final class OperationsClientImpl implements OperationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final OperationsService service; - - /** - * The service client containing this operation class. - */ - private final LoadTestClientImpl client; - - /** - * Initializes an instance of OperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OperationsClientImpl(LoadTestClientImpl client) { - this.service - = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for LoadTestClientOperations to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "LoadTestClientOperat") - public interface OperationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.LoadTestService/operations") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * List the operations for the provider. - * - * @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 list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - 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.list(this.client.getEndpoint(), 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())); - } - - /** - * List the operations for the provider. - * - * @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 list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - 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.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List the operations for the provider. - * - * @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 list of REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List the operations for the provider. - * - * @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 list of REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List the operations for the provider. - * - * @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 list of REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * List the operations for the provider. - * - * @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 list of REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/OperationsImpl.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/OperationsImpl.java deleted file mode 100644 index 43977520e8bf..000000000000 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/OperationsImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.loadtesting.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.loadtesting.fluent.OperationsClient; -import com.azure.resourcemanager.loadtesting.fluent.models.OperationInner; -import com.azure.resourcemanager.loadtesting.models.Operation; -import com.azure.resourcemanager.loadtesting.models.Operations; - -public final class OperationsImpl implements Operations { - private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); - - private final OperationsClient innerClient; - - private final com.azure.resourcemanager.loadtesting.LoadTestManager serviceManager; - - public OperationsImpl(OperationsClient innerClient, - com.azure.resourcemanager.loadtesting.LoadTestManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); - } - - private OperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.loadtesting.LoadTestManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/OutboundEnvironmentEndpointImpl.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/OutboundEnvironmentEndpointImpl.java index 52dac27836d7..13e885cc7c0f 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/OutboundEnvironmentEndpointImpl.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/OutboundEnvironmentEndpointImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.implementation; diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/QuotaResourceImpl.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/QuotaResourceImpl.java index 5ebab00494a1..493d43f82439 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/QuotaResourceImpl.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/QuotaResourceImpl.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.implementation; import com.azure.core.management.SystemData; import com.azure.resourcemanager.loadtesting.fluent.models.QuotaResourceInner; import com.azure.resourcemanager.loadtesting.models.QuotaResource; -import com.azure.resourcemanager.loadtesting.models.ResourceState; +import com.azure.resourcemanager.loadtesting.models.QuotaResourceProperties; public final class QuotaResourceImpl implements QuotaResource { private QuotaResourceInner innerObject; @@ -32,20 +32,12 @@ public String type() { return this.innerModel().type(); } - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public Integer limit() { - return this.innerModel().limit(); + public QuotaResourceProperties properties() { + return this.innerModel().properties(); } - public Integer usage() { - return this.innerModel().usage(); - } - - public ResourceState provisioningState() { - return this.innerModel().provisioningState(); + public SystemData systemData() { + return this.innerModel().systemData(); } public QuotaResourceInner innerModel() { diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/QuotasClientImpl.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/QuotasClientImpl.java deleted file mode 100644 index 7d5d8ab6c538..000000000000 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/QuotasClientImpl.java +++ /dev/null @@ -1,534 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.loadtesting.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.loadtesting.fluent.QuotasClient; -import com.azure.resourcemanager.loadtesting.fluent.models.CheckQuotaAvailabilityResponseInner; -import com.azure.resourcemanager.loadtesting.fluent.models.QuotaResourceInner; -import com.azure.resourcemanager.loadtesting.models.QuotaBucketRequest; -import com.azure.resourcemanager.loadtesting.models.QuotaResourceListResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in QuotasClient. - */ -public final class QuotasClientImpl implements QuotasClient { - /** - * The proxy service used to perform REST calls. - */ - private final QuotasService service; - - /** - * The service client containing this operation class. - */ - private final LoadTestClientImpl client; - - /** - * Initializes an instance of QuotasClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - QuotasClientImpl(LoadTestClientImpl client) { - this.service = RestProxy.create(QuotasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for LoadTestClientQuotas to be used by the proxy service to perform REST - * calls. - */ - @Host("{$host}") - @ServiceInterface(name = "LoadTestClientQuotas") - public interface QuotasService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.LoadTestService/locations/{location}/quotas") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.LoadTestService/locations/{location}/quotas/{quotaBucketName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, @PathParam("quotaBucketName") String quotaBucketName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.LoadTestService/locations/{location}/quotas/{quotaBucketName}/checkAvailability") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkAvailability(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, @PathParam("quotaBucketName") String quotaBucketName, - @BodyParam("application/json") QuotaBucketRequest body, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * List quotas for a given subscription Id. - * - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a QuotaResource list operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String location) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), location, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List quotas for a given subscription Id. - * - * @param location The name of the Azure region. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a QuotaResource list operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String location, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), location, - accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List quotas for a given subscription Id. - * - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a QuotaResource list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String location) { - return new PagedFlux<>(() -> listSinglePageAsync(location), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List quotas for a given subscription Id. - * - * @param location The name of the Azure region. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a QuotaResource list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String location, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(location, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List quotas for a given subscription Id. - * - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a QuotaResource list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String location) { - return new PagedIterable<>(listAsync(location)); - } - - /** - * List quotas for a given subscription Id. - * - * @param location The name of the Azure region. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a QuotaResource list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String location, Context context) { - return new PagedIterable<>(listAsync(location, context)); - } - - /** - * Get the available quota for a quota bucket per region per subscription. - * - * @param location The name of the Azure region. - * @param quotaBucketName The quota name. - * @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 available quota for a quota bucket per region per subscription along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String location, String quotaBucketName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (quotaBucketName == null) { - return Mono - .error(new IllegalArgumentException("Parameter quotaBucketName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), location, quotaBucketName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the available quota for a quota bucket per region per subscription. - * - * @param location The name of the Azure region. - * @param quotaBucketName The quota name. - * @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 available quota for a quota bucket per region per subscription along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String location, String quotaBucketName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (quotaBucketName == null) { - return Mono - .error(new IllegalArgumentException("Parameter quotaBucketName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - location, quotaBucketName, accept, context); - } - - /** - * Get the available quota for a quota bucket per region per subscription. - * - * @param location The name of the Azure region. - * @param quotaBucketName The quota name. - * @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 available quota for a quota bucket per region per subscription on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String location, String quotaBucketName) { - return getWithResponseAsync(location, quotaBucketName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get the available quota for a quota bucket per region per subscription. - * - * @param location The name of the Azure region. - * @param quotaBucketName The quota name. - * @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 available quota for a quota bucket per region per subscription along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String location, String quotaBucketName, Context context) { - return getWithResponseAsync(location, quotaBucketName, context).block(); - } - - /** - * Get the available quota for a quota bucket per region per subscription. - * - * @param location The name of the Azure region. - * @param quotaBucketName The quota name. - * @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 available quota for a quota bucket per region per subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public QuotaResourceInner get(String location, String quotaBucketName) { - return getWithResponse(location, quotaBucketName, Context.NONE).getValue(); - } - - /** - * Check Quota Availability on quota bucket per region per subscription. - * - * @param location The name of the Azure region. - * @param quotaBucketName The quota name. - * @param body The content of the action request. - * @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 check quota availability response object along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkAvailabilityWithResponseAsync(String location, - String quotaBucketName, QuotaBucketRequest body) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (quotaBucketName == null) { - return Mono - .error(new IllegalArgumentException("Parameter quotaBucketName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.checkAvailability(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), location, quotaBucketName, body, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Check Quota Availability on quota bucket per region per subscription. - * - * @param location The name of the Azure region. - * @param quotaBucketName The quota name. - * @param body The content of the action request. - * @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 check quota availability response object along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkAvailabilityWithResponseAsync(String location, - String quotaBucketName, QuotaBucketRequest body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (quotaBucketName == null) { - return Mono - .error(new IllegalArgumentException("Parameter quotaBucketName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.checkAvailability(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), location, quotaBucketName, body, accept, context); - } - - /** - * Check Quota Availability on quota bucket per region per subscription. - * - * @param location The name of the Azure region. - * @param quotaBucketName The quota name. - * @param body The content of the action request. - * @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 check quota availability response object on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono checkAvailabilityAsync(String location, String quotaBucketName, - QuotaBucketRequest body) { - return checkAvailabilityWithResponseAsync(location, quotaBucketName, body) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Check Quota Availability on quota bucket per region per subscription. - * - * @param location The name of the Azure region. - * @param quotaBucketName The quota name. - * @param body The content of the action request. - * @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 check quota availability response object along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkAvailabilityWithResponse(String location, - String quotaBucketName, QuotaBucketRequest body, Context context) { - return checkAvailabilityWithResponseAsync(location, quotaBucketName, body, context).block(); - } - - /** - * Check Quota Availability on quota bucket per region per subscription. - * - * @param location The name of the Azure region. - * @param quotaBucketName The quota name. - * @param body The content of the action request. - * @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 check quota availability response object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CheckQuotaAvailabilityResponseInner checkAvailability(String location, String quotaBucketName, - QuotaBucketRequest body) { - return checkAvailabilityWithResponse(location, quotaBucketName, body, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a QuotaResource list operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a QuotaResource list operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/QuotasImpl.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/QuotasImpl.java deleted file mode 100644 index 5215be47adf3..000000000000 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/QuotasImpl.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.loadtesting.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.loadtesting.fluent.QuotasClient; -import com.azure.resourcemanager.loadtesting.fluent.models.CheckQuotaAvailabilityResponseInner; -import com.azure.resourcemanager.loadtesting.fluent.models.QuotaResourceInner; -import com.azure.resourcemanager.loadtesting.models.CheckQuotaAvailabilityResponse; -import com.azure.resourcemanager.loadtesting.models.QuotaBucketRequest; -import com.azure.resourcemanager.loadtesting.models.QuotaResource; -import com.azure.resourcemanager.loadtesting.models.Quotas; - -public final class QuotasImpl implements Quotas { - private static final ClientLogger LOGGER = new ClientLogger(QuotasImpl.class); - - private final QuotasClient innerClient; - - private final com.azure.resourcemanager.loadtesting.LoadTestManager serviceManager; - - public QuotasImpl(QuotasClient innerClient, com.azure.resourcemanager.loadtesting.LoadTestManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String location) { - PagedIterable inner = this.serviceClient().list(location); - return ResourceManagerUtils.mapPage(inner, inner1 -> new QuotaResourceImpl(inner1, this.manager())); - } - - public PagedIterable list(String location, Context context) { - PagedIterable inner = this.serviceClient().list(location, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new QuotaResourceImpl(inner1, this.manager())); - } - - public Response getWithResponse(String location, String quotaBucketName, Context context) { - Response inner = this.serviceClient().getWithResponse(location, quotaBucketName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new QuotaResourceImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public QuotaResource get(String location, String quotaBucketName) { - QuotaResourceInner inner = this.serviceClient().get(location, quotaBucketName); - if (inner != null) { - return new QuotaResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response checkAvailabilityWithResponse(String location, - String quotaBucketName, QuotaBucketRequest body, Context context) { - Response inner - = this.serviceClient().checkAvailabilityWithResponse(location, quotaBucketName, body, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CheckQuotaAvailabilityResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public CheckQuotaAvailabilityResponse checkAvailability(String location, String quotaBucketName, - QuotaBucketRequest body) { - CheckQuotaAvailabilityResponseInner inner - = this.serviceClient().checkAvailability(location, quotaBucketName, body); - if (inner != null) { - return new CheckQuotaAvailabilityResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - private QuotasClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.loadtesting.LoadTestManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/ResourceManagerUtils.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/ResourceManagerUtils.java index 4db7b88d5fa3..b75929061167 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/ResourceManagerUtils.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/ResourceManagerUtils.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.implementation; diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/LoadTestsClientImpl.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/ResourceProvidersClientImpl.java similarity index 65% rename from sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/LoadTestsClientImpl.java rename to sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/ResourceProvidersClientImpl.java index 374d348b33b1..b858df6e8a8c 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/LoadTestsClientImpl.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/ResourceProvidersClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.implementation; @@ -14,6 +14,7 @@ import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -32,53 +33,57 @@ import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.loadtesting.fluent.LoadTestsClient; +import com.azure.resourcemanager.loadtesting.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.loadtesting.fluent.models.CheckQuotaAvailabilityResponseInner; import com.azure.resourcemanager.loadtesting.fluent.models.LoadTestResourceInner; import com.azure.resourcemanager.loadtesting.fluent.models.OutboundEnvironmentEndpointInner; -import com.azure.resourcemanager.loadtesting.models.LoadTestResourceListResult; -import com.azure.resourcemanager.loadtesting.models.LoadTestResourcePatchRequestBody; -import com.azure.resourcemanager.loadtesting.models.PagedOutboundEnvironmentEndpoint; +import com.azure.resourcemanager.loadtesting.fluent.models.QuotaResourceInner; +import com.azure.resourcemanager.loadtesting.implementation.models.LoadTestResourceListResult; +import com.azure.resourcemanager.loadtesting.implementation.models.PagedOutboundEnvironmentEndpoint; +import com.azure.resourcemanager.loadtesting.implementation.models.QuotaResourceListResult; +import com.azure.resourcemanager.loadtesting.models.LoadTestResourceUpdate; +import com.azure.resourcemanager.loadtesting.models.QuotaBucketRequest; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; /** - * An instance of this class provides access to all the operations defined in LoadTestsClient. + * An instance of this class provides access to all the operations defined in ResourceProvidersClient. */ -public final class LoadTestsClientImpl implements LoadTestsClient { +public final class ResourceProvidersClientImpl implements ResourceProvidersClient { /** * The proxy service used to perform REST calls. */ - private final LoadTestsService service; + private final ResourceProvidersService service; /** * The service client containing this operation class. */ - private final LoadTestClientImpl client; + private final LoadTestMgmtClientImpl client; /** - * Initializes an instance of LoadTestsClientImpl. + * Initializes an instance of ResourceProvidersClientImpl. * * @param client the instance of the service client containing this operation class. */ - LoadTestsClientImpl(LoadTestClientImpl client) { + ResourceProvidersClientImpl(LoadTestMgmtClientImpl client) { this.service - = RestProxy.create(LoadTestsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + = RestProxy.create(ResourceProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for LoadTestClientLoadTests to be used by the proxy service to perform - * REST calls. + * The interface defining all the services for LoadTestMgmtClientResourceProviders to be used by the proxy service + * to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "LoadTestClientLoadTe") - public interface LoadTestsService { + @Host("{endpoint}") + @ServiceInterface(name = "LoadTestMgmtClientRe") + public interface ResourceProvidersService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.LoadTestService/loadTests") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @@ -86,7 +91,7 @@ Mono> list(@HostParam("$host") String endpo @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LoadTestService/loadTests") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, Context context); @@ -95,36 +100,34 @@ Mono> listByResourceGroup(@HostParam("$host @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LoadTestService/loadTests/{loadTestName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("$host") String endpoint, + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("loadTestName") String loadTestName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LoadTestService/loadTests/{loadTestName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, + Mono>> createOrUpdateLoadtest(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("loadTestName") String loadTestName, - @BodyParam("application/json") LoadTestResourceInner resource, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") LoadTestResourceInner loadTestResource, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LoadTestService/loadTests/{loadTestName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, + Mono>> updateLoadtest(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("loadTestName") String loadTestName, - @BodyParam("application/json") LoadTestResourcePatchRequestBody properties, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") LoadTestResourceUpdate loadTestResourcePatchRequestBody, Context context); @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LoadTestService/loadTests/{loadTestName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, + Mono>> delete(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("loadTestName") String loadTestName, @HeaderParam("Accept") String accept, Context context); @@ -133,18 +136,45 @@ Mono>> delete(@HostParam("$host") String endpoint, @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LoadTestService/loadTests/{loadTestName}/outboundNetworkDependenciesEndpoints") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listOutboundNetworkDependenciesEndpoints( - @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + Mono> outboundNetworkDependenciesEndpoints( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("loadTestName") String loadTestName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.LoadTestService/locations/{location}/quotas/{quotaBucketName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getQuota(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @PathParam("quotaBucketName") String quotaBucketName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.LoadTestService/locations/{location}/quotas") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listQuota(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); + + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.LoadTestService/locations/{location}/quotas/{quotaBucketName}/checkAvailabilityQuota") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkAvailabilityQuota( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, + @PathParam("quotaBucketName") String quotaBucketName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") QuotaBucketRequest quotaBucketRequest, + Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -152,15 +182,23 @@ Mono> listBySubscriptionNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listOutboundNetworkDependenciesEndpointsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Mono> outboundNetworkDependenciesEndpointsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listQuotaNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } @@ -525,15 +563,15 @@ public LoadTestResourceInner getByResourceGroup(String resourceGroupName, String * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param loadTestName Load Test name. - * @param resource Resource create parameters. + * @param loadTestResource Resource create parameters. * @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 loadTest details along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String loadTestName, LoadTestResourceInner resource) { + private Mono>> createOrUpdateLoadtestWithResponseAsync(String resourceGroupName, + String loadTestName, LoadTestResourceInner loadTestResource) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -549,15 +587,18 @@ private Mono>> createOrUpdateWithResponseAsync(String if (loadTestName == null) { return Mono.error(new IllegalArgumentException("Parameter loadTestName is required and cannot be null.")); } - if (resource == null) { - return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + if (loadTestResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadTestResource is required and cannot be null.")); } else { - resource.validate(); + loadTestResource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, loadTestName, resource, accept, context)) + .withContext(context -> service.createOrUpdateLoadtest(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, loadTestName, + contentType, accept, loadTestResource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -566,7 +607,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param loadTestName Load Test name. - * @param resource Resource create parameters. + * @param loadTestResource Resource create parameters. * @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. @@ -574,8 +615,8 @@ private Mono>> createOrUpdateWithResponseAsync(String * @return loadTest details along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String loadTestName, LoadTestResourceInner resource, Context context) { + private Mono>> createOrUpdateLoadtestWithResponseAsync(String resourceGroupName, + String loadTestName, LoadTestResourceInner loadTestResource, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -591,15 +632,18 @@ private Mono>> createOrUpdateWithResponseAsync(String if (loadTestName == null) { return Mono.error(new IllegalArgumentException("Parameter loadTestName is required and cannot be null.")); } - if (resource == null) { - return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + if (loadTestResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadTestResource is required and cannot be null.")); } else { - resource.validate(); + loadTestResource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, loadTestName, resource, accept, context); + return service.createOrUpdateLoadtest(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, loadTestName, contentType, accept, loadTestResource, + context); } /** @@ -607,17 +651,17 @@ private Mono>> createOrUpdateWithResponseAsync(String * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param loadTestName Load Test name. - * @param resource Resource create parameters. + * @param loadTestResource Resource create parameters. * @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 loadTest details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, LoadTestResourceInner> - beginCreateOrUpdateAsync(String resourceGroupName, String loadTestName, LoadTestResourceInner resource) { + private PollerFlux, LoadTestResourceInner> beginCreateOrUpdateLoadtestAsync( + String resourceGroupName, String loadTestName, LoadTestResourceInner loadTestResource) { Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, loadTestName, resource); + = createOrUpdateLoadtestWithResponseAsync(resourceGroupName, loadTestName, loadTestResource); return this.client.getLroResult(mono, this.client.getHttpPipeline(), LoadTestResourceInner.class, LoadTestResourceInner.class, this.client.getContext()); @@ -628,7 +672,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param loadTestName Load Test name. - * @param resource Resource create parameters. + * @param loadTestResource Resource create parameters. * @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. @@ -636,11 +680,11 @@ private Mono>> createOrUpdateWithResponseAsync(String * @return the {@link PollerFlux} for polling of loadTest details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, LoadTestResourceInner> beginCreateOrUpdateAsync( - String resourceGroupName, String loadTestName, LoadTestResourceInner resource, Context context) { + private PollerFlux, LoadTestResourceInner> beginCreateOrUpdateLoadtestAsync( + String resourceGroupName, String loadTestName, LoadTestResourceInner loadTestResource, Context context) { context = this.client.mergeContext(context); Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, loadTestName, resource, context); + = createOrUpdateLoadtestWithResponseAsync(resourceGroupName, loadTestName, loadTestResource, context); return this.client.getLroResult(mono, this.client.getHttpPipeline(), LoadTestResourceInner.class, LoadTestResourceInner.class, context); } @@ -650,16 +694,16 @@ private PollerFlux, LoadTestResourceInner> beg * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param loadTestName Load Test name. - * @param resource Resource create parameters. + * @param loadTestResource Resource create parameters. * @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 loadTest details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, LoadTestResourceInner> - beginCreateOrUpdate(String resourceGroupName, String loadTestName, LoadTestResourceInner resource) { - return this.beginCreateOrUpdateAsync(resourceGroupName, loadTestName, resource).getSyncPoller(); + public SyncPoller, LoadTestResourceInner> beginCreateOrUpdateLoadtest( + String resourceGroupName, String loadTestName, LoadTestResourceInner loadTestResource) { + return this.beginCreateOrUpdateLoadtestAsync(resourceGroupName, loadTestName, loadTestResource).getSyncPoller(); } /** @@ -667,7 +711,7 @@ private PollerFlux, LoadTestResourceInner> beg * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param loadTestName Load Test name. - * @param resource Resource create parameters. + * @param loadTestResource Resource create parameters. * @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. @@ -675,9 +719,10 @@ private PollerFlux, LoadTestResourceInner> beg * @return the {@link SyncPoller} for polling of loadTest details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, LoadTestResourceInner> beginCreateOrUpdate( - String resourceGroupName, String loadTestName, LoadTestResourceInner resource, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, loadTestName, resource, context).getSyncPoller(); + public SyncPoller, LoadTestResourceInner> beginCreateOrUpdateLoadtest( + String resourceGroupName, String loadTestName, LoadTestResourceInner loadTestResource, Context context) { + return this.beginCreateOrUpdateLoadtestAsync(resourceGroupName, loadTestName, loadTestResource, context) + .getSyncPoller(); } /** @@ -685,16 +730,16 @@ public SyncPoller, LoadTestResourceInner> begi * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param loadTestName Load Test name. - * @param resource Resource create parameters. + * @param loadTestResource Resource create parameters. * @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 loadTest details on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String loadTestName, - LoadTestResourceInner resource) { - return beginCreateOrUpdateAsync(resourceGroupName, loadTestName, resource).last() + private Mono createOrUpdateLoadtestAsync(String resourceGroupName, String loadTestName, + LoadTestResourceInner loadTestResource) { + return beginCreateOrUpdateLoadtestAsync(resourceGroupName, loadTestName, loadTestResource).last() .flatMap(this.client::getLroFinalResultOrError); } @@ -703,7 +748,7 @@ private Mono createOrUpdateAsync(String resourceGroupName * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param loadTestName Load Test name. - * @param resource Resource create parameters. + * @param loadTestResource Resource create parameters. * @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. @@ -711,9 +756,9 @@ private Mono createOrUpdateAsync(String resourceGroupName * @return loadTest details on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String loadTestName, - LoadTestResourceInner resource, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, loadTestName, resource, context).last() + private Mono createOrUpdateLoadtestAsync(String resourceGroupName, String loadTestName, + LoadTestResourceInner loadTestResource, Context context) { + return beginCreateOrUpdateLoadtestAsync(resourceGroupName, loadTestName, loadTestResource, context).last() .flatMap(this.client::getLroFinalResultOrError); } @@ -722,16 +767,16 @@ private Mono createOrUpdateAsync(String resourceGroupName * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param loadTestName Load Test name. - * @param resource Resource create parameters. + * @param loadTestResource Resource create parameters. * @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 loadTest details. */ @ServiceMethod(returns = ReturnType.SINGLE) - public LoadTestResourceInner createOrUpdate(String resourceGroupName, String loadTestName, - LoadTestResourceInner resource) { - return createOrUpdateAsync(resourceGroupName, loadTestName, resource).block(); + public LoadTestResourceInner createOrUpdateLoadtest(String resourceGroupName, String loadTestName, + LoadTestResourceInner loadTestResource) { + return createOrUpdateLoadtestAsync(resourceGroupName, loadTestName, loadTestResource).block(); } /** @@ -739,7 +784,7 @@ public LoadTestResourceInner createOrUpdate(String resourceGroupName, String loa * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param loadTestName Load Test name. - * @param resource Resource create parameters. + * @param loadTestResource Resource create parameters. * @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. @@ -747,9 +792,9 @@ public LoadTestResourceInner createOrUpdate(String resourceGroupName, String loa * @return loadTest details. */ @ServiceMethod(returns = ReturnType.SINGLE) - public LoadTestResourceInner createOrUpdate(String resourceGroupName, String loadTestName, - LoadTestResourceInner resource, Context context) { - return createOrUpdateAsync(resourceGroupName, loadTestName, resource, context).block(); + public LoadTestResourceInner createOrUpdateLoadtest(String resourceGroupName, String loadTestName, + LoadTestResourceInner loadTestResource, Context context) { + return createOrUpdateLoadtestAsync(resourceGroupName, loadTestName, loadTestResource, context).block(); } /** @@ -757,15 +802,15 @@ public LoadTestResourceInner createOrUpdate(String resourceGroupName, String loa * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param loadTestName Load Test name. - * @param properties The resource properties to be updated. + * @param loadTestResourcePatchRequestBody The resource properties to be updated. * @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 loadTest details along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String loadTestName, - LoadTestResourcePatchRequestBody properties) { + private Mono>> updateLoadtestWithResponseAsync(String resourceGroupName, + String loadTestName, LoadTestResourceUpdate loadTestResourcePatchRequestBody) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -781,15 +826,18 @@ private Mono>> updateWithResponseAsync(String resource if (loadTestName == null) { return Mono.error(new IllegalArgumentException("Parameter loadTestName is required and cannot be null.")); } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + if (loadTestResourcePatchRequestBody == null) { + return Mono.error(new IllegalArgumentException( + "Parameter loadTestResourcePatchRequestBody is required and cannot be null.")); } else { - properties.validate(); + loadTestResourcePatchRequestBody.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, loadTestName, properties, accept, context)) + .withContext(context -> service.updateLoadtest(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, loadTestName, contentType, accept, + loadTestResourcePatchRequestBody, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -798,7 +846,7 @@ private Mono>> updateWithResponseAsync(String resource * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param loadTestName Load Test name. - * @param properties The resource properties to be updated. + * @param loadTestResourcePatchRequestBody The resource properties to be updated. * @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. @@ -806,8 +854,8 @@ private Mono>> updateWithResponseAsync(String resource * @return loadTest details along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String loadTestName, - LoadTestResourcePatchRequestBody properties, Context context) { + private Mono>> updateLoadtestWithResponseAsync(String resourceGroupName, + String loadTestName, LoadTestResourceUpdate loadTestResourcePatchRequestBody, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -823,15 +871,18 @@ private Mono>> updateWithResponseAsync(String resource if (loadTestName == null) { return Mono.error(new IllegalArgumentException("Parameter loadTestName is required and cannot be null.")); } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + if (loadTestResourcePatchRequestBody == null) { + return Mono.error(new IllegalArgumentException( + "Parameter loadTestResourcePatchRequestBody is required and cannot be null.")); } else { - properties.validate(); + loadTestResourcePatchRequestBody.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, loadTestName, properties, accept, context); + return service.updateLoadtest(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, loadTestName, contentType, accept, + loadTestResourcePatchRequestBody, context); } /** @@ -839,16 +890,17 @@ private Mono>> updateWithResponseAsync(String resource * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param loadTestName Load Test name. - * @param properties The resource properties to be updated. + * @param loadTestResourcePatchRequestBody The resource properties to be updated. * @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 loadTest details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, LoadTestResourceInner> - beginUpdateAsync(String resourceGroupName, String loadTestName, LoadTestResourcePatchRequestBody properties) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, loadTestName, properties); + private PollerFlux, LoadTestResourceInner> beginUpdateLoadtestAsync( + String resourceGroupName, String loadTestName, LoadTestResourceUpdate loadTestResourcePatchRequestBody) { + Mono>> mono + = updateLoadtestWithResponseAsync(resourceGroupName, loadTestName, loadTestResourcePatchRequestBody); return this.client.getLroResult(mono, this.client.getHttpPipeline(), LoadTestResourceInner.class, LoadTestResourceInner.class, this.client.getContext()); @@ -859,7 +911,7 @@ private Mono>> updateWithResponseAsync(String resource * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param loadTestName Load Test name. - * @param properties The resource properties to be updated. + * @param loadTestResourcePatchRequestBody The resource properties to be updated. * @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. @@ -867,11 +919,12 @@ private Mono>> updateWithResponseAsync(String resource * @return the {@link PollerFlux} for polling of loadTest details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, LoadTestResourceInner> beginUpdateAsync( - String resourceGroupName, String loadTestName, LoadTestResourcePatchRequestBody properties, Context context) { + private PollerFlux, LoadTestResourceInner> beginUpdateLoadtestAsync( + String resourceGroupName, String loadTestName, LoadTestResourceUpdate loadTestResourcePatchRequestBody, + Context context) { context = this.client.mergeContext(context); - Mono>> mono - = updateWithResponseAsync(resourceGroupName, loadTestName, properties, context); + Mono>> mono = updateLoadtestWithResponseAsync(resourceGroupName, loadTestName, + loadTestResourcePatchRequestBody, context); return this.client.getLroResult(mono, this.client.getHttpPipeline(), LoadTestResourceInner.class, LoadTestResourceInner.class, context); } @@ -881,16 +934,17 @@ private PollerFlux, LoadTestResourceInner> beg * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param loadTestName Load Test name. - * @param properties The resource properties to be updated. + * @param loadTestResourcePatchRequestBody The resource properties to be updated. * @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 loadTest details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, LoadTestResourceInner> beginUpdate(String resourceGroupName, - String loadTestName, LoadTestResourcePatchRequestBody properties) { - return this.beginUpdateAsync(resourceGroupName, loadTestName, properties).getSyncPoller(); + public SyncPoller, LoadTestResourceInner> beginUpdateLoadtest( + String resourceGroupName, String loadTestName, LoadTestResourceUpdate loadTestResourcePatchRequestBody) { + return this.beginUpdateLoadtestAsync(resourceGroupName, loadTestName, loadTestResourcePatchRequestBody) + .getSyncPoller(); } /** @@ -898,7 +952,7 @@ public SyncPoller, LoadTestResourceInner> begi * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param loadTestName Load Test name. - * @param properties The resource properties to be updated. + * @param loadTestResourcePatchRequestBody The resource properties to be updated. * @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. @@ -906,9 +960,11 @@ public SyncPoller, LoadTestResourceInner> begi * @return the {@link SyncPoller} for polling of loadTest details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, LoadTestResourceInner> beginUpdate(String resourceGroupName, - String loadTestName, LoadTestResourcePatchRequestBody properties, Context context) { - return this.beginUpdateAsync(resourceGroupName, loadTestName, properties, context).getSyncPoller(); + public SyncPoller, LoadTestResourceInner> beginUpdateLoadtest( + String resourceGroupName, String loadTestName, LoadTestResourceUpdate loadTestResourcePatchRequestBody, + Context context) { + return this.beginUpdateLoadtestAsync(resourceGroupName, loadTestName, loadTestResourcePatchRequestBody, context) + .getSyncPoller(); } /** @@ -916,16 +972,16 @@ public SyncPoller, LoadTestResourceInner> begi * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param loadTestName Load Test name. - * @param properties The resource properties to be updated. + * @param loadTestResourcePatchRequestBody The resource properties to be updated. * @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 loadTest details on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String loadTestName, - LoadTestResourcePatchRequestBody properties) { - return beginUpdateAsync(resourceGroupName, loadTestName, properties).last() + private Mono updateLoadtestAsync(String resourceGroupName, String loadTestName, + LoadTestResourceUpdate loadTestResourcePatchRequestBody) { + return beginUpdateLoadtestAsync(resourceGroupName, loadTestName, loadTestResourcePatchRequestBody).last() .flatMap(this.client::getLroFinalResultOrError); } @@ -934,7 +990,7 @@ private Mono updateAsync(String resourceGroupName, String * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param loadTestName Load Test name. - * @param properties The resource properties to be updated. + * @param loadTestResourcePatchRequestBody The resource properties to be updated. * @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. @@ -942,9 +998,10 @@ private Mono updateAsync(String resourceGroupName, String * @return loadTest details on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String loadTestName, - LoadTestResourcePatchRequestBody properties, Context context) { - return beginUpdateAsync(resourceGroupName, loadTestName, properties, context).last() + private Mono updateLoadtestAsync(String resourceGroupName, String loadTestName, + LoadTestResourceUpdate loadTestResourcePatchRequestBody, Context context) { + return beginUpdateLoadtestAsync(resourceGroupName, loadTestName, loadTestResourcePatchRequestBody, context) + .last() .flatMap(this.client::getLroFinalResultOrError); } @@ -953,16 +1010,16 @@ private Mono updateAsync(String resourceGroupName, String * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param loadTestName Load Test name. - * @param properties The resource properties to be updated. + * @param loadTestResourcePatchRequestBody The resource properties to be updated. * @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 loadTest details. */ @ServiceMethod(returns = ReturnType.SINGLE) - public LoadTestResourceInner update(String resourceGroupName, String loadTestName, - LoadTestResourcePatchRequestBody properties) { - return updateAsync(resourceGroupName, loadTestName, properties).block(); + public LoadTestResourceInner updateLoadtest(String resourceGroupName, String loadTestName, + LoadTestResourceUpdate loadTestResourcePatchRequestBody) { + return updateLoadtestAsync(resourceGroupName, loadTestName, loadTestResourcePatchRequestBody).block(); } /** @@ -970,7 +1027,7 @@ public LoadTestResourceInner update(String resourceGroupName, String loadTestNam * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param loadTestName Load Test name. - * @param properties The resource properties to be updated. + * @param loadTestResourcePatchRequestBody The resource properties to be updated. * @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. @@ -978,9 +1035,9 @@ public LoadTestResourceInner update(String resourceGroupName, String loadTestNam * @return loadTest details. */ @ServiceMethod(returns = ReturnType.SINGLE) - public LoadTestResourceInner update(String resourceGroupName, String loadTestName, - LoadTestResourcePatchRequestBody properties, Context context) { - return updateAsync(resourceGroupName, loadTestName, properties, context).block(); + public LoadTestResourceInner updateLoadtest(String resourceGroupName, String loadTestName, + LoadTestResourceUpdate loadTestResourcePatchRequestBody, Context context) { + return updateLoadtestAsync(resourceGroupName, loadTestName, loadTestResourcePatchRequestBody, context).block(); } /** @@ -1195,7 +1252,7 @@ public void delete(String resourceGroupName, String loadTestName, Context contex */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> - listOutboundNetworkDependenciesEndpointsSinglePageAsync(String resourceGroupName, String loadTestName) { + outboundNetworkDependenciesEndpointsSinglePageAsync(String resourceGroupName, String loadTestName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1213,7 +1270,7 @@ public void delete(String resourceGroupName, String loadTestName, Context contex } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listOutboundNetworkDependenciesEndpoints(this.client.getEndpoint(), + .withContext(context -> service.outboundNetworkDependenciesEndpoints(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, loadTestName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), @@ -1234,9 +1291,8 @@ public void delete(String resourceGroupName, String loadTestName, Context contex * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listOutboundNetworkDependenciesEndpointsSinglePageAsync(String resourceGroupName, String loadTestName, - Context context) { + private Mono> outboundNetworkDependenciesEndpointsSinglePageAsync( + String resourceGroupName, String loadTestName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1255,7 +1311,7 @@ public void delete(String resourceGroupName, String loadTestName, Context contex final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listOutboundNetworkDependenciesEndpoints(this.client.getEndpoint(), this.client.getApiVersion(), + .outboundNetworkDependenciesEndpoints(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, loadTestName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); @@ -1273,10 +1329,10 @@ public void delete(String resourceGroupName, String loadTestName, Context contex */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux - listOutboundNetworkDependenciesEndpointsAsync(String resourceGroupName, String loadTestName) { + outboundNetworkDependenciesEndpointsAsync(String resourceGroupName, String loadTestName) { return new PagedFlux<>( - () -> listOutboundNetworkDependenciesEndpointsSinglePageAsync(resourceGroupName, loadTestName), - nextLink -> listOutboundNetworkDependenciesEndpointsNextSinglePageAsync(nextLink)); + () -> outboundNetworkDependenciesEndpointsSinglePageAsync(resourceGroupName, loadTestName), + nextLink -> outboundNetworkDependenciesEndpointsNextSinglePageAsync(nextLink)); } /** @@ -1292,10 +1348,10 @@ public void delete(String resourceGroupName, String loadTestName, Context contex */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux - listOutboundNetworkDependenciesEndpointsAsync(String resourceGroupName, String loadTestName, Context context) { + outboundNetworkDependenciesEndpointsAsync(String resourceGroupName, String loadTestName, Context context) { return new PagedFlux<>( - () -> listOutboundNetworkDependenciesEndpointsSinglePageAsync(resourceGroupName, loadTestName, context), - nextLink -> listOutboundNetworkDependenciesEndpointsNextSinglePageAsync(nextLink, context)); + () -> outboundNetworkDependenciesEndpointsSinglePageAsync(resourceGroupName, loadTestName, context), + nextLink -> outboundNetworkDependenciesEndpointsNextSinglePageAsync(nextLink, context)); } /** @@ -1310,8 +1366,8 @@ public void delete(String resourceGroupName, String loadTestName, Context contex */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable - listOutboundNetworkDependenciesEndpoints(String resourceGroupName, String loadTestName) { - return new PagedIterable<>(listOutboundNetworkDependenciesEndpointsAsync(resourceGroupName, loadTestName)); + outboundNetworkDependenciesEndpoints(String resourceGroupName, String loadTestName) { + return new PagedIterable<>(outboundNetworkDependenciesEndpointsAsync(resourceGroupName, loadTestName)); } /** @@ -1327,9 +1383,395 @@ public void delete(String resourceGroupName, String loadTestName, Context contex */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable - listOutboundNetworkDependenciesEndpoints(String resourceGroupName, String loadTestName, Context context) { - return new PagedIterable<>( - listOutboundNetworkDependenciesEndpointsAsync(resourceGroupName, loadTestName, context)); + outboundNetworkDependenciesEndpoints(String resourceGroupName, String loadTestName, Context context) { + return new PagedIterable<>(outboundNetworkDependenciesEndpointsAsync(resourceGroupName, loadTestName, context)); + } + + /** + * Get the available quota for a quota bucket per region per subscription. + * + * @param location The name of the Azure region. + * @param quotaBucketName The quota name. + * @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 available quota for a quota bucket per region per subscription along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getQuotaWithResponseAsync(String location, String quotaBucketName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (quotaBucketName == null) { + return Mono + .error(new IllegalArgumentException("Parameter quotaBucketName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getQuota(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, quotaBucketName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the available quota for a quota bucket per region per subscription. + * + * @param location The name of the Azure region. + * @param quotaBucketName The quota name. + * @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 available quota for a quota bucket per region per subscription along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getQuotaWithResponseAsync(String location, String quotaBucketName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (quotaBucketName == null) { + return Mono + .error(new IllegalArgumentException("Parameter quotaBucketName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getQuota(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + location, quotaBucketName, accept, context); + } + + /** + * Get the available quota for a quota bucket per region per subscription. + * + * @param location The name of the Azure region. + * @param quotaBucketName The quota name. + * @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 available quota for a quota bucket per region per subscription on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getQuotaAsync(String location, String quotaBucketName) { + return getQuotaWithResponseAsync(location, quotaBucketName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the available quota for a quota bucket per region per subscription. + * + * @param location The name of the Azure region. + * @param quotaBucketName The quota name. + * @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 available quota for a quota bucket per region per subscription along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getQuotaWithResponse(String location, String quotaBucketName, Context context) { + return getQuotaWithResponseAsync(location, quotaBucketName, context).block(); + } + + /** + * Get the available quota for a quota bucket per region per subscription. + * + * @param location The name of the Azure region. + * @param quotaBucketName The quota name. + * @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 available quota for a quota bucket per region per subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public QuotaResourceInner getQuota(String location, String quotaBucketName) { + return getQuotaWithResponse(location, quotaBucketName, Context.NONE).getValue(); + } + + /** + * List quotas for a given subscription Id. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a QuotaResource list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listQuotaSinglePageAsync(String location) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listQuota(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List quotas for a given subscription Id. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a QuotaResource list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listQuotaSinglePageAsync(String location, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listQuota(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + location, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List quotas for a given subscription Id. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a QuotaResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listQuotaAsync(String location) { + return new PagedFlux<>(() -> listQuotaSinglePageAsync(location), + nextLink -> listQuotaNextSinglePageAsync(nextLink)); + } + + /** + * List quotas for a given subscription Id. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a QuotaResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listQuotaAsync(String location, Context context) { + return new PagedFlux<>(() -> listQuotaSinglePageAsync(location, context), + nextLink -> listQuotaNextSinglePageAsync(nextLink, context)); + } + + /** + * List quotas for a given subscription Id. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a QuotaResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listQuota(String location) { + return new PagedIterable<>(listQuotaAsync(location)); + } + + /** + * List quotas for a given subscription Id. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a QuotaResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listQuota(String location, Context context) { + return new PagedIterable<>(listQuotaAsync(location, context)); + } + + /** + * Check Quota Availability on quota bucket per region per subscription. + * + * @param location The name of the Azure region. + * @param quotaBucketName The quota name. + * @param quotaBucketRequest The content of the action request. + * @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 check quota availability response object along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkAvailabilityQuotaWithResponseAsync(String location, + String quotaBucketName, QuotaBucketRequest quotaBucketRequest) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (quotaBucketName == null) { + return Mono + .error(new IllegalArgumentException("Parameter quotaBucketName is required and cannot be null.")); + } + if (quotaBucketRequest == null) { + return Mono + .error(new IllegalArgumentException("Parameter quotaBucketRequest is required and cannot be null.")); + } else { + quotaBucketRequest.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.checkAvailabilityQuota(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), location, quotaBucketName, contentType, + accept, quotaBucketRequest, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Check Quota Availability on quota bucket per region per subscription. + * + * @param location The name of the Azure region. + * @param quotaBucketName The quota name. + * @param quotaBucketRequest The content of the action request. + * @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 check quota availability response object along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkAvailabilityQuotaWithResponseAsync(String location, + String quotaBucketName, QuotaBucketRequest quotaBucketRequest, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (quotaBucketName == null) { + return Mono + .error(new IllegalArgumentException("Parameter quotaBucketName is required and cannot be null.")); + } + if (quotaBucketRequest == null) { + return Mono + .error(new IllegalArgumentException("Parameter quotaBucketRequest is required and cannot be null.")); + } else { + quotaBucketRequest.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.checkAvailabilityQuota(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, quotaBucketName, contentType, accept, quotaBucketRequest, + context); + } + + /** + * Check Quota Availability on quota bucket per region per subscription. + * + * @param location The name of the Azure region. + * @param quotaBucketName The quota name. + * @param quotaBucketRequest The content of the action request. + * @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 check quota availability response object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkAvailabilityQuotaAsync(String location, + String quotaBucketName, QuotaBucketRequest quotaBucketRequest) { + return checkAvailabilityQuotaWithResponseAsync(location, quotaBucketName, quotaBucketRequest) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Check Quota Availability on quota bucket per region per subscription. + * + * @param location The name of the Azure region. + * @param quotaBucketName The quota name. + * @param quotaBucketRequest The content of the action request. + * @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 check quota availability response object along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkAvailabilityQuotaWithResponse(String location, + String quotaBucketName, QuotaBucketRequest quotaBucketRequest, Context context) { + return checkAvailabilityQuotaWithResponseAsync(location, quotaBucketName, quotaBucketRequest, context).block(); + } + + /** + * Check Quota Availability on quota bucket per region per subscription. + * + * @param location The name of the Azure region. + * @param quotaBucketName The quota name. + * @param quotaBucketRequest The content of the action request. + * @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 check quota availability response object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckQuotaAvailabilityResponseInner checkAvailabilityQuota(String location, String quotaBucketName, + QuotaBucketRequest quotaBucketRequest) { + return checkAvailabilityQuotaWithResponse(location, quotaBucketName, quotaBucketRequest, Context.NONE) + .getValue(); } /** @@ -1456,7 +1898,7 @@ private Mono> listByResourceGroupNextSingle */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> - listOutboundNetworkDependenciesEndpointsNextSinglePageAsync(String nextLink) { + outboundNetworkDependenciesEndpointsNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1466,7 +1908,7 @@ private Mono> listByResourceGroupNextSingle } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listOutboundNetworkDependenciesEndpointsNext(nextLink, + .withContext(context -> service.outboundNetworkDependenciesEndpointsNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) @@ -1486,7 +1928,7 @@ private Mono> listByResourceGroupNextSingle */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> - listOutboundNetworkDependenciesEndpointsNextSinglePageAsync(String nextLink, Context context) { + outboundNetworkDependenciesEndpointsNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1496,8 +1938,61 @@ private Mono> listByResourceGroupNextSingle } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listOutboundNetworkDependenciesEndpointsNext(nextLink, this.client.getEndpoint(), accept, context) + return service.outboundNetworkDependenciesEndpointsNext(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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a QuotaResource list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listQuotaNextSinglePageAsync(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.listQuotaNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a QuotaResource list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listQuotaNextSinglePageAsync(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.listQuotaNext(nextLink, this.client.getEndpoint(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/LoadTestsImpl.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/ResourceProvidersImpl.java similarity index 65% rename from sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/LoadTestsImpl.java rename to sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/ResourceProvidersImpl.java index 54499bbcc4e3..38d4b5ba0bc0 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/LoadTestsImpl.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/ResourceProvidersImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.implementation; @@ -9,21 +9,26 @@ import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.loadtesting.fluent.LoadTestsClient; +import com.azure.resourcemanager.loadtesting.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.loadtesting.fluent.models.CheckQuotaAvailabilityResponseInner; import com.azure.resourcemanager.loadtesting.fluent.models.LoadTestResourceInner; import com.azure.resourcemanager.loadtesting.fluent.models.OutboundEnvironmentEndpointInner; +import com.azure.resourcemanager.loadtesting.fluent.models.QuotaResourceInner; +import com.azure.resourcemanager.loadtesting.models.CheckQuotaAvailabilityResponse; import com.azure.resourcemanager.loadtesting.models.LoadTestResource; -import com.azure.resourcemanager.loadtesting.models.LoadTests; import com.azure.resourcemanager.loadtesting.models.OutboundEnvironmentEndpoint; +import com.azure.resourcemanager.loadtesting.models.QuotaBucketRequest; +import com.azure.resourcemanager.loadtesting.models.QuotaResource; +import com.azure.resourcemanager.loadtesting.models.ResourceProviders; -public final class LoadTestsImpl implements LoadTests { - private static final ClientLogger LOGGER = new ClientLogger(LoadTestsImpl.class); +public final class ResourceProvidersImpl implements ResourceProviders { + private static final ClientLogger LOGGER = new ClientLogger(ResourceProvidersImpl.class); - private final LoadTestsClient innerClient; + private final ResourceProvidersClient innerClient; private final com.azure.resourcemanager.loadtesting.LoadTestManager serviceManager; - public LoadTestsImpl(LoadTestsClient innerClient, + public ResourceProvidersImpl(ResourceProvidersClient innerClient, com.azure.resourcemanager.loadtesting.LoadTestManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -79,22 +84,75 @@ public void delete(String resourceGroupName, String loadTestName, Context contex this.serviceClient().delete(resourceGroupName, loadTestName, context); } - public PagedIterable listOutboundNetworkDependenciesEndpoints(String resourceGroupName, + public PagedIterable outboundNetworkDependenciesEndpoints(String resourceGroupName, String loadTestName) { PagedIterable inner - = this.serviceClient().listOutboundNetworkDependenciesEndpoints(resourceGroupName, loadTestName); + = this.serviceClient().outboundNetworkDependenciesEndpoints(resourceGroupName, loadTestName); return ResourceManagerUtils.mapPage(inner, inner1 -> new OutboundEnvironmentEndpointImpl(inner1, this.manager())); } - public PagedIterable listOutboundNetworkDependenciesEndpoints(String resourceGroupName, + public PagedIterable outboundNetworkDependenciesEndpoints(String resourceGroupName, String loadTestName, Context context) { PagedIterable inner - = this.serviceClient().listOutboundNetworkDependenciesEndpoints(resourceGroupName, loadTestName, context); + = this.serviceClient().outboundNetworkDependenciesEndpoints(resourceGroupName, loadTestName, context); return ResourceManagerUtils.mapPage(inner, inner1 -> new OutboundEnvironmentEndpointImpl(inner1, this.manager())); } + public Response getQuotaWithResponse(String location, String quotaBucketName, Context context) { + Response inner + = this.serviceClient().getQuotaWithResponse(location, quotaBucketName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new QuotaResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public QuotaResource getQuota(String location, String quotaBucketName) { + QuotaResourceInner inner = this.serviceClient().getQuota(location, quotaBucketName); + if (inner != null) { + return new QuotaResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listQuota(String location) { + PagedIterable inner = this.serviceClient().listQuota(location); + return ResourceManagerUtils.mapPage(inner, inner1 -> new QuotaResourceImpl(inner1, this.manager())); + } + + public PagedIterable listQuota(String location, Context context) { + PagedIterable inner = this.serviceClient().listQuota(location, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new QuotaResourceImpl(inner1, this.manager())); + } + + public Response checkAvailabilityQuotaWithResponse(String location, + String quotaBucketName, QuotaBucketRequest quotaBucketRequest, Context context) { + Response inner = this.serviceClient() + .checkAvailabilityQuotaWithResponse(location, quotaBucketName, quotaBucketRequest, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CheckQuotaAvailabilityResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CheckQuotaAvailabilityResponse checkAvailabilityQuota(String location, String quotaBucketName, + QuotaBucketRequest quotaBucketRequest) { + CheckQuotaAvailabilityResponseInner inner + = this.serviceClient().checkAvailabilityQuota(location, quotaBucketName, quotaBucketRequest); + if (inner != null) { + return new CheckQuotaAvailabilityResponseImpl(inner, this.manager()); + } else { + return null; + } + } + public LoadTestResource getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { @@ -151,7 +209,7 @@ public void deleteByIdWithResponse(String id, Context context) { this.delete(resourceGroupName, loadTestName, context); } - private LoadTestsClient serviceClient() { + private ResourceProvidersClient serviceClient() { return this.innerClient; } diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/LoadTestResourceListResult.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/models/LoadTestResourceListResult.java similarity index 80% rename from sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/LoadTestResourceListResult.java rename to sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/models/LoadTestResourceListResult.java index 97ef8610033a..bab275766d7d 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/LoadTestResourceListResult.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/models/LoadTestResourceListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.loadtesting.models; +package com.azure.resourcemanager.loadtesting.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,7 +17,7 @@ /** * The response of a LoadTestResource list operation. */ -@Fluent +@Immutable public final class LoadTestResourceListResult implements JsonSerializable { /* * The LoadTestResource items on this page @@ -32,7 +32,7 @@ public final class LoadTestResourceListResult implements JsonSerializable value() { return this.value; } - /** - * Set the value property: The LoadTestResource items on this page. - * - * @param value the value value to set. - * @return the LoadTestResourceListResult object itself. - */ - public LoadTestResourceListResult withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: The link to the next page of items. * @@ -64,17 +53,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the LoadTestResourceListResult object itself. - */ - public LoadTestResourceListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/PagedOutboundEnvironmentEndpoint.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/models/PagedOutboundEnvironmentEndpoint.java similarity index 80% rename from sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/PagedOutboundEnvironmentEndpoint.java rename to sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/models/PagedOutboundEnvironmentEndpoint.java index c0c8c9b26638..0b95c3b4b199 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/PagedOutboundEnvironmentEndpoint.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/models/PagedOutboundEnvironmentEndpoint.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.loadtesting.models; +package com.azure.resourcemanager.loadtesting.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,7 +17,7 @@ /** * Values returned by the List operation. */ -@Fluent +@Immutable public final class PagedOutboundEnvironmentEndpoint implements JsonSerializable { /* * The OutboundEnvironmentEndpoint items on this page @@ -32,7 +32,7 @@ public final class PagedOutboundEnvironmentEndpoint implements JsonSerializable< /** * Creates an instance of PagedOutboundEnvironmentEndpoint class. */ - public PagedOutboundEnvironmentEndpoint() { + private PagedOutboundEnvironmentEndpoint() { } /** @@ -44,17 +44,6 @@ public List value() { return this.value; } - /** - * Set the value property: The OutboundEnvironmentEndpoint items on this page. - * - * @param value the value value to set. - * @return the PagedOutboundEnvironmentEndpoint object itself. - */ - public PagedOutboundEnvironmentEndpoint withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: The link to the next page of items. * @@ -64,17 +53,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the PagedOutboundEnvironmentEndpoint object itself. - */ - public PagedOutboundEnvironmentEndpoint withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/QuotaResourceListResult.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/models/QuotaResourceListResult.java similarity index 80% rename from sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/QuotaResourceListResult.java rename to sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/models/QuotaResourceListResult.java index b5636bc12e4c..4ec9141d227b 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/QuotaResourceListResult.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/models/QuotaResourceListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.loadtesting.models; +package com.azure.resourcemanager.loadtesting.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,7 +17,7 @@ /** * The response of a QuotaResource list operation. */ -@Fluent +@Immutable public final class QuotaResourceListResult implements JsonSerializable { /* * The QuotaResource items on this page @@ -32,7 +32,7 @@ public final class QuotaResourceListResult implements JsonSerializable value() { return this.value; } - /** - * Set the value property: The QuotaResource items on this page. - * - * @param value the value value to set. - * @return the QuotaResourceListResult object itself. - */ - public QuotaResourceListResult withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: The link to the next page of items. * @@ -64,17 +53,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the QuotaResourceListResult object itself. - */ - public QuotaResourceListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/package-info.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/package-info.java index 2ec97d57eb43..66bd711d40bc 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/package-info.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/implementation/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the implementations for LoadTestClient. + * Package containing the implementations for LoadTest. * LoadTest client provides access to LoadTest Resource and it's status operations. */ package com.azure.resourcemanager.loadtesting.implementation; diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/ActionType.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/ActionType.java deleted file mode 100644 index 6dfc84e2965d..000000000000 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/ActionType.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.loadtesting.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - */ -public final class ActionType extends ExpandableStringEnum { - /** - * Static value Internal for ActionType. - */ - public static final ActionType INTERNAL = fromString("Internal"); - - /** - * Creates a new instance of ActionType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ActionType() { - } - - /** - * Creates or finds a ActionType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ActionType. - */ - public static ActionType fromString(String name) { - return fromString(name, ActionType.class); - } - - /** - * Gets known ActionType values. - * - * @return known ActionType values. - */ - public static Collection values() { - return values(ActionType.class); - } -} diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/CheckQuotaAvailabilityResponse.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/CheckQuotaAvailabilityResponse.java index e86cfb0b8ebb..ac7bd8dd0c54 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/CheckQuotaAvailabilityResponse.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/CheckQuotaAvailabilityResponse.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.models; diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/EncryptionProperties.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/EncryptionProperties.java index b4403e8608fb..a02520c4c59a 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/EncryptionProperties.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/EncryptionProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.models; diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/EncryptionPropertiesIdentity.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/EncryptionPropertiesIdentity.java index 1b70bd261589..cdf4f3dfc29c 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/EncryptionPropertiesIdentity.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/EncryptionPropertiesIdentity.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.models; @@ -24,7 +24,7 @@ public final class EncryptionPropertiesIdentity implements JsonSerializable/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. */ private String resourceId; @@ -57,7 +57,7 @@ public EncryptionPropertiesIdentity withType(Type type) { /** * Get the resourceId property: User assigned identity to use for accessing key encryption key Url. Ex: - * /subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/<resource + * /subscriptions/a0a0a0a0-bbbb-cccd-dddd-e1e1e1e1e1e1/resourceGroups/<resource * group>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. * * @return the resourceId value. @@ -68,7 +68,7 @@ public String resourceId() { /** * Set the resourceId property: User assigned identity to use for accessing key encryption key Url. Ex: - * /subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/<resource + * /subscriptions/a0a0a0a0-bbbb-cccd-dddd-e1e1e1e1e1e1/resourceGroups/<resource * group>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. * * @param resourceId the resourceId value to set. diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/EndpointDependency.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/EndpointDependency.java index 9cda75f8e8a4..61fd7fb35893 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/EndpointDependency.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/EndpointDependency.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.models; @@ -35,7 +35,7 @@ public final class EndpointDependency implements JsonSerializable { /** * Creates an instance of EndpointDetail class. */ - public EndpointDetail() { + private EndpointDetail() { } /** diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/models/LoadTestProperties.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/LoadTestProperties.java similarity index 89% rename from sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/models/LoadTestProperties.java rename to sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/LoadTestProperties.java index 64cd3afd8b72..a00431bb897e 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/models/LoadTestProperties.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/LoadTestProperties.java @@ -1,16 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.loadtesting.fluent.models; +package com.azure.resourcemanager.loadtesting.models; import com.azure.core.annotation.Fluent; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.loadtesting.models.EncryptionProperties; -import com.azure.resourcemanager.loadtesting.models.ResourceState; import java.io.IOException; /** @@ -31,7 +29,7 @@ public final class LoadTestProperties implements JsonSerializable tags(); + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + LoadTestProperties properties(); + /** * Gets the identity property: The managed service identities assigned to this resource. * @@ -63,34 +70,6 @@ public interface LoadTestResource { */ SystemData systemData(); - /** - * Gets the description property: Description of the resource. - * - * @return the description value. - */ - String description(); - - /** - * Gets the provisioningState property: Resource provisioning state. - * - * @return the provisioningState value. - */ - ResourceState provisioningState(); - - /** - * Gets the dataPlaneUri property: Resource data plane URI. - * - * @return the dataPlaneUri value. - */ - String dataPlaneUri(); - - /** - * Gets the encryption property: CMK Encryption property. - * - * @return the encryption value. - */ - EncryptionProperties encryption(); - /** * Gets the region of the resource. * @@ -174,8 +153,8 @@ interface WithResourceGroup { * The stage of the LoadTestResource 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.WithTags, DefinitionStages.WithIdentity, - DefinitionStages.WithDescription, DefinitionStages.WithEncryption { + interface WithCreate + extends DefinitionStages.WithTags, DefinitionStages.WithProperties, DefinitionStages.WithIdentity { /** * Executes the create request. * @@ -206,42 +185,29 @@ interface WithTags { } /** - * The stage of the LoadTestResource definition allowing to specify identity. - */ - interface WithIdentity { - /** - * Specifies the identity property: The managed service identities assigned to this resource.. - * - * @param identity The managed service identities assigned to this resource. - * @return the next definition stage. - */ - WithCreate withIdentity(ManagedServiceIdentity identity); - } - - /** - * The stage of the LoadTestResource definition allowing to specify description. + * The stage of the LoadTestResource definition allowing to specify properties. */ - interface WithDescription { + interface WithProperties { /** - * Specifies the description property: Description of the resource.. + * Specifies the properties property: The resource-specific properties for this resource.. * - * @param description Description of the resource. + * @param properties The resource-specific properties for this resource. * @return the next definition stage. */ - WithCreate withDescription(String description); + WithCreate withProperties(LoadTestProperties properties); } /** - * The stage of the LoadTestResource definition allowing to specify encryption. + * The stage of the LoadTestResource definition allowing to specify identity. */ - interface WithEncryption { + interface WithIdentity { /** - * Specifies the encryption property: CMK Encryption property.. + * Specifies the identity property: The managed service identities assigned to this resource.. * - * @param encryption CMK Encryption property. + * @param identity The managed service identities assigned to this resource. * @return the next definition stage. */ - WithCreate withEncryption(EncryptionProperties encryption); + WithCreate withIdentity(ManagedServiceIdentity identity); } } @@ -255,8 +221,7 @@ interface WithEncryption { /** * The template for LoadTestResource update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithDescription, - UpdateStages.WithEncryption { + interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithProperties { /** * Executes the update request. * @@ -304,29 +269,16 @@ interface WithIdentity { } /** - * The stage of the LoadTestResource update allowing to specify description. - */ - interface WithDescription { - /** - * Specifies the description property: Description of the resource.. - * - * @param description Description of the resource. - * @return the next definition stage. - */ - Update withDescription(String description); - } - - /** - * The stage of the LoadTestResource update allowing to specify encryption. + * The stage of the LoadTestResource update allowing to specify properties. */ - interface WithEncryption { + interface WithProperties { /** - * Specifies the encryption property: CMK Encryption property.. + * Specifies the properties property: The resource-specific properties for this resource.. * - * @param encryption CMK Encryption property. + * @param properties The resource-specific properties for this resource. * @return the next definition stage. */ - Update withEncryption(EncryptionProperties encryption); + Update withProperties(LoadTestResourceUpdateProperties properties); } } diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/LoadTestResourcePatchRequestBody.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/LoadTestResourcePatchRequestBody.java deleted file mode 100644 index 0dba723dba1e..000000000000 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/LoadTestResourcePatchRequestBody.java +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.loadtesting.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.loadtesting.fluent.models.LoadTestResourceUpdateProperties; -import java.io.IOException; -import java.util.Map; - -/** - * The type used for update operations of the LoadTestResource. - */ -@Fluent -public final class LoadTestResourcePatchRequestBody implements JsonSerializable { - /* - * The managed service identities assigned to this resource. - */ - private ManagedServiceIdentity identity; - - /* - * Resource tags. - */ - private Map tags; - - /* - * The resource-specific properties for this resource. - */ - private LoadTestResourceUpdateProperties innerProperties; - - /** - * Creates an instance of LoadTestResourcePatchRequestBody class. - */ - public LoadTestResourcePatchRequestBody() { - } - - /** - * Get the identity property: The managed service identities assigned to this resource. - * - * @return the identity value. - */ - public ManagedServiceIdentity identity() { - return this.identity; - } - - /** - * Set the identity property: The managed service identities assigned to this resource. - * - * @param identity the identity value to set. - * @return the LoadTestResourcePatchRequestBody object itself. - */ - public LoadTestResourcePatchRequestBody withIdentity(ManagedServiceIdentity identity) { - this.identity = identity; - 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 LoadTestResourcePatchRequestBody object itself. - */ - public LoadTestResourcePatchRequestBody withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the innerProperties property: The resource-specific properties for this resource. - * - * @return the innerProperties value. - */ - private LoadTestResourceUpdateProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the description property: Description of the resource. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: Description of the resource. - * - * @param description the description value to set. - * @return the LoadTestResourcePatchRequestBody object itself. - */ - public LoadTestResourcePatchRequestBody withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new LoadTestResourceUpdateProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the encryption property: CMK Encryption property. - * - * @return the encryption value. - */ - public EncryptionProperties encryption() { - return this.innerProperties() == null ? null : this.innerProperties().encryption(); - } - - /** - * Set the encryption property: CMK Encryption property. - * - * @param encryption the encryption value to set. - * @return the LoadTestResourcePatchRequestBody object itself. - */ - public LoadTestResourcePatchRequestBody withEncryption(EncryptionProperties encryption) { - if (this.innerProperties() == null) { - this.innerProperties = new LoadTestResourceUpdateProperties(); - } - this.innerProperties().withEncryption(encryption); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (identity() != null) { - identity().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("identity", this.identity); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of LoadTestResourcePatchRequestBody from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of LoadTestResourcePatchRequestBody if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the LoadTestResourcePatchRequestBody. - */ - public static LoadTestResourcePatchRequestBody fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - LoadTestResourcePatchRequestBody deserializedLoadTestResourcePatchRequestBody - = new LoadTestResourcePatchRequestBody(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("identity".equals(fieldName)) { - deserializedLoadTestResourcePatchRequestBody.identity = ManagedServiceIdentity.fromJson(reader); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedLoadTestResourcePatchRequestBody.tags = tags; - } else if ("properties".equals(fieldName)) { - deserializedLoadTestResourcePatchRequestBody.innerProperties - = LoadTestResourceUpdateProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedLoadTestResourcePatchRequestBody; - }); - } -} diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/LoadTestResourceUpdate.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/LoadTestResourceUpdate.java new file mode 100644 index 000000000000..d5673ac79c89 --- /dev/null +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/LoadTestResourceUpdate.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.loadtesting.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for update operations of the LoadTestResource. + */ +@Fluent +public final class LoadTestResourceUpdate implements JsonSerializable { + /* + * The managed service identities assigned to this resource. + */ + private ManagedServiceIdentity identity; + + /* + * Resource tags. + */ + private Map tags; + + /* + * The resource-specific properties for this resource. + */ + private LoadTestResourceUpdateProperties properties; + + /** + * Creates an instance of LoadTestResourceUpdate class. + */ + public LoadTestResourceUpdate() { + } + + /** + * Get the identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The managed service identities assigned to this resource. + * + * @param identity the identity value to set. + * @return the LoadTestResourceUpdate object itself. + */ + public LoadTestResourceUpdate withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + 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 LoadTestResourceUpdate object itself. + */ + public LoadTestResourceUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public LoadTestResourceUpdateProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the LoadTestResourceUpdate object itself. + */ + public LoadTestResourceUpdate withProperties(LoadTestResourceUpdateProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LoadTestResourceUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LoadTestResourceUpdate if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the LoadTestResourceUpdate. + */ + public static LoadTestResourceUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LoadTestResourceUpdate deserializedLoadTestResourceUpdate = new LoadTestResourceUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("identity".equals(fieldName)) { + deserializedLoadTestResourceUpdate.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedLoadTestResourceUpdate.tags = tags; + } else if ("properties".equals(fieldName)) { + deserializedLoadTestResourceUpdate.properties = LoadTestResourceUpdateProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLoadTestResourceUpdate; + }); + } +} diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/models/LoadTestResourceUpdateProperties.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/LoadTestResourceUpdateProperties.java similarity index 95% rename from sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/models/LoadTestResourceUpdateProperties.java rename to sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/LoadTestResourceUpdateProperties.java index 876ed5d6caa6..fdb43b76936f 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/models/LoadTestResourceUpdateProperties.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/LoadTestResourceUpdateProperties.java @@ -1,15 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.loadtesting.fluent.models; +package com.azure.resourcemanager.loadtesting.models; import com.azure.core.annotation.Fluent; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.loadtesting.models.EncryptionProperties; import java.io.IOException; /** diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/ManagedServiceIdentity.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/ManagedServiceIdentity.java index d0d864fa3a5f..96ba22ada0f9 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/ManagedServiceIdentity.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/ManagedServiceIdentity.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.models; @@ -12,7 +12,6 @@ import com.azure.json.JsonWriter; import java.io.IOException; import java.util.Map; -import java.util.UUID; /** * Managed service identity (system assigned and/or user assigned identities). @@ -23,24 +22,21 @@ public final class ManagedServiceIdentity implements JsonSerializable userAssignedIdentities; @@ -56,7 +52,7 @@ public ManagedServiceIdentity() { * * @return the principalId value. */ - public UUID principalId() { + public String principalId() { return this.principalId; } @@ -66,13 +62,12 @@ public UUID principalId() { * * @return the tenantId value. */ - public UUID tenantId() { + public String tenantId() { return this.tenantId; } /** - * Get the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are - * allowed). + * Get the type property: The type of managed identity assigned to this resource. * * @return the type value. */ @@ -81,8 +76,7 @@ public ManagedServiceIdentityType type() { } /** - * Set the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are - * allowed). + * Set the type property: The type of managed identity assigned to this resource. * * @param type the type value to set. * @return the ManagedServiceIdentity object itself. @@ -93,10 +87,7 @@ public ManagedServiceIdentity withType(ManagedServiceIdentityType type) { } /** - * Get the userAssignedIdentities property: The set of user assigned identities associated with the resource. The - * userAssignedIdentities dictionary keys will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - * The dictionary values can be empty objects ({}) in requests. + * Get the userAssignedIdentities property: The identities assigned to this resource by the user. * * @return the userAssignedIdentities value. */ @@ -105,10 +96,7 @@ public Map userAssignedIdentities() { } /** - * Set the userAssignedIdentities property: The set of user assigned identities associated with the resource. The - * userAssignedIdentities dictionary keys will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - * The dictionary values can be empty objects ({}) in requests. + * Set the userAssignedIdentities property: The identities assigned to this resource by the user. * * @param userAssignedIdentities the userAssignedIdentities value to set. * @return the ManagedServiceIdentity object itself. @@ -170,11 +158,9 @@ public static ManagedServiceIdentity fromJson(JsonReader jsonReader) throws IOEx if ("type".equals(fieldName)) { deserializedManagedServiceIdentity.type = ManagedServiceIdentityType.fromString(reader.getString()); } else if ("principalId".equals(fieldName)) { - deserializedManagedServiceIdentity.principalId - = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + deserializedManagedServiceIdentity.principalId = reader.getString(); } else if ("tenantId".equals(fieldName)) { - deserializedManagedServiceIdentity.tenantId - = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + deserializedManagedServiceIdentity.tenantId = reader.getString(); } else if ("userAssignedIdentities".equals(fieldName)) { Map userAssignedIdentities = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1)); diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/ManagedServiceIdentityType.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/ManagedServiceIdentityType.java index 63f81cb15b49..2e9d74b760cb 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/ManagedServiceIdentityType.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/ManagedServiceIdentityType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.models; @@ -12,22 +12,22 @@ */ public final class ManagedServiceIdentityType extends ExpandableStringEnum { /** - * Static value None for ManagedServiceIdentityType. + * No managed identity. */ public static final ManagedServiceIdentityType NONE = fromString("None"); /** - * Static value SystemAssigned for ManagedServiceIdentityType. + * System assigned managed identity. */ public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); /** - * Static value UserAssigned for ManagedServiceIdentityType. + * User assigned managed identity. */ public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); /** - * Static value SystemAssigned,UserAssigned for ManagedServiceIdentityType. + * System and user assigned managed identity. */ public static final ManagedServiceIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED = fromString("SystemAssigned,UserAssigned"); diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/Operation.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/Operation.java deleted file mode 100644 index 47321ab612fd..000000000000 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/Operation.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.loadtesting.models; - -import com.azure.resourcemanager.loadtesting.fluent.models.OperationInner; - -/** - * An immutable client-side representation of Operation. - */ -public interface Operation { - /** - * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - * - * @return the name value. - */ - String name(); - - /** - * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane - * operations and "false" for ARM/control-plane operations. - * - * @return the isDataAction value. - */ - Boolean isDataAction(); - - /** - * Gets the display property: Localized display information for this particular operation. - * - * @return the display value. - */ - OperationDisplay display(); - - /** - * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and - * audit logs UX. Default value is "user,system". - * - * @return the origin value. - */ - Origin origin(); - - /** - * Gets the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal - * only APIs. - * - * @return the actionType value. - */ - ActionType actionType(); - - /** - * Gets the inner com.azure.resourcemanager.loadtesting.fluent.models.OperationInner object. - * - * @return the inner object. - */ - OperationInner innerModel(); -} diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/OperationDisplay.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/OperationDisplay.java deleted file mode 100644 index 37ffbd85a9fd..000000000000 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/OperationDisplay.java +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.loadtesting.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Localized display information for this particular operation. - */ -@Immutable -public final class OperationDisplay implements JsonSerializable { - /* - * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or - * "Microsoft Compute". - */ - private String provider; - - /* - * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or - * "Job Schedule Collections". - */ - private String resource; - - /* - * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. - * "Create or Update Virtual Machine", "Restart Virtual Machine". - */ - private String operation; - - /* - * The short, localized friendly description of the operation; suitable for tool tips and detailed views. - */ - private String description; - - /** - * Creates an instance of OperationDisplay class. - */ - public OperationDisplay() { - } - - /** - * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring - * Insights" or "Microsoft Compute". - * - * @return the provider value. - */ - public String provider() { - return this.provider; - } - - /** - * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. - * "Virtual Machines" or "Job Schedule Collections". - * - * @return the resource value. - */ - public String resource() { - return this.resource; - } - - /** - * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. - * "Create or Update Virtual Machine", "Restart Virtual Machine". - * - * @return the operation value. - */ - public String operation() { - return this.operation; - } - - /** - * Get the description property: The short, localized friendly description of the operation; suitable for tool tips - * and detailed views. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationDisplay from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationDisplay if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the OperationDisplay. - */ - public static OperationDisplay fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationDisplay deserializedOperationDisplay = new OperationDisplay(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("provider".equals(fieldName)) { - deserializedOperationDisplay.provider = reader.getString(); - } else if ("resource".equals(fieldName)) { - deserializedOperationDisplay.resource = reader.getString(); - } else if ("operation".equals(fieldName)) { - deserializedOperationDisplay.operation = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedOperationDisplay.description = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationDisplay; - }); - } -} diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/OperationListResult.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/OperationListResult.java deleted file mode 100644 index 54b9a23c8692..000000000000 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/OperationListResult.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.loadtesting.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.loadtesting.fluent.models.OperationInner; -import java.io.IOException; -import java.util.List; - -/** - * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of - * results. - */ -@Immutable -public final class OperationListResult implements JsonSerializable { - /* - * List of operations supported by the resource provider - */ - private List value; - - /* - * URL to get the next set of operation list results (if there are any). - */ - private String nextLink; - - /** - * Creates an instance of OperationListResult class. - */ - public OperationListResult() { - } - - /** - * Get the value property: List of operations supported by the resource provider. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: URL to get the next set of operation list results (if there are any). - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationListResult if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the OperationListResult. - */ - public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationListResult deserializedOperationListResult = new OperationListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1)); - deserializedOperationListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedOperationListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationListResult; - }); - } -} diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/Operations.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/Operations.java deleted file mode 100644 index 87362f3c659c..000000000000 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/Operations.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.loadtesting.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** - * Resource collection API of Operations. - */ -public interface Operations { - /** - * List the operations for the provider. - * - * @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 a list of REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * List the operations for the provider. - * - * @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 a list of REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(Context context); -} diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/Origin.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/Origin.java deleted file mode 100644 index e39df595011f..000000000000 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/Origin.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.loadtesting.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value - * is "user,system". - */ -public final class Origin extends ExpandableStringEnum { - /** - * Static value user for Origin. - */ - public static final Origin USER = fromString("user"); - - /** - * Static value system for Origin. - */ - public static final Origin SYSTEM = fromString("system"); - - /** - * Static value user,system for Origin. - */ - public static final Origin USER_SYSTEM = fromString("user,system"); - - /** - * Creates a new instance of Origin value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public Origin() { - } - - /** - * Creates or finds a Origin from its string representation. - * - * @param name a name to look for. - * @return the corresponding Origin. - */ - public static Origin fromString(String name) { - return fromString(name, Origin.class); - } - - /** - * Gets known Origin values. - * - * @return known Origin values. - */ - public static Collection values() { - return values(Origin.class); - } -} diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/OutboundEnvironmentEndpoint.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/OutboundEnvironmentEndpoint.java index 8995b712bc6c..0c99f7d33458 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/OutboundEnvironmentEndpoint.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/OutboundEnvironmentEndpoint.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.models; diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/QuotaBucketRequest.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/QuotaBucketRequest.java index c1604966a1d4..305dbadb7023 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/QuotaBucketRequest.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/QuotaBucketRequest.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.models; diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/QuotaBucketRequestPropertiesDimensions.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/QuotaBucketRequestPropertiesDimensions.java index 580b343d49fe..a937ae4c8801 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/QuotaBucketRequestPropertiesDimensions.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/QuotaBucketRequestPropertiesDimensions.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.models; diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/QuotaResource.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/QuotaResource.java index e165e26f4592..90a8b0bab3e5 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/QuotaResource.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/QuotaResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.models; @@ -33,32 +33,18 @@ public interface QuotaResource { String type(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the limit property: Current quota limit of the quota bucket. + * Gets the properties property: The resource-specific properties for this resource. * - * @return the limit value. + * @return the properties value. */ - Integer limit(); + QuotaResourceProperties properties(); /** - * Gets the usage property: Current quota usage of the quota bucket. - * - * @return the usage value. - */ - Integer usage(); - - /** - * Gets the provisioningState property: Resource provisioning state. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the provisioningState value. + * @return the systemData value. */ - ResourceState provisioningState(); + SystemData systemData(); /** * Gets the inner com.azure.resourcemanager.loadtesting.fluent.models.QuotaResourceInner object. diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/models/QuotaResourceProperties.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/QuotaResourceProperties.java similarity index 78% rename from sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/models/QuotaResourceProperties.java rename to sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/QuotaResourceProperties.java index 3226d0e9a05d..e948a7b21363 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/fluent/models/QuotaResourceProperties.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/QuotaResourceProperties.java @@ -1,21 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.loadtesting.fluent.models; +package com.azure.resourcemanager.loadtesting.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.loadtesting.models.ResourceState; import java.io.IOException; /** * Quota bucket resource properties. */ -@Fluent +@Immutable public final class QuotaResourceProperties implements JsonSerializable { /* * Current quota limit of the quota bucket. @@ -35,7 +34,7 @@ public final class QuotaResourceProperties implements JsonSerializable list(String location); - - /** - * List quotas for a given subscription Id. - * - * @param location The name of the Azure region. - * @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 response of a QuotaResource list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String location, Context context); - - /** - * Get the available quota for a quota bucket per region per subscription. - * - * @param location The name of the Azure region. - * @param quotaBucketName The quota name. - * @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 available quota for a quota bucket per region per subscription along with {@link Response}. - */ - Response getWithResponse(String location, String quotaBucketName, Context context); - - /** - * Get the available quota for a quota bucket per region per subscription. - * - * @param location The name of the Azure region. - * @param quotaBucketName The quota name. - * @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 available quota for a quota bucket per region per subscription. - */ - QuotaResource get(String location, String quotaBucketName); - - /** - * Check Quota Availability on quota bucket per region per subscription. - * - * @param location The name of the Azure region. - * @param quotaBucketName The quota name. - * @param body The content of the action request. - * @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 check quota availability response object along with {@link Response}. - */ - Response checkAvailabilityWithResponse(String location, String quotaBucketName, - QuotaBucketRequest body, Context context); - - /** - * Check Quota Availability on quota bucket per region per subscription. - * - * @param location The name of the Azure region. - * @param quotaBucketName The quota name. - * @param body The content of the action request. - * @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 check quota availability response object. - */ - CheckQuotaAvailabilityResponse checkAvailability(String location, String quotaBucketName, QuotaBucketRequest body); -} diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/LoadTests.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/ResourceProviders.java similarity index 65% rename from sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/LoadTests.java rename to sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/ResourceProviders.java index 5138c018b794..c9a56fc5d688 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/LoadTests.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/ResourceProviders.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.models; @@ -9,9 +9,9 @@ import com.azure.core.util.Context; /** - * Resource collection API of LoadTests. + * Resource collection API of ResourceProviders. */ -public interface LoadTests { +public interface ResourceProviders { /** * List LoadTestResource resources by subscription ID. * @@ -114,7 +114,7 @@ Response getByResourceGroupWithResponse(String resourceGroupNa * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return values returned by the List operation as paginated response with {@link PagedIterable}. */ - PagedIterable listOutboundNetworkDependenciesEndpoints(String resourceGroupName, + PagedIterable outboundNetworkDependenciesEndpoints(String resourceGroupName, String loadTestName); /** @@ -128,9 +128,86 @@ PagedIterable listOutboundNetworkDependenciesEndpoi * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return values returned by the List operation as paginated response with {@link PagedIterable}. */ - PagedIterable listOutboundNetworkDependenciesEndpoints(String resourceGroupName, + PagedIterable outboundNetworkDependenciesEndpoints(String resourceGroupName, String loadTestName, Context context); + /** + * Get the available quota for a quota bucket per region per subscription. + * + * @param location The name of the Azure region. + * @param quotaBucketName The quota name. + * @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 available quota for a quota bucket per region per subscription along with {@link Response}. + */ + Response getQuotaWithResponse(String location, String quotaBucketName, Context context); + + /** + * Get the available quota for a quota bucket per region per subscription. + * + * @param location The name of the Azure region. + * @param quotaBucketName The quota name. + * @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 available quota for a quota bucket per region per subscription. + */ + QuotaResource getQuota(String location, String quotaBucketName); + + /** + * List quotas for a given subscription Id. + * + * @param location The name of the Azure region. + * @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 response of a QuotaResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listQuota(String location); + + /** + * List quotas for a given subscription Id. + * + * @param location The name of the Azure region. + * @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 response of a QuotaResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listQuota(String location, Context context); + + /** + * Check Quota Availability on quota bucket per region per subscription. + * + * @param location The name of the Azure region. + * @param quotaBucketName The quota name. + * @param quotaBucketRequest The content of the action request. + * @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 check quota availability response object along with {@link Response}. + */ + Response checkAvailabilityQuotaWithResponse(String location, String quotaBucketName, + QuotaBucketRequest quotaBucketRequest, Context context); + + /** + * Check Quota Availability on quota bucket per region per subscription. + * + * @param location The name of the Azure region. + * @param quotaBucketName The quota name. + * @param quotaBucketRequest The content of the action request. + * @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 check quota availability response object. + */ + CheckQuotaAvailabilityResponse checkAvailabilityQuota(String location, String quotaBucketName, + QuotaBucketRequest quotaBucketRequest); + /** * Get a LoadTestResource. * diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/ResourceState.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/ResourceState.java index 5067164e8870..d12f396bcc67 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/ResourceState.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/ResourceState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.models; @@ -12,22 +12,22 @@ */ public final class ResourceState extends ExpandableStringEnum { /** - * Static value Succeeded for ResourceState. + * Resource has been created. */ public static final ResourceState SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for ResourceState. + * Resource creation failed. */ public static final ResourceState FAILED = fromString("Failed"); /** - * Static value Canceled for ResourceState. + * Resource creation was canceled. */ public static final ResourceState CANCELED = fromString("Canceled"); /** - * Static value Deleted for ResourceState. + * Deleted state. */ public static final ResourceState DELETED = fromString("Deleted"); diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/Type.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/Type.java index d3b6b5fb4498..5fcb94da9ef6 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/Type.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/Type.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.models; @@ -12,12 +12,12 @@ */ public final class Type extends ExpandableStringEnum { /** - * Static value SystemAssigned for Type. + * System assigned identity. */ public static final Type SYSTEM_ASSIGNED = fromString("SystemAssigned"); /** - * Static value UserAssigned for Type. + * User assigned identity. */ public static final Type USER_ASSIGNED = fromString("UserAssigned"); diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/UserAssignedIdentity.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/UserAssignedIdentity.java index 8698abca78fb..5d05dd73a5f5 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/UserAssignedIdentity.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/UserAssignedIdentity.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.models; @@ -10,7 +10,6 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; -import java.util.UUID; /** * User assigned identity properties. @@ -18,14 +17,14 @@ @Immutable public final class UserAssignedIdentity implements JsonSerializable { /* - * The principal ID of the assigned identity. + * The client ID of the assigned identity. */ - private UUID principalId; + private String clientId; /* - * The client ID of the assigned identity. + * The principal ID of the assigned identity. */ - private UUID clientId; + private String principalId; /** * Creates an instance of UserAssignedIdentity class. @@ -34,21 +33,21 @@ public UserAssignedIdentity() { } /** - * Get the principalId property: The principal ID of the assigned identity. + * Get the clientId property: The client ID of the assigned identity. * - * @return the principalId value. + * @return the clientId value. */ - public UUID principalId() { - return this.principalId; + public String clientId() { + return this.clientId; } /** - * Get the clientId property: The client ID of the assigned identity. + * Get the principalId property: The principal ID of the assigned identity. * - * @return the clientId value. + * @return the principalId value. */ - public UUID clientId() { - return this.clientId; + public String principalId() { + return this.principalId; } /** @@ -83,12 +82,10 @@ public static UserAssignedIdentity fromJson(JsonReader jsonReader) throws IOExce String fieldName = reader.getFieldName(); reader.nextToken(); - if ("principalId".equals(fieldName)) { - deserializedUserAssignedIdentity.principalId - = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); - } else if ("clientId".equals(fieldName)) { - deserializedUserAssignedIdentity.clientId - = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + if ("clientId".equals(fieldName)) { + deserializedUserAssignedIdentity.clientId = reader.getString(); + } else if ("principalId".equals(fieldName)) { + deserializedUserAssignedIdentity.principalId = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/package-info.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/package-info.java index 223b8431d8d3..8d4676ef63f9 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/package-info.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/models/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the data models for LoadTestClient. + * Package containing the data models for LoadTest. * LoadTest client provides access to LoadTest Resource and it's status operations. */ package com.azure.resourcemanager.loadtesting.models; diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/package-info.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/package-info.java index 70ee53acdd2c..8c1389356f95 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/package-info.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/com/azure/resourcemanager/loadtesting/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the classes for LoadTestClient. + * Package containing the classes for LoadTest. * LoadTest client provides access to LoadTest Resource and it's status operations. */ package com.azure.resourcemanager.loadtesting; diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/module-info.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/module-info.java index cb9c077670bf..381237572dd1 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/module-info.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/java/module-info.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. module com.azure.resourcemanager.loadtesting { requires transitive com.azure.core.management; @@ -12,4 +12,5 @@ opens com.azure.resourcemanager.loadtesting.fluent.models to com.azure.core; opens com.azure.resourcemanager.loadtesting.models to com.azure.core; + opens com.azure.resourcemanager.loadtesting.implementation.models to com.azure.core; } diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-loadtesting/proxy-config.json b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-loadtesting/proxy-config.json index 592db7607be8..941370eb3ccb 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-loadtesting/proxy-config.json +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-loadtesting/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.loadtesting.implementation.LoadTestsClientImpl$LoadTestsService"],["com.azure.resourcemanager.loadtesting.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.loadtesting.implementation.QuotasClientImpl$QuotasService"]] \ No newline at end of file +[["com.azure.resourcemanager.loadtesting.implementation.ResourceProvidersClientImpl$ResourceProvidersService"]] \ No newline at end of file diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/resources/azure-resourcemanager-loadtesting.properties b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/resources/azure-resourcemanager-loadtesting.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/main/resources/azure-resourcemanager-loadtesting.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/LoadTestsCreateOrUpdateSamples.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/LoadTestsCreateOrUpdateSamples.java deleted file mode 100644 index 70cade993d45..000000000000 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/LoadTestsCreateOrUpdateSamples.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.loadtesting.generated; - -/** - * Samples for LoadTests CreateOrUpdate. - */ -public final class LoadTestsCreateOrUpdateSamples { - /* - * x-ms-original-file: - * specification/loadtestservice/resource-manager/Microsoft.LoadTestService/stable/2022-12-01/examples/ - * LoadTests_CreateOrUpdate.json - */ - /** - * Sample code: Create a LoadTestResource. - * - * @param manager Entry point to LoadTestManager. - */ - public static void createALoadTestResource(com.azure.resourcemanager.loadtesting.LoadTestManager manager) { - manager.loadTests() - .define("myLoadTest") - .withRegion((String) null) - .withExistingResourceGroup("dummyrg") - .create(); - } -} diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/LoadTestsGetByResourceGroupSamples.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/LoadTestsGetByResourceGroupSamples.java deleted file mode 100644 index 9841b5d39ce8..000000000000 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/LoadTestsGetByResourceGroupSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.loadtesting.generated; - -/** - * Samples for LoadTests GetByResourceGroup. - */ -public final class LoadTestsGetByResourceGroupSamples { - /* - * x-ms-original-file: - * specification/loadtestservice/resource-manager/Microsoft.LoadTestService/stable/2022-12-01/examples/LoadTests_Get - * .json - */ - /** - * Sample code: Get a LoadTestResource. - * - * @param manager Entry point to LoadTestManager. - */ - public static void getALoadTestResource(com.azure.resourcemanager.loadtesting.LoadTestManager manager) { - manager.loadTests().getByResourceGroupWithResponse("dummyrg", "myLoadTest", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/LoadTestsUpdateSamples.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/LoadTestsUpdateSamples.java deleted file mode 100644 index 0ddc26e55aff..000000000000 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/LoadTestsUpdateSamples.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.loadtesting.generated; - -import com.azure.resourcemanager.loadtesting.models.LoadTestResource; - -/** - * Samples for LoadTests Update. - */ -public final class LoadTestsUpdateSamples { - /* - * x-ms-original-file: - * specification/loadtestservice/resource-manager/Microsoft.LoadTestService/stable/2022-12-01/examples/ - * LoadTests_Update.json - */ - /** - * Sample code: Update a LoadTestResource. - * - * @param manager Entry point to LoadTestManager. - */ - public static void updateALoadTestResource(com.azure.resourcemanager.loadtesting.LoadTestManager manager) { - LoadTestResource resource = manager.loadTests() - .getByResourceGroupWithResponse("dummyrg", "myLoadTest", com.azure.core.util.Context.NONE) - .getValue(); - resource.update().apply(); - } -} diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/OperationsListSamples.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/OperationsListSamples.java deleted file mode 100644 index b8c9ecc7c493..000000000000 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/OperationsListSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.loadtesting.generated; - -/** - * Samples for Operations List. - */ -public final class OperationsListSamples { - /* - * x-ms-original-file: - * specification/loadtestservice/resource-manager/Microsoft.LoadTestService/stable/2022-12-01/examples/ - * Operations_List.json - */ - /** - * Sample code: List the operations for the provider. - * - * @param manager Entry point to LoadTestManager. - */ - public static void listTheOperationsForTheProvider(com.azure.resourcemanager.loadtesting.LoadTestManager manager) { - manager.operations().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/QuotasCheckAvailabilitySamples.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/QuotasCheckAvailabilitySamples.java deleted file mode 100644 index 4b77263be99b..000000000000 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/QuotasCheckAvailabilitySamples.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.loadtesting.generated; - -/** - * Samples for Quotas CheckAvailability. - */ -public final class QuotasCheckAvailabilitySamples { - /* - * x-ms-original-file: - * specification/loadtestservice/resource-manager/Microsoft.LoadTestService/stable/2022-12-01/examples/ - * Quotas_CheckAvailability.json - */ - /** - * Sample code: Check Quota Availability on quota bucket per region per subscription. - * - * @param manager Entry point to LoadTestManager. - */ - public static void checkQuotaAvailabilityOnQuotaBucketPerRegionPerSubscription( - com.azure.resourcemanager.loadtesting.LoadTestManager manager) { - manager.quotas() - .checkAvailabilityWithResponse("westus", "testQuotaBucket", null, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/ResourceProviderCheckAvailabilityQuotaSamples.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/ResourceProviderCheckAvailabilityQuotaSamples.java new file mode 100644 index 000000000000..458abbafb349 --- /dev/null +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/ResourceProviderCheckAvailabilityQuotaSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.loadtesting.generated; + +import com.azure.resourcemanager.loadtesting.models.QuotaBucketRequest; +import com.azure.resourcemanager.loadtesting.models.QuotaBucketRequestPropertiesDimensions; + +/** + * Samples for ResourceProvider CheckAvailabilityQuota. + */ +public final class ResourceProviderCheckAvailabilityQuotaSamples { + /* + * x-ms-original-file: 2024-12-01-preview/Quotas_CheckAvailability.json + */ + /** + * Sample code: Check Quota Availability on quota bucket per region per subscription. + * + * @param manager Entry point to LoadTestManager. + */ + public static void checkQuotaAvailabilityOnQuotaBucketPerRegionPerSubscription( + com.azure.resourcemanager.loadtesting.LoadTestManager manager) { + manager.resourceProviders() + .checkAvailabilityQuotaWithResponse("westus", "testQuotaBucket", + new QuotaBucketRequest().withCurrentUsage(20) + .withCurrentQuota(40) + .withNewQuota(50) + .withDimensions( + new QuotaBucketRequestPropertiesDimensions().withSubscriptionId("testsubscriptionId") + .withLocation("westus")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/ResourceProviderCreateOrUpdateLoadtestSamples.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/ResourceProviderCreateOrUpdateLoadtestSamples.java new file mode 100644 index 000000000000..8e747cf6f469 --- /dev/null +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/ResourceProviderCreateOrUpdateLoadtestSamples.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.loadtesting.generated; + +import com.azure.resourcemanager.loadtesting.models.EncryptionProperties; +import com.azure.resourcemanager.loadtesting.models.EncryptionPropertiesIdentity; +import com.azure.resourcemanager.loadtesting.models.LoadTestProperties; +import com.azure.resourcemanager.loadtesting.models.ManagedServiceIdentity; +import com.azure.resourcemanager.loadtesting.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.loadtesting.models.Type; +import com.azure.resourcemanager.loadtesting.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ResourceProvider CreateOrUpdateLoadtest. + */ +public final class ResourceProviderCreateOrUpdateLoadtestSamples { + /* + * x-ms-original-file: 2024-12-01-preview/LoadTests_CreateOrUpdate.json + */ + /** + * Sample code: Create a LoadTestResource. + * + * @param manager Entry point to LoadTestManager. + */ + public static void createALoadTestResource(com.azure.resourcemanager.loadtesting.LoadTestManager manager) { + manager.resourceProviders() + .define("myLoadTest") + .withRegion("westus") + .withExistingResourceGroup("dummyrg") + .withTags(mapOf("Team", "Dev Exp")) + .withProperties(new LoadTestProperties().withDescription("This is new load test resource") + .withEncryption(new EncryptionProperties().withIdentity(new EncryptionPropertiesIdentity() + .withType(Type.USER_ASSIGNED) + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1")) + .withKeyUrl("fakeTokenPlaceholder"))) + .withIdentity(new ManagedServiceIdentity() + .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1", + new UserAssignedIdentity()))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/LoadTestsDeleteSamples.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/ResourceProviderDeleteSamples.java similarity index 51% rename from sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/LoadTestsDeleteSamples.java rename to sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/ResourceProviderDeleteSamples.java index ae0a52bcb4a3..d1872522b604 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/LoadTestsDeleteSamples.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/ResourceProviderDeleteSamples.java @@ -1,17 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.generated; /** - * Samples for LoadTests Delete. + * Samples for ResourceProvider Delete. */ -public final class LoadTestsDeleteSamples { +public final class ResourceProviderDeleteSamples { /* - * x-ms-original-file: - * specification/loadtestservice/resource-manager/Microsoft.LoadTestService/stable/2022-12-01/examples/ - * LoadTests_Delete.json + * x-ms-original-file: 2024-12-01-preview/LoadTests_Delete.json */ /** * Sample code: Delete a LoadTestResource. @@ -19,6 +17,6 @@ public final class LoadTestsDeleteSamples { * @param manager Entry point to LoadTestManager. */ public static void deleteALoadTestResource(com.azure.resourcemanager.loadtesting.LoadTestManager manager) { - manager.loadTests().delete("dummyrg", "myLoadTest", com.azure.core.util.Context.NONE); + manager.resourceProviders().delete("dummyrg", "myLoadTest", com.azure.core.util.Context.NONE); } } diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/ResourceProviderGetByResourceGroupSamples.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/ResourceProviderGetByResourceGroupSamples.java new file mode 100644 index 000000000000..dc30a0c5ac83 --- /dev/null +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/ResourceProviderGetByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.loadtesting.generated; + +/** + * Samples for ResourceProvider GetByResourceGroup. + */ +public final class ResourceProviderGetByResourceGroupSamples { + /* + * x-ms-original-file: 2024-12-01-preview/LoadTests_Get.json + */ + /** + * Sample code: Get a LoadTestResource. + * + * @param manager Entry point to LoadTestManager. + */ + public static void getALoadTestResource(com.azure.resourcemanager.loadtesting.LoadTestManager manager) { + manager.resourceProviders() + .getByResourceGroupWithResponse("dummyrg", "myLoadTest", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/QuotasGetSamples.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/ResourceProviderGetQuotaSamples.java similarity index 56% rename from sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/QuotasGetSamples.java rename to sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/ResourceProviderGetQuotaSamples.java index 0bd5010b16e6..9dc6545e909b 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/QuotasGetSamples.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/ResourceProviderGetQuotaSamples.java @@ -1,17 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.generated; /** - * Samples for Quotas Get. + * Samples for ResourceProvider GetQuota. */ -public final class QuotasGetSamples { +public final class ResourceProviderGetQuotaSamples { /* - * x-ms-original-file: - * specification/loadtestservice/resource-manager/Microsoft.LoadTestService/stable/2022-12-01/examples/Quotas_Get. - * json + * x-ms-original-file: 2024-12-01-preview/Quotas_Get.json */ /** * Sample code: Get the available quota for a quota bucket per region per subscription. @@ -20,6 +18,6 @@ public final class QuotasGetSamples { */ public static void getTheAvailableQuotaForAQuotaBucketPerRegionPerSubscription( com.azure.resourcemanager.loadtesting.LoadTestManager manager) { - manager.quotas().getWithResponse("westus", "testQuotaBucket", com.azure.core.util.Context.NONE); + manager.resourceProviders().getQuotaWithResponse("westus", "testQuotaBucket", com.azure.core.util.Context.NONE); } } diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/LoadTestsListByResourceGroupSamples.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/ResourceProviderListByResourceGroupSamples.java similarity index 52% rename from sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/LoadTestsListByResourceGroupSamples.java rename to sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/ResourceProviderListByResourceGroupSamples.java index 5b805c5021e2..ee320c1b11fc 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/LoadTestsListByResourceGroupSamples.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/ResourceProviderListByResourceGroupSamples.java @@ -1,17 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.generated; /** - * Samples for LoadTests ListByResourceGroup. + * Samples for ResourceProvider ListByResourceGroup. */ -public final class LoadTestsListByResourceGroupSamples { +public final class ResourceProviderListByResourceGroupSamples { /* - * x-ms-original-file: - * specification/loadtestservice/resource-manager/Microsoft.LoadTestService/stable/2022-12-01/examples/ - * LoadTests_ListByResourceGroup.json + * x-ms-original-file: 2024-12-01-preview/LoadTests_ListByResourceGroup.json */ /** * Sample code: List LoadTestResource resources by resource group. @@ -20,6 +18,6 @@ public final class LoadTestsListByResourceGroupSamples { */ public static void listLoadTestResourceResourcesByResourceGroup(com.azure.resourcemanager.loadtesting.LoadTestManager manager) { - manager.loadTests().listByResourceGroup("dummyrg", com.azure.core.util.Context.NONE); + manager.resourceProviders().listByResourceGroup("dummyrg", com.azure.core.util.Context.NONE); } } diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/QuotasListSamples.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/ResourceProviderListQuotaSamples.java similarity index 55% rename from sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/QuotasListSamples.java rename to sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/ResourceProviderListQuotaSamples.java index 431a21456bd3..cbc80831aa88 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/QuotasListSamples.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/ResourceProviderListQuotaSamples.java @@ -1,17 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.generated; /** - * Samples for Quotas List. + * Samples for ResourceProvider ListQuota. */ -public final class QuotasListSamples { +public final class ResourceProviderListQuotaSamples { /* - * x-ms-original-file: - * specification/loadtestservice/resource-manager/Microsoft.LoadTestService/stable/2022-12-01/examples/Quotas_List. - * json + * x-ms-original-file: 2024-12-01-preview/Quotas_List.json */ /** * Sample code: List quotas for a given subscription Id. @@ -20,6 +18,6 @@ public final class QuotasListSamples { */ public static void listQuotasForAGivenSubscriptionId(com.azure.resourcemanager.loadtesting.LoadTestManager manager) { - manager.quotas().list("westus", com.azure.core.util.Context.NONE); + manager.resourceProviders().listQuota("westus", com.azure.core.util.Context.NONE); } } diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/LoadTestsListSamples.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/ResourceProviderListSamples.java similarity index 55% rename from sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/LoadTestsListSamples.java rename to sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/ResourceProviderListSamples.java index 6363d792c9d7..406f9153b20d 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/LoadTestsListSamples.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/ResourceProviderListSamples.java @@ -1,17 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.generated; /** - * Samples for LoadTests List. + * Samples for ResourceProvider List. */ -public final class LoadTestsListSamples { +public final class ResourceProviderListSamples { /* - * x-ms-original-file: - * specification/loadtestservice/resource-manager/Microsoft.LoadTestService/stable/2022-12-01/examples/ - * LoadTests_ListBySubscription.json + * x-ms-original-file: 2024-12-01-preview/LoadTests_ListBySubscription.json */ /** * Sample code: List LoadTestResource resources by subscription ID. @@ -20,6 +18,6 @@ public final class LoadTestsListSamples { */ public static void listLoadTestResourceResourcesBySubscriptionID(com.azure.resourcemanager.loadtesting.LoadTestManager manager) { - manager.loadTests().list(com.azure.core.util.Context.NONE); + manager.resourceProviders().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/LoadTestsListOutboundNetworkDependenciesEndpointsSamples.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/ResourceProviderOutboundNetworkDependenciesEndpointsSamples.java similarity index 50% rename from sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/LoadTestsListOutboundNetworkDependenciesEndpointsSamples.java rename to sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/ResourceProviderOutboundNetworkDependenciesEndpointsSamples.java index 9be0f8787e3c..61e177a2743c 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/LoadTestsListOutboundNetworkDependenciesEndpointsSamples.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/ResourceProviderOutboundNetworkDependenciesEndpointsSamples.java @@ -1,17 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.generated; /** - * Samples for LoadTests ListOutboundNetworkDependenciesEndpoints. + * Samples for ResourceProvider OutboundNetworkDependenciesEndpoints. */ -public final class LoadTestsListOutboundNetworkDependenciesEndpointsSamples { +public final class ResourceProviderOutboundNetworkDependenciesEndpointsSamples { /* - * x-ms-original-file: - * specification/loadtestservice/resource-manager/Microsoft.LoadTestService/stable/2022-12-01/examples/ - * LoadTests_ListOutboundNetworkDependenciesEndpoints.json + * x-ms-original-file: 2024-12-01-preview/LoadTests_ListOutboundNetworkDependenciesEndpoints.json */ /** * Sample code: Lists the endpoints that agents may call as part of load testing. @@ -20,8 +18,8 @@ public final class LoadTestsListOutboundNetworkDependenciesEndpointsSamples { */ public static void listsTheEndpointsThatAgentsMayCallAsPartOfLoadTesting( com.azure.resourcemanager.loadtesting.LoadTestManager manager) { - manager.loadTests() - .listOutboundNetworkDependenciesEndpoints("default-azureloadtest-japaneast", "sampleloadtest", + manager.resourceProviders() + .outboundNetworkDependenciesEndpoints("default-azureloadtest-japaneast", "sampleloadtest", com.azure.core.util.Context.NONE); } } diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/ResourceProviderUpdateLoadtestSamples.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/ResourceProviderUpdateLoadtestSamples.java new file mode 100644 index 000000000000..c72aaa3b9520 --- /dev/null +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/samples/java/com/azure/resourcemanager/loadtesting/generated/ResourceProviderUpdateLoadtestSamples.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.loadtesting.generated; + +import com.azure.resourcemanager.loadtesting.models.EncryptionProperties; +import com.azure.resourcemanager.loadtesting.models.EncryptionPropertiesIdentity; +import com.azure.resourcemanager.loadtesting.models.LoadTestResource; +import com.azure.resourcemanager.loadtesting.models.LoadTestResourceUpdateProperties; +import com.azure.resourcemanager.loadtesting.models.ManagedServiceIdentity; +import com.azure.resourcemanager.loadtesting.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.loadtesting.models.Type; +import com.azure.resourcemanager.loadtesting.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ResourceProvider UpdateLoadtest. + */ +public final class ResourceProviderUpdateLoadtestSamples { + /* + * x-ms-original-file: 2024-12-01-preview/LoadTests_Update.json + */ + /** + * Sample code: Update a LoadTestResource. + * + * @param manager Entry point to LoadTestManager. + */ + public static void updateALoadTestResource(com.azure.resourcemanager.loadtesting.LoadTestManager manager) { + LoadTestResource resource = manager.resourceProviders() + .getByResourceGroupWithResponse("dummyrg", "myLoadTest", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("Team", "Dev Exp", "Division", "LT")) + .withIdentity(new ManagedServiceIdentity() + .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1", + new UserAssignedIdentity()))) + .withProperties(new LoadTestResourceUpdateProperties().withDescription("This is new load test resource") + .withEncryption(new EncryptionProperties() + .withIdentity(new EncryptionPropertiesIdentity().withType(Type.SYSTEM_ASSIGNED)) + .withKeyUrl("fakeTokenPlaceholder"))) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/CheckQuotaAvailabilityResponseInnerTests.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/CheckQuotaAvailabilityResponseInnerTests.java index 309ce56113cf..508a0ed1ceb0 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/CheckQuotaAvailabilityResponseInnerTests.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/CheckQuotaAvailabilityResponseInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.generated; @@ -12,18 +12,9 @@ public final class CheckQuotaAvailabilityResponseInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CheckQuotaAvailabilityResponseInner model = BinaryData.fromString( - "{\"id\":\"hkr\",\"type\":\"pdappds\",\"name\":\"vwrwj\",\"properties\":{\"isAvailable\":false,\"availabilityStatus\":\"hutje\"}}") + "{\"id\":\"jgzjaoyfhrtx\",\"type\":\"lnerkujysvleju\",\"name\":\"awrlyx\",\"properties\":{\"isAvailable\":false,\"availabilityStatus\":\"rbnwbxgjvtbvpy\"}}") .toObject(CheckQuotaAvailabilityResponseInner.class); - Assertions.assertEquals(false, model.isAvailable()); - Assertions.assertEquals("hutje", model.availabilityStatus()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CheckQuotaAvailabilityResponseInner model - = new CheckQuotaAvailabilityResponseInner().withIsAvailable(false).withAvailabilityStatus("hutje"); - model = BinaryData.fromObject(model).toObject(CheckQuotaAvailabilityResponseInner.class); - Assertions.assertEquals(false, model.isAvailable()); - Assertions.assertEquals("hutje", model.availabilityStatus()); + Assertions.assertFalse(model.isAvailable()); + Assertions.assertEquals("rbnwbxgjvtbvpy", model.availabilityStatus()); } } diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/CheckQuotaAvailabilityResponsePropertiesTests.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/CheckQuotaAvailabilityResponsePropertiesTests.java index ce23795ae034..e0db525b6c91 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/CheckQuotaAvailabilityResponsePropertiesTests.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/CheckQuotaAvailabilityResponsePropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.generated; @@ -12,19 +12,9 @@ public final class CheckQuotaAvailabilityResponsePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CheckQuotaAvailabilityResponseProperties model - = BinaryData.fromString("{\"isAvailable\":false,\"availabilityStatus\":\"ldhugjzzdatqxh\"}") + = BinaryData.fromString("{\"isAvailable\":false,\"availabilityStatus\":\"nruj\"}") .toObject(CheckQuotaAvailabilityResponseProperties.class); - Assertions.assertEquals(false, model.isAvailable()); - Assertions.assertEquals("ldhugjzzdatqxh", model.availabilityStatus()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CheckQuotaAvailabilityResponseProperties model - = new CheckQuotaAvailabilityResponseProperties().withIsAvailable(false) - .withAvailabilityStatus("ldhugjzzdatqxh"); - model = BinaryData.fromObject(model).toObject(CheckQuotaAvailabilityResponseProperties.class); - Assertions.assertEquals(false, model.isAvailable()); - Assertions.assertEquals("ldhugjzzdatqxh", model.availabilityStatus()); + Assertions.assertFalse(model.isAvailable()); + Assertions.assertEquals("nruj", model.availabilityStatus()); } } diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/EncryptionPropertiesIdentityTests.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/EncryptionPropertiesIdentityTests.java index c8adadd767e3..f8316b0200c8 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/EncryptionPropertiesIdentityTests.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/EncryptionPropertiesIdentityTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.generated; @@ -12,18 +12,19 @@ public final class EncryptionPropertiesIdentityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - EncryptionPropertiesIdentity model = BinaryData.fromString("{\"type\":\"UserAssigned\",\"resourceId\":\"w\"}") - .toObject(EncryptionPropertiesIdentity.class); + EncryptionPropertiesIdentity model + = BinaryData.fromString("{\"type\":\"UserAssigned\",\"resourceId\":\"qucmpo\"}") + .toObject(EncryptionPropertiesIdentity.class); Assertions.assertEquals(Type.USER_ASSIGNED, model.type()); - Assertions.assertEquals("w", model.resourceId()); + Assertions.assertEquals("qucmpo", model.resourceId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { EncryptionPropertiesIdentity model - = new EncryptionPropertiesIdentity().withType(Type.USER_ASSIGNED).withResourceId("w"); + = new EncryptionPropertiesIdentity().withType(Type.USER_ASSIGNED).withResourceId("qucmpo"); model = BinaryData.fromObject(model).toObject(EncryptionPropertiesIdentity.class); Assertions.assertEquals(Type.USER_ASSIGNED, model.type()); - Assertions.assertEquals("w", model.resourceId()); + Assertions.assertEquals("qucmpo", model.resourceId()); } } diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/EndpointDependencyTests.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/EndpointDependencyTests.java index c5c619aac551..d24ea1bd1a34 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/EndpointDependencyTests.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/EndpointDependencyTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.generated; @@ -11,13 +11,7 @@ public final class EndpointDependencyTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { EndpointDependency model = BinaryData.fromString( - "{\"domainName\":\"fqpte\",\"description\":\"zzvypyqrimzinp\",\"endpointDetails\":[{\"port\":1273702243}]}") + "{\"domainName\":\"sqrglssainq\",\"description\":\"wnzlljfmppeeb\",\"endpointDetails\":[{\"port\":1969125414},{\"port\":1742159588}]}") .toObject(EndpointDependency.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EndpointDependency model = new EndpointDependency(); - model = BinaryData.fromObject(model).toObject(EndpointDependency.class); - } } diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/EndpointDetailTests.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/EndpointDetailTests.java index a44b790a422c..54c0240ab09f 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/EndpointDetailTests.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/EndpointDetailTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.generated; @@ -10,12 +10,6 @@ public final class EndpointDetailTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - EndpointDetail model = BinaryData.fromString("{\"port\":1998185224}").toObject(EndpointDetail.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EndpointDetail model = new EndpointDetail(); - model = BinaryData.fromObject(model).toObject(EndpointDetail.class); + EndpointDetail model = BinaryData.fromString("{\"port\":2117273621}").toObject(EndpointDetail.class); } } diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/ManagedServiceIdentityTests.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/ManagedServiceIdentityTests.java index 03625d756566..4716a2f3a490 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/ManagedServiceIdentityTests.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/ManagedServiceIdentityTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.generated; @@ -16,19 +16,19 @@ public final class ManagedServiceIdentityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ManagedServiceIdentity model = BinaryData.fromString( - "{\"principalId\":\"f30cbbea-0dca-4bdf-bf12-84b1245708c8\",\"tenantId\":\"be5c6a39-ea2f-4c03-a5d8-8ac44629b47e\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"oqpsoa\":{\"principalId\":\"39e02d32-6e81-4105-9304-95140c70362b\",\"clientId\":\"6cf3cded-af38-42d7-bf71-f160c23b3f48\"},\"azakl\":{\"principalId\":\"4b9f4fd5-512d-4630-bc31-9624700861b1\",\"clientId\":\"555fffed-b231-45af-9602-83b17bf10cf2\"},\"hbcryffdfdosyge\":{\"principalId\":\"f99bb37e-f075-4f1d-b312-752d135d86b3\",\"clientId\":\"e603fde4-9ccd-4a3a-ab25-53de1d1a5d45\"}}}") + "{\"principalId\":\"dkfo\",\"tenantId\":\"nygj\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"hs\":{\"clientId\":\"eqsrdeupewnwreit\",\"principalId\":\"yflusarhmofc\"},\"arcryuanzwuxzdxt\":{\"clientId\":\"urkdtmlx\",\"principalId\":\"kuksjtxukcdm\"},\"rqobmtuk\":{\"clientId\":\"rlhm\",\"principalId\":\"fp\"},\"kohdbiha\":{\"clientId\":\"ryrtihfxtijbpzv\",\"principalId\":\"wzsymglzufcy\"}}}") .toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.type()); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.type()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ManagedServiceIdentity model - = new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("oqpsoa", new UserAssignedIdentity(), "azakl", - new UserAssignedIdentity(), "hbcryffdfdosyge", new UserAssignedIdentity())); + ManagedServiceIdentity model = new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities( + mapOf("hs", new UserAssignedIdentity(), "arcryuanzwuxzdxt", new UserAssignedIdentity(), "rqobmtuk", + new UserAssignedIdentity(), "kohdbiha", new UserAssignedIdentity())); model = BinaryData.fromObject(model).toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.type()); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.type()); } // Use "Map.of" if available diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/OperationDisplayTests.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/OperationDisplayTests.java deleted file mode 100644 index c85e613ef58c..000000000000 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/OperationDisplayTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.loadtesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loadtesting.models.OperationDisplay; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = BinaryData.fromString( - "{\"provider\":\"yrtih\",\"resource\":\"tijbpzvgnwzsymgl\",\"operation\":\"fcyzkohdbihanufh\",\"description\":\"bj\"}") - .toObject(OperationDisplay.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay(); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - } -} diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/OperationInnerTests.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/OperationInnerTests.java deleted file mode 100644 index 36514b571453..000000000000 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/OperationInnerTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.loadtesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loadtesting.fluent.models.OperationInner; -import com.azure.resourcemanager.loadtesting.models.OperationDisplay; - -public final class OperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInner model = BinaryData.fromString( - "{\"name\":\"usarhmofc\",\"isDataAction\":false,\"display\":{\"provider\":\"urkdtmlx\",\"resource\":\"kuksjtxukcdm\",\"operation\":\"rcryuanzwuxzdxta\",\"description\":\"lhmwhfpmrqobm\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") - .toObject(OperationInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withDisplay(new OperationDisplay()); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - } -} diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/OperationListResultTests.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/OperationListResultTests.java deleted file mode 100644 index a39e4ed514db..000000000000 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/OperationListResultTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.loadtesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loadtesting.models.OperationListResult; - -public final class OperationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationListResult model = BinaryData.fromString( - "{\"value\":[{\"name\":\"quvgjxpybczme\",\"isDataAction\":true,\"display\":{\"provider\":\"pbsphrupidgs\",\"resource\":\"bejhphoycmsxa\",\"operation\":\"hdxbmtqio\",\"description\":\"zehtbmu\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"izhwlrxy\",\"isDataAction\":false,\"display\":{\"provider\":\"ijgkdm\",\"resource\":\"azlobcufpdznrbt\",\"operation\":\"qjnqglhqgnufoooj\",\"description\":\"ifsqesaagdfmg\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"rifkwm\",\"isDataAction\":true,\"display\":{\"provider\":\"izntocipao\",\"resource\":\"jpsq\",\"operation\":\"mpoyfd\",\"description\":\"ogknygjofjdd\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}],\"nextLink\":\"upewnwreitjzy\"}") - .toObject(OperationListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model = new OperationListResult(); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); - } -} diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/OperationsListMockTests.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/OperationsListMockTests.java deleted file mode 100644 index 9f45eff7a396..000000000000 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/OperationsListMockTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.loadtesting.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.loadtesting.LoadTestManager; -import com.azure.resourcemanager.loadtesting.models.Operation; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class OperationsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"name\":\"soodqxhcrmnoh\",\"isDataAction\":false,\"display\":{\"provider\":\"h\",\"resource\":\"oifiyipjxsqwpgr\",\"operation\":\"znorcj\",\"description\":\"snb\"},\"origin\":\"user\",\"actionType\":\"Internal\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - LoadTestManager manager = LoadTestManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/OutboundEnvironmentEndpointInnerTests.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/OutboundEnvironmentEndpointInnerTests.java index 47aa29c46fce..360a84e2794a 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/OutboundEnvironmentEndpointInnerTests.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/OutboundEnvironmentEndpointInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.generated; @@ -11,13 +11,7 @@ public final class OutboundEnvironmentEndpointInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OutboundEnvironmentEndpointInner model = BinaryData.fromString( - "{\"category\":\"hr\",\"endpoints\":[{\"domainName\":\"fvzwdzuhty\",\"description\":\"isdkfthwxmnteiw\",\"endpointDetails\":[{\"port\":269791591},{\"port\":1582483628},{\"port\":93191871},{\"port\":779159524}]},{\"domainName\":\"xdcu\",\"description\":\"fsrpymzidnse\",\"endpointDetails\":[{\"port\":564973983},{\"port\":391919190},{\"port\":820164188},{\"port\":121296393}]},{\"domainName\":\"cs\",\"description\":\"wmdwzjeiachboo\",\"endpointDetails\":[{\"port\":361275746},{\"port\":13730136}]}]}") + "{\"category\":\"fygxgispemvtzfk\",\"endpoints\":[{\"domainName\":\"bljofxqeof\",\"description\":\"e\",\"endpointDetails\":[{\"port\":1787416912},{\"port\":915193606},{\"port\":91789189}]},{\"domainName\":\"msmjqulngsntn\",\"description\":\"bkzgcwrwclx\",\"endpointDetails\":[{\"port\":1334059398},{\"port\":1070346714},{\"port\":890604952}]},{\"domainName\":\"kcqvkocrc\",\"description\":\"kwt\",\"endpointDetails\":[{\"port\":1728330738},{\"port\":1272736991},{\"port\":339957012}]}]}") .toObject(OutboundEnvironmentEndpointInner.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OutboundEnvironmentEndpointInner model = new OutboundEnvironmentEndpointInner(); - model = BinaryData.fromObject(model).toObject(OutboundEnvironmentEndpointInner.class); - } } diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/PagedOutboundEnvironmentEndpointTests.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/PagedOutboundEnvironmentEndpointTests.java index 8364d0908718..79cf5a1237a8 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/PagedOutboundEnvironmentEndpointTests.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/PagedOutboundEnvironmentEndpointTests.java @@ -1,30 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loadtesting.fluent.models.OutboundEnvironmentEndpointInner; -import com.azure.resourcemanager.loadtesting.models.PagedOutboundEnvironmentEndpoint; -import java.util.Arrays; +import com.azure.resourcemanager.loadtesting.implementation.models.PagedOutboundEnvironmentEndpoint; import org.junit.jupiter.api.Assertions; public final class PagedOutboundEnvironmentEndpointTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PagedOutboundEnvironmentEndpoint model = BinaryData.fromString( - "{\"value\":[{\"category\":\"ktapspwgcuertu\",\"endpoints\":[{\"domainName\":\"o\",\"description\":\"qw\",\"endpointDetails\":[{},{},{}]},{\"domainName\":\"dgbb\",\"description\":\"ddgmb\",\"endpointDetails\":[{}]},{\"domainName\":\"xppbhtqqro\",\"description\":\"p\",\"endpointDetails\":[{}]},{\"domainName\":\"algbquxigjyjg\",\"description\":\"aoyfhrtxilnerkuj\",\"endpointDetails\":[{},{},{}]}]},{\"category\":\"eju\",\"endpoints\":[{\"domainName\":\"awrlyx\",\"description\":\"kcprbnw\",\"endpointDetails\":[{},{}]},{\"domainName\":\"jvtbvpyss\",\"description\":\"nruj\",\"endpointDetails\":[{},{},{},{}]},{\"domainName\":\"hmuouqfprwzwbn\",\"description\":\"itnwuizgazxufi\",\"endpointDetails\":[{},{}]}]}],\"nextLink\":\"y\"}") + "{\"value\":[{\"category\":\"ryo\",\"endpoints\":[{\"domainName\":\"oacctaza\",\"description\":\"j\",\"endpointDetails\":[{},{},{},{}]},{\"domainName\":\"bcryffdfd\",\"description\":\"ygexpaojakhmsb\",\"endpointDetails\":[{},{}]},{\"domainName\":\"crzevdphlx\",\"description\":\"lthqtrgqjbp\",\"endpointDetails\":[{},{},{},{}]}]},{\"category\":\"inzgvfcj\",\"endpoints\":[{\"domainName\":\"oxxjtfelluwf\",\"description\":\"tonpe\",\"endpointDetails\":[{},{},{}]},{\"domainName\":\"jkjlxofpdvhpfx\",\"description\":\"pini\",\"endpointDetails\":[{},{}]}]},{\"category\":\"huyb\",\"endpoints\":[{\"domainName\":\"odepoogin\",\"description\":\"amiheognarxz\",\"endpointDetails\":[{},{}]},{\"domainName\":\"eotusivyevc\",\"description\":\"qi\",\"endpointDetails\":[{},{},{}]}]}],\"nextLink\":\"ngbwjz\"}") .toObject(PagedOutboundEnvironmentEndpoint.class); - Assertions.assertEquals("y", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PagedOutboundEnvironmentEndpoint model = new PagedOutboundEnvironmentEndpoint() - .withValue(Arrays.asList(new OutboundEnvironmentEndpointInner(), new OutboundEnvironmentEndpointInner())) - .withNextLink("y"); - model = BinaryData.fromObject(model).toObject(PagedOutboundEnvironmentEndpoint.class); - Assertions.assertEquals("y", model.nextLink()); + Assertions.assertEquals("ngbwjz", model.nextLink()); } } diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/QuotaBucketRequestPropertiesDimensionsTests.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/QuotaBucketRequestPropertiesDimensionsTests.java index 5d2b267e2597..4afe4bfb5e1b 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/QuotaBucketRequestPropertiesDimensionsTests.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/QuotaBucketRequestPropertiesDimensionsTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.generated; @@ -12,19 +12,18 @@ public final class QuotaBucketRequestPropertiesDimensionsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { QuotaBucketRequestPropertiesDimensions model - = BinaryData.fromString("{\"subscriptionId\":\"ebvmgxsabkyqd\",\"location\":\"jitcjczdzevn\"}") + = BinaryData.fromString("{\"subscriptionId\":\"s\",\"location\":\"gbquxigj\"}") .toObject(QuotaBucketRequestPropertiesDimensions.class); - Assertions.assertEquals("ebvmgxsabkyqd", model.subscriptionId()); - Assertions.assertEquals("jitcjczdzevn", model.location()); + Assertions.assertEquals("s", model.subscriptionId()); + Assertions.assertEquals("gbquxigj", model.location()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { QuotaBucketRequestPropertiesDimensions model - = new QuotaBucketRequestPropertiesDimensions().withSubscriptionId("ebvmgxsabkyqd") - .withLocation("jitcjczdzevn"); + = new QuotaBucketRequestPropertiesDimensions().withSubscriptionId("s").withLocation("gbquxigj"); model = BinaryData.fromObject(model).toObject(QuotaBucketRequestPropertiesDimensions.class); - Assertions.assertEquals("ebvmgxsabkyqd", model.subscriptionId()); - Assertions.assertEquals("jitcjczdzevn", model.location()); + Assertions.assertEquals("s", model.subscriptionId()); + Assertions.assertEquals("gbquxigj", model.location()); } } diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/QuotaBucketRequestPropertiesTests.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/QuotaBucketRequestPropertiesTests.java index 8256f4ce21bc..77b21c57b5e3 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/QuotaBucketRequestPropertiesTests.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/QuotaBucketRequestPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.generated; @@ -13,27 +13,27 @@ public final class QuotaBucketRequestPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { QuotaBucketRequestProperties model = BinaryData.fromString( - "{\"currentUsage\":747491790,\"currentQuota\":1343054120,\"newQuota\":1034535063,\"dimensions\":{\"subscriptionId\":\"njbiksqrglssain\",\"location\":\"jwnzlljfmp\"}}") + "{\"currentUsage\":609393619,\"currentQuota\":693802,\"newQuota\":914724830,\"dimensions\":{\"subscriptionId\":\"bmbexppbhtqqro\",\"location\":\"p\"}}") .toObject(QuotaBucketRequestProperties.class); - Assertions.assertEquals(747491790, model.currentUsage()); - Assertions.assertEquals(1343054120, model.currentQuota()); - Assertions.assertEquals(1034535063, model.newQuota()); - Assertions.assertEquals("njbiksqrglssain", model.dimensions().subscriptionId()); - Assertions.assertEquals("jwnzlljfmp", model.dimensions().location()); + Assertions.assertEquals(609393619, model.currentUsage()); + Assertions.assertEquals(693802, model.currentQuota()); + Assertions.assertEquals(914724830, model.newQuota()); + Assertions.assertEquals("bmbexppbhtqqro", model.dimensions().subscriptionId()); + Assertions.assertEquals("p", model.dimensions().location()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - QuotaBucketRequestProperties model = new QuotaBucketRequestProperties().withCurrentUsage(747491790) - .withCurrentQuota(1343054120) - .withNewQuota(1034535063) - .withDimensions(new QuotaBucketRequestPropertiesDimensions().withSubscriptionId("njbiksqrglssain") - .withLocation("jwnzlljfmp")); + QuotaBucketRequestProperties model = new QuotaBucketRequestProperties().withCurrentUsage(609393619) + .withCurrentQuota(693802) + .withNewQuota(914724830) + .withDimensions( + new QuotaBucketRequestPropertiesDimensions().withSubscriptionId("bmbexppbhtqqro").withLocation("p")); model = BinaryData.fromObject(model).toObject(QuotaBucketRequestProperties.class); - Assertions.assertEquals(747491790, model.currentUsage()); - Assertions.assertEquals(1343054120, model.currentQuota()); - Assertions.assertEquals(1034535063, model.newQuota()); - Assertions.assertEquals("njbiksqrglssain", model.dimensions().subscriptionId()); - Assertions.assertEquals("jwnzlljfmp", model.dimensions().location()); + Assertions.assertEquals(609393619, model.currentUsage()); + Assertions.assertEquals(693802, model.currentQuota()); + Assertions.assertEquals(914724830, model.newQuota()); + Assertions.assertEquals("bmbexppbhtqqro", model.dimensions().subscriptionId()); + Assertions.assertEquals("p", model.dimensions().location()); } } diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/QuotaBucketRequestTests.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/QuotaBucketRequestTests.java index c65a41f67d4f..0e787d615cd2 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/QuotaBucketRequestTests.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/QuotaBucketRequestTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.generated; @@ -13,27 +13,27 @@ public final class QuotaBucketRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { QuotaBucketRequest model = BinaryData.fromString( - "{\"properties\":{\"currentUsage\":105854038,\"currentQuota\":406268406,\"newQuota\":823404328,\"dimensions\":{\"subscriptionId\":\"clxxwrljdo\",\"location\":\"kcqvkocrc\"}}}") + "{\"properties\":{\"currentUsage\":1519721589,\"currentQuota\":412437103,\"newQuota\":1911925190,\"dimensions\":{\"subscriptionId\":\"gcue\",\"location\":\"umkdosvqwhbmd\"}}}") .toObject(QuotaBucketRequest.class); - Assertions.assertEquals(105854038, model.currentUsage()); - Assertions.assertEquals(406268406, model.currentQuota()); - Assertions.assertEquals(823404328, model.newQuota()); - Assertions.assertEquals("clxxwrljdo", model.dimensions().subscriptionId()); - Assertions.assertEquals("kcqvkocrc", model.dimensions().location()); + Assertions.assertEquals(1519721589, model.currentUsage()); + Assertions.assertEquals(412437103, model.currentQuota()); + Assertions.assertEquals(1911925190, model.newQuota()); + Assertions.assertEquals("gcue", model.dimensions().subscriptionId()); + Assertions.assertEquals("umkdosvqwhbmd", model.dimensions().location()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - QuotaBucketRequest model = new QuotaBucketRequest().withCurrentUsage(105854038) - .withCurrentQuota(406268406) - .withNewQuota(823404328) - .withDimensions(new QuotaBucketRequestPropertiesDimensions().withSubscriptionId("clxxwrljdo") - .withLocation("kcqvkocrc")); + QuotaBucketRequest model = new QuotaBucketRequest().withCurrentUsage(1519721589) + .withCurrentQuota(412437103) + .withNewQuota(1911925190) + .withDimensions( + new QuotaBucketRequestPropertiesDimensions().withSubscriptionId("gcue").withLocation("umkdosvqwhbmd")); model = BinaryData.fromObject(model).toObject(QuotaBucketRequest.class); - Assertions.assertEquals(105854038, model.currentUsage()); - Assertions.assertEquals(406268406, model.currentQuota()); - Assertions.assertEquals(823404328, model.newQuota()); - Assertions.assertEquals("clxxwrljdo", model.dimensions().subscriptionId()); - Assertions.assertEquals("kcqvkocrc", model.dimensions().location()); + Assertions.assertEquals(1519721589, model.currentUsage()); + Assertions.assertEquals(412437103, model.currentQuota()); + Assertions.assertEquals(1911925190, model.newQuota()); + Assertions.assertEquals("gcue", model.dimensions().subscriptionId()); + Assertions.assertEquals("umkdosvqwhbmd", model.dimensions().location()); } } diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/QuotaResourceInnerTests.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/QuotaResourceInnerTests.java index 67805e2cab9f..b6c6d659a6f8 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/QuotaResourceInnerTests.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/QuotaResourceInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.generated; @@ -12,17 +12,9 @@ public final class QuotaResourceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { QuotaResourceInner model = BinaryData.fromString( - "{\"properties\":{\"limit\":283529548,\"usage\":1437097866,\"provisioningState\":\"Failed\"},\"id\":\"qeof\",\"name\":\"aeqjhqjbasvms\",\"type\":\"jqul\"}") + "{\"properties\":{\"limit\":1982194402,\"usage\":922988316,\"provisioningState\":\"Succeeded\"},\"id\":\"jczdzevndh\",\"name\":\"rwpdappdsbdkvwrw\",\"type\":\"feusnhut\"}") .toObject(QuotaResourceInner.class); - Assertions.assertEquals(283529548, model.limit()); - Assertions.assertEquals(1437097866, model.usage()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QuotaResourceInner model = new QuotaResourceInner().withLimit(283529548).withUsage(1437097866); - model = BinaryData.fromObject(model).toObject(QuotaResourceInner.class); - Assertions.assertEquals(283529548, model.limit()); - Assertions.assertEquals(1437097866, model.usage()); + Assertions.assertEquals(1982194402, model.properties().limit()); + Assertions.assertEquals(922988316, model.properties().usage()); } } diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/QuotaResourceListResultTests.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/QuotaResourceListResultTests.java index 9ff579a7f130..53d950e5bf0d 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/QuotaResourceListResultTests.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/QuotaResourceListResultTests.java @@ -1,38 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loadtesting.fluent.models.QuotaResourceInner; -import com.azure.resourcemanager.loadtesting.models.QuotaResourceListResult; -import java.util.Arrays; +import com.azure.resourcemanager.loadtesting.implementation.models.QuotaResourceListResult; import org.junit.jupiter.api.Assertions; public final class QuotaResourceListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { QuotaResourceListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"limit\":1344443621,\"usage\":21740307,\"provisioningState\":\"Canceled\"},\"id\":\"jhcrz\",\"name\":\"vdphlxaolthqtr\",\"type\":\"qjbpfzfsin\"},{\"properties\":{\"limit\":107051246,\"usage\":1595507269,\"provisioningState\":\"Succeeded\"},\"id\":\"oxxjtfelluwf\",\"name\":\"it\",\"type\":\"np\"},{\"properties\":{\"limit\":794210755,\"usage\":813348790,\"provisioningState\":\"Deleted\"},\"id\":\"ofpdvh\",\"name\":\"fxxypininmayhuy\",\"type\":\"bkpodepooginuv\"},{\"properties\":{\"limit\":1401461716,\"usage\":1822725253,\"provisioningState\":\"Deleted\"},\"id\":\"rxzxtheo\",\"name\":\"usivye\",\"type\":\"cciqihnhungbwjz\"}],\"nextLink\":\"fygxgispemvtzfk\"}") + "{\"value\":[{\"properties\":{\"limit\":1504510608,\"usage\":768645194,\"provisioningState\":\"Deleted\"},\"id\":\"tqxhocdgeab\",\"name\":\"gphuticndvka\",\"type\":\"zwyiftyhxhur\"},{\"properties\":{\"limit\":559319579,\"usage\":1369496360,\"provisioningState\":\"Deleted\"},\"id\":\"iwpwcuk\",\"name\":\"fkgiawxk\",\"type\":\"ryplwckbasyypn\"},{\"properties\":{\"limit\":1420674387,\"usage\":1775066996,\"provisioningState\":\"Canceled\"},\"id\":\"phejkotynqgoulz\",\"name\":\"dlikwyqkgfgibma\",\"type\":\"gakeqsr\"},{\"properties\":{\"limit\":1438808958,\"usage\":1683307088,\"provisioningState\":\"Deleted\"},\"id\":\"ytb\",\"name\":\"iqfouflmmnkz\",\"type\":\"modmglougpb\"}],\"nextLink\":\"tmut\"}") .toObject(QuotaResourceListResult.class); - Assertions.assertEquals(1344443621, model.value().get(0).limit()); - Assertions.assertEquals(21740307, model.value().get(0).usage()); - Assertions.assertEquals("fygxgispemvtzfk", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QuotaResourceListResult model - = new QuotaResourceListResult() - .withValue(Arrays.asList(new QuotaResourceInner().withLimit(1344443621).withUsage(21740307), - new QuotaResourceInner().withLimit(107051246).withUsage(1595507269), - new QuotaResourceInner().withLimit(794210755).withUsage(813348790), - new QuotaResourceInner().withLimit(1401461716).withUsage(1822725253))) - .withNextLink("fygxgispemvtzfk"); - model = BinaryData.fromObject(model).toObject(QuotaResourceListResult.class); - Assertions.assertEquals(1344443621, model.value().get(0).limit()); - Assertions.assertEquals(21740307, model.value().get(0).usage()); - Assertions.assertEquals("fygxgispemvtzfk", model.nextLink()); + Assertions.assertEquals(1504510608, model.value().get(0).properties().limit()); + Assertions.assertEquals(768645194, model.value().get(0).properties().usage()); + Assertions.assertEquals("tmut", model.nextLink()); } } diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/QuotaResourcePropertiesTests.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/QuotaResourcePropertiesTests.java index ac1150521c05..ae958c6eb032 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/QuotaResourcePropertiesTests.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/QuotaResourcePropertiesTests.java @@ -1,28 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loadtesting.fluent.models.QuotaResourceProperties; +import com.azure.resourcemanager.loadtesting.models.QuotaResourceProperties; import org.junit.jupiter.api.Assertions; public final class QuotaResourcePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { QuotaResourceProperties model - = BinaryData.fromString("{\"limit\":951964300,\"usage\":568686899,\"provisioningState\":\"Deleted\"}") + = BinaryData.fromString("{\"limit\":1743582993,\"usage\":1438650135,\"provisioningState\":\"Deleted\"}") .toObject(QuotaResourceProperties.class); - Assertions.assertEquals(951964300, model.limit()); - Assertions.assertEquals(568686899, model.usage()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QuotaResourceProperties model = new QuotaResourceProperties().withLimit(951964300).withUsage(568686899); - model = BinaryData.fromObject(model).toObject(QuotaResourceProperties.class); - Assertions.assertEquals(951964300, model.limit()); - Assertions.assertEquals(568686899, model.usage()); + Assertions.assertEquals(1743582993, model.limit()); + Assertions.assertEquals(1438650135, model.usage()); } } diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/QuotasCheckAvailabilityWithResponseMockTests.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/ResourceProvidersCheckAvailabilityQuotaWithResponseMockTests.java similarity index 57% rename from sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/QuotasCheckAvailabilityWithResponseMockTests.java rename to sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/ResourceProvidersCheckAvailabilityQuotaWithResponseMockTests.java index 8b6f98ec25d2..6df7af8b392b 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/QuotasCheckAvailabilityWithResponseMockTests.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/ResourceProvidersCheckAvailabilityQuotaWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loadtesting.LoadTestManager; import com.azure.resourcemanager.loadtesting.models.CheckQuotaAvailabilityResponse; @@ -19,30 +19,30 @@ import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; -public final class QuotasCheckAvailabilityWithResponseMockTests { +public final class ResourceProvidersCheckAvailabilityQuotaWithResponseMockTests { @Test - public void testCheckAvailabilityWithResponse() throws Exception { + public void testCheckAvailabilityQuotaWithResponse() throws Exception { String responseStr - = "{\"id\":\"zscxaqwo\",\"type\":\"chcbonqvpkvlrxnj\",\"name\":\"eipheoflokeyy\",\"properties\":{\"isAvailable\":true,\"availabilityStatus\":\"dlwtgrhpdj\"}}"; + = "{\"id\":\"og\",\"type\":\"m\",\"name\":\"a\",\"properties\":{\"isAvailable\":true,\"availabilityStatus\":\"z\"}}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LoadTestManager manager = LoadTestManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - CheckQuotaAvailabilityResponse response = manager.quotas() - .checkAvailabilityWithResponse("ccfwnfnbacfion", "ebxetqgtzxdp", - new QuotaBucketRequest().withCurrentUsage(847580815) - .withCurrentQuota(1376492737) - .withNewQuota(2122264998) - .withDimensions(new QuotaBucketRequestPropertiesDimensions().withSubscriptionId("eallnwsubisnj") - .withLocation("pmng")), + CheckQuotaAvailabilityResponse response = manager.resourceProviders() + .checkAvailabilityQuotaWithResponse("icbtwnpzao", "vuhrhcffcyddgl", + new QuotaBucketRequest().withCurrentUsage(553941063) + .withCurrentQuota(1041112743) + .withNewQuota(1652029285) + .withDimensions(new QuotaBucketRequestPropertiesDimensions().withSubscriptionId("eicxmqciwqvhkhi") + .withLocation("igdtopbob")), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals(true, response.isAvailable()); - Assertions.assertEquals("dlwtgrhpdj", response.availabilityStatus()); + Assertions.assertTrue(response.isAvailable()); + Assertions.assertEquals("z", response.availabilityStatus()); } } diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/QuotasGetWithResponseMockTests.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/ResourceProvidersGetQuotaWithResponseMockTests.java similarity index 58% rename from sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/QuotasGetWithResponseMockTests.java rename to sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/ResourceProvidersGetQuotaWithResponseMockTests.java index 7a8fa77feed6..f4a134fe2df7 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/QuotasGetWithResponseMockTests.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/ResourceProvidersGetQuotaWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loadtesting.LoadTestManager; import com.azure.resourcemanager.loadtesting.models.QuotaResource; @@ -17,24 +17,24 @@ import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; -public final class QuotasGetWithResponseMockTests { +public final class ResourceProvidersGetQuotaWithResponseMockTests { @Test - public void testGetWithResponse() throws Exception { + public void testGetQuotaWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"limit\":1657951268,\"usage\":1165207027,\"provisioningState\":\"Succeeded\"},\"id\":\"bmqj\",\"name\":\"abcypmivk\",\"type\":\"lzu\"}"; + = "{\"properties\":{\"limit\":1130287748,\"usage\":137439916,\"provisioningState\":\"Deleted\"},\"id\":\"jctbza\",\"name\":\"s\",\"type\":\"sycbkbfk\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LoadTestManager manager = LoadTestManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - QuotaResource response = manager.quotas() - .getWithResponse("nhzgpphrcgyn", "ocpecfvmmco", com.azure.core.util.Context.NONE) + QuotaResource response = manager.resourceProviders() + .getQuotaWithResponse("r", "vdjwzrlovm", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals(1657951268, response.limit()); - Assertions.assertEquals(1165207027, response.usage()); + Assertions.assertEquals(1130287748, response.properties().limit()); + Assertions.assertEquals(137439916, response.properties().usage()); } } diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/QuotasListMockTests.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/ResourceProvidersListQuotaMockTests.java similarity index 57% rename from sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/QuotasListMockTests.java rename to sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/ResourceProvidersListQuotaMockTests.java index c0a7e87278fd..a4a349346ecd 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/QuotasListMockTests.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/ResourceProvidersListQuotaMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loadtesting.LoadTestManager; import com.azure.resourcemanager.loadtesting.models.QuotaResource; @@ -18,22 +18,23 @@ import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; -public final class QuotasListMockTests { +public final class ResourceProvidersListQuotaMockTests { @Test - public void testList() throws Exception { + public void testListQuota() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"limit\":1583346323,\"usage\":1570785735,\"provisioningState\":\"Deleted\"},\"id\":\"rabhjybigeho\",\"name\":\"fbowskanyk\",\"type\":\"zlcuiywgqywgndrv\"}]}"; + = "{\"value\":[{\"properties\":{\"limit\":825369958,\"usage\":1635783635,\"provisioningState\":\"Failed\"},\"id\":\"ocjjxhvpmouexh\",\"name\":\"zxibqeoj\",\"type\":\"xqbzvddntwnd\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LoadTestManager manager = LoadTestManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response = manager.quotas().list("mi", com.azure.core.util.Context.NONE); + PagedIterable response + = manager.resourceProviders().listQuota("ukdkexxppofmxa", com.azure.core.util.Context.NONE); - Assertions.assertEquals(1583346323, response.iterator().next().limit()); - Assertions.assertEquals(1570785735, response.iterator().next().usage()); + Assertions.assertEquals(825369958, response.iterator().next().properties().limit()); + Assertions.assertEquals(1635783635, response.iterator().next().properties().usage()); } } diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/LoadTestsListOutboundNetworkDependenciesEndpointsMockTests.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/ResourceProvidersOutboundNetworkDependenciesEndpointsMockTests.java similarity index 52% rename from sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/LoadTestsListOutboundNetworkDependenciesEndpointsMockTests.java rename to sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/ResourceProvidersOutboundNetworkDependenciesEndpointsMockTests.java index 21c4429905d2..ab13c9ac1478 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/LoadTestsListOutboundNetworkDependenciesEndpointsMockTests.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/ResourceProvidersOutboundNetworkDependenciesEndpointsMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loadtesting.LoadTestManager; import com.azure.resourcemanager.loadtesting.models.OutboundEnvironmentEndpoint; @@ -17,22 +17,21 @@ import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; -public final class LoadTestsListOutboundNetworkDependenciesEndpointsMockTests { +public final class ResourceProvidersOutboundNetworkDependenciesEndpointsMockTests { @Test - public void testListOutboundNetworkDependenciesEndpoints() throws Exception { + public void testOutboundNetworkDependenciesEndpoints() throws Exception { String responseStr - = "{\"value\":[{\"category\":\"c\",\"endpoints\":[{\"domainName\":\"hvpmoue\",\"description\":\"dzxibqeojnxqbzvd\",\"endpointDetails\":[{\"port\":830064552}]},{\"domainName\":\"deicbtwnpzao\",\"description\":\"uhrhcffcyddgl\",\"endpointDetails\":[{\"port\":439652711}]}]}]}"; + = "{\"value\":[{\"category\":\"abnmocpcyshu\",\"endpoints\":[{\"domainName\":\"fblj\",\"description\":\"pbtoqcjmkl\",\"endpointDetails\":[{\"port\":300306842},{\"port\":1581174340}]},{\"domainName\":\"tqajzyulpkudjkrl\",\"description\":\"bzhfepgzgqexz\",\"endpointDetails\":[{\"port\":1323879070}]},{\"domainName\":\"c\",\"description\":\"ierhhbcsglummaj\",\"endpointDetails\":[{\"port\":865429737},{\"port\":1555681942}]},{\"domainName\":\"bnbdxkqpxokajion\",\"description\":\"mexgstxgcp\",\"endpointDetails\":[{\"port\":1107396913},{\"port\":600216788}]}]}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LoadTestManager manager = LoadTestManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response = manager.loadTests() - .listOutboundNetworkDependenciesEndpoints("bkbfkgukdkex", "ppofmxaxcfjpgdd", - com.azure.core.util.Context.NONE); + PagedIterable response = manager.resourceProviders() + .outboundNetworkDependenciesEndpoints("gr", "bznorcjxvsnby", com.azure.core.util.Context.NONE); } } diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/UserAssignedIdentityTests.java b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/UserAssignedIdentityTests.java index 94ce9ff7c61d..590313c931d9 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/UserAssignedIdentityTests.java +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/src/test/java/com/azure/resourcemanager/loadtesting/generated/UserAssignedIdentityTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.loadtesting.generated; @@ -10,8 +10,7 @@ public final class UserAssignedIdentityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - UserAssignedIdentity model = BinaryData.fromString( - "{\"principalId\":\"456cab04-3d5f-40dc-93eb-a950c6ac8025\",\"clientId\":\"c00cd387-7cdd-4e4f-86f4-2d329d21e218\"}") + UserAssignedIdentity model = BinaryData.fromString("{\"clientId\":\"fhfcb\",\"principalId\":\"s\"}") .toObject(UserAssignedIdentity.class); } diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/tsp-location.yaml b/sdk/loadtesting/azure-resourcemanager-loadtesting/tsp-location.yaml new file mode 100644 index 000000000000..d11df680e3bf --- /dev/null +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/loadtestservice/LoadTestService.Management +commit: 02d891edd0a78d71fdaa969f028261a831432c54 +repo: Azure/azure-rest-api-specs +additionalDirectories: