diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/CHANGELOG.md b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/CHANGELOG.md index e4e14f155dfb..c4fa60cd32ba 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/CHANGELOG.md +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/CHANGELOG.md @@ -1,7 +1,82 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.2 (2023-01-18) +- Azure Resource Manager PowerBIDedicated client library for Java. This package contains Microsoft Azure SDK for PowerBIDedicated Management SDK. PowerBI Dedicated Web API provides a RESTful set of web services that enables users to create, retrieve, update, and delete Power BI dedicated capacities. Package tag package-2021-01-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +### Breaking Changes + +* `models.DedicatedCapacityProperties` was removed + +* `models.DedicatedCapacityMutableProperties` was removed + +* `models.AutoScaleVCoreMutableProperties` was removed + +* `models.AutoScaleVCoreProperties` was removed + +#### `models.AutoScaleVCores` was modified + +* `deleteWithResponse(java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed + +### Features Added + +* `models.MetricSpecificationDimensionsItem` was added + +* `models.ServiceSpecification` was added + +* `models.LogSpecification` was added + +* `models.MetricSpecification` was added + +* `models.OperationProperties` was added + +#### `PowerBIDedicatedManager` was modified + +* `authenticate(com.azure.core.http.HttpPipeline,com.azure.core.management.profile.AzureProfile)` was added + +#### `models.Operation` was modified + +* `origin()` was added +* `properties()` was added + +#### `models.OperationDisplay` was modified + +* `withDescription(java.lang.String)` was added +* `description()` was added + +#### `models.SkuDetailsForExistingResource` was modified + +* `withResourceType(java.lang.String)` was added +* `resourceType()` was added + +#### `models.DedicatedCapacity` was modified + +* `resourceGroupName()` was added +* `friendlyName()` was added +* `tenantId()` was added + +#### `models.AutoScaleVCore` was modified + +* `resourceGroupName()` was added + +#### `models.CapacitySku` was modified + +* `withCapacity(java.lang.Integer)` was added +* `capacity()` was added + +#### `models.AutoScaleVCores` was modified + +* `deleteByResourceGroupWithResponse(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added + +#### `models.DedicatedCapacityUpdateParameters` was modified + +* `friendlyName()` was added +* `tenantId()` was added + +#### `PowerBIDedicatedManager$Configurable` was modified + +* `withScope(java.lang.String)` was added +* `withRetryOptions(com.azure.core.http.policy.RetryOptions)` was added ## 1.0.0-beta.1 (2021-04-20) diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/README.md b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/README.md index 0148136b9774..d93eef07d8b3 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/README.md +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/README.md @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-powerbidedicated - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) @@ -41,19 +41,19 @@ Various documentation is available to help you get started Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. -[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. ### Authentication -By default, Azure Active Directory token authentication depends on correct configure of following environment variables. +By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. - `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. -In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. +In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. -With above configuration, `azure` client can be authenticated by following code: +With above configuration, `azure` client can be authenticated using the following code: ```java AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); @@ -74,19 +74,22 @@ See [API design][design] for general introduction on design and key concepts on ## Examples +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/SAMPLE.md) + + ## Troubleshooting ## Next steps ## Contributing -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). +For details on contributing to this repository, see the [contributing guide][cg]. + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. -1. Fork it -1. Create your feature branch (`git checkout -b my-new-feature`) -1. Commit your changes (`git commit -am 'Add some feature'`) -1. Push to the branch (`git push origin my-new-feature`) -1. Create new Pull Request +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. [survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS @@ -97,3 +100,6 @@ For details on contributing to this repository, see the [contributing guide](htt [azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty [authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md [design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[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/powerbidedicated/azure-resourcemanager-powerbidedicated/SAMPLE.md b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/SAMPLE.md new file mode 100644 index 000000000000..12ce823a4ec2 --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/SAMPLE.md @@ -0,0 +1,534 @@ +# Code snippets and samples + + +## AutoScaleVCores + +- [Create](#autoscalevcores_create) +- [Delete](#autoscalevcores_delete) +- [GetByResourceGroup](#autoscalevcores_getbyresourcegroup) +- [List](#autoscalevcores_list) +- [ListByResourceGroup](#autoscalevcores_listbyresourcegroup) +- [Update](#autoscalevcores_update) + +## Capacities + +- [CheckNameAvailability](#capacities_checknameavailability) +- [Create](#capacities_create) +- [Delete](#capacities_delete) +- [GetByResourceGroup](#capacities_getbyresourcegroup) +- [List](#capacities_list) +- [ListByResourceGroup](#capacities_listbyresourcegroup) +- [ListSkus](#capacities_listskus) +- [ListSkusForCapacity](#capacities_listskusforcapacity) +- [Resume](#capacities_resume) +- [Suspend](#capacities_suspend) +- [Update](#capacities_update) + +## Operations + +- [List](#operations_list) +### AutoScaleVCores_Create + +```java +import com.azure.resourcemanager.powerbidedicated.models.AutoScaleVCoreSku; +import com.azure.resourcemanager.powerbidedicated.models.VCoreSkuTier; +import java.util.HashMap; +import java.util.Map; + +/** Samples for AutoScaleVCores Create. */ +public final class AutoScaleVCoresCreateSamples { + /* + * x-ms-original-file: specification/powerbidedicated/resource-manager/Microsoft.PowerBIdedicated/stable/2021-01-01/examples/createAutoScaleVCore.json + */ + /** + * Sample code: Create auto scale v-core. + * + * @param manager Entry point to PowerBIDedicatedManager. + */ + public static void createAutoScaleVCore( + com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager manager) { + manager + .autoScaleVCores() + .define("testvcore") + .withRegion("West US") + .withExistingResourceGroup("TestRG") + .withSku(new AutoScaleVCoreSku().withName("AutoScale").withTier(VCoreSkuTier.AUTO_SCALE).withCapacity(0)) + .withTags(mapOf("testKey", "testValue")) + .withCapacityObjectId("a28f00bd-5330-4572-88f1-fa883e074785") + .withCapacityLimit(10) + .create(); + } + + @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; + } +} +``` + +### AutoScaleVCores_Delete + +```java +/** Samples for AutoScaleVCores Delete. */ +public final class AutoScaleVCoresDeleteSamples { + /* + * x-ms-original-file: specification/powerbidedicated/resource-manager/Microsoft.PowerBIdedicated/stable/2021-01-01/examples/deleteAutoScaleVCore.json + */ + /** + * Sample code: Delete an auto scale v-core. + * + * @param manager Entry point to PowerBIDedicatedManager. + */ + public static void deleteAnAutoScaleVCore( + com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager manager) { + manager + .autoScaleVCores() + .deleteByResourceGroupWithResponse("TestRG", "testvcore", com.azure.core.util.Context.NONE); + } +} +``` + +### AutoScaleVCores_GetByResourceGroup + +```java +/** Samples for AutoScaleVCores GetByResourceGroup. */ +public final class AutoScaleVCoresGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/powerbidedicated/resource-manager/Microsoft.PowerBIdedicated/stable/2021-01-01/examples/getAutoScaleVCore.json + */ + /** + * Sample code: Get details of an auto scale v-core. + * + * @param manager Entry point to PowerBIDedicatedManager. + */ + public static void getDetailsOfAnAutoScaleVCore( + com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager manager) { + manager + .autoScaleVCores() + .getByResourceGroupWithResponse("TestRG", "testvcore", com.azure.core.util.Context.NONE); + } +} +``` + +### AutoScaleVCores_List + +```java +/** Samples for AutoScaleVCores List. */ +public final class AutoScaleVCoresListSamples { + /* + * x-ms-original-file: specification/powerbidedicated/resource-manager/Microsoft.PowerBIdedicated/stable/2021-01-01/examples/listAutoScaleVCoresInSubscription.json + */ + /** + * Sample code: List auto scale v-cores in subscription. + * + * @param manager Entry point to PowerBIDedicatedManager. + */ + public static void listAutoScaleVCoresInSubscription( + com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager manager) { + manager.autoScaleVCores().list(com.azure.core.util.Context.NONE); + } +} +``` + +### AutoScaleVCores_ListByResourceGroup + +```java +/** Samples for AutoScaleVCores ListByResourceGroup. */ +public final class AutoScaleVCoresListByResourceGroupSamples { + /* + * x-ms-original-file: specification/powerbidedicated/resource-manager/Microsoft.PowerBIdedicated/stable/2021-01-01/examples/listAutoScaleVCoresInResourceGroup.json + */ + /** + * Sample code: List auto scale v-cores in resource group. + * + * @param manager Entry point to PowerBIDedicatedManager. + */ + public static void listAutoScaleVCoresInResourceGroup( + com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager manager) { + manager.autoScaleVCores().listByResourceGroup("TestRG", com.azure.core.util.Context.NONE); + } +} +``` + +### AutoScaleVCores_Update + +```java +import com.azure.resourcemanager.powerbidedicated.models.AutoScaleVCore; +import com.azure.resourcemanager.powerbidedicated.models.AutoScaleVCoreSku; +import com.azure.resourcemanager.powerbidedicated.models.VCoreSkuTier; +import java.util.HashMap; +import java.util.Map; + +/** Samples for AutoScaleVCores Update. */ +public final class AutoScaleVCoresUpdateSamples { + /* + * x-ms-original-file: specification/powerbidedicated/resource-manager/Microsoft.PowerBIdedicated/stable/2021-01-01/examples/updateAutoScaleVCore.json + */ + /** + * Sample code: Update auto scale v-core parameters. + * + * @param manager Entry point to PowerBIDedicatedManager. + */ + public static void updateAutoScaleVCoreParameters( + com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager manager) { + AutoScaleVCore resource = + manager + .autoScaleVCores() + .getByResourceGroupWithResponse("TestRG", "testvcore", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("testKey", "testValue")) + .withSku(new AutoScaleVCoreSku().withName("AutoScale").withTier(VCoreSkuTier.AUTO_SCALE).withCapacity(0)) + .withCapacityLimit(20) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Capacities_CheckNameAvailability + +```java +import com.azure.resourcemanager.powerbidedicated.models.CheckCapacityNameAvailabilityParameters; + +/** Samples for Capacities CheckNameAvailability. */ +public final class CapacitiesCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/powerbidedicated/resource-manager/Microsoft.PowerBIdedicated/stable/2021-01-01/examples/checkNameAvailability.json + */ + /** + * Sample code: Check name availability of a capacity. + * + * @param manager Entry point to PowerBIDedicatedManager. + */ + public static void checkNameAvailabilityOfACapacity( + com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager manager) { + manager + .capacities() + .checkNameAvailabilityWithResponse( + "West US", + new CheckCapacityNameAvailabilityParameters() + .withName("azsdktest") + .withType("Microsoft.PowerBIDedicated/capacities"), + com.azure.core.util.Context.NONE); + } +} +``` + +### Capacities_Create + +```java +import com.azure.resourcemanager.powerbidedicated.models.CapacitySku; +import com.azure.resourcemanager.powerbidedicated.models.CapacitySkuTier; +import com.azure.resourcemanager.powerbidedicated.models.DedicatedCapacityAdministrators; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Capacities Create. */ +public final class CapacitiesCreateSamples { + /* + * x-ms-original-file: specification/powerbidedicated/resource-manager/Microsoft.PowerBIdedicated/stable/2021-01-01/examples/createCapacity.json + */ + /** + * Sample code: Create capacity. + * + * @param manager Entry point to PowerBIDedicatedManager. + */ + public static void createCapacity(com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager manager) { + manager + .capacities() + .define("azsdktest") + .withRegion("West US") + .withExistingResourceGroup("TestRG") + .withSku(new CapacitySku().withName("A1").withTier(CapacitySkuTier.PBIE_AZURE)) + .withTags(mapOf("testKey", "testValue")) + .withAdministration( + new DedicatedCapacityAdministrators() + .withMembers(Arrays.asList("azsdktest@microsoft.com", "azsdktest2@microsoft.com"))) + .create(); + } + + @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; + } +} +``` + +### Capacities_Delete + +```java +/** Samples for Capacities Delete. */ +public final class CapacitiesDeleteSamples { + /* + * x-ms-original-file: specification/powerbidedicated/resource-manager/Microsoft.PowerBIdedicated/stable/2021-01-01/examples/deleteCapacity.json + */ + /** + * Sample code: Get details of a capacity. + * + * @param manager Entry point to PowerBIDedicatedManager. + */ + public static void getDetailsOfACapacity( + com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager manager) { + manager.capacities().delete("TestRG", "azsdktest", com.azure.core.util.Context.NONE); + } +} +``` + +### Capacities_GetByResourceGroup + +```java +/** Samples for Capacities GetByResourceGroup. */ +public final class CapacitiesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/powerbidedicated/resource-manager/Microsoft.PowerBIdedicated/stable/2021-01-01/examples/getCapacity.json + */ + /** + * Sample code: Get details of a capacity. + * + * @param manager Entry point to PowerBIDedicatedManager. + */ + public static void getDetailsOfACapacity( + com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager manager) { + manager.capacities().getByResourceGroupWithResponse("TestRG", "azsdktest", com.azure.core.util.Context.NONE); + } +} +``` + +### Capacities_List + +```java +/** Samples for Capacities List. */ +public final class CapacitiesListSamples { + /* + * x-ms-original-file: specification/powerbidedicated/resource-manager/Microsoft.PowerBIdedicated/stable/2021-01-01/examples/listCapacitiesInSubscription.json + */ + /** + * Sample code: Get details of a capacity. + * + * @param manager Entry point to PowerBIDedicatedManager. + */ + public static void getDetailsOfACapacity( + com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager manager) { + manager.capacities().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Capacities_ListByResourceGroup + +```java +/** Samples for Capacities ListByResourceGroup. */ +public final class CapacitiesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/powerbidedicated/resource-manager/Microsoft.PowerBIdedicated/stable/2021-01-01/examples/listCapacitiesInResourceGroup.json + */ + /** + * Sample code: List capacities in resource group. + * + * @param manager Entry point to PowerBIDedicatedManager. + */ + public static void listCapacitiesInResourceGroup( + com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager manager) { + manager.capacities().listByResourceGroup("TestRG", com.azure.core.util.Context.NONE); + } +} +``` + +### Capacities_ListSkus + +```java +/** Samples for Capacities ListSkus. */ +public final class CapacitiesListSkusSamples { + /* + * x-ms-original-file: specification/powerbidedicated/resource-manager/Microsoft.PowerBIdedicated/stable/2021-01-01/examples/listSKUsForNew.json + */ + /** + * Sample code: List eligible SKUs for a new capacity. + * + * @param manager Entry point to PowerBIDedicatedManager. + */ + public static void listEligibleSKUsForANewCapacity( + com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager manager) { + manager.capacities().listSkusWithResponse(com.azure.core.util.Context.NONE); + } +} +``` + +### Capacities_ListSkusForCapacity + +```java +/** Samples for Capacities ListSkusForCapacity. */ +public final class CapacitiesListSkusForCapacitySamples { + /* + * x-ms-original-file: specification/powerbidedicated/resource-manager/Microsoft.PowerBIdedicated/stable/2021-01-01/examples/listSKUsForExisting.json + */ + /** + * Sample code: List eligible SKUs for an existing capacity. + * + * @param manager Entry point to PowerBIDedicatedManager. + */ + public static void listEligibleSKUsForAnExistingCapacity( + com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager manager) { + manager.capacities().listSkusForCapacityWithResponse("TestRG", "azsdktest", com.azure.core.util.Context.NONE); + } +} +``` + +### Capacities_Resume + +```java +/** Samples for Capacities Resume. */ +public final class CapacitiesResumeSamples { + /* + * x-ms-original-file: specification/powerbidedicated/resource-manager/Microsoft.PowerBIdedicated/stable/2021-01-01/examples/resumeCapacity.json + */ + /** + * Sample code: Get details of a capacity. + * + * @param manager Entry point to PowerBIDedicatedManager. + */ + public static void getDetailsOfACapacity( + com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager manager) { + manager.capacities().resume("TestRG", "azsdktest", com.azure.core.util.Context.NONE); + } +} +``` + +### Capacities_Suspend + +```java +/** Samples for Capacities Suspend. */ +public final class CapacitiesSuspendSamples { + /* + * x-ms-original-file: specification/powerbidedicated/resource-manager/Microsoft.PowerBIdedicated/stable/2021-01-01/examples/suspendCapacity.json + */ + /** + * Sample code: Suspend capacity. + * + * @param manager Entry point to PowerBIDedicatedManager. + */ + public static void suspendCapacity(com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager manager) { + manager.capacities().suspend("TestRG", "azsdktest", com.azure.core.util.Context.NONE); + } +} +``` + +### Capacities_Update + +```java +import com.azure.resourcemanager.powerbidedicated.models.CapacitySku; +import com.azure.resourcemanager.powerbidedicated.models.CapacitySkuTier; +import com.azure.resourcemanager.powerbidedicated.models.DedicatedCapacity; +import com.azure.resourcemanager.powerbidedicated.models.DedicatedCapacityAdministrators; +import com.azure.resourcemanager.powerbidedicated.models.Mode; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Capacities Update. */ +public final class CapacitiesUpdateSamples { + /* + * x-ms-original-file: specification/powerbidedicated/resource-manager/Microsoft.PowerBIdedicated/stable/2021-01-01/examples/updateToGen2.json + */ + /** + * Sample code: Update capacity to Generation 2. + * + * @param manager Entry point to PowerBIDedicatedManager. + */ + public static void updateCapacityToGeneration2( + com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager manager) { + DedicatedCapacity resource = + manager + .capacities() + .getByResourceGroupWithResponse("TestRG", "azsdktest", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("testKey", "testValue")) + .withSku(new CapacitySku().withName("A1").withTier(CapacitySkuTier.PBIE_AZURE)) + .withMode(Mode.GEN2) + .apply(); + } + + /* + * x-ms-original-file: specification/powerbidedicated/resource-manager/Microsoft.PowerBIdedicated/stable/2021-01-01/examples/updateCapacity.json + */ + /** + * Sample code: Update capacity parameters. + * + * @param manager Entry point to PowerBIDedicatedManager. + */ + public static void updateCapacityParameters( + com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager manager) { + DedicatedCapacity resource = + manager + .capacities() + .getByResourceGroupWithResponse("TestRG", "azsdktest", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("testKey", "testValue")) + .withSku(new CapacitySku().withName("A1").withTier(CapacitySkuTier.PBIE_AZURE)) + .withAdministration( + new DedicatedCapacityAdministrators() + .withMembers(Arrays.asList("azsdktest@microsoft.com", "azsdktest2@microsoft.com"))) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Operations_List + +```java +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/powerbidedicated/resource-manager/Microsoft.PowerBIdedicated/stable/2021-01-01/examples/operations.json + */ + /** + * Sample code: List operations. + * + * @param manager Entry point to PowerBIDedicatedManager. + */ + public static void listOperations(com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/pom.xml b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/pom.xml index e595b6d255fb..f1c3bc9e3142 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/pom.xml +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/pom.xml @@ -1,55 +1,91 @@ - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + - com.azure.resourcemanager - azure-resourcemanager-powerbidedicated - 1.0.0-beta.2 - jar + com.azure.resourcemanager + azure-resourcemanager-powerbidedicated + 1.0.0-beta.2 + jar - Microsoft Azure SDK for PowerBIDedicated Management - This package contains Microsoft Azure SDK for PowerBIDedicated Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. PowerBI Dedicated Web API provides a RESTful set of web services that enables users to create, retrieve, update, and delete Power BI dedicated capacities. Package tag package-2021-01-01. - https://github.com/Azure/azure-sdk-for-java + Microsoft Azure SDK for PowerBIDedicated Management + This package contains Microsoft Azure SDK for PowerBIDedicated Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. PowerBI Dedicated Web API provides a RESTful set of web services that enables users to create, retrieve, update, and delete Power BI dedicated capacities. Package tag package-2021-01-01. + https://github.com/Azure/azure-sdk-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - microsoft - Microsoft - - - - UTF-8 - true - - - - com.azure - azure-core - 1.35.0 - - - com.azure - azure-core-management - 1.10.0 - - + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + + + + com.azure + azure-core + 1.35.0 + + + com.azure + azure-core-management + 1.10.0 + + + com.azure + azure-core-test + 1.14.0 + test + + + com.azure + azure-identity + 1.7.3 + test + + + org.junit.jupiter + junit-jupiter-api + 5.9.1 + test + + + org.junit.jupiter + junit-jupiter-engine + 5.9.1 + test + + + org.mockito + mockito-core + 4.5.1 + test + + + org.slf4j + slf4j-simple + 1.7.36 + test + + diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/PowerBIDedicatedManager.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/PowerBIDedicatedManager.java index a1dd487a35f1..116579a93633 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/PowerBIDedicatedManager.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/PowerBIDedicatedManager.java @@ -8,15 +8,18 @@ import com.azure.core.http.HttpClient; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.policy.HttpPolicyProviders; import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; @@ -33,6 +36,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; /** * Entry point to PowerBIDedicatedManager. PowerBI Dedicated Web API provides a RESTful set of web services that enables @@ -72,6 +76,19 @@ public static PowerBIDedicatedManager authenticate(TokenCredential credential, A return configure().authenticate(credential, profile); } + /** + * Creates an instance of PowerBIDedicated service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the PowerBIDedicated service API instance. + */ + public static PowerBIDedicatedManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new PowerBIDedicatedManager(httpPipeline, profile, null); + } + /** * Gets a Configurable instance that can be used to create PowerBIDedicatedManager with optional configuration. * @@ -83,12 +100,14 @@ public static Configurable configure() { /** The Configurable allowing configurations to be set. */ public static final class Configurable { - private final ClientLogger logger = new ClientLogger(Configurable.class); + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; + private RetryOptions retryOptions; private Duration defaultPollInterval; private Configurable() { @@ -127,6 +146,17 @@ public Configurable withPolicy(HttpPipelinePolicy policy) { return this; } + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + /** * Sets the retry policy to the HTTP pipeline. * @@ -138,6 +168,19 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { return this; } + /** + * Sets the retry options for the HTTP pipeline retry policy. + * + *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + /** * Sets the default poll interval, used when service does not provide "Retry-After" header. * @@ -145,9 +188,11 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { * @return the configurable object itself. */ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + this.defaultPollInterval = + Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); if (this.defaultPollInterval.isNegative()) { - throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); } return this; } @@ -169,7 +214,7 @@ public PowerBIDedicatedManager authenticate(TokenCredential credential, AzurePro .append("-") .append("com.azure.resourcemanager.powerbidedicated") .append("/") - .append("1.0.0-beta.1"); + .append("1.0.0-beta.2"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -183,20 +228,38 @@ public PowerBIDedicatedManager authenticate(TokenCredential credential, AzurePro userAgentBuilder.append(" (auto-generated)"); } + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } if (retryPolicy == null) { - retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } } List policies = new ArrayList<>(); policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies - .add( - new BearerTokenAuthenticationPolicy( - credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); - policies.addAll(this.policies); + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); HttpPipeline httpPipeline = @@ -208,7 +271,11 @@ public PowerBIDedicatedManager authenticate(TokenCredential credential, AzurePro } } - /** @return Resource collection API of Capacities. */ + /** + * Gets the resource collection API of Capacities. It manages DedicatedCapacity. + * + * @return Resource collection API of Capacities. + */ public Capacities capacities() { if (this.capacities == null) { this.capacities = new CapacitiesImpl(clientObject.getCapacities(), this); @@ -216,7 +283,11 @@ public Capacities capacities() { return capacities; } - /** @return Resource collection API of Operations. */ + /** + * 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); @@ -224,7 +295,11 @@ public Operations operations() { return operations; } - /** @return Resource collection API of AutoScaleVCores. */ + /** + * Gets the resource collection API of AutoScaleVCores. It manages AutoScaleVCore. + * + * @return Resource collection API of AutoScaleVCores. + */ public AutoScaleVCores autoScaleVCores() { if (this.autoScaleVCores == null) { this.autoScaleVCores = new AutoScaleVCoresImpl(clientObject.getAutoScaleVCores(), this); diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/AutoScaleVCoresClient.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/AutoScaleVCoresClient.java index db1d3ebc03e6..0c3955d8b967 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/AutoScaleVCoresClient.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/AutoScaleVCoresClient.java @@ -20,13 +20,15 @@ public interface AutoScaleVCoresClient { * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated capacity is part. * This name must be at least 1 character in length, and no more than 90. * @param vcoreName The name of the auto scale v-core. It must be a minimum of 3 characters, and a maximum of 63. + * @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 details about the specified auto scale v-core. + * @return details about the specified auto scale v-core along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - AutoScaleVCoreInner getByResourceGroup(String resourceGroupName, String vcoreName); + Response getByResourceGroupWithResponse( + String resourceGroupName, String vcoreName, Context context); /** * Gets details about the specified auto scale v-core. @@ -34,15 +36,13 @@ public interface AutoScaleVCoresClient { * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated capacity is part. * This name must be at least 1 character in length, and no more than 90. * @param vcoreName The name of the auto scale v-core. It must be a minimum of 3 characters, and a maximum of 63. - * @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 details about the specified auto scale v-core. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String vcoreName, Context context); + AutoScaleVCoreInner getByResourceGroup(String resourceGroupName, String vcoreName); /** * Provisions the specified auto scale v-core based on the configuration specified in the request. @@ -51,13 +51,15 @@ Response getByResourceGroupWithResponse( * This name must be at least 1 character in length, and no more than 90. * @param vcoreName The name of the auto scale v-core. It must be a minimum of 3 characters, and a maximum of 63. * @param vCoreParameters Contains the information used to provision the auto scale v-core. + * @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 represents an instance of an auto scale v-core resource. + * @return represents an instance of an auto scale v-core resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - AutoScaleVCoreInner create(String resourceGroupName, String vcoreName, AutoScaleVCoreInner vCoreParameters); + Response createWithResponse( + String resourceGroupName, String vcoreName, AutoScaleVCoreInner vCoreParameters, Context context); /** * Provisions the specified auto scale v-core based on the configuration specified in the request. @@ -66,15 +68,13 @@ Response getByResourceGroupWithResponse( * This name must be at least 1 character in length, and no more than 90. * @param vcoreName The name of the auto scale v-core. It must be a minimum of 3 characters, and a maximum of 63. * @param vCoreParameters Contains the information used to provision the auto scale v-core. - * @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 represents an instance of an auto scale v-core resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String resourceGroupName, String vcoreName, AutoScaleVCoreInner vCoreParameters, Context context); + AutoScaleVCoreInner create(String resourceGroupName, String vcoreName, AutoScaleVCoreInner vCoreParameters); /** * Deletes the specified auto scale v-core. @@ -82,12 +82,14 @@ Response createWithResponse( * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated capacity is part. * This name must be at least 1 character in length, and no more than 90. * @param vcoreName The name of the auto scale v-core. It must be a minimum of 3 characters, and a maximum of 63. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String vcoreName); + Response deleteWithResponse(String resourceGroupName, String vcoreName, Context context); /** * Deletes the specified auto scale v-core. @@ -95,14 +97,12 @@ Response createWithResponse( * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated capacity is part. * This name must be at least 1 character in length, and no more than 90. * @param vcoreName The name of the auto scale v-core. It must be a minimum of 3 characters, and a maximum of 63. - * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String vcoreName, Context context); + void delete(String resourceGroupName, String vcoreName); /** * Updates the current state of the specified auto scale v-core. @@ -111,14 +111,18 @@ Response createWithResponse( * This name must be at least 1 character in length, and no more than 90. * @param vcoreName The name of the auto scale v-core. It must be a minimum of 3 characters, and a maximum of 63. * @param vCoreUpdateParameters Request object that contains the updated information for the auto scale v-core. + * @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 represents an instance of an auto scale v-core resource. + * @return represents an instance of an auto scale v-core resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - AutoScaleVCoreInner update( - String resourceGroupName, String vcoreName, AutoScaleVCoreUpdateParameters vCoreUpdateParameters); + Response updateWithResponse( + String resourceGroupName, + String vcoreName, + AutoScaleVCoreUpdateParameters vCoreUpdateParameters, + Context context); /** * Updates the current state of the specified auto scale v-core. @@ -127,18 +131,14 @@ AutoScaleVCoreInner update( * This name must be at least 1 character in length, and no more than 90. * @param vcoreName The name of the auto scale v-core. It must be a minimum of 3 characters, and a maximum of 63. * @param vCoreUpdateParameters Request object that contains the updated information for the auto scale v-core. - * @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 represents an instance of an auto scale v-core resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, - String vcoreName, - AutoScaleVCoreUpdateParameters vCoreUpdateParameters, - Context context); + AutoScaleVCoreInner update( + String resourceGroupName, String vcoreName, AutoScaleVCoreUpdateParameters vCoreUpdateParameters); /** * Gets all the auto scale v-cores for the given resource group. @@ -148,7 +148,7 @@ Response updateWithResponse( * @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 all the auto scale v-cores for the given resource group. + * @return all the auto scale v-cores for the given resource group as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); @@ -162,7 +162,7 @@ Response updateWithResponse( * @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 all the auto scale v-cores for the given resource group. + * @return all the auto scale v-cores for the given resource group as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -172,7 +172,7 @@ Response updateWithResponse( * * @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 an array of auto scale v-core resources. + * @return an array of auto scale v-core resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -184,7 +184,7 @@ Response updateWithResponse( * @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 an array of auto scale v-core resources. + * @return an array of auto scale v-core resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/CapacitiesClient.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/CapacitiesClient.java index 9c573d317376..6578d229aae3 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/CapacitiesClient.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/CapacitiesClient.java @@ -27,13 +27,15 @@ public interface CapacitiesClient { * This name must be at least 1 character in length, and no more than 90. * @param dedicatedCapacityName The name of the dedicated capacity. It must be a minimum of 3 characters, and a * maximum of 63. + * @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 details about the specified dedicated capacity. + * @return details about the specified dedicated capacity along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - DedicatedCapacityInner getByResourceGroup(String resourceGroupName, String dedicatedCapacityName); + Response getByResourceGroupWithResponse( + String resourceGroupName, String dedicatedCapacityName, Context context); /** * Gets details about the specified dedicated capacity. @@ -42,15 +44,13 @@ public interface CapacitiesClient { * This name must be at least 1 character in length, and no more than 90. * @param dedicatedCapacityName The name of the dedicated capacity. It must be a minimum of 3 characters, and a * maximum of 63. - * @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 details about the specified dedicated capacity. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String dedicatedCapacityName, Context context); + DedicatedCapacityInner getByResourceGroup(String resourceGroupName, String dedicatedCapacityName); /** * Provisions the specified Dedicated capacity based on the configuration specified in the request. @@ -63,9 +63,9 @@ Response getByResourceGroupWithResponse( * @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 represents an instance of a Dedicated Capacity resource. + * @return the {@link SyncPoller} for polling of represents an instance of a Dedicated Capacity resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DedicatedCapacityInner> beginCreate( String resourceGroupName, String dedicatedCapacityName, DedicatedCapacityInner capacityParameters); @@ -81,9 +81,9 @@ SyncPoller, DedicatedCapacityInner> beginCrea * @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 represents an instance of a Dedicated Capacity resource. + * @return the {@link SyncPoller} for polling of represents an instance of a Dedicated Capacity resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DedicatedCapacityInner> beginCreate( String resourceGroupName, String dedicatedCapacityName, @@ -138,9 +138,9 @@ DedicatedCapacityInner create( * @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 completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String dedicatedCapacityName); /** @@ -154,9 +154,9 @@ DedicatedCapacityInner create( * @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 completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String resourceGroupName, String dedicatedCapacityName, Context context); @@ -200,9 +200,9 @@ SyncPoller, Void> beginDelete( * @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 represents an instance of a Dedicated Capacity resource. + * @return the {@link SyncPoller} for polling of represents an instance of a Dedicated Capacity resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DedicatedCapacityInner> beginUpdate( String resourceGroupName, String dedicatedCapacityName, @@ -220,9 +220,9 @@ SyncPoller, DedicatedCapacityInner> beginUpda * @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 represents an instance of a Dedicated Capacity resource. + * @return the {@link SyncPoller} for polling of represents an instance of a Dedicated Capacity resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DedicatedCapacityInner> beginUpdate( String resourceGroupName, String dedicatedCapacityName, @@ -279,9 +279,9 @@ DedicatedCapacityInner update( * @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 completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginSuspend(String resourceGroupName, String dedicatedCapacityName); /** @@ -295,9 +295,9 @@ DedicatedCapacityInner update( * @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 completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginSuspend( String resourceGroupName, String dedicatedCapacityName, Context context); @@ -340,9 +340,9 @@ SyncPoller, Void> beginSuspend( * @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 completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginResume(String resourceGroupName, String dedicatedCapacityName); /** @@ -356,9 +356,9 @@ SyncPoller, Void> beginSuspend( * @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 completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginResume( String resourceGroupName, String dedicatedCapacityName, Context context); @@ -399,7 +399,8 @@ SyncPoller, Void> beginResume( * @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 all the Dedicated capacities for the given resource group. + * @return all the Dedicated capacities for the given resource group as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); @@ -413,7 +414,8 @@ SyncPoller, Void> beginResume( * @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 all the Dedicated capacities for the given resource group. + * @return all the Dedicated capacities for the given resource group as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -423,7 +425,7 @@ SyncPoller, Void> beginResume( * * @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 an array of Dedicated capacities resources. + * @return an array of Dedicated capacities resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -435,7 +437,7 @@ SyncPoller, Void> beginResume( * @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 an array of Dedicated capacities resources. + * @return an array of Dedicated capacities resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); @@ -443,24 +445,24 @@ SyncPoller, Void> beginResume( /** * Lists eligible SKUs for PowerBI Dedicated resource 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 an object that represents enumerating SKUs for new resources. + * @return an object that represents enumerating SKUs for new resources along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - SkuEnumerationForNewResourceResultInner listSkus(); + Response listSkusWithResponse(Context context); /** * Lists eligible SKUs for PowerBI Dedicated resource 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 an object that represents enumerating SKUs for new resources. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listSkusWithResponse(Context context); + SkuEnumerationForNewResourceResultInner listSkus(); /** * Lists eligible SKUs for a PowerBI Dedicated resource. @@ -469,14 +471,15 @@ SyncPoller, Void> beginResume( * This name must be at least 1 character in length, and no more than 90. * @param dedicatedCapacityName The name of the Dedicated capacity. It must be at least 3 characters in length, and * no more than 63. + * @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 an object that represents enumerating SKUs for existing resources. + * @return an object that represents enumerating SKUs for existing resources along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - SkuEnumerationForExistingResourceResultInner listSkusForCapacity( - String resourceGroupName, String dedicatedCapacityName); + Response listSkusForCapacityWithResponse( + String resourceGroupName, String dedicatedCapacityName, Context context); /** * Lists eligible SKUs for a PowerBI Dedicated resource. @@ -485,42 +488,41 @@ SkuEnumerationForExistingResourceResultInner listSkusForCapacity( * This name must be at least 1 character in length, and no more than 90. * @param dedicatedCapacityName The name of the Dedicated capacity. It must be at least 3 characters in length, and * no more than 63. - * @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 an object that represents enumerating SKUs for existing resources. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listSkusForCapacityWithResponse( - String resourceGroupName, String dedicatedCapacityName, Context context); + SkuEnumerationForExistingResourceResultInner listSkusForCapacity( + String resourceGroupName, String dedicatedCapacityName); /** * Check the name availability in the target location. * * @param location The region name which the operation will lookup into. * @param capacityParameters The name of the capacity. + * @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 checking result of capacity name availability. + * @return the checking result of capacity name availability along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - CheckCapacityNameAvailabilityResultInner checkNameAvailability( - String location, CheckCapacityNameAvailabilityParameters capacityParameters); + Response checkNameAvailabilityWithResponse( + String location, CheckCapacityNameAvailabilityParameters capacityParameters, Context context); /** * Check the name availability in the target location. * * @param location The region name which the operation will lookup into. * @param capacityParameters The name of the capacity. - * @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 checking result of capacity name availability. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response checkNameAvailabilityWithResponse( - String location, CheckCapacityNameAvailabilityParameters capacityParameters, Context context); + CheckCapacityNameAvailabilityResultInner checkNameAvailability( + String location, CheckCapacityNameAvailabilityParameters capacityParameters); } diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/OperationsClient.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/OperationsClient.java index 4b1f6bfe895c..2e416b3a95ef 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/OperationsClient.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/OperationsClient.java @@ -17,7 +17,7 @@ public interface OperationsClient { * * @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 result listing capacities. + * @return result listing capacities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -29,7 +29,7 @@ public interface OperationsClient { * @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 result listing capacities. + * @return result listing capacities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/models/AutoScaleVCoreInner.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/models/AutoScaleVCoreInner.java index a68a2dc39cd8..6f5c0e1a4c1a 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/models/AutoScaleVCoreInner.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/models/AutoScaleVCoreInner.java @@ -5,22 +5,17 @@ package com.azure.resourcemanager.powerbidedicated.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.powerbidedicated.models.AutoScaleVCoreSku; import com.azure.resourcemanager.powerbidedicated.models.VCoreProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** Represents an instance of an auto scale v-core resource. */ -@JsonFlatten @Fluent -public class AutoScaleVCoreInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AutoScaleVCoreInner.class); - +public final class AutoScaleVCoreInner extends Resource { /* * The SKU of the auto scale v-core resource. */ @@ -28,24 +23,10 @@ public class AutoScaleVCoreInner extends Resource { private AutoScaleVCoreSku sku; /* - * The maximum capacity of an auto scale v-core resource. - */ - @JsonProperty(value = "properties.capacityLimit") - private Integer capacityLimit; - - /* - * The object ID of the capacity resource associated with the auto scale - * v-core resource. - */ - @JsonProperty(value = "properties.capacityObjectId") - private String capacityObjectId; - - /* - * The current deployment state of an auto scale v-core resource. The - * provisioningState is to indicate states for resource provisioning. + * Properties of an auto scale v-core resource. */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private VCoreProvisioningState provisioningState; + @JsonProperty(value = "properties") + private AutoScaleVCoreProperties innerProperties; /* * Metadata pertaining to creation and last modification of the resource. @@ -53,6 +34,10 @@ public class AutoScaleVCoreInner extends Resource { @JsonProperty(value = "systemData") private SystemData systemData; + /** Creates an instance of AutoScaleVCoreInner class. */ + public AutoScaleVCoreInner() { + } + /** * Get the sku property: The SKU of the auto scale v-core resource. * @@ -74,22 +59,45 @@ public AutoScaleVCoreInner withSku(AutoScaleVCoreSku sku) { } /** - * Get the capacityLimit property: The maximum capacity of an auto scale v-core resource. + * Get the innerProperties property: Properties of an auto scale v-core resource. * - * @return the capacityLimit value. + * @return the innerProperties value. */ - public Integer capacityLimit() { - return this.capacityLimit; + private AutoScaleVCoreProperties innerProperties() { + return this.innerProperties; } /** - * Set the capacityLimit property: The maximum capacity of an auto scale v-core resource. + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. * - * @param capacityLimit the capacityLimit value to set. + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Set the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @param systemData the systemData value to set. * @return the AutoScaleVCoreInner object itself. */ - public AutoScaleVCoreInner withCapacityLimit(Integer capacityLimit) { - this.capacityLimit = capacityLimit; + public AutoScaleVCoreInner withSystemData(SystemData systemData) { + this.systemData = systemData; + return this; + } + + /** {@inheritDoc} */ + @Override + public AutoScaleVCoreInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public AutoScaleVCoreInner withTags(Map tags) { + super.withTags(tags); return this; } @@ -100,7 +108,7 @@ public AutoScaleVCoreInner withCapacityLimit(Integer capacityLimit) { * @return the capacityObjectId value. */ public String capacityObjectId() { - return this.capacityObjectId; + return this.innerProperties() == null ? null : this.innerProperties().capacityObjectId(); } /** @@ -111,7 +119,10 @@ public String capacityObjectId() { * @return the AutoScaleVCoreInner object itself. */ public AutoScaleVCoreInner withCapacityObjectId(String capacityObjectId) { - this.capacityObjectId = capacityObjectId; + if (this.innerProperties() == null) { + this.innerProperties = new AutoScaleVCoreProperties(); + } + this.innerProperties().withCapacityObjectId(capacityObjectId); return this; } @@ -122,40 +133,29 @@ public AutoScaleVCoreInner withCapacityObjectId(String capacityObjectId) { * @return the provisioningState value. */ public VCoreProvisioningState provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** - * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * Get the capacityLimit property: The maximum capacity of an auto scale v-core resource. * - * @return the systemData value. + * @return the capacityLimit value. */ - public SystemData systemData() { - return this.systemData; + public Integer capacityLimit() { + return this.innerProperties() == null ? null : this.innerProperties().capacityLimit(); } /** - * Set the systemData property: Metadata pertaining to creation and last modification of the resource. + * Set the capacityLimit property: The maximum capacity of an auto scale v-core resource. * - * @param systemData the systemData value to set. + * @param capacityLimit the capacityLimit value to set. * @return the AutoScaleVCoreInner object itself. */ - public AutoScaleVCoreInner withSystemData(SystemData systemData) { - this.systemData = systemData; - return this; - } - - /** {@inheritDoc} */ - @Override - public AutoScaleVCoreInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public AutoScaleVCoreInner withTags(Map tags) { - super.withTags(tags); + public AutoScaleVCoreInner withCapacityLimit(Integer capacityLimit) { + if (this.innerProperties() == null) { + this.innerProperties = new AutoScaleVCoreProperties(); + } + this.innerProperties().withCapacityLimit(capacityLimit); return this; } @@ -166,11 +166,16 @@ public AutoScaleVCoreInner withTags(Map tags) { */ public void validate() { if (sku() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property sku in model AutoScaleVCoreInner")); } else { sku().validate(); } + if (innerProperties() != null) { + innerProperties().validate(); + } } + + private static final ClientLogger LOGGER = new ClientLogger(AutoScaleVCoreInner.class); } diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/AutoScaleVCoreMutableProperties.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/models/AutoScaleVCoreMutableProperties.java similarity index 83% rename from sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/AutoScaleVCoreMutableProperties.java rename to sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/models/AutoScaleVCoreMutableProperties.java index 28211c5b1d21..8a4f5614338e 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/AutoScaleVCoreMutableProperties.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/models/AutoScaleVCoreMutableProperties.java @@ -2,24 +2,24 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.powerbidedicated.models; +package com.azure.resourcemanager.powerbidedicated.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** An object that represents a set of mutable auto scale v-core resource properties. */ @Fluent public class AutoScaleVCoreMutableProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AutoScaleVCoreMutableProperties.class); - /* * The maximum capacity of an auto scale v-core resource. */ @JsonProperty(value = "capacityLimit") private Integer capacityLimit; + /** Creates an instance of AutoScaleVCoreMutableProperties class. */ + public AutoScaleVCoreMutableProperties() { + } + /** * Get the capacityLimit property: The maximum capacity of an auto scale v-core resource. * diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/AutoScaleVCoreProperties.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/models/AutoScaleVCoreProperties.java similarity index 85% rename from sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/AutoScaleVCoreProperties.java rename to sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/models/AutoScaleVCoreProperties.java index 75299a2bd611..f84b07a92012 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/AutoScaleVCoreProperties.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/models/AutoScaleVCoreProperties.java @@ -2,32 +2,32 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.powerbidedicated.models; +package com.azure.resourcemanager.powerbidedicated.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.powerbidedicated.models.VCoreProvisioningState; import com.fasterxml.jackson.annotation.JsonProperty; /** Properties of an auto scale v-core resource. */ @Fluent public final class AutoScaleVCoreProperties extends AutoScaleVCoreMutableProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AutoScaleVCoreProperties.class); - /* - * The object ID of the capacity resource associated with the auto scale - * v-core resource. + * The object ID of the capacity resource associated with the auto scale v-core resource. */ @JsonProperty(value = "capacityObjectId") private String capacityObjectId; /* - * The current deployment state of an auto scale v-core resource. The - * provisioningState is to indicate states for resource provisioning. + * The current deployment state of an auto scale v-core resource. The provisioningState is to indicate states for + * resource provisioning. */ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private VCoreProvisioningState provisioningState; + /** Creates an instance of AutoScaleVCoreProperties class. */ + public AutoScaleVCoreProperties() { + } + /** * Get the capacityObjectId property: The object ID of the capacity resource associated with the auto scale v-core * resource. diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/models/CheckCapacityNameAvailabilityResultInner.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/models/CheckCapacityNameAvailabilityResultInner.java index 2e3a4188e444..769ec75c1472 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/models/CheckCapacityNameAvailabilityResultInner.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/models/CheckCapacityNameAvailabilityResultInner.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.powerbidedicated.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The checking result of capacity name availability. */ @Fluent public final class CheckCapacityNameAvailabilityResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckCapacityNameAvailabilityResultInner.class); - /* * Indicator of availability of the capacity name. */ @@ -32,6 +28,10 @@ public final class CheckCapacityNameAvailabilityResultInner { @JsonProperty(value = "message") private String message; + /** Creates an instance of CheckCapacityNameAvailabilityResultInner class. */ + public CheckCapacityNameAvailabilityResultInner() { + } + /** * Get the nameAvailable property: Indicator of availability of the capacity name. * diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/models/DedicatedCapacityInner.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/models/DedicatedCapacityInner.java index 1b32b2abb812..281a60424ba8 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/models/DedicatedCapacityInner.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/models/DedicatedCapacityInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.powerbidedicated.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; @@ -14,16 +13,12 @@ import com.azure.resourcemanager.powerbidedicated.models.DedicatedCapacityAdministrators; import com.azure.resourcemanager.powerbidedicated.models.Mode; import com.azure.resourcemanager.powerbidedicated.models.State; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** Represents an instance of a Dedicated Capacity resource. */ -@JsonFlatten @Fluent -public class DedicatedCapacityInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DedicatedCapacityInner.class); - +public final class DedicatedCapacityInner extends Resource { /* * The SKU of the PowerBI Dedicated capacity resource. */ @@ -31,30 +26,10 @@ public class DedicatedCapacityInner extends Resource { private CapacitySku sku; /* - * A collection of Dedicated capacity administrators - */ - @JsonProperty(value = "properties.administration") - private DedicatedCapacityAdministrators administration; - - /* - * The capacity mode. - */ - @JsonProperty(value = "properties.mode") - private Mode mode; - - /* - * The current state of PowerBI Dedicated resource. The state is to - * indicate more states outside of resource provisioning. + * Properties of the provision operation request. */ - @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) - private State state; - - /* - * The current deployment state of PowerBI Dedicated resource. The - * provisioningState is to indicate states for resource provisioning. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private CapacityProvisioningState provisioningState; + @JsonProperty(value = "properties") + private DedicatedCapacityProperties innerProperties; /* * Metadata pertaining to creation and last modification of the resource. @@ -62,6 +37,10 @@ public class DedicatedCapacityInner extends Resource { @JsonProperty(value = "systemData") private SystemData systemData; + /** Creates an instance of DedicatedCapacityInner class. */ + public DedicatedCapacityInner() { + } + /** * Get the sku property: The SKU of the PowerBI Dedicated capacity resource. * @@ -83,42 +62,45 @@ public DedicatedCapacityInner withSku(CapacitySku sku) { } /** - * Get the administration property: A collection of Dedicated capacity administrators. + * Get the innerProperties property: Properties of the provision operation request. * - * @return the administration value. + * @return the innerProperties value. */ - public DedicatedCapacityAdministrators administration() { - return this.administration; + private DedicatedCapacityProperties innerProperties() { + return this.innerProperties; } /** - * Set the administration property: A collection of Dedicated capacity administrators. + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. * - * @param administration the administration value to set. - * @return the DedicatedCapacityInner object itself. + * @return the systemData value. */ - public DedicatedCapacityInner withAdministration(DedicatedCapacityAdministrators administration) { - this.administration = administration; - return this; + public SystemData systemData() { + return this.systemData; } /** - * Get the mode property: The capacity mode. + * Set the systemData property: Metadata pertaining to creation and last modification of the resource. * - * @return the mode value. + * @param systemData the systemData value to set. + * @return the DedicatedCapacityInner object itself. */ - public Mode mode() { - return this.mode; + public DedicatedCapacityInner withSystemData(SystemData systemData) { + this.systemData = systemData; + return this; } - /** - * Set the mode property: The capacity mode. - * - * @param mode the mode value to set. - * @return the DedicatedCapacityInner object itself. - */ - public DedicatedCapacityInner withMode(Mode mode) { - this.mode = mode; + /** {@inheritDoc} */ + @Override + public DedicatedCapacityInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public DedicatedCapacityInner withTags(Map tags) { + super.withTags(tags); return this; } @@ -129,7 +111,7 @@ public DedicatedCapacityInner withMode(Mode mode) { * @return the state value. */ public State state() { - return this.state; + return this.innerProperties() == null ? null : this.innerProperties().state(); } /** @@ -139,43 +121,77 @@ public State state() { * @return the provisioningState value. */ public CapacityProvisioningState provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** - * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * Get the administration property: A collection of Dedicated capacity administrators. * - * @return the systemData value. + * @return the administration value. */ - public SystemData systemData() { - return this.systemData; + public DedicatedCapacityAdministrators administration() { + return this.innerProperties() == null ? null : this.innerProperties().administration(); } /** - * Set the systemData property: Metadata pertaining to creation and last modification of the resource. + * Set the administration property: A collection of Dedicated capacity administrators. * - * @param systemData the systemData value to set. + * @param administration the administration value to set. * @return the DedicatedCapacityInner object itself. */ - public DedicatedCapacityInner withSystemData(SystemData systemData) { - this.systemData = systemData; + public DedicatedCapacityInner withAdministration(DedicatedCapacityAdministrators administration) { + if (this.innerProperties() == null) { + this.innerProperties = new DedicatedCapacityProperties(); + } + this.innerProperties().withAdministration(administration); return this; } - /** {@inheritDoc} */ - @Override - public DedicatedCapacityInner withLocation(String location) { - super.withLocation(location); - return this; + /** + * Get the mode property: Specifies the generation of the Power BI Embedded capacity. If no value is specified, the + * default value 'Gen2' is used. [Learn + * More](https://docs.microsoft.com/power-bi/developer/embedded/power-bi-embedded-generation-2). + * + * @return the mode value. + */ + public Mode mode() { + return this.innerProperties() == null ? null : this.innerProperties().mode(); } - /** {@inheritDoc} */ - @Override - public DedicatedCapacityInner withTags(Map tags) { - super.withTags(tags); + /** + * Set the mode property: Specifies the generation of the Power BI Embedded capacity. If no value is specified, the + * default value 'Gen2' is used. [Learn + * More](https://docs.microsoft.com/power-bi/developer/embedded/power-bi-embedded-generation-2). + * + * @param mode the mode value to set. + * @return the DedicatedCapacityInner object itself. + */ + public DedicatedCapacityInner withMode(Mode mode) { + if (this.innerProperties() == null) { + this.innerProperties = new DedicatedCapacityProperties(); + } + this.innerProperties().withMode(mode); return this; } + /** + * Get the tenantId property: Tenant ID for the capacity. Used for creating Pro Plus capacity. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.innerProperties() == null ? null : this.innerProperties().tenantId(); + } + + /** + * Get the friendlyName property: Capacity name. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + } + /** * Validates the instance. * @@ -183,14 +199,16 @@ public DedicatedCapacityInner withTags(Map tags) { */ public void validate() { if (sku() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property sku in model DedicatedCapacityInner")); } else { sku().validate(); } - if (administration() != null) { - administration().validate(); + if (innerProperties() != null) { + innerProperties().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(DedicatedCapacityInner.class); } diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/DedicatedCapacityMutableProperties.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/models/DedicatedCapacityMutableProperties.java similarity index 51% rename from sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/DedicatedCapacityMutableProperties.java rename to sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/models/DedicatedCapacityMutableProperties.java index 4b0f2979d7a9..484aae4f5ea9 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/DedicatedCapacityMutableProperties.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/models/DedicatedCapacityMutableProperties.java @@ -2,18 +2,16 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.powerbidedicated.models; +package com.azure.resourcemanager.powerbidedicated.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.powerbidedicated.models.DedicatedCapacityAdministrators; +import com.azure.resourcemanager.powerbidedicated.models.Mode; import com.fasterxml.jackson.annotation.JsonProperty; /** An object that represents a set of mutable Dedicated capacity resource properties. */ @Fluent public class DedicatedCapacityMutableProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DedicatedCapacityMutableProperties.class); - /* * A collection of Dedicated capacity administrators */ @@ -21,11 +19,28 @@ public class DedicatedCapacityMutableProperties { private DedicatedCapacityAdministrators administration; /* - * The capacity mode. + * Specifies the generation of the Power BI Embedded capacity. If no value is specified, the default value 'Gen2' + * is used. [Learn More](https://docs.microsoft.com/power-bi/developer/embedded/power-bi-embedded-generation-2) */ @JsonProperty(value = "mode") private Mode mode; + /* + * Tenant ID for the capacity. Used for creating Pro Plus capacity. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /* + * Capacity name + */ + @JsonProperty(value = "friendlyName", access = JsonProperty.Access.WRITE_ONLY) + private String friendlyName; + + /** Creates an instance of DedicatedCapacityMutableProperties class. */ + public DedicatedCapacityMutableProperties() { + } + /** * Get the administration property: A collection of Dedicated capacity administrators. * @@ -47,7 +62,9 @@ public DedicatedCapacityMutableProperties withAdministration(DedicatedCapacityAd } /** - * Get the mode property: The capacity mode. + * Get the mode property: Specifies the generation of the Power BI Embedded capacity. If no value is specified, the + * default value 'Gen2' is used. [Learn + * More](https://docs.microsoft.com/power-bi/developer/embedded/power-bi-embedded-generation-2). * * @return the mode value. */ @@ -56,7 +73,9 @@ public Mode mode() { } /** - * Set the mode property: The capacity mode. + * Set the mode property: Specifies the generation of the Power BI Embedded capacity. If no value is specified, the + * default value 'Gen2' is used. [Learn + * More](https://docs.microsoft.com/power-bi/developer/embedded/power-bi-embedded-generation-2). * * @param mode the mode value to set. * @return the DedicatedCapacityMutableProperties object itself. @@ -66,6 +85,24 @@ public DedicatedCapacityMutableProperties withMode(Mode mode) { return this; } + /** + * Get the tenantId property: Tenant ID for the capacity. Used for creating Pro Plus capacity. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the friendlyName property: Capacity name. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + /** * Validates the instance. * diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/DedicatedCapacityProperties.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/models/DedicatedCapacityProperties.java similarity index 74% rename from sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/DedicatedCapacityProperties.java rename to sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/models/DedicatedCapacityProperties.java index e4d23c66aa87..f7ecb9fa02d7 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/DedicatedCapacityProperties.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/models/DedicatedCapacityProperties.java @@ -2,32 +2,36 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.powerbidedicated.models; +package com.azure.resourcemanager.powerbidedicated.fluent.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.powerbidedicated.models.CapacityProvisioningState; +import com.azure.resourcemanager.powerbidedicated.models.DedicatedCapacityAdministrators; +import com.azure.resourcemanager.powerbidedicated.models.Mode; +import com.azure.resourcemanager.powerbidedicated.models.State; import com.fasterxml.jackson.annotation.JsonProperty; /** Properties of Dedicated Capacity resource. */ -@Immutable +@Fluent public final class DedicatedCapacityProperties extends DedicatedCapacityMutableProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DedicatedCapacityProperties.class); - /* - * The current state of PowerBI Dedicated resource. The state is to - * indicate more states outside of resource provisioning. + * The current state of PowerBI Dedicated resource. The state is to indicate more states outside of resource + * provisioning. */ @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) private State state; /* - * The current deployment state of PowerBI Dedicated resource. The - * provisioningState is to indicate states for resource provisioning. + * The current deployment state of PowerBI Dedicated resource. The provisioningState is to indicate states for + * resource provisioning. */ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private CapacityProvisioningState provisioningState; + /** Creates an instance of DedicatedCapacityProperties class. */ + public DedicatedCapacityProperties() { + } + /** * Get the state property: The current state of PowerBI Dedicated resource. The state is to indicate more states * outside of resource provisioning. diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/models/OperationInner.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/models/OperationInner.java index 54ed4f1f9379..f97ace29b97f 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/models/OperationInner.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/models/OperationInner.java @@ -5,16 +5,13 @@ package com.azure.resourcemanager.powerbidedicated.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.powerbidedicated.models.OperationDisplay; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.powerbidedicated.models.OperationProperties; import com.fasterxml.jackson.annotation.JsonProperty; /** Capacities REST API operation. */ @Fluent public final class OperationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); - /* * Operation name: {provider}/{resource}/{operation}. */ @@ -27,6 +24,22 @@ public final class OperationInner { @JsonProperty(value = "display") private OperationDisplay display; + /* + * Origin of the operation. + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private String origin; + + /* + * Additional properties to expose performance metrics to shoebox. + */ + @JsonProperty(value = "properties") + private OperationProperties properties; + + /** Creates an instance of OperationInner class. */ + public OperationInner() { + } + /** * Get the name property: Operation name: {provider}/{resource}/{operation}. * @@ -56,6 +69,35 @@ public OperationInner withDisplay(OperationDisplay display) { return this; } + /** + * Get the origin property: Origin of the operation. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Get the properties property: Additional properties to expose performance metrics to shoebox. + * + * @return the properties value. + */ + public OperationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Additional properties to expose performance metrics to shoebox. + * + * @param properties the properties value to set. + * @return the OperationInner object itself. + */ + public OperationInner withProperties(OperationProperties properties) { + this.properties = properties; + return this; + } + /** * Validates the instance. * @@ -65,5 +107,8 @@ public void validate() { if (display() != null) { display().validate(); } + if (properties() != null) { + properties().validate(); + } } } diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/models/SkuEnumerationForExistingResourceResultInner.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/models/SkuEnumerationForExistingResourceResultInner.java index f2d71f600ce8..b9f72ab58c33 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/models/SkuEnumerationForExistingResourceResultInner.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/models/SkuEnumerationForExistingResourceResultInner.java @@ -5,24 +5,23 @@ package com.azure.resourcemanager.powerbidedicated.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.powerbidedicated.models.SkuDetailsForExistingResource; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** An object that represents enumerating SKUs for existing resources. */ @Fluent public final class SkuEnumerationForExistingResourceResultInner { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(SkuEnumerationForExistingResourceResultInner.class); - /* * The collection of available SKUs for existing resources */ @JsonProperty(value = "value") private List value; + /** Creates an instance of SkuEnumerationForExistingResourceResultInner class. */ + public SkuEnumerationForExistingResourceResultInner() { + } + /** * Get the value property: The collection of available SKUs for existing resources. * diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/models/SkuEnumerationForNewResourceResultInner.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/models/SkuEnumerationForNewResourceResultInner.java index 076da9a186c4..8a4798f5aeb1 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/models/SkuEnumerationForNewResourceResultInner.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/fluent/models/SkuEnumerationForNewResourceResultInner.java @@ -5,23 +5,23 @@ package com.azure.resourcemanager.powerbidedicated.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.powerbidedicated.models.CapacitySku; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** An object that represents enumerating SKUs for new resources. */ @Fluent public final class SkuEnumerationForNewResourceResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuEnumerationForNewResourceResultInner.class); - /* * The collection of available SKUs for new resources */ @JsonProperty(value = "value") private List value; + /** Creates an instance of SkuEnumerationForNewResourceResultInner class. */ + public SkuEnumerationForNewResourceResultInner() { + } + /** * Get the value property: The collection of available SKUs for new resources. * diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/AutoScaleVCoreImpl.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/AutoScaleVCoreImpl.java index 78cdc54f2fbb..30acff635585 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/AutoScaleVCoreImpl.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/AutoScaleVCoreImpl.java @@ -49,8 +49,8 @@ public AutoScaleVCoreSku sku() { return this.innerModel().sku(); } - public Integer capacityLimit() { - return this.innerModel().capacityLimit(); + public SystemData systemData() { + return this.innerModel().systemData(); } public String capacityObjectId() { @@ -61,8 +61,8 @@ public VCoreProvisioningState provisioningState() { return this.innerModel().provisioningState(); } - public SystemData systemData() { - return this.innerModel().systemData(); + public Integer capacityLimit() { + return this.innerModel().capacityLimit(); } public Region region() { @@ -73,6 +73,10 @@ public String regionName() { return this.location(); } + public String resourceGroupName() { + return resourceGroupName; + } + public AutoScaleVCoreInner innerModel() { return this.innerObject; } @@ -202,6 +206,16 @@ public AutoScaleVCoreImpl withTags(Map tags) { } } + public AutoScaleVCoreImpl withSystemData(SystemData systemData) { + this.innerModel().withSystemData(systemData); + return this; + } + + public AutoScaleVCoreImpl withCapacityObjectId(String capacityObjectId) { + this.innerModel().withCapacityObjectId(capacityObjectId); + return this; + } + public AutoScaleVCoreImpl withCapacityLimit(Integer capacityLimit) { if (isInCreateMode()) { this.innerModel().withCapacityLimit(capacityLimit); @@ -212,16 +226,6 @@ public AutoScaleVCoreImpl withCapacityLimit(Integer capacityLimit) { } } - public AutoScaleVCoreImpl withCapacityObjectId(String capacityObjectId) { - this.innerModel().withCapacityObjectId(capacityObjectId); - return this; - } - - public AutoScaleVCoreImpl withSystemData(SystemData systemData) { - this.innerModel().withSystemData(systemData); - return this; - } - private boolean isInCreateMode() { return this.innerModel().id() == null; } diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/AutoScaleVCoresClientImpl.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/AutoScaleVCoresClientImpl.java index f24844c9c0ca..2ae8a9e81574 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/AutoScaleVCoresClientImpl.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/AutoScaleVCoresClientImpl.java @@ -29,7 +29,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.powerbidedicated.fluent.AutoScaleVCoresClient; import com.azure.resourcemanager.powerbidedicated.fluent.models.AutoScaleVCoreInner; import com.azure.resourcemanager.powerbidedicated.models.AutoScaleVCoreListResult; @@ -38,8 +37,6 @@ /** An instance of this class provides access to all the operations defined in AutoScaleVCoresClient. */ public final class AutoScaleVCoresClientImpl implements AutoScaleVCoresClient { - private final ClientLogger logger = new ClientLogger(AutoScaleVCoresClientImpl.class); - /** The proxy service used to perform REST calls. */ private final AutoScaleVCoresService service; @@ -63,7 +60,7 @@ public final class AutoScaleVCoresClientImpl implements AutoScaleVCoresClient { */ @Host("{$host}") @ServiceInterface(name = "PowerBIDedicatedAuto") - private interface AutoScaleVCoresService { + public interface AutoScaleVCoresService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated" @@ -161,7 +158,8 @@ Mono> list( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details about the specified auto scale v-core. + * @return details about the specified auto scale v-core along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -211,7 +209,8 @@ private Mono> getByResourceGroupWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details about the specified auto scale v-core. + * @return details about the specified auto scale v-core along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -257,19 +256,12 @@ private Mono> getByResourceGroupWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details about the specified auto scale v-core. + * @return details about the specified auto scale v-core on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, String vcoreName) { return getByResourceGroupWithResponseAsync(resourceGroupName, vcoreName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -278,14 +270,16 @@ private Mono getByResourceGroupAsync(String resourceGroupNa * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated capacity is part. * This name must be at least 1 character in length, and no more than 90. * @param vcoreName The name of the auto scale v-core. It must be a minimum of 3 characters, and a maximum of 63. + * @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 details about the specified auto scale v-core. + * @return details about the specified auto scale v-core along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AutoScaleVCoreInner getByResourceGroup(String resourceGroupName, String vcoreName) { - return getByResourceGroupAsync(resourceGroupName, vcoreName).block(); + public Response getByResourceGroupWithResponse( + String resourceGroupName, String vcoreName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, vcoreName, context).block(); } /** @@ -294,16 +288,14 @@ public AutoScaleVCoreInner getByResourceGroup(String resourceGroupName, String v * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated capacity is part. * This name must be at least 1 character in length, and no more than 90. * @param vcoreName The name of the auto scale v-core. It must be a minimum of 3 characters, and a maximum of 63. - * @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 details about the specified auto scale v-core. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String vcoreName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, vcoreName, context).block(); + public AutoScaleVCoreInner getByResourceGroup(String resourceGroupName, String vcoreName) { + return getByResourceGroupWithResponse(resourceGroupName, vcoreName, Context.NONE).getValue(); } /** @@ -316,7 +308,8 @@ public Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of an auto scale v-core resource. + * @return represents an instance of an auto scale v-core resource along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createWithResponseAsync( @@ -374,7 +367,8 @@ private Mono> createWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of an auto scale v-core resource. + * @return represents an instance of an auto scale v-core resource along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createWithResponseAsync( @@ -428,20 +422,13 @@ private Mono> createWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of an auto scale v-core resource. + * @return represents an instance of an auto scale v-core resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync( String resourceGroupName, String vcoreName, AutoScaleVCoreInner vCoreParameters) { return createWithResponseAsync(resourceGroupName, vcoreName, vCoreParameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -451,14 +438,16 @@ private Mono createAsync( * This name must be at least 1 character in length, and no more than 90. * @param vcoreName The name of the auto scale v-core. It must be a minimum of 3 characters, and a maximum of 63. * @param vCoreParameters Contains the information used to provision the auto scale v-core. + * @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 represents an instance of an auto scale v-core resource. + * @return represents an instance of an auto scale v-core resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AutoScaleVCoreInner create(String resourceGroupName, String vcoreName, AutoScaleVCoreInner vCoreParameters) { - return createAsync(resourceGroupName, vcoreName, vCoreParameters).block(); + public Response createWithResponse( + String resourceGroupName, String vcoreName, AutoScaleVCoreInner vCoreParameters, Context context) { + return createWithResponseAsync(resourceGroupName, vcoreName, vCoreParameters, context).block(); } /** @@ -468,16 +457,14 @@ public AutoScaleVCoreInner create(String resourceGroupName, String vcoreName, Au * This name must be at least 1 character in length, and no more than 90. * @param vcoreName The name of the auto scale v-core. It must be a minimum of 3 characters, and a maximum of 63. * @param vCoreParameters Contains the information used to provision the auto scale v-core. - * @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 represents an instance of an auto scale v-core resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String resourceGroupName, String vcoreName, AutoScaleVCoreInner vCoreParameters, Context context) { - return createWithResponseAsync(resourceGroupName, vcoreName, vCoreParameters, context).block(); + public AutoScaleVCoreInner create(String resourceGroupName, String vcoreName, AutoScaleVCoreInner vCoreParameters) { + return createWithResponse(resourceGroupName, vcoreName, vCoreParameters, Context.NONE).getValue(); } /** @@ -489,7 +476,7 @@ public Response createWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String vcoreName) { @@ -538,7 +525,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String vcoreName, Context context) { @@ -583,11 +570,11 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String vcoreName) { - return deleteWithResponseAsync(resourceGroupName, vcoreName).flatMap((Response res) -> Mono.empty()); + return deleteWithResponseAsync(resourceGroupName, vcoreName).flatMap(ignored -> Mono.empty()); } /** @@ -596,13 +583,15 @@ private Mono deleteAsync(String resourceGroupName, String vcoreName) { * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated capacity is part. * This name must be at least 1 character in length, and no more than 90. * @param vcoreName The name of the auto scale v-core. It must be a minimum of 3 characters, and a maximum of 63. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String vcoreName) { - deleteAsync(resourceGroupName, vcoreName).block(); + public Response deleteWithResponse(String resourceGroupName, String vcoreName, Context context) { + return deleteWithResponseAsync(resourceGroupName, vcoreName, context).block(); } /** @@ -611,15 +600,13 @@ public void delete(String resourceGroupName, String vcoreName) { * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated capacity is part. * This name must be at least 1 character in length, and no more than 90. * @param vcoreName The name of the auto scale v-core. It must be a minimum of 3 characters, and a maximum of 63. - * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String vcoreName, Context context) { - return deleteWithResponseAsync(resourceGroupName, vcoreName, context).block(); + public void delete(String resourceGroupName, String vcoreName) { + deleteWithResponse(resourceGroupName, vcoreName, Context.NONE); } /** @@ -632,7 +619,8 @@ public Response deleteWithResponse(String resourceGroupName, String vcoreN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of an auto scale v-core resource. + * @return represents an instance of an auto scale v-core resource along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -690,7 +678,8 @@ private Mono> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of an auto scale v-core resource. + * @return represents an instance of an auto scale v-core resource along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -747,20 +736,13 @@ private Mono> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of an auto scale v-core resource. + * @return represents an instance of an auto scale v-core resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( String resourceGroupName, String vcoreName, AutoScaleVCoreUpdateParameters vCoreUpdateParameters) { return updateWithResponseAsync(resourceGroupName, vcoreName, vCoreUpdateParameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -770,15 +752,19 @@ private Mono updateAsync( * This name must be at least 1 character in length, and no more than 90. * @param vcoreName The name of the auto scale v-core. It must be a minimum of 3 characters, and a maximum of 63. * @param vCoreUpdateParameters Request object that contains the updated information for the auto scale v-core. + * @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 represents an instance of an auto scale v-core resource. + * @return represents an instance of an auto scale v-core resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AutoScaleVCoreInner update( - String resourceGroupName, String vcoreName, AutoScaleVCoreUpdateParameters vCoreUpdateParameters) { - return updateAsync(resourceGroupName, vcoreName, vCoreUpdateParameters).block(); + public Response updateWithResponse( + String resourceGroupName, + String vcoreName, + AutoScaleVCoreUpdateParameters vCoreUpdateParameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, vcoreName, vCoreUpdateParameters, context).block(); } /** @@ -788,19 +774,15 @@ public AutoScaleVCoreInner update( * This name must be at least 1 character in length, and no more than 90. * @param vcoreName The name of the auto scale v-core. It must be a minimum of 3 characters, and a maximum of 63. * @param vCoreUpdateParameters Request object that contains the updated information for the auto scale v-core. - * @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 represents an instance of an auto scale v-core resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, - String vcoreName, - AutoScaleVCoreUpdateParameters vCoreUpdateParameters, - Context context) { - return updateWithResponseAsync(resourceGroupName, vcoreName, vCoreUpdateParameters, context).block(); + public AutoScaleVCoreInner update( + String resourceGroupName, String vcoreName, AutoScaleVCoreUpdateParameters vCoreUpdateParameters) { + return updateWithResponse(resourceGroupName, vcoreName, vCoreUpdateParameters, Context.NONE).getValue(); } /** @@ -811,7 +793,8 @@ public Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the auto scale v-cores for the given resource group. + * @return all the auto scale v-cores for the given resource group along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { @@ -859,7 +842,8 @@ private Mono> listByResourceGroupSinglePageAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the auto scale v-cores for the given resource group. + * @return all the auto scale v-cores for the given resource group along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( @@ -904,7 +888,7 @@ private Mono> listByResourceGroupSinglePageAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the auto scale v-cores for the given resource group. + * @return all the auto scale v-cores for the given resource group as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { @@ -920,7 +904,7 @@ private PagedFlux listByResourceGroupAsync(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the auto scale v-cores for the given resource group. + * @return all the auto scale v-cores for the given resource group as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { @@ -935,7 +919,7 @@ private PagedFlux listByResourceGroupAsync(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the auto scale v-cores for the given resource group. + * @return all the auto scale v-cores for the given resource group as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -951,7 +935,7 @@ public PagedIterable listByResourceGroup(String resourceGro * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the auto scale v-cores for the given resource group. + * @return all the auto scale v-cores for the given resource group as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { @@ -963,7 +947,8 @@ public PagedIterable listByResourceGroup(String resourceGro * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an array of auto scale v-core resources. + * @return an array of auto scale v-core resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -1004,7 +989,8 @@ private Mono> listSinglePageAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an array of auto scale v-core resources. + * @return an array of auto scale v-core resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -1040,7 +1026,7 @@ private Mono> listSinglePageAsync(Context con * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an array of auto scale v-core resources. + * @return an array of auto scale v-core resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -1054,7 +1040,7 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an array of auto scale v-core resources. + * @return an array of auto scale v-core resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -1066,7 +1052,7 @@ private PagedFlux listAsync(Context context) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an array of auto scale v-core resources. + * @return an array of auto scale v-core resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -1080,7 +1066,7 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an array of auto scale v-core resources. + * @return an array of auto scale v-core resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/AutoScaleVCoresImpl.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/AutoScaleVCoresImpl.java index 0af2960a6773..a2f2870299ab 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/AutoScaleVCoresImpl.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/AutoScaleVCoresImpl.java @@ -13,10 +13,9 @@ import com.azure.resourcemanager.powerbidedicated.fluent.models.AutoScaleVCoreInner; import com.azure.resourcemanager.powerbidedicated.models.AutoScaleVCore; import com.azure.resourcemanager.powerbidedicated.models.AutoScaleVCores; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class AutoScaleVCoresImpl implements AutoScaleVCores { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AutoScaleVCoresImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(AutoScaleVCoresImpl.class); private final AutoScaleVCoresClient innerClient; @@ -29,15 +28,6 @@ public AutoScaleVCoresImpl( this.serviceManager = serviceManager; } - public AutoScaleVCore getByResourceGroup(String resourceGroupName, String vcoreName) { - AutoScaleVCoreInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, vcoreName); - if (inner != null) { - return new AutoScaleVCoreImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getByResourceGroupWithResponse( String resourceGroupName, String vcoreName, Context context) { Response inner = @@ -53,14 +43,24 @@ public Response getByResourceGroupWithResponse( } } - public void deleteByResourceGroup(String resourceGroupName, String vcoreName) { - this.serviceClient().delete(resourceGroupName, vcoreName); + public AutoScaleVCore getByResourceGroup(String resourceGroupName, String vcoreName) { + AutoScaleVCoreInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, vcoreName); + if (inner != null) { + return new AutoScaleVCoreImpl(inner, this.manager()); + } else { + return null; + } } - public Response deleteWithResponse(String resourceGroupName, String vcoreName, Context context) { + public Response deleteByResourceGroupWithResponse( + String resourceGroupName, String vcoreName, Context context) { return this.serviceClient().deleteWithResponse(resourceGroupName, vcoreName, context); } + public void deleteByResourceGroup(String resourceGroupName, String vcoreName) { + this.serviceClient().delete(resourceGroupName, vcoreName); + } + public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); return Utils.mapPage(inner, inner1 -> new AutoScaleVCoreImpl(inner1, this.manager())); @@ -84,7 +84,7 @@ public PagedIterable list(Context context) { public AutoScaleVCore getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -92,7 +92,7 @@ public AutoScaleVCore getById(String id) { } String vcoreName = Utils.getValueFromIdByName(id, "autoScaleVCores"); if (vcoreName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -104,7 +104,7 @@ public AutoScaleVCore getById(String id) { public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -112,7 +112,7 @@ public Response getByIdWithResponse(String id, Context context) } String vcoreName = Utils.getValueFromIdByName(id, "autoScaleVCores"); if (vcoreName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -124,7 +124,7 @@ public Response getByIdWithResponse(String id, Context context) public void deleteById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -132,19 +132,19 @@ public void deleteById(String id) { } String vcoreName = Utils.getValueFromIdByName(id, "autoScaleVCores"); if (vcoreName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String .format("The resource ID '%s' is not valid. Missing path segment 'autoScaleVCores'.", id))); } - this.deleteWithResponse(resourceGroupName, vcoreName, Context.NONE).getValue(); + this.deleteByResourceGroupWithResponse(resourceGroupName, vcoreName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -152,13 +152,13 @@ public Response deleteByIdWithResponse(String id, Context context) { } String vcoreName = Utils.getValueFromIdByName(id, "autoScaleVCores"); if (vcoreName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String .format("The resource ID '%s' is not valid. Missing path segment 'autoScaleVCores'.", id))); } - return this.deleteWithResponse(resourceGroupName, vcoreName, context); + return this.deleteByResourceGroupWithResponse(resourceGroupName, vcoreName, context); } private AutoScaleVCoresClient serviceClient() { diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/CapacitiesClientImpl.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/CapacitiesClientImpl.java index 143494a8122d..23cbc283b82f 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/CapacitiesClientImpl.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/CapacitiesClientImpl.java @@ -31,7 +31,6 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.powerbidedicated.fluent.CapacitiesClient; @@ -48,8 +47,6 @@ /** An instance of this class provides access to all the operations defined in CapacitiesClient. */ public final class CapacitiesClientImpl implements CapacitiesClient { - private final ClientLogger logger = new ClientLogger(CapacitiesClientImpl.class); - /** The proxy service used to perform REST calls. */ private final CapacitiesService service; @@ -73,7 +70,7 @@ public final class CapacitiesClientImpl implements CapacitiesClient { */ @Host("{$host}") @ServiceInterface(name = "PowerBIDedicatedCapa") - private interface CapacitiesService { + public interface CapacitiesService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated" @@ -243,7 +240,8 @@ Mono> checkNameAvailability( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details about the specified dedicated capacity. + * @return details about the specified dedicated capacity along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -295,7 +293,8 @@ private Mono> getByResourceGroupWithResponseAsy * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details about the specified dedicated capacity. + * @return details about the specified dedicated capacity along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -343,20 +342,13 @@ private Mono> getByResourceGroupWithResponseAsy * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details about the specified dedicated capacity. + * @return details about the specified dedicated capacity on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync( String resourceGroupName, String dedicatedCapacityName) { return getByResourceGroupWithResponseAsync(resourceGroupName, dedicatedCapacityName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -366,14 +358,16 @@ private Mono getByResourceGroupAsync( * This name must be at least 1 character in length, and no more than 90. * @param dedicatedCapacityName The name of the dedicated capacity. It must be a minimum of 3 characters, and a * maximum of 63. + * @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 details about the specified dedicated capacity. + * @return details about the specified dedicated capacity along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DedicatedCapacityInner getByResourceGroup(String resourceGroupName, String dedicatedCapacityName) { - return getByResourceGroupAsync(resourceGroupName, dedicatedCapacityName).block(); + public Response getByResourceGroupWithResponse( + String resourceGroupName, String dedicatedCapacityName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, dedicatedCapacityName, context).block(); } /** @@ -383,16 +377,14 @@ public DedicatedCapacityInner getByResourceGroup(String resourceGroupName, Strin * This name must be at least 1 character in length, and no more than 90. * @param dedicatedCapacityName The name of the dedicated capacity. It must be a minimum of 3 characters, and a * maximum of 63. - * @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 details about the specified dedicated capacity. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String dedicatedCapacityName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, dedicatedCapacityName, context).block(); + public DedicatedCapacityInner getByResourceGroup(String resourceGroupName, String dedicatedCapacityName) { + return getByResourceGroupWithResponse(resourceGroupName, dedicatedCapacityName, Context.NONE).getValue(); } /** @@ -406,7 +398,8 @@ public Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a Dedicated Capacity resource. + * @return represents an instance of a Dedicated Capacity resource along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createWithResponseAsync( @@ -466,7 +459,8 @@ private Mono>> createWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a Dedicated Capacity resource. + * @return represents an instance of a Dedicated Capacity resource along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createWithResponseAsync( @@ -525,9 +519,9 @@ private Mono>> createWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a Dedicated Capacity resource. + * @return the {@link PollerFlux} for polling of represents an instance of a Dedicated Capacity resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DedicatedCapacityInner> beginCreateAsync( String resourceGroupName, String dedicatedCapacityName, DedicatedCapacityInner capacityParameters) { Mono>> mono = @@ -539,7 +533,7 @@ private PollerFlux, DedicatedCapacityInner> b this.client.getHttpPipeline(), DedicatedCapacityInner.class, DedicatedCapacityInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -554,9 +548,9 @@ private PollerFlux, DedicatedCapacityInner> b * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a Dedicated Capacity resource. + * @return the {@link PollerFlux} for polling of represents an instance of a Dedicated Capacity resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DedicatedCapacityInner> beginCreateAsync( String resourceGroupName, String dedicatedCapacityName, @@ -586,12 +580,12 @@ private PollerFlux, DedicatedCapacityInner> b * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a Dedicated Capacity resource. + * @return the {@link SyncPoller} for polling of represents an instance of a Dedicated Capacity resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DedicatedCapacityInner> beginCreate( String resourceGroupName, String dedicatedCapacityName, DedicatedCapacityInner capacityParameters) { - return beginCreateAsync(resourceGroupName, dedicatedCapacityName, capacityParameters).getSyncPoller(); + return this.beginCreateAsync(resourceGroupName, dedicatedCapacityName, capacityParameters).getSyncPoller(); } /** @@ -606,15 +600,17 @@ public SyncPoller, DedicatedCapacityInner> be * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a Dedicated Capacity resource. + * @return the {@link SyncPoller} for polling of represents an instance of a Dedicated Capacity resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DedicatedCapacityInner> beginCreate( String resourceGroupName, String dedicatedCapacityName, DedicatedCapacityInner capacityParameters, Context context) { - return beginCreateAsync(resourceGroupName, dedicatedCapacityName, capacityParameters, context).getSyncPoller(); + return this + .beginCreateAsync(resourceGroupName, dedicatedCapacityName, capacityParameters, context) + .getSyncPoller(); } /** @@ -628,7 +624,7 @@ public SyncPoller, DedicatedCapacityInner> be * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a Dedicated Capacity resource. + * @return represents an instance of a Dedicated Capacity resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync( @@ -650,7 +646,7 @@ private Mono createAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a Dedicated Capacity resource. + * @return represents an instance of a Dedicated Capacity resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync( @@ -715,7 +711,7 @@ public DedicatedCapacityInner create( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -767,7 +763,7 @@ private Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -815,15 +811,16 @@ private Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String dedicatedCapacityName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, dedicatedCapacityName); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -837,9 +834,9 @@ private PollerFlux, Void> beginDeleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String dedicatedCapacityName, Context context) { context = this.client.mergeContext(context); @@ -860,11 +857,11 @@ private PollerFlux, Void> beginDeleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String dedicatedCapacityName) { - return beginDeleteAsync(resourceGroupName, dedicatedCapacityName).getSyncPoller(); + return this.beginDeleteAsync(resourceGroupName, dedicatedCapacityName).getSyncPoller(); } /** @@ -878,12 +875,12 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String dedicatedCapacityName, Context context) { - return beginDeleteAsync(resourceGroupName, dedicatedCapacityName, context).getSyncPoller(); + return this.beginDeleteAsync(resourceGroupName, dedicatedCapacityName, context).getSyncPoller(); } /** @@ -896,7 +893,7 @@ public SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String dedicatedCapacityName) { @@ -916,7 +913,7 @@ private Mono deleteAsync(String resourceGroupName, String dedicatedCapacit * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String dedicatedCapacityName, Context context) { @@ -969,7 +966,8 @@ public void delete(String resourceGroupName, String dedicatedCapacityName, Conte * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a Dedicated Capacity resource. + * @return represents an instance of a Dedicated Capacity resource along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync( @@ -1032,7 +1030,8 @@ private Mono>> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a Dedicated Capacity resource. + * @return represents an instance of a Dedicated Capacity resource along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync( @@ -1092,9 +1091,9 @@ private Mono>> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a Dedicated Capacity resource. + * @return the {@link PollerFlux} for polling of represents an instance of a Dedicated Capacity resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DedicatedCapacityInner> beginUpdateAsync( String resourceGroupName, String dedicatedCapacityName, @@ -1108,7 +1107,7 @@ private PollerFlux, DedicatedCapacityInner> b this.client.getHttpPipeline(), DedicatedCapacityInner.class, DedicatedCapacityInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -1123,9 +1122,9 @@ private PollerFlux, DedicatedCapacityInner> b * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a Dedicated Capacity resource. + * @return the {@link PollerFlux} for polling of represents an instance of a Dedicated Capacity resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DedicatedCapacityInner> beginUpdateAsync( String resourceGroupName, String dedicatedCapacityName, @@ -1155,14 +1154,16 @@ private PollerFlux, DedicatedCapacityInner> b * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a Dedicated Capacity resource. + * @return the {@link SyncPoller} for polling of represents an instance of a Dedicated Capacity resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DedicatedCapacityInner> beginUpdate( String resourceGroupName, String dedicatedCapacityName, DedicatedCapacityUpdateParameters capacityUpdateParameters) { - return beginUpdateAsync(resourceGroupName, dedicatedCapacityName, capacityUpdateParameters).getSyncPoller(); + return this + .beginUpdateAsync(resourceGroupName, dedicatedCapacityName, capacityUpdateParameters) + .getSyncPoller(); } /** @@ -1177,15 +1178,16 @@ public SyncPoller, DedicatedCapacityInner> be * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a Dedicated Capacity resource. + * @return the {@link SyncPoller} for polling of represents an instance of a Dedicated Capacity resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DedicatedCapacityInner> beginUpdate( String resourceGroupName, String dedicatedCapacityName, DedicatedCapacityUpdateParameters capacityUpdateParameters, Context context) { - return beginUpdateAsync(resourceGroupName, dedicatedCapacityName, capacityUpdateParameters, context) + return this + .beginUpdateAsync(resourceGroupName, dedicatedCapacityName, capacityUpdateParameters, context) .getSyncPoller(); } @@ -1200,7 +1202,7 @@ public SyncPoller, DedicatedCapacityInner> be * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a Dedicated Capacity resource. + * @return represents an instance of a Dedicated Capacity resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -1224,7 +1226,7 @@ private Mono updateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a Dedicated Capacity resource. + * @return represents an instance of a Dedicated Capacity resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -1291,7 +1293,7 @@ public DedicatedCapacityInner update( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> suspendWithResponseAsync( @@ -1343,7 +1345,7 @@ private Mono>> suspendWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> suspendWithResponseAsync( @@ -1391,15 +1393,16 @@ private Mono>> suspendWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginSuspendAsync( String resourceGroupName, String dedicatedCapacityName) { Mono>> mono = suspendWithResponseAsync(resourceGroupName, dedicatedCapacityName); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -1413,9 +1416,9 @@ private PollerFlux, Void> beginSuspendAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginSuspendAsync( String resourceGroupName, String dedicatedCapacityName, Context context) { context = this.client.mergeContext(context); @@ -1436,11 +1439,11 @@ private PollerFlux, Void> beginSuspendAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginSuspend(String resourceGroupName, String dedicatedCapacityName) { - return beginSuspendAsync(resourceGroupName, dedicatedCapacityName).getSyncPoller(); + return this.beginSuspendAsync(resourceGroupName, dedicatedCapacityName).getSyncPoller(); } /** @@ -1454,12 +1457,12 @@ public SyncPoller, Void> beginSuspend(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginSuspend( String resourceGroupName, String dedicatedCapacityName, Context context) { - return beginSuspendAsync(resourceGroupName, dedicatedCapacityName, context).getSyncPoller(); + return this.beginSuspendAsync(resourceGroupName, dedicatedCapacityName, context).getSyncPoller(); } /** @@ -1472,7 +1475,7 @@ public SyncPoller, Void> beginSuspend( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono suspendAsync(String resourceGroupName, String dedicatedCapacityName) { @@ -1492,7 +1495,7 @@ private Mono suspendAsync(String resourceGroupName, String dedicatedCapaci * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono suspendAsync(String resourceGroupName, String dedicatedCapacityName, Context context) { @@ -1544,7 +1547,7 @@ public void suspend(String resourceGroupName, String dedicatedCapacityName, Cont * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> resumeWithResponseAsync( @@ -1596,7 +1599,7 @@ private Mono>> resumeWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> resumeWithResponseAsync( @@ -1644,15 +1647,16 @@ private Mono>> resumeWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginResumeAsync( String resourceGroupName, String dedicatedCapacityName) { Mono>> mono = resumeWithResponseAsync(resourceGroupName, dedicatedCapacityName); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -1666,9 +1670,9 @@ private PollerFlux, Void> beginResumeAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginResumeAsync( String resourceGroupName, String dedicatedCapacityName, Context context) { context = this.client.mergeContext(context); @@ -1689,11 +1693,11 @@ private PollerFlux, Void> beginResumeAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginResume(String resourceGroupName, String dedicatedCapacityName) { - return beginResumeAsync(resourceGroupName, dedicatedCapacityName).getSyncPoller(); + return this.beginResumeAsync(resourceGroupName, dedicatedCapacityName).getSyncPoller(); } /** @@ -1707,12 +1711,12 @@ public SyncPoller, Void> beginResume(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginResume( String resourceGroupName, String dedicatedCapacityName, Context context) { - return beginResumeAsync(resourceGroupName, dedicatedCapacityName, context).getSyncPoller(); + return this.beginResumeAsync(resourceGroupName, dedicatedCapacityName, context).getSyncPoller(); } /** @@ -1725,7 +1729,7 @@ public SyncPoller, Void> beginResume( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono resumeAsync(String resourceGroupName, String dedicatedCapacityName) { @@ -1745,7 +1749,7 @@ private Mono resumeAsync(String resourceGroupName, String dedicatedCapacit * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono resumeAsync(String resourceGroupName, String dedicatedCapacityName, Context context) { @@ -1795,7 +1799,8 @@ public void resume(String resourceGroupName, String dedicatedCapacityName, Conte * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Dedicated capacities for the given resource group. + * @return all the Dedicated capacities for the given resource group along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { @@ -1843,7 +1848,8 @@ private Mono> listByResourceGroupSinglePag * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Dedicated capacities for the given resource group. + * @return all the Dedicated capacities for the given resource group along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( @@ -1888,7 +1894,7 @@ private Mono> listByResourceGroupSinglePag * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Dedicated capacities for the given resource group. + * @return all the Dedicated capacities for the given resource group as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { @@ -1904,7 +1910,7 @@ private PagedFlux listByResourceGroupAsync(String resour * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Dedicated capacities for the given resource group. + * @return all the Dedicated capacities for the given resource group as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { @@ -1919,7 +1925,8 @@ private PagedFlux listByResourceGroupAsync(String resour * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Dedicated capacities for the given resource group. + * @return all the Dedicated capacities for the given resource group as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -1935,7 +1942,8 @@ public PagedIterable listByResourceGroup(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Dedicated capacities for the given resource group. + * @return all the Dedicated capacities for the given resource group as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { @@ -1947,7 +1955,8 @@ public PagedIterable listByResourceGroup(String resource * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an array of Dedicated capacities resources. + * @return an array of Dedicated capacities resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -1988,7 +1997,8 @@ private Mono> listSinglePageAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an array of Dedicated capacities resources. + * @return an array of Dedicated capacities resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -2024,7 +2034,7 @@ private Mono> listSinglePageAsync(Context * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an array of Dedicated capacities resources. + * @return an array of Dedicated capacities resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -2038,7 +2048,7 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an array of Dedicated capacities resources. + * @return an array of Dedicated capacities resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -2050,7 +2060,7 @@ private PagedFlux listAsync(Context context) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an array of Dedicated capacities resources. + * @return an array of Dedicated capacities resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -2064,7 +2074,7 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an array of Dedicated capacities resources. + * @return an array of Dedicated capacities resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -2076,7 +2086,8 @@ public PagedIterable list(Context context) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents enumerating SKUs for new resources. + * @return an object that represents enumerating SKUs for new resources along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSkusWithResponseAsync() { @@ -2113,7 +2124,8 @@ private Mono> listSkusWithResp * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents enumerating SKUs for new resources. + * @return an object that represents enumerating SKUs for new resources along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSkusWithResponseAsync(Context context) { @@ -2145,45 +2157,37 @@ private Mono> listSkusWithResp * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents enumerating SKUs for new resources. + * @return an object that represents enumerating SKUs for new resources on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono listSkusAsync() { - return listSkusWithResponseAsync() - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return listSkusWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Lists eligible SKUs for PowerBI Dedicated resource 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 an object that represents enumerating SKUs for new resources. + * @return an object that represents enumerating SKUs for new resources along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SkuEnumerationForNewResourceResultInner listSkus() { - return listSkusAsync().block(); + public Response listSkusWithResponse(Context context) { + return listSkusWithResponseAsync(context).block(); } /** * Lists eligible SKUs for PowerBI Dedicated resource 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 an object that represents enumerating SKUs for new resources. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listSkusWithResponse(Context context) { - return listSkusWithResponseAsync(context).block(); + public SkuEnumerationForNewResourceResultInner listSkus() { + return listSkusWithResponse(Context.NONE).getValue(); } /** @@ -2196,7 +2200,8 @@ public Response listSkusWithResponse(Co * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents enumerating SKUs for existing resources. + * @return an object that represents enumerating SKUs for existing resources along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSkusForCapacityWithResponseAsync( @@ -2248,7 +2253,8 @@ private Mono> listSkusFor * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents enumerating SKUs for existing resources. + * @return an object that represents enumerating SKUs for existing resources along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSkusForCapacityWithResponseAsync( @@ -2296,20 +2302,14 @@ private Mono> listSkusFor * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an object that represents enumerating SKUs for existing resources. + * @return an object that represents enumerating SKUs for existing resources on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono listSkusForCapacityAsync( String resourceGroupName, String dedicatedCapacityName) { return listSkusForCapacityWithResponseAsync(resourceGroupName, dedicatedCapacityName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -2319,15 +2319,16 @@ private Mono listSkusForCapacityAs * This name must be at least 1 character in length, and no more than 90. * @param dedicatedCapacityName The name of the Dedicated capacity. It must be at least 3 characters in length, and * no more than 63. + * @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 an object that represents enumerating SKUs for existing resources. + * @return an object that represents enumerating SKUs for existing resources along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SkuEnumerationForExistingResourceResultInner listSkusForCapacity( - String resourceGroupName, String dedicatedCapacityName) { - return listSkusForCapacityAsync(resourceGroupName, dedicatedCapacityName).block(); + public Response listSkusForCapacityWithResponse( + String resourceGroupName, String dedicatedCapacityName, Context context) { + return listSkusForCapacityWithResponseAsync(resourceGroupName, dedicatedCapacityName, context).block(); } /** @@ -2337,16 +2338,15 @@ public SkuEnumerationForExistingResourceResultInner listSkusForCapacity( * This name must be at least 1 character in length, and no more than 90. * @param dedicatedCapacityName The name of the Dedicated capacity. It must be at least 3 characters in length, and * no more than 63. - * @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 an object that represents enumerating SKUs for existing resources. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listSkusForCapacityWithResponse( - String resourceGroupName, String dedicatedCapacityName, Context context) { - return listSkusForCapacityWithResponseAsync(resourceGroupName, dedicatedCapacityName, context).block(); + public SkuEnumerationForExistingResourceResultInner listSkusForCapacity( + String resourceGroupName, String dedicatedCapacityName) { + return listSkusForCapacityWithResponse(resourceGroupName, dedicatedCapacityName, Context.NONE).getValue(); } /** @@ -2357,7 +2357,8 @@ public Response listSkusForCapacit * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 checking result of capacity name availability. + * @return the checking result of capacity name availability along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkNameAvailabilityWithResponseAsync( @@ -2408,7 +2409,8 @@ private Mono> checkNameAvaila * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 checking result of capacity name availability. + * @return the checking result of capacity name availability along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkNameAvailabilityWithResponseAsync( @@ -2455,20 +2457,13 @@ private Mono> checkNameAvaila * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 checking result of capacity name availability. + * @return the checking result of capacity name availability on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono checkNameAvailabilityAsync( String location, CheckCapacityNameAvailabilityParameters capacityParameters) { return checkNameAvailabilityWithResponseAsync(location, capacityParameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -2476,15 +2471,16 @@ private Mono checkNameAvailabilityAsyn * * @param location The region name which the operation will lookup into. * @param capacityParameters The name of the capacity. + * @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 checking result of capacity name availability. + * @return the checking result of capacity name availability along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CheckCapacityNameAvailabilityResultInner checkNameAvailability( - String location, CheckCapacityNameAvailabilityParameters capacityParameters) { - return checkNameAvailabilityAsync(location, capacityParameters).block(); + public Response checkNameAvailabilityWithResponse( + String location, CheckCapacityNameAvailabilityParameters capacityParameters, Context context) { + return checkNameAvailabilityWithResponseAsync(location, capacityParameters, context).block(); } /** @@ -2492,15 +2488,14 @@ public CheckCapacityNameAvailabilityResultInner checkNameAvailability( * * @param location The region name which the operation will lookup into. * @param capacityParameters The name of the capacity. - * @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 checking result of capacity name availability. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkNameAvailabilityWithResponse( - String location, CheckCapacityNameAvailabilityParameters capacityParameters, Context context) { - return checkNameAvailabilityWithResponseAsync(location, capacityParameters, context).block(); + public CheckCapacityNameAvailabilityResultInner checkNameAvailability( + String location, CheckCapacityNameAvailabilityParameters capacityParameters) { + return checkNameAvailabilityWithResponse(location, capacityParameters, Context.NONE).getValue(); } } diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/CapacitiesImpl.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/CapacitiesImpl.java index c22c74e800b7..c84e09f2da13 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/CapacitiesImpl.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/CapacitiesImpl.java @@ -20,10 +20,9 @@ import com.azure.resourcemanager.powerbidedicated.models.DedicatedCapacity; import com.azure.resourcemanager.powerbidedicated.models.SkuEnumerationForExistingResourceResult; import com.azure.resourcemanager.powerbidedicated.models.SkuEnumerationForNewResourceResult; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class CapacitiesImpl implements Capacities { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CapacitiesImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(CapacitiesImpl.class); private final CapacitiesClient innerClient; @@ -36,16 +35,6 @@ public CapacitiesImpl( this.serviceManager = serviceManager; } - public DedicatedCapacity getByResourceGroup(String resourceGroupName, String dedicatedCapacityName) { - DedicatedCapacityInner inner = - this.serviceClient().getByResourceGroup(resourceGroupName, dedicatedCapacityName); - if (inner != null) { - return new DedicatedCapacityImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getByResourceGroupWithResponse( String resourceGroupName, String dedicatedCapacityName, Context context) { Response inner = @@ -61,6 +50,16 @@ public Response getByResourceGroupWithResponse( } } + public DedicatedCapacity getByResourceGroup(String resourceGroupName, String dedicatedCapacityName) { + DedicatedCapacityInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, dedicatedCapacityName); + if (inner != null) { + return new DedicatedCapacityImpl(inner, this.manager()); + } else { + return null; + } + } + public void deleteByResourceGroup(String resourceGroupName, String dedicatedCapacityName) { this.serviceClient().delete(resourceGroupName, dedicatedCapacityName); } @@ -106,15 +105,6 @@ public PagedIterable list(Context context) { return Utils.mapPage(inner, inner1 -> new DedicatedCapacityImpl(inner1, this.manager())); } - public SkuEnumerationForNewResourceResult listSkus() { - SkuEnumerationForNewResourceResultInner inner = this.serviceClient().listSkus(); - if (inner != null) { - return new SkuEnumerationForNewResourceResultImpl(inner, this.manager()); - } else { - return null; - } - } - public Response listSkusWithResponse(Context context) { Response inner = this.serviceClient().listSkusWithResponse(context); if (inner != null) { @@ -128,12 +118,10 @@ public Response listSkusWithResponse(Context } } - public SkuEnumerationForExistingResourceResult listSkusForCapacity( - String resourceGroupName, String dedicatedCapacityName) { - SkuEnumerationForExistingResourceResultInner inner = - this.serviceClient().listSkusForCapacity(resourceGroupName, dedicatedCapacityName); + public SkuEnumerationForNewResourceResult listSkus() { + SkuEnumerationForNewResourceResultInner inner = this.serviceClient().listSkus(); if (inner != null) { - return new SkuEnumerationForExistingResourceResultImpl(inner, this.manager()); + return new SkuEnumerationForNewResourceResultImpl(inner, this.manager()); } else { return null; } @@ -154,12 +142,12 @@ public Response listSkusForCapacityWith } } - public CheckCapacityNameAvailabilityResult checkNameAvailability( - String location, CheckCapacityNameAvailabilityParameters capacityParameters) { - CheckCapacityNameAvailabilityResultInner inner = - this.serviceClient().checkNameAvailability(location, capacityParameters); + public SkuEnumerationForExistingResourceResult listSkusForCapacity( + String resourceGroupName, String dedicatedCapacityName) { + SkuEnumerationForExistingResourceResultInner inner = + this.serviceClient().listSkusForCapacity(resourceGroupName, dedicatedCapacityName); if (inner != null) { - return new CheckCapacityNameAvailabilityResultImpl(inner, this.manager()); + return new SkuEnumerationForExistingResourceResultImpl(inner, this.manager()); } else { return null; } @@ -180,10 +168,21 @@ public Response checkNameAvailabilityWithRe } } + public CheckCapacityNameAvailabilityResult checkNameAvailability( + String location, CheckCapacityNameAvailabilityParameters capacityParameters) { + CheckCapacityNameAvailabilityResultInner inner = + this.serviceClient().checkNameAvailability(location, capacityParameters); + if (inner != null) { + return new CheckCapacityNameAvailabilityResultImpl(inner, this.manager()); + } else { + return null; + } + } + public DedicatedCapacity getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -191,7 +190,7 @@ public DedicatedCapacity getById(String id) { } String dedicatedCapacityName = Utils.getValueFromIdByName(id, "capacities"); if (dedicatedCapacityName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'capacities'.", id))); @@ -202,7 +201,7 @@ public DedicatedCapacity getById(String id) { public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -210,7 +209,7 @@ public Response getByIdWithResponse(String id, Context contex } String dedicatedCapacityName = Utils.getValueFromIdByName(id, "capacities"); if (dedicatedCapacityName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'capacities'.", id))); @@ -221,7 +220,7 @@ public Response getByIdWithResponse(String id, Context contex public void deleteById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -229,7 +228,7 @@ public void deleteById(String id) { } String dedicatedCapacityName = Utils.getValueFromIdByName(id, "capacities"); if (dedicatedCapacityName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'capacities'.", id))); @@ -240,7 +239,7 @@ public void deleteById(String id) { public void deleteByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -248,7 +247,7 @@ public void deleteByIdWithResponse(String id, Context context) { } String dedicatedCapacityName = Utils.getValueFromIdByName(id, "capacities"); if (dedicatedCapacityName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'capacities'.", id))); diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/DedicatedCapacityImpl.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/DedicatedCapacityImpl.java index 8667b152ee47..79398f89dfc2 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/DedicatedCapacityImpl.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/DedicatedCapacityImpl.java @@ -53,12 +53,8 @@ public CapacitySku sku() { return this.innerModel().sku(); } - public DedicatedCapacityAdministrators administration() { - return this.innerModel().administration(); - } - - public Mode mode() { - return this.innerModel().mode(); + public SystemData systemData() { + return this.innerModel().systemData(); } public State state() { @@ -69,8 +65,20 @@ public CapacityProvisioningState provisioningState() { return this.innerModel().provisioningState(); } - public SystemData systemData() { - return this.innerModel().systemData(); + public DedicatedCapacityAdministrators administration() { + return this.innerModel().administration(); + } + + public Mode mode() { + return this.innerModel().mode(); + } + + public String tenantId() { + return this.innerModel().tenantId(); + } + + public String friendlyName() { + return this.innerModel().friendlyName(); } public Region region() { @@ -81,6 +89,10 @@ public String regionName() { return this.location(); } + public String resourceGroupName() { + return resourceGroupName; + } + public DedicatedCapacityInner innerModel() { return this.innerObject; } @@ -223,6 +235,11 @@ public DedicatedCapacityImpl withTags(Map tags) { } } + public DedicatedCapacityImpl withSystemData(SystemData systemData) { + this.innerModel().withSystemData(systemData); + return this; + } + public DedicatedCapacityImpl withAdministration(DedicatedCapacityAdministrators administration) { if (isInCreateMode()) { this.innerModel().withAdministration(administration); @@ -243,11 +260,6 @@ public DedicatedCapacityImpl withMode(Mode mode) { } } - public DedicatedCapacityImpl withSystemData(SystemData systemData) { - this.innerModel().withSystemData(systemData); - return this; - } - private boolean isInCreateMode() { return this.innerModel().id() == null; } diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/OperationImpl.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/OperationImpl.java index e95eb7768f72..9e97a533b868 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/OperationImpl.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/OperationImpl.java @@ -7,6 +7,7 @@ import com.azure.resourcemanager.powerbidedicated.fluent.models.OperationInner; import com.azure.resourcemanager.powerbidedicated.models.Operation; import com.azure.resourcemanager.powerbidedicated.models.OperationDisplay; +import com.azure.resourcemanager.powerbidedicated.models.OperationProperties; public final class OperationImpl implements Operation { private OperationInner innerObject; @@ -27,6 +28,14 @@ public OperationDisplay display() { return this.innerModel().display(); } + public String origin() { + return this.innerModel().origin(); + } + + public OperationProperties properties() { + return this.innerModel().properties(); + } + public OperationInner innerModel() { return this.innerObject; } diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/OperationsClientImpl.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/OperationsClientImpl.java index 680968f42321..7699cb4a1170 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/OperationsClientImpl.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/OperationsClientImpl.java @@ -25,7 +25,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.powerbidedicated.fluent.OperationsClient; import com.azure.resourcemanager.powerbidedicated.fluent.models.OperationInner; import com.azure.resourcemanager.powerbidedicated.models.OperationListResult; @@ -33,8 +32,6 @@ /** An instance of this class provides access to all the operations defined in OperationsClient. */ public final class OperationsClientImpl implements OperationsClient { - private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final OperationsService service; @@ -58,7 +55,7 @@ public final class OperationsClientImpl implements OperationsClient { */ @Host("{$host}") @ServiceInterface(name = "PowerBIDedicatedOper") - private interface OperationsService { + public interface OperationsService { @Headers({"Content-Type: application/json"}) @Get("/providers/Microsoft.PowerBIDedicated/operations") @ExpectedResponses({200}) @@ -85,7 +82,7 @@ Mono> listNext( * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result listing capacities. + * @return result listing capacities along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -118,7 +115,7 @@ private Mono> listSinglePageAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result listing capacities. + * @return result listing capacities along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -148,7 +145,7 @@ private Mono> listSinglePageAsync(Context context) * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result listing capacities. + * @return result listing capacities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -162,7 +159,7 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result listing capacities. + * @return result listing capacities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -175,7 +172,7 @@ private PagedFlux listAsync(Context context) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result listing capacities. + * @return result listing capacities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -189,7 +186,7 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result listing capacities. + * @return result listing capacities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -199,11 +196,12 @@ public PagedIterable list(Context context) { /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result listing capacities. + * @return result listing capacities along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -234,12 +232,13 @@ private Mono> listNextSinglePageAsync(String nextL /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result listing capacities. + * @return result listing capacities along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/OperationsImpl.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/OperationsImpl.java index b08e84ef19d3..3216d46b4f3c 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/OperationsImpl.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/OperationsImpl.java @@ -11,10 +11,9 @@ import com.azure.resourcemanager.powerbidedicated.fluent.models.OperationInner; import com.azure.resourcemanager.powerbidedicated.models.Operation; import com.azure.resourcemanager.powerbidedicated.models.Operations; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class OperationsImpl implements Operations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); private final OperationsClient innerClient; diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/PowerBIDedicatedBuilder.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/PowerBIDedicatedBuilder.java index 33b3f9ee3092..ecda850ea5d6 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/PowerBIDedicatedBuilder.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/PowerBIDedicatedBuilder.java @@ -7,7 +7,6 @@ import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.CookiePolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.AzureEnvironment; @@ -19,8 +18,8 @@ @ServiceClientBuilder(serviceClients = {PowerBIDedicatedImpl.class}) public final class PowerBIDedicatedBuilder { /* - * A unique identifier for a Microsoft Azure subscription. The subscription - * ID forms part of the URI for every service call. + * A unique identifier for a Microsoft Azure subscription. The subscription ID forms part of the URI for every + * service call. */ private String subscriptionId; @@ -69,34 +68,34 @@ public PowerBIDedicatedBuilder environment(AzureEnvironment environment) { } /* - * The default poll interval for long-running operation + * The HTTP pipeline to send requests through */ - private Duration defaultPollInterval; + private HttpPipeline pipeline; /** - * Sets The default poll interval for long-running operation. + * Sets The HTTP pipeline to send requests through. * - * @param defaultPollInterval the defaultPollInterval value. + * @param pipeline the pipeline value. * @return the PowerBIDedicatedBuilder. */ - public PowerBIDedicatedBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; + public PowerBIDedicatedBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; return this; } /* - * The HTTP pipeline to send requests through + * The default poll interval for long-running operation */ - private HttpPipeline pipeline; + private Duration defaultPollInterval; /** - * Sets The HTTP pipeline to send requests through. + * Sets The default poll interval for long-running operation. * - * @param pipeline the pipeline value. + * @param defaultPollInterval the defaultPollInterval value. * @return the PowerBIDedicatedBuilder. */ - public PowerBIDedicatedBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; + public PowerBIDedicatedBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; return this; } @@ -122,27 +121,26 @@ public PowerBIDedicatedBuilder serializerAdapter(SerializerAdapter serializerAda * @return an instance of PowerBIDedicatedImpl. */ public PowerBIDedicatedImpl buildClient() { - if (endpoint == null) { - this.endpoint = "https://management.azure.com"; - } - if (environment == null) { - this.environment = AzureEnvironment.AZURE; - } - if (defaultPollInterval == null) { - this.defaultPollInterval = Duration.ofSeconds(30); - } - if (pipeline == null) { - this.pipeline = - new HttpPipelineBuilder() - .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) - .build(); - } - if (serializerAdapter == null) { - this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); - } + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = + (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval = + (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = + (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); PowerBIDedicatedImpl client = new PowerBIDedicatedImpl( - pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + localPipeline, + localSerializerAdapter, + localDefaultPollInterval, + localEnvironment, + subscriptionId, + localEndpoint); return client; } } diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/PowerBIDedicatedImpl.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/PowerBIDedicatedImpl.java index 79b5af1be050..bf62467db5b3 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/PowerBIDedicatedImpl.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/implementation/PowerBIDedicatedImpl.java @@ -15,6 +15,7 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.management.polling.PollerFactory; import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; import com.azure.core.util.polling.LongRunningOperationStatus; @@ -31,15 +32,12 @@ import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.time.Duration; -import java.util.Map; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; /** Initializes a new instance of the PowerBIDedicatedImpl type. */ @ServiceClient(builder = PowerBIDedicatedBuilder.class) public final class PowerBIDedicatedImpl implements PowerBIDedicated { - private final ClientLogger logger = new ClientLogger(PowerBIDedicatedImpl.class); - /** * A unique identifier for a Microsoft Azure subscription. The subscription ID forms part of the URI for every * service call. @@ -197,10 +195,7 @@ public Context getContext() { * @return the merged context. */ public Context mergeContext(Context context) { - for (Map.Entry entry : this.getContext().getValues().entrySet()) { - context = context.addData(entry.getKey(), entry.getValue()); - } - return context; + return CoreUtils.mergeContexts(this.getContext(), context); } /** @@ -264,7 +259,7 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, managementError = null; } } catch (IOException | RuntimeException ioe) { - logger.logThrowableAsWarning(ioe); + LOGGER.logThrowableAsWarning(ioe); } } } else { @@ -323,4 +318,6 @@ public Mono getBodyAsString(Charset charset) { return Mono.just(new String(responseBody, charset)); } } + + private static final ClientLogger LOGGER = new ClientLogger(PowerBIDedicatedImpl.class); } diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/AutoScaleVCore.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/AutoScaleVCore.java index 098878e83502..bff4e0929669 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/AutoScaleVCore.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/AutoScaleVCore.java @@ -55,11 +55,11 @@ public interface AutoScaleVCore { AutoScaleVCoreSku sku(); /** - * Gets the capacityLimit property: The maximum capacity of an auto scale v-core resource. + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. * - * @return the capacityLimit value. + * @return the systemData value. */ - Integer capacityLimit(); + SystemData systemData(); /** * Gets the capacityObjectId property: The object ID of the capacity resource associated with the auto scale v-core @@ -78,11 +78,11 @@ public interface AutoScaleVCore { VCoreProvisioningState provisioningState(); /** - * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * Gets the capacityLimit property: The maximum capacity of an auto scale v-core resource. * - * @return the systemData value. + * @return the capacityLimit value. */ - SystemData systemData(); + Integer capacityLimit(); /** * Gets the region of the resource. @@ -98,6 +98,13 @@ public interface AutoScaleVCore { */ String regionName(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.powerbidedicated.fluent.models.AutoScaleVCoreInner object. * @@ -163,9 +170,9 @@ interface WithSku { */ interface WithCreate extends DefinitionStages.WithTags, - DefinitionStages.WithCapacityLimit, + DefinitionStages.WithSystemData, DefinitionStages.WithCapacityObjectId, - DefinitionStages.WithSystemData { + DefinitionStages.WithCapacityLimit { /** * Executes the create request. * @@ -191,15 +198,16 @@ interface WithTags { */ WithCreate withTags(Map tags); } - /** The stage of the AutoScaleVCore definition allowing to specify capacityLimit. */ - interface WithCapacityLimit { + /** The stage of the AutoScaleVCore definition allowing to specify systemData. */ + interface WithSystemData { /** - * Specifies the capacityLimit property: The maximum capacity of an auto scale v-core resource.. + * Specifies the systemData property: Metadata pertaining to creation and last modification of the + * resource.. * - * @param capacityLimit The maximum capacity of an auto scale v-core resource. + * @param systemData Metadata pertaining to creation and last modification of the resource. * @return the next definition stage. */ - WithCreate withCapacityLimit(Integer capacityLimit); + WithCreate withSystemData(SystemData systemData); } /** The stage of the AutoScaleVCore definition allowing to specify capacityObjectId. */ interface WithCapacityObjectId { @@ -213,16 +221,15 @@ interface WithCapacityObjectId { */ WithCreate withCapacityObjectId(String capacityObjectId); } - /** The stage of the AutoScaleVCore definition allowing to specify systemData. */ - interface WithSystemData { + /** The stage of the AutoScaleVCore definition allowing to specify capacityLimit. */ + interface WithCapacityLimit { /** - * Specifies the systemData property: Metadata pertaining to creation and last modification of the - * resource.. + * Specifies the capacityLimit property: The maximum capacity of an auto scale v-core resource.. * - * @param systemData Metadata pertaining to creation and last modification of the resource. + * @param capacityLimit The maximum capacity of an auto scale v-core resource. * @return the next definition stage. */ - WithCreate withSystemData(SystemData systemData); + WithCreate withCapacityLimit(Integer capacityLimit); } } /** diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/AutoScaleVCoreListResult.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/AutoScaleVCoreListResult.java index 20d4b2a8db38..60430cc9801c 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/AutoScaleVCoreListResult.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/AutoScaleVCoreListResult.java @@ -7,21 +7,22 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.powerbidedicated.fluent.models.AutoScaleVCoreInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** An array of auto scale v-core resources. */ @Fluent public final class AutoScaleVCoreListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AutoScaleVCoreListResult.class); - /* * An array of auto scale v-core resources. */ @JsonProperty(value = "value", required = true) private List value; + /** Creates an instance of AutoScaleVCoreListResult class. */ + public AutoScaleVCoreListResult() { + } + /** * Get the value property: An array of auto scale v-core resources. * @@ -49,11 +50,13 @@ public AutoScaleVCoreListResult withValue(List value) { */ public void validate() { if (value() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property value in model AutoScaleVCoreListResult")); } else { value().forEach(e -> e.validate()); } } + + private static final ClientLogger LOGGER = new ClientLogger(AutoScaleVCoreListResult.class); } diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/AutoScaleVCoreSku.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/AutoScaleVCoreSku.java index c96ace43a40d..c277e464b433 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/AutoScaleVCoreSku.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/AutoScaleVCoreSku.java @@ -6,14 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Represents the SKU name and Azure pricing tier for auto scale v-core resource. */ @Fluent public final class AutoScaleVCoreSku { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AutoScaleVCoreSku.class); - /* * Name of the SKU level. */ @@ -32,6 +29,10 @@ public final class AutoScaleVCoreSku { @JsonProperty(value = "capacity") private Integer capacity; + /** Creates an instance of AutoScaleVCoreSku class. */ + public AutoScaleVCoreSku() { + } + /** * Get the name property: Name of the SKU level. * @@ -99,9 +100,11 @@ public AutoScaleVCoreSku withCapacity(Integer capacity) { */ public void validate() { if (name() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property name in model AutoScaleVCoreSku")); } } + + private static final ClientLogger LOGGER = new ClientLogger(AutoScaleVCoreSku.class); } diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/AutoScaleVCoreUpdateParameters.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/AutoScaleVCoreUpdateParameters.java index 7c4f6b634641..eea5a7986870 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/AutoScaleVCoreUpdateParameters.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/AutoScaleVCoreUpdateParameters.java @@ -5,18 +5,14 @@ package com.azure.resourcemanager.powerbidedicated.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.powerbidedicated.fluent.models.AutoScaleVCoreMutableProperties; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** Update request specification. */ -@JsonFlatten @Fluent -public class AutoScaleVCoreUpdateParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AutoScaleVCoreUpdateParameters.class); - +public final class AutoScaleVCoreUpdateParameters { /* * The SKU of the auto scale v-core resource. */ @@ -27,13 +23,18 @@ public class AutoScaleVCoreUpdateParameters { * Key-value pairs of additional provisioning properties. */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* - * The maximum capacity of an auto scale v-core resource. + * Properties of the update operation request. */ - @JsonProperty(value = "properties.capacityLimit") - private Integer capacityLimit; + @JsonProperty(value = "properties") + private AutoScaleVCoreMutableProperties innerProperties; + + /** Creates an instance of AutoScaleVCoreUpdateParameters class. */ + public AutoScaleVCoreUpdateParameters() { + } /** * Get the sku property: The SKU of the auto scale v-core resource. @@ -75,13 +76,22 @@ public AutoScaleVCoreUpdateParameters withTags(Map tags) { return this; } + /** + * Get the innerProperties property: Properties of the update operation request. + * + * @return the innerProperties value. + */ + private AutoScaleVCoreMutableProperties innerProperties() { + return this.innerProperties; + } + /** * Get the capacityLimit property: The maximum capacity of an auto scale v-core resource. * * @return the capacityLimit value. */ public Integer capacityLimit() { - return this.capacityLimit; + return this.innerProperties() == null ? null : this.innerProperties().capacityLimit(); } /** @@ -91,7 +101,10 @@ public Integer capacityLimit() { * @return the AutoScaleVCoreUpdateParameters object itself. */ public AutoScaleVCoreUpdateParameters withCapacityLimit(Integer capacityLimit) { - this.capacityLimit = capacityLimit; + if (this.innerProperties() == null) { + this.innerProperties = new AutoScaleVCoreMutableProperties(); + } + this.innerProperties().withCapacityLimit(capacityLimit); return this; } @@ -104,5 +117,8 @@ public void validate() { if (sku() != null) { sku().validate(); } + if (innerProperties() != null) { + innerProperties().validate(); + } } } diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/AutoScaleVCores.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/AutoScaleVCores.java index 7786de02051d..058567afc8f3 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/AutoScaleVCores.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/AutoScaleVCores.java @@ -16,12 +16,14 @@ public interface AutoScaleVCores { * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated capacity is part. * This name must be at least 1 character in length, and no more than 90. * @param vcoreName The name of the auto scale v-core. It must be a minimum of 3 characters, and a maximum of 63. + * @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 details about the specified auto scale v-core. + * @return details about the specified auto scale v-core along with {@link Response}. */ - AutoScaleVCore getByResourceGroup(String resourceGroupName, String vcoreName); + Response getByResourceGroupWithResponse( + String resourceGroupName, String vcoreName, Context context); /** * Gets details about the specified auto scale v-core. @@ -29,14 +31,12 @@ public interface AutoScaleVCores { * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated capacity is part. * This name must be at least 1 character in length, and no more than 90. * @param vcoreName The name of the auto scale v-core. It must be a minimum of 3 characters, and a maximum of 63. - * @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 details about the specified auto scale v-core. */ - Response getByResourceGroupWithResponse( - String resourceGroupName, String vcoreName, Context context); + AutoScaleVCore getByResourceGroup(String resourceGroupName, String vcoreName); /** * Deletes the specified auto scale v-core. @@ -44,11 +44,13 @@ Response getByResourceGroupWithResponse( * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated capacity is part. * This name must be at least 1 character in length, and no more than 90. * @param vcoreName The name of the auto scale v-core. It must be a minimum of 3 characters, and a maximum of 63. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ - void deleteByResourceGroup(String resourceGroupName, String vcoreName); + Response deleteByResourceGroupWithResponse(String resourceGroupName, String vcoreName, Context context); /** * Deletes the specified auto scale v-core. @@ -56,13 +58,11 @@ Response getByResourceGroupWithResponse( * @param resourceGroupName The name of the Azure Resource group of which a given PowerBIDedicated capacity is part. * This name must be at least 1 character in length, and no more than 90. * @param vcoreName The name of the auto scale v-core. It must be a minimum of 3 characters, and a maximum of 63. - * @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. */ - Response deleteWithResponse(String resourceGroupName, String vcoreName, Context context); + void deleteByResourceGroup(String resourceGroupName, String vcoreName); /** * Gets all the auto scale v-cores for the given resource group. @@ -72,7 +72,7 @@ Response getByResourceGroupWithResponse( * @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 all the auto scale v-cores for the given resource group. + * @return all the auto scale v-cores for the given resource group as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); @@ -85,7 +85,7 @@ Response getByResourceGroupWithResponse( * @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 all the auto scale v-cores for the given resource group. + * @return all the auto scale v-cores for the given resource group as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -94,7 +94,7 @@ Response getByResourceGroupWithResponse( * * @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 an array of auto scale v-core resources. + * @return an array of auto scale v-core resources as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -105,7 +105,7 @@ Response getByResourceGroupWithResponse( * @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 an array of auto scale v-core resources. + * @return an array of auto scale v-core resources as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); @@ -116,7 +116,7 @@ Response getByResourceGroupWithResponse( * @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 details about the specified auto scale v-core. + * @return details about the specified auto scale v-core along with {@link Response}. */ AutoScaleVCore getById(String id); @@ -128,7 +128,7 @@ Response getByResourceGroupWithResponse( * @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 details about the specified auto scale v-core. + * @return details about the specified auto scale v-core along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); @@ -150,7 +150,7 @@ Response getByResourceGroupWithResponse( * @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. + * @return the {@link Response}. */ Response deleteByIdWithResponse(String id, Context context); diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/Capacities.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/Capacities.java index 264e9cdd3531..e1ef0522b42e 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/Capacities.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/Capacities.java @@ -17,12 +17,14 @@ public interface Capacities { * This name must be at least 1 character in length, and no more than 90. * @param dedicatedCapacityName The name of the dedicated capacity. It must be a minimum of 3 characters, and a * maximum of 63. + * @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 details about the specified dedicated capacity. + * @return details about the specified dedicated capacity along with {@link Response}. */ - DedicatedCapacity getByResourceGroup(String resourceGroupName, String dedicatedCapacityName); + Response getByResourceGroupWithResponse( + String resourceGroupName, String dedicatedCapacityName, Context context); /** * Gets details about the specified dedicated capacity. @@ -31,14 +33,12 @@ public interface Capacities { * This name must be at least 1 character in length, and no more than 90. * @param dedicatedCapacityName The name of the dedicated capacity. It must be a minimum of 3 characters, and a * maximum of 63. - * @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 details about the specified dedicated capacity. */ - Response getByResourceGroupWithResponse( - String resourceGroupName, String dedicatedCapacityName, Context context); + DedicatedCapacity getByResourceGroup(String resourceGroupName, String dedicatedCapacityName); /** * Deletes the specified Dedicated capacity. @@ -129,7 +129,8 @@ Response getByResourceGroupWithResponse( * @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 all the Dedicated capacities for the given resource group. + * @return all the Dedicated capacities for the given resource group as paginated response with {@link + * PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); @@ -142,7 +143,8 @@ Response getByResourceGroupWithResponse( * @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 all the Dedicated capacities for the given resource group. + * @return all the Dedicated capacities for the given resource group as paginated response with {@link + * PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -151,7 +153,7 @@ Response getByResourceGroupWithResponse( * * @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 an array of Dedicated capacities resources. + * @return an array of Dedicated capacities resources as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -162,29 +164,29 @@ Response getByResourceGroupWithResponse( * @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 an array of Dedicated capacities resources. + * @return an array of Dedicated capacities resources as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); /** * Lists eligible SKUs for PowerBI Dedicated resource 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 an object that represents enumerating SKUs for new resources. + * @return an object that represents enumerating SKUs for new resources along with {@link Response}. */ - SkuEnumerationForNewResourceResult listSkus(); + Response listSkusWithResponse(Context context); /** * Lists eligible SKUs for PowerBI Dedicated resource 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 an object that represents enumerating SKUs for new resources. */ - Response listSkusWithResponse(Context context); + SkuEnumerationForNewResourceResult listSkus(); /** * Lists eligible SKUs for a PowerBI Dedicated resource. @@ -193,12 +195,14 @@ Response getByResourceGroupWithResponse( * This name must be at least 1 character in length, and no more than 90. * @param dedicatedCapacityName The name of the Dedicated capacity. It must be at least 3 characters in length, and * no more than 63. + * @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 an object that represents enumerating SKUs for existing resources. + * @return an object that represents enumerating SKUs for existing resources along with {@link Response}. */ - SkuEnumerationForExistingResourceResult listSkusForCapacity(String resourceGroupName, String dedicatedCapacityName); + Response listSkusForCapacityWithResponse( + String resourceGroupName, String dedicatedCapacityName, Context context); /** * Lists eligible SKUs for a PowerBI Dedicated resource. @@ -207,41 +211,39 @@ Response getByResourceGroupWithResponse( * This name must be at least 1 character in length, and no more than 90. * @param dedicatedCapacityName The name of the Dedicated capacity. It must be at least 3 characters in length, and * no more than 63. - * @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 an object that represents enumerating SKUs for existing resources. */ - Response listSkusForCapacityWithResponse( - String resourceGroupName, String dedicatedCapacityName, Context context); + SkuEnumerationForExistingResourceResult listSkusForCapacity(String resourceGroupName, String dedicatedCapacityName); /** * Check the name availability in the target location. * * @param location The region name which the operation will lookup into. * @param capacityParameters The name of the capacity. + * @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 checking result of capacity name availability. + * @return the checking result of capacity name availability along with {@link Response}. */ - CheckCapacityNameAvailabilityResult checkNameAvailability( - String location, CheckCapacityNameAvailabilityParameters capacityParameters); + Response checkNameAvailabilityWithResponse( + String location, CheckCapacityNameAvailabilityParameters capacityParameters, Context context); /** * Check the name availability in the target location. * * @param location The region name which the operation will lookup into. * @param capacityParameters The name of the capacity. - * @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 checking result of capacity name availability. */ - Response checkNameAvailabilityWithResponse( - String location, CheckCapacityNameAvailabilityParameters capacityParameters, Context context); + CheckCapacityNameAvailabilityResult checkNameAvailability( + String location, CheckCapacityNameAvailabilityParameters capacityParameters); /** * Gets details about the specified dedicated capacity. @@ -250,7 +252,7 @@ Response checkNameAvailabilityWithResponse( * @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 details about the specified dedicated capacity. + * @return details about the specified dedicated capacity along with {@link Response}. */ DedicatedCapacity getById(String id); @@ -262,7 +264,7 @@ Response checkNameAvailabilityWithResponse( * @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 details about the specified dedicated capacity. + * @return details about the specified dedicated capacity along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/CapacityProvisioningState.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/CapacityProvisioningState.java index dff0e53c04b9..6d6c98032f87 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/CapacityProvisioningState.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/CapacityProvisioningState.java @@ -8,7 +8,10 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for CapacityProvisioningState. */ +/** + * The current deployment state of PowerBI Dedicated resource. The provisioningState is to indicate states for resource + * provisioning. + */ public final class CapacityProvisioningState extends ExpandableStringEnum { /** Static value Deleting for CapacityProvisioningState. */ public static final CapacityProvisioningState DELETING = fromString("Deleting"); @@ -46,6 +49,15 @@ public final class CapacityProvisioningState extends ExpandableStringEnum values() { return values(CapacityProvisioningState.class); } diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/CapacitySku.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/CapacitySku.java index b5b7bcb6a613..ff089df4f861 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/CapacitySku.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/CapacitySku.java @@ -6,14 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Represents the SKU name and Azure pricing tier for PowerBI Dedicated capacity resource. */ @Fluent public final class CapacitySku { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CapacitySku.class); - /* * Name of the SKU level. */ @@ -26,6 +23,16 @@ public final class CapacitySku { @JsonProperty(value = "tier") private CapacitySkuTier tier; + /* + * The capacity of the SKU. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** Creates an instance of CapacitySku class. */ + public CapacitySku() { + } + /** * Get the name property: Name of the SKU level. * @@ -66,6 +73,26 @@ public CapacitySku withTier(CapacitySkuTier tier) { return this; } + /** + * Get the capacity property: The capacity of the SKU. + * + * @return the capacity value. + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity property: The capacity of the SKU. + * + * @param capacity the capacity value to set. + * @return the CapacitySku object itself. + */ + public CapacitySku withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + /** * Validates the instance. * @@ -73,9 +100,11 @@ public CapacitySku withTier(CapacitySkuTier tier) { */ public void validate() { if (name() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property name in model CapacitySku")); } } + + private static final ClientLogger LOGGER = new ClientLogger(CapacitySku.class); } diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/CapacitySkuTier.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/CapacitySkuTier.java index 706fd1de1d93..0dd4c7c774f1 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/CapacitySkuTier.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/CapacitySkuTier.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for CapacitySkuTier. */ +/** The name of the Azure pricing tier to which the SKU applies. */ public final class CapacitySkuTier extends ExpandableStringEnum { /** Static value PBIE_Azure for CapacitySkuTier. */ public static final CapacitySkuTier PBIE_AZURE = fromString("PBIE_Azure"); @@ -19,6 +19,15 @@ public final class CapacitySkuTier extends ExpandableStringEnum /** Static value AutoPremiumHost for CapacitySkuTier. */ public static final CapacitySkuTier AUTO_PREMIUM_HOST = fromString("AutoPremiumHost"); + /** + * Creates a new instance of CapacitySkuTier value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CapacitySkuTier() { + } + /** * Creates or finds a CapacitySkuTier from its string representation. * @@ -30,7 +39,11 @@ public static CapacitySkuTier fromString(String name) { return fromString(name, CapacitySkuTier.class); } - /** @return known CapacitySkuTier values. */ + /** + * Gets known CapacitySkuTier values. + * + * @return known CapacitySkuTier values. + */ public static Collection values() { return values(CapacitySkuTier.class); } diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/CheckCapacityNameAvailabilityParameters.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/CheckCapacityNameAvailabilityParameters.java index b59261b020bf..b7cd333096e9 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/CheckCapacityNameAvailabilityParameters.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/CheckCapacityNameAvailabilityParameters.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.powerbidedicated.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Details of capacity name request body. */ @Fluent public final class CheckCapacityNameAvailabilityParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckCapacityNameAvailabilityParameters.class); - /* * Name for checking availability. */ @@ -26,6 +22,10 @@ public final class CheckCapacityNameAvailabilityParameters { @JsonProperty(value = "type") private String type; + /** Creates an instance of CheckCapacityNameAvailabilityParameters class. */ + public CheckCapacityNameAvailabilityParameters() { + } + /** * Get the name property: Name for checking availability. * diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/DedicatedCapacities.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/DedicatedCapacities.java index be3dca71d82b..a952374faaf9 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/DedicatedCapacities.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/DedicatedCapacities.java @@ -7,21 +7,22 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.powerbidedicated.fluent.models.DedicatedCapacityInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** An array of Dedicated capacities resources. */ @Fluent public final class DedicatedCapacities { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DedicatedCapacities.class); - /* * An array of Dedicated capacities resources. */ @JsonProperty(value = "value", required = true) private List value; + /** Creates an instance of DedicatedCapacities class. */ + public DedicatedCapacities() { + } + /** * Get the value property: An array of Dedicated capacities resources. * @@ -49,11 +50,13 @@ public DedicatedCapacities withValue(List value) { */ public void validate() { if (value() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property value in model DedicatedCapacities")); } else { value().forEach(e -> e.validate()); } } + + private static final ClientLogger LOGGER = new ClientLogger(DedicatedCapacities.class); } diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/DedicatedCapacity.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/DedicatedCapacity.java index c702be79abcc..f964c3f22610 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/DedicatedCapacity.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/DedicatedCapacity.java @@ -55,18 +55,11 @@ public interface DedicatedCapacity { CapacitySku sku(); /** - * Gets the administration property: A collection of Dedicated capacity administrators. - * - * @return the administration value. - */ - DedicatedCapacityAdministrators administration(); - - /** - * Gets the mode property: The capacity mode. + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. * - * @return the mode value. + * @return the systemData value. */ - Mode mode(); + SystemData systemData(); /** * Gets the state property: The current state of PowerBI Dedicated resource. The state is to indicate more states @@ -85,11 +78,34 @@ public interface DedicatedCapacity { CapacityProvisioningState provisioningState(); /** - * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * Gets the administration property: A collection of Dedicated capacity administrators. * - * @return the systemData value. + * @return the administration value. */ - SystemData systemData(); + DedicatedCapacityAdministrators administration(); + + /** + * Gets the mode property: Specifies the generation of the Power BI Embedded capacity. If no value is specified, the + * default value 'Gen2' is used. [Learn + * More](https://docs.microsoft.com/power-bi/developer/embedded/power-bi-embedded-generation-2). + * + * @return the mode value. + */ + Mode mode(); + + /** + * Gets the tenantId property: Tenant ID for the capacity. Used for creating Pro Plus capacity. + * + * @return the tenantId value. + */ + String tenantId(); + + /** + * Gets the friendlyName property: Capacity name. + * + * @return the friendlyName value. + */ + String friendlyName(); /** * Gets the region of the resource. @@ -105,6 +121,13 @@ public interface DedicatedCapacity { */ String regionName(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.powerbidedicated.fluent.models.DedicatedCapacityInner object. * @@ -170,9 +193,9 @@ interface WithSku { */ interface WithCreate extends DefinitionStages.WithTags, + DefinitionStages.WithSystemData, DefinitionStages.WithAdministration, - DefinitionStages.WithMode, - DefinitionStages.WithSystemData { + DefinitionStages.WithMode { /** * Executes the create request. * @@ -198,6 +221,17 @@ interface WithTags { */ WithCreate withTags(Map tags); } + /** The stage of the DedicatedCapacity definition allowing to specify systemData. */ + interface WithSystemData { + /** + * Specifies the systemData property: Metadata pertaining to creation and last modification of the + * resource.. + * + * @param systemData Metadata pertaining to creation and last modification of the resource. + * @return the next definition stage. + */ + WithCreate withSystemData(SystemData systemData); + } /** The stage of the DedicatedCapacity definition allowing to specify administration. */ interface WithAdministration { /** @@ -211,24 +245,17 @@ interface WithAdministration { /** The stage of the DedicatedCapacity definition allowing to specify mode. */ interface WithMode { /** - * Specifies the mode property: The capacity mode.. + * Specifies the mode property: Specifies the generation of the Power BI Embedded capacity. If no value is + * specified, the default value 'Gen2' is used. [Learn + * More](https://docs.microsoft.com/power-bi/developer/embedded/power-bi-embedded-generation-2). * - * @param mode The capacity mode. + * @param mode Specifies the generation of the Power BI Embedded capacity. If no value is specified, the + * default value 'Gen2' is used. [Learn + * More](https://docs.microsoft.com/power-bi/developer/embedded/power-bi-embedded-generation-2). * @return the next definition stage. */ WithCreate withMode(Mode mode); } - /** The stage of the DedicatedCapacity definition allowing to specify systemData. */ - interface WithSystemData { - /** - * Specifies the systemData property: Metadata pertaining to creation and last modification of the - * resource.. - * - * @param systemData Metadata pertaining to creation and last modification of the resource. - * @return the next definition stage. - */ - WithCreate withSystemData(SystemData systemData); - } } /** * Begins update for the DedicatedCapacity resource. @@ -290,9 +317,13 @@ interface WithAdministration { /** The stage of the DedicatedCapacity update allowing to specify mode. */ interface WithMode { /** - * Specifies the mode property: The capacity mode.. + * Specifies the mode property: Specifies the generation of the Power BI Embedded capacity. If no value is + * specified, the default value 'Gen2' is used. [Learn + * More](https://docs.microsoft.com/power-bi/developer/embedded/power-bi-embedded-generation-2). * - * @param mode The capacity mode. + * @param mode Specifies the generation of the Power BI Embedded capacity. If no value is specified, the + * default value 'Gen2' is used. [Learn + * More](https://docs.microsoft.com/power-bi/developer/embedded/power-bi-embedded-generation-2). * @return the next definition stage. */ Update withMode(Mode mode); diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/DedicatedCapacityAdministrators.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/DedicatedCapacityAdministrators.java index f56ed5e3a89f..9e251d849b7a 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/DedicatedCapacityAdministrators.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/DedicatedCapacityAdministrators.java @@ -5,22 +5,22 @@ package com.azure.resourcemanager.powerbidedicated.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** An array of administrator user identities. */ @Fluent public final class DedicatedCapacityAdministrators { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DedicatedCapacityAdministrators.class); - /* * An array of administrator user identities. */ @JsonProperty(value = "members") private List members; + /** Creates an instance of DedicatedCapacityAdministrators class. */ + public DedicatedCapacityAdministrators() { + } + /** * Get the members property: An array of administrator user identities. * diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/DedicatedCapacityUpdateParameters.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/DedicatedCapacityUpdateParameters.java index 42cdcc6dab1d..9286226760f5 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/DedicatedCapacityUpdateParameters.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/DedicatedCapacityUpdateParameters.java @@ -5,18 +5,14 @@ package com.azure.resourcemanager.powerbidedicated.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.powerbidedicated.fluent.models.DedicatedCapacityMutableProperties; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** Provision request specification. */ -@JsonFlatten @Fluent -public class DedicatedCapacityUpdateParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DedicatedCapacityUpdateParameters.class); - +public final class DedicatedCapacityUpdateParameters { /* * The SKU of the Dedicated capacity resource. */ @@ -27,19 +23,18 @@ public class DedicatedCapacityUpdateParameters { * Key-value pairs of additional provisioning properties. */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* - * A collection of Dedicated capacity administrators + * Properties of the provision operation request. */ - @JsonProperty(value = "properties.administration") - private DedicatedCapacityAdministrators administration; + @JsonProperty(value = "properties") + private DedicatedCapacityMutableProperties innerProperties; - /* - * The capacity mode. - */ - @JsonProperty(value = "properties.mode") - private Mode mode; + /** Creates an instance of DedicatedCapacityUpdateParameters class. */ + public DedicatedCapacityUpdateParameters() { + } /** * Get the sku property: The SKU of the Dedicated capacity resource. @@ -81,13 +76,22 @@ public DedicatedCapacityUpdateParameters withTags(Map tags) { return this; } + /** + * Get the innerProperties property: Properties of the provision operation request. + * + * @return the innerProperties value. + */ + private DedicatedCapacityMutableProperties innerProperties() { + return this.innerProperties; + } + /** * Get the administration property: A collection of Dedicated capacity administrators. * * @return the administration value. */ public DedicatedCapacityAdministrators administration() { - return this.administration; + return this.innerProperties() == null ? null : this.innerProperties().administration(); } /** @@ -97,30 +101,58 @@ public DedicatedCapacityAdministrators administration() { * @return the DedicatedCapacityUpdateParameters object itself. */ public DedicatedCapacityUpdateParameters withAdministration(DedicatedCapacityAdministrators administration) { - this.administration = administration; + if (this.innerProperties() == null) { + this.innerProperties = new DedicatedCapacityMutableProperties(); + } + this.innerProperties().withAdministration(administration); return this; } /** - * Get the mode property: The capacity mode. + * Get the mode property: Specifies the generation of the Power BI Embedded capacity. If no value is specified, the + * default value 'Gen2' is used. [Learn + * More](https://docs.microsoft.com/power-bi/developer/embedded/power-bi-embedded-generation-2). * * @return the mode value. */ public Mode mode() { - return this.mode; + return this.innerProperties() == null ? null : this.innerProperties().mode(); } /** - * Set the mode property: The capacity mode. + * Set the mode property: Specifies the generation of the Power BI Embedded capacity. If no value is specified, the + * default value 'Gen2' is used. [Learn + * More](https://docs.microsoft.com/power-bi/developer/embedded/power-bi-embedded-generation-2). * * @param mode the mode value to set. * @return the DedicatedCapacityUpdateParameters object itself. */ public DedicatedCapacityUpdateParameters withMode(Mode mode) { - this.mode = mode; + if (this.innerProperties() == null) { + this.innerProperties = new DedicatedCapacityMutableProperties(); + } + this.innerProperties().withMode(mode); return this; } + /** + * Get the tenantId property: Tenant ID for the capacity. Used for creating Pro Plus capacity. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.innerProperties() == null ? null : this.innerProperties().tenantId(); + } + + /** + * Get the friendlyName property: Capacity name. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + } + /** * Validates the instance. * @@ -130,8 +162,8 @@ public void validate() { if (sku() != null) { sku().validate(); } - if (administration() != null) { - administration().validate(); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/LogSpecification.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/LogSpecification.java new file mode 100644 index 000000000000..4f2bc2821386 --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/LogSpecification.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Log specification for exposing diagnostic logs to shoebox. */ +@Fluent +public final class LogSpecification { + /* + * Name of the log + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Localizable name of the log + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Blob duration for the log + */ + @JsonProperty(value = "blobDuration", access = JsonProperty.Access.WRITE_ONLY) + private String blobDuration; + + /** Creates an instance of LogSpecification class. */ + public LogSpecification() { + } + + /** + * Get the name property: Name of the log. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the displayName property: Localizable name of the log. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Localizable name of the log. + * + * @param displayName the displayName value to set. + * @return the LogSpecification object itself. + */ + public LogSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the blobDuration property: Blob duration for the log. + * + * @return the blobDuration value. + */ + public String blobDuration() { + return this.blobDuration; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/MetricSpecification.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/MetricSpecification.java new file mode 100644 index 000000000000..911e02f42530 --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/MetricSpecification.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Metric specification for exposing performance metrics to shoebox. */ +@Fluent +public final class MetricSpecification { + /* + * Metric name + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Localizable metric name + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Localizable description of metric + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /* + * Unit for the metric + */ + @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) + private String unit; + + /* + * Aggregation type for the metric + */ + @JsonProperty(value = "aggregationType", access = JsonProperty.Access.WRITE_ONLY) + private String aggregationType; + + /* + * Pattern used to filter the metric + */ + @JsonProperty(value = "metricFilterPattern", access = JsonProperty.Access.WRITE_ONLY) + private String metricFilterPattern; + + /* + * For describing multi dimensional metrics + */ + @JsonProperty(value = "dimensions") + private List dimensions; + + /** Creates an instance of MetricSpecification class. */ + public MetricSpecification() { + } + + /** + * Get the name property: Metric name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the displayName property: Localizable metric name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Localizable metric name. + * + * @param displayName the displayName value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the displayDescription property: Localizable description of metric. + * + * @return the displayDescription value. + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Set the displayDescription property: Localizable description of metric. + * + * @param displayDescription the displayDescription value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayDescription(String displayDescription) { + this.displayDescription = displayDescription; + return this; + } + + /** + * Get the unit property: Unit for the metric. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * Get the aggregationType property: Aggregation type for the metric. + * + * @return the aggregationType value. + */ + public String aggregationType() { + return this.aggregationType; + } + + /** + * Get the metricFilterPattern property: Pattern used to filter the metric. + * + * @return the metricFilterPattern value. + */ + public String metricFilterPattern() { + return this.metricFilterPattern; + } + + /** + * Get the dimensions property: For describing multi dimensional metrics. + * + * @return the dimensions value. + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Set the dimensions property: For describing multi dimensional metrics. + * + * @param dimensions the dimensions value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDimensions(List dimensions) { + this.dimensions = dimensions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dimensions() != null) { + dimensions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/MetricSpecificationDimensionsItem.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/MetricSpecificationDimensionsItem.java new file mode 100644 index 000000000000..27e15f01d88c --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/MetricSpecificationDimensionsItem.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The MetricSpecificationDimensionsItem model. */ +@Fluent +public final class MetricSpecificationDimensionsItem { + /* + * Dimension of the metric + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Localizable dimension of the metric + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** Creates an instance of MetricSpecificationDimensionsItem class. */ + public MetricSpecificationDimensionsItem() { + } + + /** + * Get the name property: Dimension of the metric. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the displayName property: Localizable dimension of the metric. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Localizable dimension of the metric. + * + * @param displayName the displayName value to set. + * @return the MetricSpecificationDimensionsItem object itself. + */ + public MetricSpecificationDimensionsItem withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/Mode.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/Mode.java index d94fcdd671d3..bce3a9b97e10 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/Mode.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/Mode.java @@ -8,7 +8,10 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for Mode. */ +/** + * Specifies the generation of the Power BI Embedded capacity. If no value is specified, the default value 'Gen2' is + * used. [Learn More](https://docs.microsoft.com/power-bi/developer/embedded/power-bi-embedded-generation-2). + */ public final class Mode extends ExpandableStringEnum { /** Static value Gen1 for Mode. */ public static final Mode GEN1 = fromString("Gen1"); @@ -16,6 +19,15 @@ public final class Mode extends ExpandableStringEnum { /** Static value Gen2 for Mode. */ public static final Mode GEN2 = fromString("Gen2"); + /** + * Creates a new instance of Mode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Mode() { + } + /** * Creates or finds a Mode from its string representation. * @@ -27,7 +39,11 @@ public static Mode fromString(String name) { return fromString(name, Mode.class); } - /** @return known Mode values. */ + /** + * Gets known Mode values. + * + * @return known Mode values. + */ public static Collection values() { return values(Mode.class); } diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/Operation.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/Operation.java index 89ddc710170c..b59c5bd1fb4c 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/Operation.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/Operation.java @@ -22,6 +22,20 @@ public interface Operation { */ OperationDisplay display(); + /** + * Gets the origin property: Origin of the operation. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the properties property: Additional properties to expose performance metrics to shoebox. + * + * @return the properties value. + */ + OperationProperties properties(); + /** * Gets the inner com.azure.resourcemanager.powerbidedicated.fluent.models.OperationInner object. * diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/OperationDisplay.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/OperationDisplay.java index 33874c6a4151..0517e1dfc476 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/OperationDisplay.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/OperationDisplay.java @@ -4,16 +4,12 @@ package com.azure.resourcemanager.powerbidedicated.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; /** The object that represents the operation. */ -@Immutable +@Fluent public final class OperationDisplay { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); - /* * Service provider: Microsoft.PowerBIDedicated. */ @@ -32,6 +28,16 @@ public final class OperationDisplay { @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) private String operation; + /* + * Localized description of the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** Creates an instance of OperationDisplay class. */ + public OperationDisplay() { + } + /** * Get the provider property: Service provider: Microsoft.PowerBIDedicated. * @@ -59,6 +65,26 @@ public String operation() { return this.operation; } + /** + * Get the description property: Localized description of the operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Localized description of the operation. + * + * @param description the description value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + /** * Validates the instance. * diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/OperationListResult.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/OperationListResult.java index a28dcf9818d2..dbdad06787aa 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/OperationListResult.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/OperationListResult.java @@ -5,20 +5,15 @@ package com.azure.resourcemanager.powerbidedicated.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.powerbidedicated.fluent.models.OperationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Result listing capacities. It contains a list of operations and a URL link to get the next set of results. */ @Immutable public final class OperationListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResult.class); - /* - * List of capacities supported by the Microsoft.PowerBIDedicated resource - * provider. + * List of capacities supported by the Microsoft.PowerBIDedicated resource provider. */ @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; @@ -29,6 +24,10 @@ public final class OperationListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of OperationListResult class. */ + public OperationListResult() { + } + /** * Get the value property: List of capacities supported by the Microsoft.PowerBIDedicated resource provider. * diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/OperationProperties.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/OperationProperties.java new file mode 100644 index 000000000000..82540b535647 --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/OperationProperties.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Additional properties to expose performance metrics to shoebox. */ +@Fluent +public final class OperationProperties { + /* + * Service specification for exposing performance metrics to shoebox. + */ + @JsonProperty(value = "serviceSpecification") + private ServiceSpecification serviceSpecification; + + /** Creates an instance of OperationProperties class. */ + public OperationProperties() { + } + + /** + * Get the serviceSpecification property: Service specification for exposing performance metrics to shoebox. + * + * @return the serviceSpecification value. + */ + public ServiceSpecification serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Set the serviceSpecification property: Service specification for exposing performance metrics to shoebox. + * + * @param serviceSpecification the serviceSpecification value to set. + * @return the OperationProperties object itself. + */ + public OperationProperties withServiceSpecification(ServiceSpecification serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (serviceSpecification() != null) { + serviceSpecification().validate(); + } + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/Operations.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/Operations.java index 9cf3a6072c5f..fa7351e63776 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/Operations.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/Operations.java @@ -14,7 +14,7 @@ public interface Operations { * * @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 result listing capacities. + * @return result listing capacities as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -25,7 +25,7 @@ public interface Operations { * @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 result listing capacities. + * @return result listing capacities as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); } diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/ServiceSpecification.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/ServiceSpecification.java new file mode 100644 index 000000000000..8802b93e8344 --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/ServiceSpecification.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Service specification for exposing performance metrics to shoebox. */ +@Fluent +public final class ServiceSpecification { + /* + * Metric specifications for exposing performance metrics to shoebox. + */ + @JsonProperty(value = "metricSpecifications") + private List metricSpecifications; + + /* + * Log specifications for exposing diagnostic logs to shoebox. + */ + @JsonProperty(value = "logSpecifications") + private List logSpecifications; + + /** Creates an instance of ServiceSpecification class. */ + public ServiceSpecification() { + } + + /** + * Get the metricSpecifications property: Metric specifications for exposing performance metrics to shoebox. + * + * @return the metricSpecifications value. + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Set the metricSpecifications property: Metric specifications for exposing performance metrics to shoebox. + * + * @param metricSpecifications the metricSpecifications value to set. + * @return the ServiceSpecification object itself. + */ + public ServiceSpecification withMetricSpecifications(List metricSpecifications) { + this.metricSpecifications = metricSpecifications; + return this; + } + + /** + * Get the logSpecifications property: Log specifications for exposing diagnostic logs to shoebox. + * + * @return the logSpecifications value. + */ + public List logSpecifications() { + return this.logSpecifications; + } + + /** + * Set the logSpecifications property: Log specifications for exposing diagnostic logs to shoebox. + * + * @param logSpecifications the logSpecifications value to set. + * @return the ServiceSpecification object itself. + */ + public ServiceSpecification withLogSpecifications(List logSpecifications) { + this.logSpecifications = logSpecifications; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (metricSpecifications() != null) { + metricSpecifications().forEach(e -> e.validate()); + } + if (logSpecifications() != null) { + logSpecifications().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/SkuDetailsForExistingResource.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/SkuDetailsForExistingResource.java index 77903dcc2e89..a5495d08ca41 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/SkuDetailsForExistingResource.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/SkuDetailsForExistingResource.java @@ -5,14 +5,16 @@ package com.azure.resourcemanager.powerbidedicated.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** An object that represents SKU details for existing resources. */ @Fluent public final class SkuDetailsForExistingResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuDetailsForExistingResource.class); + /* + * The resource type + */ + @JsonProperty(value = "resourceType") + private String resourceType; /* * The SKU in SKU details for existing resources. @@ -20,6 +22,30 @@ public final class SkuDetailsForExistingResource { @JsonProperty(value = "sku") private CapacitySku sku; + /** Creates an instance of SkuDetailsForExistingResource class. */ + public SkuDetailsForExistingResource() { + } + + /** + * Get the resourceType property: The resource type. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Set the resourceType property: The resource type. + * + * @param resourceType the resourceType value to set. + * @return the SkuDetailsForExistingResource object itself. + */ + public SkuDetailsForExistingResource withResourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + /** * Get the sku property: The SKU in SKU details for existing resources. * diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/State.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/State.java index bc461bf8093c..8c0c43c310aa 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/State.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/State.java @@ -8,7 +8,10 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for State. */ +/** + * The current state of PowerBI Dedicated resource. The state is to indicate more states outside of resource + * provisioning. + */ public final class State extends ExpandableStringEnum { /** Static value Deleting for State. */ public static final State DELETING = fromString("Deleting"); @@ -46,6 +49,15 @@ public final class State extends ExpandableStringEnum { /** Static value Scaling for State. */ public static final State SCALING = fromString("Scaling"); + /** + * Creates a new instance of State value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public State() { + } + /** * Creates or finds a State from its string representation. * @@ -57,7 +69,11 @@ public static State fromString(String name) { return fromString(name, State.class); } - /** @return known State values. */ + /** + * Gets known State values. + * + * @return known State values. + */ public static Collection values() { return values(State.class); } diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/VCoreProvisioningState.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/VCoreProvisioningState.java index 40ab6e2ed0a2..0bc3b3582adf 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/VCoreProvisioningState.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/VCoreProvisioningState.java @@ -8,11 +8,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for VCoreProvisioningState. */ +/** + * The current deployment state of an auto scale v-core resource. The provisioningState is to indicate states for + * resource provisioning. + */ public final class VCoreProvisioningState extends ExpandableStringEnum { /** Static value Succeeded for VCoreProvisioningState. */ public static final VCoreProvisioningState SUCCEEDED = fromString("Succeeded"); + /** + * Creates a new instance of VCoreProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VCoreProvisioningState() { + } + /** * Creates or finds a VCoreProvisioningState from its string representation. * @@ -24,7 +36,11 @@ public static VCoreProvisioningState fromString(String name) { return fromString(name, VCoreProvisioningState.class); } - /** @return known VCoreProvisioningState values. */ + /** + * Gets known VCoreProvisioningState values. + * + * @return known VCoreProvisioningState values. + */ public static Collection values() { return values(VCoreProvisioningState.class); } diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/VCoreSkuTier.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/VCoreSkuTier.java index 66cc516b52b9..adf7d2a34834 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/VCoreSkuTier.java +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/main/java/com/azure/resourcemanager/powerbidedicated/models/VCoreSkuTier.java @@ -8,11 +8,20 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for VCoreSkuTier. */ +/** The name of the Azure pricing tier to which the SKU applies. */ public final class VCoreSkuTier extends ExpandableStringEnum { /** Static value AutoScale for VCoreSkuTier. */ public static final VCoreSkuTier AUTO_SCALE = fromString("AutoScale"); + /** + * Creates a new instance of VCoreSkuTier value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VCoreSkuTier() { + } + /** * Creates or finds a VCoreSkuTier from its string representation. * @@ -24,7 +33,11 @@ public static VCoreSkuTier fromString(String name) { return fromString(name, VCoreSkuTier.class); } - /** @return known VCoreSkuTier values. */ + /** + * Gets known VCoreSkuTier values. + * + * @return known VCoreSkuTier values. + */ public static Collection values() { return values(VCoreSkuTier.class); } diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoresCreateSamples.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoresCreateSamples.java new file mode 100644 index 000000000000..397eda3b3c09 --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoresCreateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.resourcemanager.powerbidedicated.models.AutoScaleVCoreSku; +import com.azure.resourcemanager.powerbidedicated.models.VCoreSkuTier; +import java.util.HashMap; +import java.util.Map; + +/** Samples for AutoScaleVCores Create. */ +public final class AutoScaleVCoresCreateSamples { + /* + * x-ms-original-file: specification/powerbidedicated/resource-manager/Microsoft.PowerBIdedicated/stable/2021-01-01/examples/createAutoScaleVCore.json + */ + /** + * Sample code: Create auto scale v-core. + * + * @param manager Entry point to PowerBIDedicatedManager. + */ + public static void createAutoScaleVCore( + com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager manager) { + manager + .autoScaleVCores() + .define("testvcore") + .withRegion("West US") + .withExistingResourceGroup("TestRG") + .withSku(new AutoScaleVCoreSku().withName("AutoScale").withTier(VCoreSkuTier.AUTO_SCALE).withCapacity(0)) + .withTags(mapOf("testKey", "testValue")) + .withCapacityObjectId("a28f00bd-5330-4572-88f1-fa883e074785") + .withCapacityLimit(10) + .create(); + } + + @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/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoresDeleteSamples.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoresDeleteSamples.java new file mode 100644 index 000000000000..e696b06a850a --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoresDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +/** Samples for AutoScaleVCores Delete. */ +public final class AutoScaleVCoresDeleteSamples { + /* + * x-ms-original-file: specification/powerbidedicated/resource-manager/Microsoft.PowerBIdedicated/stable/2021-01-01/examples/deleteAutoScaleVCore.json + */ + /** + * Sample code: Delete an auto scale v-core. + * + * @param manager Entry point to PowerBIDedicatedManager. + */ + public static void deleteAnAutoScaleVCore( + com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager manager) { + manager + .autoScaleVCores() + .deleteByResourceGroupWithResponse("TestRG", "testvcore", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoresGetByResourceGroupSamples.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoresGetByResourceGroupSamples.java new file mode 100644 index 000000000000..6e7b6e1131cc --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoresGetByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +/** Samples for AutoScaleVCores GetByResourceGroup. */ +public final class AutoScaleVCoresGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/powerbidedicated/resource-manager/Microsoft.PowerBIdedicated/stable/2021-01-01/examples/getAutoScaleVCore.json + */ + /** + * Sample code: Get details of an auto scale v-core. + * + * @param manager Entry point to PowerBIDedicatedManager. + */ + public static void getDetailsOfAnAutoScaleVCore( + com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager manager) { + manager + .autoScaleVCores() + .getByResourceGroupWithResponse("TestRG", "testvcore", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoresListByResourceGroupSamples.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoresListByResourceGroupSamples.java new file mode 100644 index 000000000000..ff017be4a8e2 --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoresListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +/** Samples for AutoScaleVCores ListByResourceGroup. */ +public final class AutoScaleVCoresListByResourceGroupSamples { + /* + * x-ms-original-file: specification/powerbidedicated/resource-manager/Microsoft.PowerBIdedicated/stable/2021-01-01/examples/listAutoScaleVCoresInResourceGroup.json + */ + /** + * Sample code: List auto scale v-cores in resource group. + * + * @param manager Entry point to PowerBIDedicatedManager. + */ + public static void listAutoScaleVCoresInResourceGroup( + com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager manager) { + manager.autoScaleVCores().listByResourceGroup("TestRG", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoresListSamples.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoresListSamples.java new file mode 100644 index 000000000000..b3d8cfc82d00 --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoresListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +/** Samples for AutoScaleVCores List. */ +public final class AutoScaleVCoresListSamples { + /* + * x-ms-original-file: specification/powerbidedicated/resource-manager/Microsoft.PowerBIdedicated/stable/2021-01-01/examples/listAutoScaleVCoresInSubscription.json + */ + /** + * Sample code: List auto scale v-cores in subscription. + * + * @param manager Entry point to PowerBIDedicatedManager. + */ + public static void listAutoScaleVCoresInSubscription( + com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager manager) { + manager.autoScaleVCores().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoresUpdateSamples.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoresUpdateSamples.java new file mode 100644 index 000000000000..76bc92923d23 --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoresUpdateSamples.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.resourcemanager.powerbidedicated.models.AutoScaleVCore; +import com.azure.resourcemanager.powerbidedicated.models.AutoScaleVCoreSku; +import com.azure.resourcemanager.powerbidedicated.models.VCoreSkuTier; +import java.util.HashMap; +import java.util.Map; + +/** Samples for AutoScaleVCores Update. */ +public final class AutoScaleVCoresUpdateSamples { + /* + * x-ms-original-file: specification/powerbidedicated/resource-manager/Microsoft.PowerBIdedicated/stable/2021-01-01/examples/updateAutoScaleVCore.json + */ + /** + * Sample code: Update auto scale v-core parameters. + * + * @param manager Entry point to PowerBIDedicatedManager. + */ + public static void updateAutoScaleVCoreParameters( + com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager manager) { + AutoScaleVCore resource = + manager + .autoScaleVCores() + .getByResourceGroupWithResponse("TestRG", "testvcore", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("testKey", "testValue")) + .withSku(new AutoScaleVCoreSku().withName("AutoScale").withTier(VCoreSkuTier.AUTO_SCALE).withCapacity(0)) + .withCapacityLimit(20) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesCheckNameAvailabilitySamples.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesCheckNameAvailabilitySamples.java new file mode 100644 index 000000000000..ee016be9acf3 --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesCheckNameAvailabilitySamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.resourcemanager.powerbidedicated.models.CheckCapacityNameAvailabilityParameters; + +/** Samples for Capacities CheckNameAvailability. */ +public final class CapacitiesCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/powerbidedicated/resource-manager/Microsoft.PowerBIdedicated/stable/2021-01-01/examples/checkNameAvailability.json + */ + /** + * Sample code: Check name availability of a capacity. + * + * @param manager Entry point to PowerBIDedicatedManager. + */ + public static void checkNameAvailabilityOfACapacity( + com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager manager) { + manager + .capacities() + .checkNameAvailabilityWithResponse( + "West US", + new CheckCapacityNameAvailabilityParameters() + .withName("azsdktest") + .withType("Microsoft.PowerBIDedicated/capacities"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesCreateSamples.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesCreateSamples.java new file mode 100644 index 000000000000..1c3bb9753d81 --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesCreateSamples.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.resourcemanager.powerbidedicated.models.CapacitySku; +import com.azure.resourcemanager.powerbidedicated.models.CapacitySkuTier; +import com.azure.resourcemanager.powerbidedicated.models.DedicatedCapacityAdministrators; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Capacities Create. */ +public final class CapacitiesCreateSamples { + /* + * x-ms-original-file: specification/powerbidedicated/resource-manager/Microsoft.PowerBIdedicated/stable/2021-01-01/examples/createCapacity.json + */ + /** + * Sample code: Create capacity. + * + * @param manager Entry point to PowerBIDedicatedManager. + */ + public static void createCapacity(com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager manager) { + manager + .capacities() + .define("azsdktest") + .withRegion("West US") + .withExistingResourceGroup("TestRG") + .withSku(new CapacitySku().withName("A1").withTier(CapacitySkuTier.PBIE_AZURE)) + .withTags(mapOf("testKey", "testValue")) + .withAdministration( + new DedicatedCapacityAdministrators() + .withMembers(Arrays.asList("azsdktest@microsoft.com", "azsdktest2@microsoft.com"))) + .create(); + } + + @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/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesDeleteSamples.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesDeleteSamples.java new file mode 100644 index 000000000000..c944fe9e15c4 --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesDeleteSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +/** Samples for Capacities Delete. */ +public final class CapacitiesDeleteSamples { + /* + * x-ms-original-file: specification/powerbidedicated/resource-manager/Microsoft.PowerBIdedicated/stable/2021-01-01/examples/deleteCapacity.json + */ + /** + * Sample code: Get details of a capacity. + * + * @param manager Entry point to PowerBIDedicatedManager. + */ + public static void getDetailsOfACapacity( + com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager manager) { + manager.capacities().delete("TestRG", "azsdktest", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesGetByResourceGroupSamples.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..e74513b3d491 --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesGetByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +/** Samples for Capacities GetByResourceGroup. */ +public final class CapacitiesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/powerbidedicated/resource-manager/Microsoft.PowerBIdedicated/stable/2021-01-01/examples/getCapacity.json + */ + /** + * Sample code: Get details of a capacity. + * + * @param manager Entry point to PowerBIDedicatedManager. + */ + public static void getDetailsOfACapacity( + com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager manager) { + manager.capacities().getByResourceGroupWithResponse("TestRG", "azsdktest", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesListByResourceGroupSamples.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesListByResourceGroupSamples.java new file mode 100644 index 000000000000..3c0b6aec3fb4 --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +/** Samples for Capacities ListByResourceGroup. */ +public final class CapacitiesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/powerbidedicated/resource-manager/Microsoft.PowerBIdedicated/stable/2021-01-01/examples/listCapacitiesInResourceGroup.json + */ + /** + * Sample code: List capacities in resource group. + * + * @param manager Entry point to PowerBIDedicatedManager. + */ + public static void listCapacitiesInResourceGroup( + com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager manager) { + manager.capacities().listByResourceGroup("TestRG", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesListSamples.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesListSamples.java new file mode 100644 index 000000000000..a50e20361b28 --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +/** Samples for Capacities List. */ +public final class CapacitiesListSamples { + /* + * x-ms-original-file: specification/powerbidedicated/resource-manager/Microsoft.PowerBIdedicated/stable/2021-01-01/examples/listCapacitiesInSubscription.json + */ + /** + * Sample code: Get details of a capacity. + * + * @param manager Entry point to PowerBIDedicatedManager. + */ + public static void getDetailsOfACapacity( + com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager manager) { + manager.capacities().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesListSkusForCapacitySamples.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesListSkusForCapacitySamples.java new file mode 100644 index 000000000000..2067bf83de83 --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesListSkusForCapacitySamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +/** Samples for Capacities ListSkusForCapacity. */ +public final class CapacitiesListSkusForCapacitySamples { + /* + * x-ms-original-file: specification/powerbidedicated/resource-manager/Microsoft.PowerBIdedicated/stable/2021-01-01/examples/listSKUsForExisting.json + */ + /** + * Sample code: List eligible SKUs for an existing capacity. + * + * @param manager Entry point to PowerBIDedicatedManager. + */ + public static void listEligibleSKUsForAnExistingCapacity( + com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager manager) { + manager.capacities().listSkusForCapacityWithResponse("TestRG", "azsdktest", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesListSkusSamples.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesListSkusSamples.java new file mode 100644 index 000000000000..4b00d95e86ff --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesListSkusSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +/** Samples for Capacities ListSkus. */ +public final class CapacitiesListSkusSamples { + /* + * x-ms-original-file: specification/powerbidedicated/resource-manager/Microsoft.PowerBIdedicated/stable/2021-01-01/examples/listSKUsForNew.json + */ + /** + * Sample code: List eligible SKUs for a new capacity. + * + * @param manager Entry point to PowerBIDedicatedManager. + */ + public static void listEligibleSKUsForANewCapacity( + com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager manager) { + manager.capacities().listSkusWithResponse(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesResumeSamples.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesResumeSamples.java new file mode 100644 index 000000000000..66c49a46d53b --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesResumeSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +/** Samples for Capacities Resume. */ +public final class CapacitiesResumeSamples { + /* + * x-ms-original-file: specification/powerbidedicated/resource-manager/Microsoft.PowerBIdedicated/stable/2021-01-01/examples/resumeCapacity.json + */ + /** + * Sample code: Get details of a capacity. + * + * @param manager Entry point to PowerBIDedicatedManager. + */ + public static void getDetailsOfACapacity( + com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager manager) { + manager.capacities().resume("TestRG", "azsdktest", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesSuspendSamples.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesSuspendSamples.java new file mode 100644 index 000000000000..de4ea8e162cf --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesSuspendSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +/** Samples for Capacities Suspend. */ +public final class CapacitiesSuspendSamples { + /* + * x-ms-original-file: specification/powerbidedicated/resource-manager/Microsoft.PowerBIdedicated/stable/2021-01-01/examples/suspendCapacity.json + */ + /** + * Sample code: Suspend capacity. + * + * @param manager Entry point to PowerBIDedicatedManager. + */ + public static void suspendCapacity(com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager manager) { + manager.capacities().suspend("TestRG", "azsdktest", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesUpdateSamples.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesUpdateSamples.java new file mode 100644 index 000000000000..415230b71308 --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesUpdateSamples.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.resourcemanager.powerbidedicated.models.CapacitySku; +import com.azure.resourcemanager.powerbidedicated.models.CapacitySkuTier; +import com.azure.resourcemanager.powerbidedicated.models.DedicatedCapacity; +import com.azure.resourcemanager.powerbidedicated.models.DedicatedCapacityAdministrators; +import com.azure.resourcemanager.powerbidedicated.models.Mode; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Capacities Update. */ +public final class CapacitiesUpdateSamples { + /* + * x-ms-original-file: specification/powerbidedicated/resource-manager/Microsoft.PowerBIdedicated/stable/2021-01-01/examples/updateToGen2.json + */ + /** + * Sample code: Update capacity to Generation 2. + * + * @param manager Entry point to PowerBIDedicatedManager. + */ + public static void updateCapacityToGeneration2( + com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager manager) { + DedicatedCapacity resource = + manager + .capacities() + .getByResourceGroupWithResponse("TestRG", "azsdktest", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("testKey", "testValue")) + .withSku(new CapacitySku().withName("A1").withTier(CapacitySkuTier.PBIE_AZURE)) + .withMode(Mode.GEN2) + .apply(); + } + + /* + * x-ms-original-file: specification/powerbidedicated/resource-manager/Microsoft.PowerBIdedicated/stable/2021-01-01/examples/updateCapacity.json + */ + /** + * Sample code: Update capacity parameters. + * + * @param manager Entry point to PowerBIDedicatedManager. + */ + public static void updateCapacityParameters( + com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager manager) { + DedicatedCapacity resource = + manager + .capacities() + .getByResourceGroupWithResponse("TestRG", "azsdktest", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("testKey", "testValue")) + .withSku(new CapacitySku().withName("A1").withTier(CapacitySkuTier.PBIE_AZURE)) + .withAdministration( + new DedicatedCapacityAdministrators() + .withMembers(Arrays.asList("azsdktest@microsoft.com", "azsdktest2@microsoft.com"))) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/OperationsListSamples.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/OperationsListSamples.java new file mode 100644 index 000000000000..fd72c3e0a8f4 --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/samples/java/com/azure/resourcemanager/powerbidedicated/generated/OperationsListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/powerbidedicated/resource-manager/Microsoft.PowerBIdedicated/stable/2021-01-01/examples/operations.json + */ + /** + * Sample code: List operations. + * + * @param manager Entry point to PowerBIDedicatedManager. + */ + public static void listOperations(com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoreInnerTests.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoreInnerTests.java new file mode 100644 index 000000000000..2a6887f70b9e --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoreInnerTests.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.powerbidedicated.fluent.models.AutoScaleVCoreInner; +import com.azure.resourcemanager.powerbidedicated.models.AutoScaleVCoreSku; +import com.azure.resourcemanager.powerbidedicated.models.VCoreSkuTier; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class AutoScaleVCoreInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AutoScaleVCoreInner model = + BinaryData + .fromString( + "{\"sku\":{\"name\":\"pfhyhl\",\"tier\":\"AutoScale\",\"capacity\":1911186108},\"properties\":{\"capacityObjectId\":\"mcmatuokthfuiu\",\"provisioningState\":\"Succeeded\",\"capacityLimit\":680550088},\"location\":\"pk\",\"tags\":{\"dagfuaxbezyiuok\":\"dpuozmyz\",\"surex\":\"twhrdxwzywqsm\",\"dystkiiuxhqyud\":\"moryocfsfksym\",\"rq\":\"o\"},\"id\":\"b\",\"name\":\"oczvy\",\"type\":\"fqrvkdvjsllrmvvd\"}") + .toObject(AutoScaleVCoreInner.class); + Assertions.assertEquals("pk", model.location()); + Assertions.assertEquals("dpuozmyz", model.tags().get("dagfuaxbezyiuok")); + Assertions.assertEquals("pfhyhl", model.sku().name()); + Assertions.assertEquals(VCoreSkuTier.AUTO_SCALE, model.sku().tier()); + Assertions.assertEquals(1911186108, model.sku().capacity()); + Assertions.assertEquals("mcmatuokthfuiu", model.capacityObjectId()); + Assertions.assertEquals(680550088, model.capacityLimit()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AutoScaleVCoreInner model = + new AutoScaleVCoreInner() + .withLocation("pk") + .withTags( + mapOf( + "dagfuaxbezyiuok", + "dpuozmyz", + "surex", + "twhrdxwzywqsm", + "dystkiiuxhqyud", + "moryocfsfksym", + "rq", + "o")) + .withSku( + new AutoScaleVCoreSku() + .withName("pfhyhl") + .withTier(VCoreSkuTier.AUTO_SCALE) + .withCapacity(1911186108)) + .withCapacityObjectId("mcmatuokthfuiu") + .withCapacityLimit(680550088); + model = BinaryData.fromObject(model).toObject(AutoScaleVCoreInner.class); + Assertions.assertEquals("pk", model.location()); + Assertions.assertEquals("dpuozmyz", model.tags().get("dagfuaxbezyiuok")); + Assertions.assertEquals("pfhyhl", model.sku().name()); + Assertions.assertEquals(VCoreSkuTier.AUTO_SCALE, model.sku().tier()); + Assertions.assertEquals(1911186108, model.sku().capacity()); + Assertions.assertEquals("mcmatuokthfuiu", model.capacityObjectId()); + Assertions.assertEquals(680550088, model.capacityLimit()); + } + + @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/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoreListResultTests.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoreListResultTests.java new file mode 100644 index 000000000000..6fa6e244760e --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoreListResultTests.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.powerbidedicated.fluent.models.AutoScaleVCoreInner; +import com.azure.resourcemanager.powerbidedicated.models.AutoScaleVCoreListResult; +import com.azure.resourcemanager.powerbidedicated.models.AutoScaleVCoreSku; +import com.azure.resourcemanager.powerbidedicated.models.VCoreSkuTier; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class AutoScaleVCoreListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AutoScaleVCoreListResult model = + BinaryData + .fromString( + "{\"value\":[{\"sku\":{\"name\":\"lhocohslkev\",\"tier\":\"AutoScale\",\"capacity\":1425243209},\"properties\":{\"capacityObjectId\":\"u\",\"provisioningState\":\"Succeeded\",\"capacityLimit\":53032115},\"location\":\"x\",\"tags\":{\"v\":\"eiithlvmez\",\"xwburvjxxjns\":\"hxmzsbbzoggig\",\"ou\":\"ydptkoen\"},\"id\":\"nvudwtiukb\",\"name\":\"dng\",\"type\":\"pocipazyxoegu\"},{\"sku\":{\"name\":\"g\",\"tier\":\"AutoScale\",\"capacity\":244069221},\"properties\":{\"capacityObjectId\":\"ygevqzntypmrbpiz\",\"provisioningState\":\"Succeeded\",\"capacityLimit\":53365345},\"location\":\"dpydn\",\"tags\":{\"ifsjttgzfbishcb\":\"xdeoejzic\",\"alpbuxwgipwhon\":\"hajdeyeamdpha\"},\"id\":\"wkgshwa\",\"name\":\"kix\",\"type\":\"bin\"},{\"sku\":{\"name\":\"eputtmrywnuzoqf\",\"tier\":\"AutoScale\",\"capacity\":827817441},\"properties\":{\"capacityObjectId\":\"kcqvyxl\",\"provisioningState\":\"Succeeded\",\"capacityLimit\":1368622267},\"location\":\"cohoq\",\"tags\":{\"gyxzk\":\"vlryavwhheunmmq\"},\"id\":\"noc\",\"name\":\"koklya\",\"type\":\"uconuqszfkbey\"}]}") + .toObject(AutoScaleVCoreListResult.class); + Assertions.assertEquals("x", model.value().get(0).location()); + Assertions.assertEquals("eiithlvmez", model.value().get(0).tags().get("v")); + Assertions.assertEquals("lhocohslkev", model.value().get(0).sku().name()); + Assertions.assertEquals(VCoreSkuTier.AUTO_SCALE, model.value().get(0).sku().tier()); + Assertions.assertEquals(1425243209, model.value().get(0).sku().capacity()); + Assertions.assertEquals("u", model.value().get(0).capacityObjectId()); + Assertions.assertEquals(53032115, model.value().get(0).capacityLimit()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AutoScaleVCoreListResult model = + new AutoScaleVCoreListResult() + .withValue( + Arrays + .asList( + new AutoScaleVCoreInner() + .withLocation("x") + .withTags(mapOf("v", "eiithlvmez", "xwburvjxxjns", "hxmzsbbzoggig", "ou", "ydptkoen")) + .withSku( + new AutoScaleVCoreSku() + .withName("lhocohslkev") + .withTier(VCoreSkuTier.AUTO_SCALE) + .withCapacity(1425243209)) + .withCapacityObjectId("u") + .withCapacityLimit(53032115), + new AutoScaleVCoreInner() + .withLocation("dpydn") + .withTags(mapOf("ifsjttgzfbishcb", "xdeoejzic", "alpbuxwgipwhon", "hajdeyeamdpha")) + .withSku( + new AutoScaleVCoreSku() + .withName("g") + .withTier(VCoreSkuTier.AUTO_SCALE) + .withCapacity(244069221)) + .withCapacityObjectId("ygevqzntypmrbpiz") + .withCapacityLimit(53365345), + new AutoScaleVCoreInner() + .withLocation("cohoq") + .withTags(mapOf("gyxzk", "vlryavwhheunmmq")) + .withSku( + new AutoScaleVCoreSku() + .withName("eputtmrywnuzoqf") + .withTier(VCoreSkuTier.AUTO_SCALE) + .withCapacity(827817441)) + .withCapacityObjectId("kcqvyxl") + .withCapacityLimit(1368622267))); + model = BinaryData.fromObject(model).toObject(AutoScaleVCoreListResult.class); + Assertions.assertEquals("x", model.value().get(0).location()); + Assertions.assertEquals("eiithlvmez", model.value().get(0).tags().get("v")); + Assertions.assertEquals("lhocohslkev", model.value().get(0).sku().name()); + Assertions.assertEquals(VCoreSkuTier.AUTO_SCALE, model.value().get(0).sku().tier()); + Assertions.assertEquals(1425243209, model.value().get(0).sku().capacity()); + Assertions.assertEquals("u", model.value().get(0).capacityObjectId()); + Assertions.assertEquals(53032115, model.value().get(0).capacityLimit()); + } + + @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/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoreMutablePropertiesTests.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoreMutablePropertiesTests.java new file mode 100644 index 000000000000..2f1e8e36b8ba --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoreMutablePropertiesTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.powerbidedicated.fluent.models.AutoScaleVCoreMutableProperties; +import org.junit.jupiter.api.Assertions; + +public final class AutoScaleVCoreMutablePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AutoScaleVCoreMutableProperties model = + BinaryData.fromString("{\"capacityLimit\":100068665}").toObject(AutoScaleVCoreMutableProperties.class); + Assertions.assertEquals(100068665, model.capacityLimit()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AutoScaleVCoreMutableProperties model = new AutoScaleVCoreMutableProperties().withCapacityLimit(100068665); + model = BinaryData.fromObject(model).toObject(AutoScaleVCoreMutableProperties.class); + Assertions.assertEquals(100068665, model.capacityLimit()); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCorePropertiesTests.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCorePropertiesTests.java new file mode 100644 index 000000000000..14e6af29a9f5 --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCorePropertiesTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.powerbidedicated.fluent.models.AutoScaleVCoreProperties; +import org.junit.jupiter.api.Assertions; + +public final class AutoScaleVCorePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AutoScaleVCoreProperties model = + BinaryData + .fromString( + "{\"capacityObjectId\":\"wiqzbqjvsovmyo\",\"provisioningState\":\"Succeeded\",\"capacityLimit\":1421441668}") + .toObject(AutoScaleVCoreProperties.class); + Assertions.assertEquals(1421441668, model.capacityLimit()); + Assertions.assertEquals("wiqzbqjvsovmyo", model.capacityObjectId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AutoScaleVCoreProperties model = + new AutoScaleVCoreProperties().withCapacityLimit(1421441668).withCapacityObjectId("wiqzbqjvsovmyo"); + model = BinaryData.fromObject(model).toObject(AutoScaleVCoreProperties.class); + Assertions.assertEquals(1421441668, model.capacityLimit()); + Assertions.assertEquals("wiqzbqjvsovmyo", model.capacityObjectId()); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoreSkuTests.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoreSkuTests.java new file mode 100644 index 000000000000..a42751eab88b --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoreSkuTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.powerbidedicated.models.AutoScaleVCoreSku; +import com.azure.resourcemanager.powerbidedicated.models.VCoreSkuTier; +import org.junit.jupiter.api.Assertions; + +public final class AutoScaleVCoreSkuTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AutoScaleVCoreSku model = + BinaryData + .fromString("{\"name\":\"watkpnpulexxb\",\"tier\":\"AutoScale\",\"capacity\":1309614398}") + .toObject(AutoScaleVCoreSku.class); + Assertions.assertEquals("watkpnpulexxb", model.name()); + Assertions.assertEquals(VCoreSkuTier.AUTO_SCALE, model.tier()); + Assertions.assertEquals(1309614398, model.capacity()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AutoScaleVCoreSku model = + new AutoScaleVCoreSku() + .withName("watkpnpulexxb") + .withTier(VCoreSkuTier.AUTO_SCALE) + .withCapacity(1309614398); + model = BinaryData.fromObject(model).toObject(AutoScaleVCoreSku.class); + Assertions.assertEquals("watkpnpulexxb", model.name()); + Assertions.assertEquals(VCoreSkuTier.AUTO_SCALE, model.tier()); + Assertions.assertEquals(1309614398, model.capacity()); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoreUpdateParametersTests.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoreUpdateParametersTests.java new file mode 100644 index 000000000000..1640d29ef15c --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoreUpdateParametersTests.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.powerbidedicated.models.AutoScaleVCoreSku; +import com.azure.resourcemanager.powerbidedicated.models.AutoScaleVCoreUpdateParameters; +import com.azure.resourcemanager.powerbidedicated.models.VCoreSkuTier; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class AutoScaleVCoreUpdateParametersTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AutoScaleVCoreUpdateParameters model = + BinaryData + .fromString( + "{\"sku\":{\"name\":\"hzdobpxjmflbvvnc\",\"tier\":\"AutoScale\",\"capacity\":682758161},\"tags\":{\"rsa\":\"wzjuqk\",\"ghsauuimjmvxied\":\"iwkuofos\",\"byao\":\"ugidyjrr\",\"xc\":\"v\"},\"properties\":{\"capacityLimit\":771742090}}") + .toObject(AutoScaleVCoreUpdateParameters.class); + Assertions.assertEquals("hzdobpxjmflbvvnc", model.sku().name()); + Assertions.assertEquals(VCoreSkuTier.AUTO_SCALE, model.sku().tier()); + Assertions.assertEquals(682758161, model.sku().capacity()); + Assertions.assertEquals("wzjuqk", model.tags().get("rsa")); + Assertions.assertEquals(771742090, model.capacityLimit()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AutoScaleVCoreUpdateParameters model = + new AutoScaleVCoreUpdateParameters() + .withSku( + new AutoScaleVCoreSku() + .withName("hzdobpxjmflbvvnc") + .withTier(VCoreSkuTier.AUTO_SCALE) + .withCapacity(682758161)) + .withTags(mapOf("rsa", "wzjuqk", "ghsauuimjmvxied", "iwkuofos", "byao", "ugidyjrr", "xc", "v")) + .withCapacityLimit(771742090); + model = BinaryData.fromObject(model).toObject(AutoScaleVCoreUpdateParameters.class); + Assertions.assertEquals("hzdobpxjmflbvvnc", model.sku().name()); + Assertions.assertEquals(VCoreSkuTier.AUTO_SCALE, model.sku().tier()); + Assertions.assertEquals(682758161, model.sku().capacity()); + Assertions.assertEquals("wzjuqk", model.tags().get("rsa")); + Assertions.assertEquals(771742090, model.capacityLimit()); + } + + @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/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoresCreateWithResponseMockTests.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoresCreateWithResponseMockTests.java new file mode 100644 index 000000000000..dfdc87b4737f --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoresCreateWithResponseMockTests.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager; +import com.azure.resourcemanager.powerbidedicated.models.AutoScaleVCore; +import com.azure.resourcemanager.powerbidedicated.models.AutoScaleVCoreSku; +import com.azure.resourcemanager.powerbidedicated.models.VCoreSkuTier; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class AutoScaleVCoresCreateWithResponseMockTests { + @Test + public void testCreateWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"sku\":{\"name\":\"t\",\"tier\":\"AutoScale\",\"capacity\":1761160515},\"properties\":{\"capacityObjectId\":\"tfdygpfqb\",\"provisioningState\":\"Succeeded\",\"capacityLimit\":519394000},\"location\":\"zfq\",\"tags\":{\"ol\":\"uaopppcqeq\",\"kdmoi\":\"dahzxctobg\"},\"id\":\"postmgrcfbunrm\",\"name\":\"qjhhkxbpv\",\"type\":\"ymjhxxjyngudivkr\"}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + PowerBIDedicatedManager manager = + PowerBIDedicatedManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + AutoScaleVCore response = + manager + .autoScaleVCores() + .define("aalnjixi") + .withRegion("nr") + .withExistingResourceGroup("vbxwyjsflhh") + .withSku( + new AutoScaleVCoreSku() + .withName("xyawj") + .withTier(VCoreSkuTier.AUTO_SCALE) + .withCapacity(1772436776)) + .withTags(mapOf("hb", "o", "dtpnapnyiropuhp", "xknalaulppg", "gqgitxmedjvcsl", "gvpgy")) + .withCapacityObjectId("yjpkiidzyexz") + .withCapacityLimit(712721872) + .create(); + + Assertions.assertEquals("zfq", response.location()); + Assertions.assertEquals("uaopppcqeq", response.tags().get("ol")); + Assertions.assertEquals("t", response.sku().name()); + Assertions.assertEquals(VCoreSkuTier.AUTO_SCALE, response.sku().tier()); + Assertions.assertEquals(1761160515, response.sku().capacity()); + Assertions.assertEquals("tfdygpfqb", response.capacityObjectId()); + Assertions.assertEquals(519394000, response.capacityLimit()); + } + + @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/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoresDeleteByResourceGroupWithResponseMockTests.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoresDeleteByResourceGroupWithResponseMockTests.java new file mode 100644 index 000000000000..9948bcf728ee --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoresDeleteByResourceGroupWithResponseMockTests.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class AutoScaleVCoresDeleteByResourceGroupWithResponseMockTests { + @Test + public void testDeleteWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = "{}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + PowerBIDedicatedManager manager = + PowerBIDedicatedManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + manager + .autoScaleVCores() + .deleteByResourceGroupWithResponse("wxzvlvqhjkb", "gibtnm", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoresGetByResourceGroupWithResponseMockTests.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoresGetByResourceGroupWithResponseMockTests.java new file mode 100644 index 000000000000..053c3e627a0f --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoresGetByResourceGroupWithResponseMockTests.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager; +import com.azure.resourcemanager.powerbidedicated.models.AutoScaleVCore; +import com.azure.resourcemanager.powerbidedicated.models.VCoreSkuTier; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class AutoScaleVCoresGetByResourceGroupWithResponseMockTests { + @Test + public void testGetByResourceGroupWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"sku\":{\"name\":\"skxfbk\",\"tier\":\"AutoScale\",\"capacity\":1553337592},\"properties\":{\"capacityObjectId\":\"ndnhj\",\"provisioningState\":\"Succeeded\",\"capacityLimit\":2043748556},\"location\":\"ylwz\",\"tags\":{\"ujznb\":\"h\",\"wpr\":\"pow\",\"xobbcswsrt\":\"qlveualupjmkh\"},\"id\":\"riplrbpbewtg\",\"name\":\"fgb\",\"type\":\"c\"}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + PowerBIDedicatedManager manager = + PowerBIDedicatedManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + AutoScaleVCore response = + manager + .autoScaleVCores() + .getByResourceGroupWithResponse("xnrj", "wgqwgxhn", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("ylwz", response.location()); + Assertions.assertEquals("h", response.tags().get("ujznb")); + Assertions.assertEquals("skxfbk", response.sku().name()); + Assertions.assertEquals(VCoreSkuTier.AUTO_SCALE, response.sku().tier()); + Assertions.assertEquals(1553337592, response.sku().capacity()); + Assertions.assertEquals("ndnhj", response.capacityObjectId()); + Assertions.assertEquals(2043748556, response.capacityLimit()); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoresListByResourceGroupMockTests.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoresListByResourceGroupMockTests.java new file mode 100644 index 000000000000..55e70fe5c942 --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoresListByResourceGroupMockTests.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager; +import com.azure.resourcemanager.powerbidedicated.models.AutoScaleVCore; +import com.azure.resourcemanager.powerbidedicated.models.VCoreSkuTier; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class AutoScaleVCoresListByResourceGroupMockTests { + @Test + public void testListByResourceGroup() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"value\":[{\"sku\":{\"name\":\"j\",\"tier\":\"AutoScale\",\"capacity\":580617744},\"properties\":{\"capacityObjectId\":\"htxongmtsavjc\",\"provisioningState\":\"Succeeded\",\"capacityLimit\":1259658579},\"location\":\"srknftguv\",\"tags\":{\"qtayri\":\"hprwmdyv\",\"bycnojvkn\":\"wroyqbexrmcq\",\"qsgzvahapj\":\"e\"},\"id\":\"zhpvgqzcjrvxd\",\"name\":\"zlmwlxkvugfhz\",\"type\":\"vawjvzunlu\"}]}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + PowerBIDedicatedManager manager = + PowerBIDedicatedManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response = + manager.autoScaleVCores().listByResourceGroup("iebwwaloayqcgwrt", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("srknftguv", response.iterator().next().location()); + Assertions.assertEquals("hprwmdyv", response.iterator().next().tags().get("qtayri")); + Assertions.assertEquals("j", response.iterator().next().sku().name()); + Assertions.assertEquals(VCoreSkuTier.AUTO_SCALE, response.iterator().next().sku().tier()); + Assertions.assertEquals(580617744, response.iterator().next().sku().capacity()); + Assertions.assertEquals("htxongmtsavjc", response.iterator().next().capacityObjectId()); + Assertions.assertEquals(1259658579, response.iterator().next().capacityLimit()); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoresListMockTests.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoresListMockTests.java new file mode 100644 index 000000000000..9170654746ad --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/AutoScaleVCoresListMockTests.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager; +import com.azure.resourcemanager.powerbidedicated.models.AutoScaleVCore; +import com.azure.resourcemanager.powerbidedicated.models.VCoreSkuTier; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class AutoScaleVCoresListMockTests { + @Test + public void testList() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"value\":[{\"sku\":{\"name\":\"hnnpr\",\"tier\":\"AutoScale\",\"capacity\":1099728143},\"properties\":{\"capacityObjectId\":\"pjzu\",\"provisioningState\":\"Succeeded\",\"capacityLimit\":1754120882},\"location\":\"ltskzbbtd\",\"tags\":{\"sjyofdx\":\"veekgpwozuhkfp\"},\"id\":\"uusdttouwa\",\"name\":\"oekqvk\",\"type\":\"lns\"}]}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + PowerBIDedicatedManager manager = + PowerBIDedicatedManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response = manager.autoScaleVCores().list(com.azure.core.util.Context.NONE); + + Assertions.assertEquals("ltskzbbtd", response.iterator().next().location()); + Assertions.assertEquals("veekgpwozuhkfp", response.iterator().next().tags().get("sjyofdx")); + Assertions.assertEquals("hnnpr", response.iterator().next().sku().name()); + Assertions.assertEquals(VCoreSkuTier.AUTO_SCALE, response.iterator().next().sku().tier()); + Assertions.assertEquals(1099728143, response.iterator().next().sku().capacity()); + Assertions.assertEquals("pjzu", response.iterator().next().capacityObjectId()); + Assertions.assertEquals(1754120882, response.iterator().next().capacityLimit()); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesCheckNameAvailabilityWithResponseMockTests.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesCheckNameAvailabilityWithResponseMockTests.java new file mode 100644 index 000000000000..73dfce3cdfb6 --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesCheckNameAvailabilityWithResponseMockTests.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager; +import com.azure.resourcemanager.powerbidedicated.models.CheckCapacityNameAvailabilityParameters; +import com.azure.resourcemanager.powerbidedicated.models.CheckCapacityNameAvailabilityResult; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class CapacitiesCheckNameAvailabilityWithResponseMockTests { + @Test + public void testCheckNameAvailabilityWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = "{\"nameAvailable\":false,\"reason\":\"eoveilovnotyf\",\"message\":\"cnjbkcnxdhbt\"}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + PowerBIDedicatedManager manager = + PowerBIDedicatedManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + CheckCapacityNameAvailabilityResult response = + manager + .capacities() + .checkNameAvailabilityWithResponse( + "scwsv", + new CheckCapacityNameAvailabilityParameters().withName("otogtwrupqs").withType("nmic"), + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(false, response.nameAvailable()); + Assertions.assertEquals("eoveilovnotyf", response.reason()); + Assertions.assertEquals("cnjbkcnxdhbt", response.message()); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesCreateMockTests.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesCreateMockTests.java new file mode 100644 index 000000000000..fcc6360f255d --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesCreateMockTests.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager; +import com.azure.resourcemanager.powerbidedicated.models.CapacitySku; +import com.azure.resourcemanager.powerbidedicated.models.CapacitySkuTier; +import com.azure.resourcemanager.powerbidedicated.models.DedicatedCapacity; +import com.azure.resourcemanager.powerbidedicated.models.DedicatedCapacityAdministrators; +import com.azure.resourcemanager.powerbidedicated.models.Mode; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class CapacitiesCreateMockTests { + @Test + public void testCreate() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"sku\":{\"name\":\"rxsbkyvp\",\"tier\":\"Premium\",\"capacity\":427278595},\"properties\":{\"state\":\"Resuming\",\"provisioningState\":\"Succeeded\",\"administration\":{\"members\":[]},\"mode\":\"Gen1\",\"tenantId\":\"b\",\"friendlyName\":\"nwbmeh\"},\"location\":\"eyvjusrtslhspkde\",\"tags\":{\"ahvljuaha\":\"ofmxagkvtmelmqkr\",\"ualaexqpvfadmw\":\"uhcdhm\",\"vgomz\":\"rcrgvx\"},\"id\":\"fmisg\",\"name\":\"bnbbeldawkz\",\"type\":\"ali\"}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + PowerBIDedicatedManager manager = + PowerBIDedicatedManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + DedicatedCapacity response = + manager + .capacities() + .define("nermcl") + .withRegion("suyonobglaocq") + .withExistingResourceGroup("kphywpnvjto") + .withSku( + new CapacitySku() + .withName("plpho") + .withTier(CapacitySkuTier.AUTO_PREMIUM_HOST) + .withCapacity(1106219716)) + .withTags(mapOf("ytlmoyrxvwfud", "cmgyud")) + .withAdministration(new DedicatedCapacityAdministrators().withMembers(Arrays.asList())) + .withMode(Mode.GEN2) + .create(); + + Assertions.assertEquals("eyvjusrtslhspkde", response.location()); + Assertions.assertEquals("ofmxagkvtmelmqkr", response.tags().get("ahvljuaha")); + Assertions.assertEquals("rxsbkyvp", response.sku().name()); + Assertions.assertEquals(CapacitySkuTier.PREMIUM, response.sku().tier()); + Assertions.assertEquals(427278595, response.sku().capacity()); + Assertions.assertEquals(Mode.GEN1, response.mode()); + } + + @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/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesDeleteMockTests.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesDeleteMockTests.java new file mode 100644 index 000000000000..d3edb0973c87 --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesDeleteMockTests.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class CapacitiesDeleteMockTests { + @Test + public void testDelete() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = "{}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + PowerBIDedicatedManager manager = + PowerBIDedicatedManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + manager.capacities().delete("ispnqzahmgkbrp", "y", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesGetByResourceGroupWithResponseMockTests.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesGetByResourceGroupWithResponseMockTests.java new file mode 100644 index 000000000000..010bacbec32e --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesGetByResourceGroupWithResponseMockTests.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager; +import com.azure.resourcemanager.powerbidedicated.models.CapacitySkuTier; +import com.azure.resourcemanager.powerbidedicated.models.DedicatedCapacity; +import com.azure.resourcemanager.powerbidedicated.models.Mode; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class CapacitiesGetByResourceGroupWithResponseMockTests { + @Test + public void testGetByResourceGroupWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"sku\":{\"name\":\"frzpwvlqdqgb\",\"tier\":\"AutoPremiumHost\",\"capacity\":878153378},\"properties\":{\"state\":\"Updating\",\"provisioningState\":\"Updating\",\"administration\":{\"members\":[]},\"mode\":\"Gen2\",\"tenantId\":\"civfsnkymuctq\",\"friendlyName\":\"fbebrjcxer\"},\"location\":\"wutttxfvjrbi\",\"tags\":{\"jky\":\"xepcyvahfn\",\"ljyoxgvcltb\":\"xjvuujqgidokg\",\"bijhtxfvgxbf\":\"sncghkjeszz\",\"ec\":\"mxnehmp\"},\"id\":\"godebfqkkrbmpu\",\"name\":\"gr\",\"type\":\"wflzlfbxzpuzy\"}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + PowerBIDedicatedManager manager = + PowerBIDedicatedManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + DedicatedCapacity response = + manager + .capacities() + .getByResourceGroupWithResponse("ewrmjmwvvjektc", "senhwlrs", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("wutttxfvjrbi", response.location()); + Assertions.assertEquals("xepcyvahfn", response.tags().get("jky")); + Assertions.assertEquals("frzpwvlqdqgb", response.sku().name()); + Assertions.assertEquals(CapacitySkuTier.AUTO_PREMIUM_HOST, response.sku().tier()); + Assertions.assertEquals(878153378, response.sku().capacity()); + Assertions.assertEquals(Mode.GEN2, response.mode()); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesListByResourceGroupMockTests.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesListByResourceGroupMockTests.java new file mode 100644 index 000000000000..c7b7063758b9 --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesListByResourceGroupMockTests.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager; +import com.azure.resourcemanager.powerbidedicated.models.CapacitySkuTier; +import com.azure.resourcemanager.powerbidedicated.models.DedicatedCapacity; +import com.azure.resourcemanager.powerbidedicated.models.Mode; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class CapacitiesListByResourceGroupMockTests { + @Test + public void testListByResourceGroup() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"value\":[{\"sku\":{\"name\":\"rcvpnazzmhjrunmp\",\"tier\":\"AutoPremiumHost\",\"capacity\":480744947},\"properties\":{\"state\":\"Resuming\",\"provisioningState\":\"Succeeded\",\"administration\":{\"members\":[]},\"mode\":\"Gen1\",\"tenantId\":\"yskpbhen\",\"friendlyName\":\"kcxywnyt\"},\"location\":\"synlqidybyxczfc\",\"tags\":{\"wrqlfktsthsuco\":\"axdbabph\",\"bt\":\"mnyyazt\",\"ckzywbiexzfeyue\":\"wrqpue\",\"zyoxaepdkzjan\":\"xibxujwbhqwalm\"},\"id\":\"ux\",\"name\":\"hdwbavxbniwdjs\",\"type\":\"zt\"}]}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + PowerBIDedicatedManager manager = + PowerBIDedicatedManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response = + manager.capacities().listByResourceGroup("arbu", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("synlqidybyxczfc", response.iterator().next().location()); + Assertions.assertEquals("axdbabph", response.iterator().next().tags().get("wrqlfktsthsuco")); + Assertions.assertEquals("rcvpnazzmhjrunmp", response.iterator().next().sku().name()); + Assertions.assertEquals(CapacitySkuTier.AUTO_PREMIUM_HOST, response.iterator().next().sku().tier()); + Assertions.assertEquals(480744947, response.iterator().next().sku().capacity()); + Assertions.assertEquals(Mode.GEN1, response.iterator().next().mode()); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesListMockTests.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesListMockTests.java new file mode 100644 index 000000000000..72b6fc97796d --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesListMockTests.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager; +import com.azure.resourcemanager.powerbidedicated.models.CapacitySkuTier; +import com.azure.resourcemanager.powerbidedicated.models.DedicatedCapacity; +import com.azure.resourcemanager.powerbidedicated.models.Mode; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class CapacitiesListMockTests { + @Test + public void testList() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"value\":[{\"sku\":{\"name\":\"dbpgnxytxhp\",\"tier\":\"AutoPremiumHost\",\"capacity\":936315847},\"properties\":{\"state\":\"Resuming\",\"provisioningState\":\"Resuming\",\"administration\":{\"members\":[]},\"mode\":\"Gen1\",\"tenantId\":\"wtctyqi\",\"friendlyName\":\"bbovplwzbhvgyugu\"},\"location\":\"vmkfssxqu\",\"tags\":{\"zkd\":\"plgmgsxnk\"},\"id\":\"slpvlop\",\"name\":\"i\",\"type\":\"ighxpk\"}]}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + PowerBIDedicatedManager manager = + PowerBIDedicatedManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response = manager.capacities().list(com.azure.core.util.Context.NONE); + + Assertions.assertEquals("vmkfssxqu", response.iterator().next().location()); + Assertions.assertEquals("plgmgsxnk", response.iterator().next().tags().get("zkd")); + Assertions.assertEquals("dbpgnxytxhp", response.iterator().next().sku().name()); + Assertions.assertEquals(CapacitySkuTier.AUTO_PREMIUM_HOST, response.iterator().next().sku().tier()); + Assertions.assertEquals(936315847, response.iterator().next().sku().capacity()); + Assertions.assertEquals(Mode.GEN1, response.iterator().next().mode()); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesListSkusForCapacityWithResponseMockTests.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesListSkusForCapacityWithResponseMockTests.java new file mode 100644 index 000000000000..c3f014b04c4d --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesListSkusForCapacityWithResponseMockTests.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager; +import com.azure.resourcemanager.powerbidedicated.models.SkuEnumerationForExistingResourceResult; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class CapacitiesListSkusForCapacityWithResponseMockTests { + @Test + public void testListSkusForCapacityWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = "{\"value\":[{\"resourceType\":\"skrdqmhjj\"},{\"resourceType\":\"ldwkyzxuutkn\"}]}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + PowerBIDedicatedManager manager = + PowerBIDedicatedManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + SkuEnumerationForExistingResourceResult response = + manager + .capacities() + .listSkusForCapacityWithResponse("eojnabc", "hsmtxpsiebtfhvp", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("skrdqmhjj", response.value().get(0).resourceType()); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesListSkusWithResponseMockTests.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesListSkusWithResponseMockTests.java new file mode 100644 index 000000000000..9de3f68b174e --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesListSkusWithResponseMockTests.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager; +import com.azure.resourcemanager.powerbidedicated.models.CapacitySkuTier; +import com.azure.resourcemanager.powerbidedicated.models.SkuEnumerationForNewResourceResult; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class CapacitiesListSkusWithResponseMockTests { + @Test + public void testListSkusWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = "{\"value\":[{\"name\":\"baiuebbaumny\",\"tier\":\"Premium\",\"capacity\":865900212}]}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + PowerBIDedicatedManager manager = + PowerBIDedicatedManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + SkuEnumerationForNewResourceResult response = + manager.capacities().listSkusWithResponse(com.azure.core.util.Context.NONE).getValue(); + + Assertions.assertEquals("baiuebbaumny", response.value().get(0).name()); + Assertions.assertEquals(CapacitySkuTier.PREMIUM, response.value().get(0).tier()); + Assertions.assertEquals(865900212, response.value().get(0).capacity()); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesResumeMockTests.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesResumeMockTests.java new file mode 100644 index 000000000000..9eb842c333d3 --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesResumeMockTests.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class CapacitiesResumeMockTests { + @Test + public void testResume() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = "{}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + PowerBIDedicatedManager manager = + PowerBIDedicatedManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + manager.capacities().resume("buynhijggm", "bfs", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesSuspendMockTests.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesSuspendMockTests.java new file mode 100644 index 000000000000..6a6dd26437ba --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitiesSuspendMockTests.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class CapacitiesSuspendMockTests { + @Test + public void testSuspend() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = "{}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + PowerBIDedicatedManager manager = + PowerBIDedicatedManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + manager.capacities().suspend("hibnuqqkpika", "rgvtqag", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitySkuTests.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitySkuTests.java new file mode 100644 index 000000000000..b359521b932e --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/CapacitySkuTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.powerbidedicated.models.CapacitySku; +import com.azure.resourcemanager.powerbidedicated.models.CapacitySkuTier; +import org.junit.jupiter.api.Assertions; + +public final class CapacitySkuTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CapacitySku model = + BinaryData + .fromString("{\"name\":\"zyf\",\"tier\":\"Premium\",\"capacity\":272665329}") + .toObject(CapacitySku.class); + Assertions.assertEquals("zyf", model.name()); + Assertions.assertEquals(CapacitySkuTier.PREMIUM, model.tier()); + Assertions.assertEquals(272665329, model.capacity()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CapacitySku model = new CapacitySku().withName("zyf").withTier(CapacitySkuTier.PREMIUM).withCapacity(272665329); + model = BinaryData.fromObject(model).toObject(CapacitySku.class); + Assertions.assertEquals("zyf", model.name()); + Assertions.assertEquals(CapacitySkuTier.PREMIUM, model.tier()); + Assertions.assertEquals(272665329, model.capacity()); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/CheckCapacityNameAvailabilityParametersTests.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/CheckCapacityNameAvailabilityParametersTests.java new file mode 100644 index 000000000000..6077db8dbe1d --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/CheckCapacityNameAvailabilityParametersTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.powerbidedicated.models.CheckCapacityNameAvailabilityParameters; +import org.junit.jupiter.api.Assertions; + +public final class CheckCapacityNameAvailabilityParametersTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CheckCapacityNameAvailabilityParameters model = + BinaryData + .fromString("{\"name\":\"vxyqjpkcattpngjc\",\"type\":\"czsqpjhvm\"}") + .toObject(CheckCapacityNameAvailabilityParameters.class); + Assertions.assertEquals("vxyqjpkcattpngjc", model.name()); + Assertions.assertEquals("czsqpjhvm", model.type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CheckCapacityNameAvailabilityParameters model = + new CheckCapacityNameAvailabilityParameters().withName("vxyqjpkcattpngjc").withType("czsqpjhvm"); + model = BinaryData.fromObject(model).toObject(CheckCapacityNameAvailabilityParameters.class); + Assertions.assertEquals("vxyqjpkcattpngjc", model.name()); + Assertions.assertEquals("czsqpjhvm", model.type()); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/CheckCapacityNameAvailabilityResultInnerTests.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/CheckCapacityNameAvailabilityResultInnerTests.java new file mode 100644 index 000000000000..61c20244cbc3 --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/CheckCapacityNameAvailabilityResultInnerTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.powerbidedicated.fluent.models.CheckCapacityNameAvailabilityResultInner; +import org.junit.jupiter.api.Assertions; + +public final class CheckCapacityNameAvailabilityResultInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CheckCapacityNameAvailabilityResultInner model = + BinaryData + .fromString("{\"nameAvailable\":true,\"reason\":\"nysounqe\",\"message\":\"noae\"}") + .toObject(CheckCapacityNameAvailabilityResultInner.class); + Assertions.assertEquals(true, model.nameAvailable()); + Assertions.assertEquals("nysounqe", model.reason()); + Assertions.assertEquals("noae", model.message()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CheckCapacityNameAvailabilityResultInner model = + new CheckCapacityNameAvailabilityResultInner() + .withNameAvailable(true) + .withReason("nysounqe") + .withMessage("noae"); + model = BinaryData.fromObject(model).toObject(CheckCapacityNameAvailabilityResultInner.class); + Assertions.assertEquals(true, model.nameAvailable()); + Assertions.assertEquals("nysounqe", model.reason()); + Assertions.assertEquals("noae", model.message()); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/DedicatedCapacitiesTests.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/DedicatedCapacitiesTests.java new file mode 100644 index 000000000000..2003456752bc --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/DedicatedCapacitiesTests.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.powerbidedicated.fluent.models.DedicatedCapacityInner; +import com.azure.resourcemanager.powerbidedicated.models.CapacitySku; +import com.azure.resourcemanager.powerbidedicated.models.CapacitySkuTier; +import com.azure.resourcemanager.powerbidedicated.models.DedicatedCapacities; +import com.azure.resourcemanager.powerbidedicated.models.Mode; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class DedicatedCapacitiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DedicatedCapacities model = + BinaryData + .fromString( + "{\"value\":[{\"sku\":{\"name\":\"pmqnja\",\"tier\":\"AutoPremiumHost\",\"capacity\":1052966015},\"properties\":{\"state\":\"Scaling\",\"provisioningState\":\"Suspended\",\"mode\":\"Gen2\",\"tenantId\":\"tegjvwmf\",\"friendlyName\":\"t\"},\"location\":\"mdvpjhulsu\",\"tags\":{\"odjpslwejd\":\"kjozkrwfnd\",\"cctazakljlahbc\":\"vwryoqpso\",\"gexpaojakhmsbz\":\"yffdfdos\"},\"id\":\"hcrzevd\",\"name\":\"hlxaolthqtr\",\"type\":\"qjbpfzfsin\"},{\"sku\":{\"name\":\"gvfcj\",\"tier\":\"PBIE_Azure\",\"capacity\":1543108452},\"properties\":{\"state\":\"Provisioning\",\"provisioningState\":\"Resuming\",\"mode\":\"Gen2\",\"tenantId\":\"fziton\",\"friendlyName\":\"qfpjk\"},\"location\":\"xofpdvhpfxxypi\",\"tags\":{\"inuvamiheogn\":\"mayhuybbkpodepoo\",\"usivye\":\"rxzxtheo\",\"nfygxgispemvtz\":\"cciqihnhungbwjz\"},\"id\":\"kufubljo\",\"name\":\"xqeofjaeqjhqjba\",\"type\":\"v\"},{\"sku\":{\"name\":\"smjqulngsntnbyb\",\"tier\":\"PBIE_Azure\",\"capacity\":823404328},\"properties\":{\"state\":\"Failed\",\"provisioningState\":\"Succeeded\",\"mode\":\"Gen2\",\"tenantId\":\"jdous\",\"friendlyName\":\"qvkoc\"},\"location\":\"jdkwtnhxbnjb\",\"tags\":{\"lljfmppeeb\":\"qrglssainqpjwn\",\"yqduujit\":\"mgxsab\",\"rwpdappdsbdkvwrw\":\"jczdzevndh\"},\"id\":\"feusnhut\",\"name\":\"eltmrldhugjzzdat\",\"type\":\"xhocdgeablgphuti\"},{\"sku\":{\"name\":\"ndv\",\"tier\":\"PBIE_Azure\",\"capacity\":563001635},\"properties\":{\"state\":\"Suspended\",\"provisioningState\":\"Succeeded\",\"mode\":\"Gen2\",\"tenantId\":\"rokft\",\"friendlyName\":\"olniwpwcukjf\"},\"location\":\"iawxklry\",\"tags\":{\"sgcbac\":\"ckbasyypndd\",\"zndlikwy\":\"hejkotynqgou\",\"bmadgak\":\"kgfg\"},\"id\":\"qsrxybzqqed\",\"name\":\"ytb\",\"type\":\"iqfouflmmnkz\"}]}") + .toObject(DedicatedCapacities.class); + Assertions.assertEquals("mdvpjhulsu", model.value().get(0).location()); + Assertions.assertEquals("kjozkrwfnd", model.value().get(0).tags().get("odjpslwejd")); + Assertions.assertEquals("pmqnja", model.value().get(0).sku().name()); + Assertions.assertEquals(CapacitySkuTier.AUTO_PREMIUM_HOST, model.value().get(0).sku().tier()); + Assertions.assertEquals(1052966015, model.value().get(0).sku().capacity()); + Assertions.assertEquals(Mode.GEN2, model.value().get(0).mode()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DedicatedCapacities model = + new DedicatedCapacities() + .withValue( + Arrays + .asList( + new DedicatedCapacityInner() + .withLocation("mdvpjhulsu") + .withTags( + mapOf( + "odjpslwejd", + "kjozkrwfnd", + "cctazakljlahbc", + "vwryoqpso", + "gexpaojakhmsbz", + "yffdfdos")) + .withSku( + new CapacitySku() + .withName("pmqnja") + .withTier(CapacitySkuTier.AUTO_PREMIUM_HOST) + .withCapacity(1052966015)) + .withMode(Mode.GEN2), + new DedicatedCapacityInner() + .withLocation("xofpdvhpfxxypi") + .withTags( + mapOf( + "inuvamiheogn", + "mayhuybbkpodepoo", + "usivye", + "rxzxtheo", + "nfygxgispemvtz", + "cciqihnhungbwjz")) + .withSku( + new CapacitySku() + .withName("gvfcj") + .withTier(CapacitySkuTier.PBIE_AZURE) + .withCapacity(1543108452)) + .withMode(Mode.GEN2), + new DedicatedCapacityInner() + .withLocation("jdkwtnhxbnjb") + .withTags( + mapOf( + "lljfmppeeb", + "qrglssainqpjwn", + "yqduujit", + "mgxsab", + "rwpdappdsbdkvwrw", + "jczdzevndh")) + .withSku( + new CapacitySku() + .withName("smjqulngsntnbyb") + .withTier(CapacitySkuTier.PBIE_AZURE) + .withCapacity(823404328)) + .withMode(Mode.GEN2), + new DedicatedCapacityInner() + .withLocation("iawxklry") + .withTags(mapOf("sgcbac", "ckbasyypndd", "zndlikwy", "hejkotynqgou", "bmadgak", "kgfg")) + .withSku( + new CapacitySku() + .withName("ndv") + .withTier(CapacitySkuTier.PBIE_AZURE) + .withCapacity(563001635)) + .withMode(Mode.GEN2))); + model = BinaryData.fromObject(model).toObject(DedicatedCapacities.class); + Assertions.assertEquals("mdvpjhulsu", model.value().get(0).location()); + Assertions.assertEquals("kjozkrwfnd", model.value().get(0).tags().get("odjpslwejd")); + Assertions.assertEquals("pmqnja", model.value().get(0).sku().name()); + Assertions.assertEquals(CapacitySkuTier.AUTO_PREMIUM_HOST, model.value().get(0).sku().tier()); + Assertions.assertEquals(1052966015, model.value().get(0).sku().capacity()); + Assertions.assertEquals(Mode.GEN2, model.value().get(0).mode()); + } + + @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/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/DedicatedCapacityAdministratorsTests.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/DedicatedCapacityAdministratorsTests.java new file mode 100644 index 000000000000..1ea29aa33dad --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/DedicatedCapacityAdministratorsTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.powerbidedicated.models.DedicatedCapacityAdministrators; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class DedicatedCapacityAdministratorsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DedicatedCapacityAdministrators model = + BinaryData + .fromString( + "{\"members\":[\"cyzkohdbihanuf\",\"fcbjysagithxqha\",\"ifpikxwczby\",\"cnpqxuhivyqniwby\"]}") + .toObject(DedicatedCapacityAdministrators.class); + Assertions.assertEquals("cyzkohdbihanuf", model.members().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DedicatedCapacityAdministrators model = + new DedicatedCapacityAdministrators() + .withMembers(Arrays.asList("cyzkohdbihanuf", "fcbjysagithxqha", "ifpikxwczby", "cnpqxuhivyqniwby")); + model = BinaryData.fromObject(model).toObject(DedicatedCapacityAdministrators.class); + Assertions.assertEquals("cyzkohdbihanuf", model.members().get(0)); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/DedicatedCapacityInnerTests.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/DedicatedCapacityInnerTests.java new file mode 100644 index 000000000000..426968b5fa2d --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/DedicatedCapacityInnerTests.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.powerbidedicated.fluent.models.DedicatedCapacityInner; +import com.azure.resourcemanager.powerbidedicated.models.CapacitySku; +import com.azure.resourcemanager.powerbidedicated.models.CapacitySkuTier; +import com.azure.resourcemanager.powerbidedicated.models.DedicatedCapacityAdministrators; +import com.azure.resourcemanager.powerbidedicated.models.Mode; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class DedicatedCapacityInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DedicatedCapacityInner model = + BinaryData + .fromString( + "{\"sku\":{\"name\":\"mmhquvgjxpyb\",\"tier\":\"PBIE_Azure\",\"capacity\":1336465504},\"properties\":{\"state\":\"Suspending\",\"provisioningState\":\"Deleting\",\"administration\":{\"members\":[\"h\",\"upi\",\"gsybbejhp\",\"oycmsxaobhdxbmt\"]},\"mode\":\"Gen2\",\"tenantId\":\"jzehtb\",\"friendlyName\":\"fpownoizhwlr\"},\"location\":\"bqsoqijg\",\"tags\":{\"btcqq\":\"bpazlobcufpdzn\",\"lhqgnufooojy\":\"nq\",\"zlhjxrifkwmrvkt\":\"ifsqesaagdfmg\",\"ajpsquc\":\"izntocipao\"},\"id\":\"poyfdkfogkn\",\"name\":\"gjofjd\",\"type\":\"eqsrdeupewnwreit\"}") + .toObject(DedicatedCapacityInner.class); + Assertions.assertEquals("bqsoqijg", model.location()); + Assertions.assertEquals("bpazlobcufpdzn", model.tags().get("btcqq")); + Assertions.assertEquals("mmhquvgjxpyb", model.sku().name()); + Assertions.assertEquals(CapacitySkuTier.PBIE_AZURE, model.sku().tier()); + Assertions.assertEquals(1336465504, model.sku().capacity()); + Assertions.assertEquals("h", model.administration().members().get(0)); + Assertions.assertEquals(Mode.GEN2, model.mode()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DedicatedCapacityInner model = + new DedicatedCapacityInner() + .withLocation("bqsoqijg") + .withTags( + mapOf( + "btcqq", + "bpazlobcufpdzn", + "lhqgnufooojy", + "nq", + "zlhjxrifkwmrvkt", + "ifsqesaagdfmg", + "ajpsquc", + "izntocipao")) + .withSku( + new CapacitySku() + .withName("mmhquvgjxpyb") + .withTier(CapacitySkuTier.PBIE_AZURE) + .withCapacity(1336465504)) + .withAdministration( + new DedicatedCapacityAdministrators() + .withMembers(Arrays.asList("h", "upi", "gsybbejhp", "oycmsxaobhdxbmt"))) + .withMode(Mode.GEN2); + model = BinaryData.fromObject(model).toObject(DedicatedCapacityInner.class); + Assertions.assertEquals("bqsoqijg", model.location()); + Assertions.assertEquals("bpazlobcufpdzn", model.tags().get("btcqq")); + Assertions.assertEquals("mmhquvgjxpyb", model.sku().name()); + Assertions.assertEquals(CapacitySkuTier.PBIE_AZURE, model.sku().tier()); + Assertions.assertEquals(1336465504, model.sku().capacity()); + Assertions.assertEquals("h", model.administration().members().get(0)); + Assertions.assertEquals(Mode.GEN2, model.mode()); + } + + @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/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/DedicatedCapacityMutablePropertiesTests.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/DedicatedCapacityMutablePropertiesTests.java new file mode 100644 index 000000000000..5ed9243aea6d --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/DedicatedCapacityMutablePropertiesTests.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.powerbidedicated.fluent.models.DedicatedCapacityMutableProperties; +import com.azure.resourcemanager.powerbidedicated.models.DedicatedCapacityAdministrators; +import com.azure.resourcemanager.powerbidedicated.models.Mode; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class DedicatedCapacityMutablePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DedicatedCapacityMutableProperties model = + BinaryData + .fromString( + "{\"administration\":{\"members\":[\"ryuanzwuxzdxtay\",\"lhmwhfpmrqobm\"]},\"mode\":\"Gen2\",\"tenantId\":\"nryrtihf\",\"friendlyName\":\"ijbpzvgnwzsymgl\"}") + .toObject(DedicatedCapacityMutableProperties.class); + Assertions.assertEquals("ryuanzwuxzdxtay", model.administration().members().get(0)); + Assertions.assertEquals(Mode.GEN2, model.mode()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DedicatedCapacityMutableProperties model = + new DedicatedCapacityMutableProperties() + .withAdministration( + new DedicatedCapacityAdministrators() + .withMembers(Arrays.asList("ryuanzwuxzdxtay", "lhmwhfpmrqobm"))) + .withMode(Mode.GEN2); + model = BinaryData.fromObject(model).toObject(DedicatedCapacityMutableProperties.class); + Assertions.assertEquals("ryuanzwuxzdxtay", model.administration().members().get(0)); + Assertions.assertEquals(Mode.GEN2, model.mode()); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/DedicatedCapacityPropertiesTests.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/DedicatedCapacityPropertiesTests.java new file mode 100644 index 000000000000..2a56b947fdd7 --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/DedicatedCapacityPropertiesTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.powerbidedicated.fluent.models.DedicatedCapacityProperties; +import com.azure.resourcemanager.powerbidedicated.models.DedicatedCapacityAdministrators; +import com.azure.resourcemanager.powerbidedicated.models.Mode; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class DedicatedCapacityPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DedicatedCapacityProperties model = + BinaryData + .fromString( + "{\"state\":\"Suspending\",\"provisioningState\":\"Updating\",\"administration\":{\"members\":[\"smy\"]},\"mode\":\"Gen2\",\"tenantId\":\"tmlxhekuksjtx\",\"friendlyName\":\"cdm\"}") + .toObject(DedicatedCapacityProperties.class); + Assertions.assertEquals("smy", model.administration().members().get(0)); + Assertions.assertEquals(Mode.GEN2, model.mode()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DedicatedCapacityProperties model = + new DedicatedCapacityProperties() + .withAdministration(new DedicatedCapacityAdministrators().withMembers(Arrays.asList("smy"))) + .withMode(Mode.GEN2); + model = BinaryData.fromObject(model).toObject(DedicatedCapacityProperties.class); + Assertions.assertEquals("smy", model.administration().members().get(0)); + Assertions.assertEquals(Mode.GEN2, model.mode()); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/DedicatedCapacityUpdateParametersTests.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/DedicatedCapacityUpdateParametersTests.java new file mode 100644 index 000000000000..3ffe6dbe2cd9 --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/DedicatedCapacityUpdateParametersTests.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.powerbidedicated.models.CapacitySku; +import com.azure.resourcemanager.powerbidedicated.models.CapacitySkuTier; +import com.azure.resourcemanager.powerbidedicated.models.DedicatedCapacityAdministrators; +import com.azure.resourcemanager.powerbidedicated.models.DedicatedCapacityUpdateParameters; +import com.azure.resourcemanager.powerbidedicated.models.Mode; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class DedicatedCapacityUpdateParametersTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DedicatedCapacityUpdateParameters model = + BinaryData + .fromString( + "{\"sku\":{\"name\":\"k\",\"tier\":\"Premium\",\"capacity\":832798449},\"tags\":{\"ukxgaud\":\"rtfw\",\"h\":\"cs\"},\"properties\":{\"administration\":{\"members\":[\"ejhkry\",\"tnapczwlokjyemkk\"]},\"mode\":\"Gen2\",\"tenantId\":\"joxzjnchgejspodm\",\"friendlyName\":\"lzydehojwyahux\"}}") + .toObject(DedicatedCapacityUpdateParameters.class); + Assertions.assertEquals("k", model.sku().name()); + Assertions.assertEquals(CapacitySkuTier.PREMIUM, model.sku().tier()); + Assertions.assertEquals(832798449, model.sku().capacity()); + Assertions.assertEquals("rtfw", model.tags().get("ukxgaud")); + Assertions.assertEquals("ejhkry", model.administration().members().get(0)); + Assertions.assertEquals(Mode.GEN2, model.mode()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DedicatedCapacityUpdateParameters model = + new DedicatedCapacityUpdateParameters() + .withSku(new CapacitySku().withName("k").withTier(CapacitySkuTier.PREMIUM).withCapacity(832798449)) + .withTags(mapOf("ukxgaud", "rtfw", "h", "cs")) + .withAdministration( + new DedicatedCapacityAdministrators().withMembers(Arrays.asList("ejhkry", "tnapczwlokjyemkk"))) + .withMode(Mode.GEN2); + model = BinaryData.fromObject(model).toObject(DedicatedCapacityUpdateParameters.class); + Assertions.assertEquals("k", model.sku().name()); + Assertions.assertEquals(CapacitySkuTier.PREMIUM, model.sku().tier()); + Assertions.assertEquals(832798449, model.sku().capacity()); + Assertions.assertEquals("rtfw", model.tags().get("ukxgaud")); + Assertions.assertEquals("ejhkry", model.administration().members().get(0)); + Assertions.assertEquals(Mode.GEN2, model.mode()); + } + + @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/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/LogSpecificationTests.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/LogSpecificationTests.java new file mode 100644 index 000000000000..2602b683a92b --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/LogSpecificationTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.powerbidedicated.models.LogSpecification; +import org.junit.jupiter.api.Assertions; + +public final class LogSpecificationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + LogSpecification model = + BinaryData + .fromString( + "{\"name\":\"mdectehfiqscjey\",\"displayName\":\"hezrkgq\",\"blobDuration\":\"jrefovgmkqsle\"}") + .toObject(LogSpecification.class); + Assertions.assertEquals("hezrkgq", model.displayName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + LogSpecification model = new LogSpecification().withDisplayName("hezrkgq"); + model = BinaryData.fromObject(model).toObject(LogSpecification.class); + Assertions.assertEquals("hezrkgq", model.displayName()); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/MetricSpecificationDimensionsItemTests.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/MetricSpecificationDimensionsItemTests.java new file mode 100644 index 000000000000..8642418b16d7 --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/MetricSpecificationDimensionsItemTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.powerbidedicated.models.MetricSpecificationDimensionsItem; +import org.junit.jupiter.api.Assertions; + +public final class MetricSpecificationDimensionsItemTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MetricSpecificationDimensionsItem model = + BinaryData + .fromString("{\"name\":\"evfyexfwhybcib\",\"displayName\":\"vdcsitynn\"}") + .toObject(MetricSpecificationDimensionsItem.class); + Assertions.assertEquals("vdcsitynn", model.displayName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MetricSpecificationDimensionsItem model = new MetricSpecificationDimensionsItem().withDisplayName("vdcsitynn"); + model = BinaryData.fromObject(model).toObject(MetricSpecificationDimensionsItem.class); + Assertions.assertEquals("vdcsitynn", model.displayName()); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/MetricSpecificationTests.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/MetricSpecificationTests.java new file mode 100644 index 000000000000..c0dae147bed4 --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/MetricSpecificationTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.powerbidedicated.models.MetricSpecification; +import com.azure.resourcemanager.powerbidedicated.models.MetricSpecificationDimensionsItem; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class MetricSpecificationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MetricSpecification model = + BinaryData + .fromString( + "{\"name\":\"ienjbdlwtgr\",\"displayName\":\"djpjumasxazjpq\",\"displayDescription\":\"gual\",\"unit\":\"xxhejjzzvd\",\"aggregationType\":\"gwdslfhotwm\",\"metricFilterPattern\":\"npwlbjnpg\",\"dimensions\":[{\"name\":\"adehxnltyfsopp\",\"displayName\":\"uesnzwdejbavo\"},{\"name\":\"zdmohctbqvu\",\"displayName\":\"xdn\"},{\"name\":\"vo\",\"displayName\":\"ujjugwdkcglh\"},{\"name\":\"azjdyggd\",\"displayName\":\"ixhbkuofqweykhm\"}]}") + .toObject(MetricSpecification.class); + Assertions.assertEquals("djpjumasxazjpq", model.displayName()); + Assertions.assertEquals("gual", model.displayDescription()); + Assertions.assertEquals("uesnzwdejbavo", model.dimensions().get(0).displayName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MetricSpecification model = + new MetricSpecification() + .withDisplayName("djpjumasxazjpq") + .withDisplayDescription("gual") + .withDimensions( + Arrays + .asList( + new MetricSpecificationDimensionsItem().withDisplayName("uesnzwdejbavo"), + new MetricSpecificationDimensionsItem().withDisplayName("xdn"), + new MetricSpecificationDimensionsItem().withDisplayName("ujjugwdkcglh"), + new MetricSpecificationDimensionsItem().withDisplayName("ixhbkuofqweykhm"))); + model = BinaryData.fromObject(model).toObject(MetricSpecification.class); + Assertions.assertEquals("djpjumasxazjpq", model.displayName()); + Assertions.assertEquals("gual", model.displayDescription()); + Assertions.assertEquals("uesnzwdejbavo", model.dimensions().get(0).displayName()); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/OperationDisplayTests.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/OperationDisplayTests.java new file mode 100644 index 000000000000..42c9bc3495ab --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/OperationDisplayTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.powerbidedicated.models.OperationDisplay; +import org.junit.jupiter.api.Assertions; + +public final class OperationDisplayTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationDisplay model = + BinaryData + .fromString( + "{\"provider\":\"pjxsqwpgrjbznor\",\"resource\":\"xv\",\"operation\":\"byxqabn\",\"description\":\"cpc\"}") + .toObject(OperationDisplay.class); + Assertions.assertEquals("cpc", model.description()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OperationDisplay model = new OperationDisplay().withDescription("cpc"); + model = BinaryData.fromObject(model).toObject(OperationDisplay.class); + Assertions.assertEquals("cpc", model.description()); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/OperationInnerTests.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/OperationInnerTests.java new file mode 100644 index 000000000000..69c564a74d77 --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/OperationInnerTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.powerbidedicated.fluent.models.OperationInner; +import com.azure.resourcemanager.powerbidedicated.models.OperationDisplay; +import com.azure.resourcemanager.powerbidedicated.models.OperationProperties; +import com.azure.resourcemanager.powerbidedicated.models.ServiceSpecification; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class OperationInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationInner model = + BinaryData + .fromString( + "{\"name\":\"eiachboosflnr\",\"display\":{\"provider\":\"qpteeh\",\"resource\":\"vypyqrimzinpv\",\"operation\":\"jdkirsoodqx\",\"description\":\"rmnohj\"},\"origin\":\"kwh\",\"properties\":{\"serviceSpecification\":{\"metricSpecifications\":[],\"logSpecifications\":[]}}}") + .toObject(OperationInner.class); + Assertions.assertEquals("rmnohj", model.display().description()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OperationInner model = + new OperationInner() + .withDisplay(new OperationDisplay().withDescription("rmnohj")) + .withProperties( + new OperationProperties() + .withServiceSpecification( + new ServiceSpecification() + .withMetricSpecifications(Arrays.asList()) + .withLogSpecifications(Arrays.asList()))); + model = BinaryData.fromObject(model).toObject(OperationInner.class); + Assertions.assertEquals("rmnohj", model.display().description()); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/OperationListResultTests.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/OperationListResultTests.java new file mode 100644 index 000000000000..1ce356a6317e --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/OperationListResultTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.powerbidedicated.models.OperationListResult; + +public final class OperationListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationListResult model = + BinaryData + .fromString( + "{\"value\":[{\"name\":\"xgjvtbv\",\"display\":{\"provider\":\"szdnr\",\"resource\":\"qguhmuo\",\"operation\":\"f\",\"description\":\"wzwbnguitn\"},\"origin\":\"izgazxu\",\"properties\":{}},{\"name\":\"ckyfih\",\"display\":{\"provider\":\"dfvzwdzuhty\",\"resource\":\"isdkfthwxmnteiw\",\"operation\":\"pvkmijcmmxdcuf\",\"description\":\"srp\"},\"origin\":\"zidnsezcxtbzsgfy\",\"properties\":{}}],\"nextLink\":\"ewmdw\"}") + .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/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/OperationPropertiesTests.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/OperationPropertiesTests.java new file mode 100644 index 000000000000..e80318b2d59e --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/OperationPropertiesTests.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.powerbidedicated.models.LogSpecification; +import com.azure.resourcemanager.powerbidedicated.models.MetricSpecification; +import com.azure.resourcemanager.powerbidedicated.models.OperationProperties; +import com.azure.resourcemanager.powerbidedicated.models.ServiceSpecification; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class OperationPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationProperties model = + BinaryData + .fromString( + "{\"serviceSpecification\":{\"metricSpecifications\":[{\"name\":\"zafb\",\"displayName\":\"j\",\"displayDescription\":\"btoqcjmkljavbqid\",\"unit\":\"ajzyul\",\"aggregationType\":\"u\",\"metricFilterPattern\":\"krlkhbzhfepg\",\"dimensions\":[]},{\"name\":\"e\",\"displayName\":\"locx\",\"displayDescription\":\"paierh\",\"unit\":\"csglum\",\"aggregationType\":\"jtjaodxobnbdxkq\",\"metricFilterPattern\":\"okaj\",\"dimensions\":[]}],\"logSpecifications\":[{\"name\":\"mexgstxgcp\",\"displayName\":\"gmaajrm\",\"blobDuration\":\"jwzrl\"},{\"name\":\"mcl\",\"displayName\":\"ijcoejctb\",\"blobDuration\":\"qsqsy\"},{\"name\":\"kbfkg\",\"displayName\":\"dkexxppofm\",\"blobDuration\":\"x\"},{\"name\":\"jpgd\",\"displayName\":\"ocjjxhvpmouexh\",\"blobDuration\":\"xibqeojnx\"}]}}") + .toObject(OperationProperties.class); + Assertions.assertEquals("j", model.serviceSpecification().metricSpecifications().get(0).displayName()); + Assertions + .assertEquals( + "btoqcjmkljavbqid", model.serviceSpecification().metricSpecifications().get(0).displayDescription()); + Assertions.assertEquals("gmaajrm", model.serviceSpecification().logSpecifications().get(0).displayName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OperationProperties model = + new OperationProperties() + .withServiceSpecification( + new ServiceSpecification() + .withMetricSpecifications( + Arrays + .asList( + new MetricSpecification() + .withDisplayName("j") + .withDisplayDescription("btoqcjmkljavbqid") + .withDimensions(Arrays.asList()), + new MetricSpecification() + .withDisplayName("locx") + .withDisplayDescription("paierh") + .withDimensions(Arrays.asList()))) + .withLogSpecifications( + Arrays + .asList( + new LogSpecification().withDisplayName("gmaajrm"), + new LogSpecification().withDisplayName("ijcoejctb"), + new LogSpecification().withDisplayName("dkexxppofm"), + new LogSpecification().withDisplayName("ocjjxhvpmouexh")))); + model = BinaryData.fromObject(model).toObject(OperationProperties.class); + Assertions.assertEquals("j", model.serviceSpecification().metricSpecifications().get(0).displayName()); + Assertions + .assertEquals( + "btoqcjmkljavbqid", model.serviceSpecification().metricSpecifications().get(0).displayDescription()); + Assertions.assertEquals("gmaajrm", model.serviceSpecification().logSpecifications().get(0).displayName()); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/OperationsListMockTests.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/OperationsListMockTests.java new file mode 100644 index 000000000000..649161f27390 --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/OperationsListMockTests.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager; +import com.azure.resourcemanager.powerbidedicated.models.Operation; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class OperationsListMockTests { + @Test + public void testList() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"value\":[{\"name\":\"rqhakauha\",\"display\":{\"provider\":\"fwxosowzxcu\",\"resource\":\"cjooxdjebwpucwwf\",\"operation\":\"vbvmeu\",\"description\":\"ivyhzceuojgjrwju\"},\"origin\":\"otwmcdyt\",\"properties\":{\"serviceSpecification\":{\"metricSpecifications\":[],\"logSpecifications\":[]}}}]}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + PowerBIDedicatedManager manager = + PowerBIDedicatedManager + .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); + + Assertions.assertEquals("ivyhzceuojgjrwju", response.iterator().next().display().description()); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/ServiceSpecificationTests.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/ServiceSpecificationTests.java new file mode 100644 index 000000000000..20a075a1b6b4 --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/ServiceSpecificationTests.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.powerbidedicated.models.LogSpecification; +import com.azure.resourcemanager.powerbidedicated.models.MetricSpecification; +import com.azure.resourcemanager.powerbidedicated.models.ServiceSpecification; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ServiceSpecificationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ServiceSpecification model = + BinaryData + .fromString( + "{\"metricSpecifications\":[{\"name\":\"ddntwndei\",\"displayName\":\"twnpzaoqvuhrhcf\",\"displayDescription\":\"yd\",\"unit\":\"lmjthjq\",\"aggregationType\":\"pyeicxm\",\"metricFilterPattern\":\"iwqvhkh\",\"dimensions\":[]},{\"name\":\"gdtopbobjogh\",\"displayName\":\"w\",\"displayDescription\":\"m\",\"unit\":\"hrzayvvtpgvdf\",\"aggregationType\":\"otkftutqxlngx\",\"metricFilterPattern\":\"fgugnxkrxdqmid\",\"dimensions\":[]},{\"name\":\"rvqdra\",\"displayName\":\"jybige\",\"displayDescription\":\"qfbow\",\"unit\":\"anyktzlcuiywg\",\"aggregationType\":\"wgndrvynhzgpp\",\"metricFilterPattern\":\"cgyncocpecf\",\"dimensions\":[]},{\"name\":\"oo\",\"displayName\":\"xlzevgbmqjqabcy\",\"displayDescription\":\"ivkwlzuvccfwnfnb\",\"unit\":\"fionl\",\"aggregationType\":\"x\",\"metricFilterPattern\":\"qgtz\",\"dimensions\":[]}],\"logSpecifications\":[{\"name\":\"qqwx\",\"displayName\":\"feallnwsu\",\"blobDuration\":\"snjampmng\"},{\"name\":\"scxaq\",\"displayName\":\"ochcbonqvpkvl\",\"blobDuration\":\"njeaseipheofloke\"}]}") + .toObject(ServiceSpecification.class); + Assertions.assertEquals("twnpzaoqvuhrhcf", model.metricSpecifications().get(0).displayName()); + Assertions.assertEquals("yd", model.metricSpecifications().get(0).displayDescription()); + Assertions.assertEquals("feallnwsu", model.logSpecifications().get(0).displayName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ServiceSpecification model = + new ServiceSpecification() + .withMetricSpecifications( + Arrays + .asList( + new MetricSpecification() + .withDisplayName("twnpzaoqvuhrhcf") + .withDisplayDescription("yd") + .withDimensions(Arrays.asList()), + new MetricSpecification() + .withDisplayName("w") + .withDisplayDescription("m") + .withDimensions(Arrays.asList()), + new MetricSpecification() + .withDisplayName("jybige") + .withDisplayDescription("qfbow") + .withDimensions(Arrays.asList()), + new MetricSpecification() + .withDisplayName("xlzevgbmqjqabcy") + .withDisplayDescription("ivkwlzuvccfwnfnb") + .withDimensions(Arrays.asList()))) + .withLogSpecifications( + Arrays + .asList( + new LogSpecification().withDisplayName("feallnwsu"), + new LogSpecification().withDisplayName("ochcbonqvpkvl"))); + model = BinaryData.fromObject(model).toObject(ServiceSpecification.class); + Assertions.assertEquals("twnpzaoqvuhrhcf", model.metricSpecifications().get(0).displayName()); + Assertions.assertEquals("yd", model.metricSpecifications().get(0).displayDescription()); + Assertions.assertEquals("feallnwsu", model.logSpecifications().get(0).displayName()); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/SkuDetailsForExistingResourceTests.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/SkuDetailsForExistingResourceTests.java new file mode 100644 index 000000000000..c9510b7d8674 --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/SkuDetailsForExistingResourceTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.powerbidedicated.models.CapacitySku; +import com.azure.resourcemanager.powerbidedicated.models.CapacitySkuTier; +import com.azure.resourcemanager.powerbidedicated.models.SkuDetailsForExistingResource; +import org.junit.jupiter.api.Assertions; + +public final class SkuDetailsForExistingResourceTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SkuDetailsForExistingResource model = + BinaryData + .fromString( + "{\"resourceType\":\"jysvl\",\"sku\":{\"name\":\"uvfqawrlyxwj\",\"tier\":\"AutoPremiumHost\",\"capacity\":2115233391}}") + .toObject(SkuDetailsForExistingResource.class); + Assertions.assertEquals("jysvl", model.resourceType()); + Assertions.assertEquals("uvfqawrlyxwj", model.sku().name()); + Assertions.assertEquals(CapacitySkuTier.AUTO_PREMIUM_HOST, model.sku().tier()); + Assertions.assertEquals(2115233391, model.sku().capacity()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SkuDetailsForExistingResource model = + new SkuDetailsForExistingResource() + .withResourceType("jysvl") + .withSku( + new CapacitySku() + .withName("uvfqawrlyxwj") + .withTier(CapacitySkuTier.AUTO_PREMIUM_HOST) + .withCapacity(2115233391)); + model = BinaryData.fromObject(model).toObject(SkuDetailsForExistingResource.class); + Assertions.assertEquals("jysvl", model.resourceType()); + Assertions.assertEquals("uvfqawrlyxwj", model.sku().name()); + Assertions.assertEquals(CapacitySkuTier.AUTO_PREMIUM_HOST, model.sku().tier()); + Assertions.assertEquals(2115233391, model.sku().capacity()); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/SkuEnumerationForExistingResourceResultInnerTests.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/SkuEnumerationForExistingResourceResultInnerTests.java new file mode 100644 index 000000000000..dca60cddcfaa --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/SkuEnumerationForExistingResourceResultInnerTests.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.powerbidedicated.fluent.models.SkuEnumerationForExistingResourceResultInner; +import com.azure.resourcemanager.powerbidedicated.models.CapacitySku; +import com.azure.resourcemanager.powerbidedicated.models.CapacitySkuTier; +import com.azure.resourcemanager.powerbidedicated.models.SkuDetailsForExistingResource; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class SkuEnumerationForExistingResourceResultInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SkuEnumerationForExistingResourceResultInner model = + BinaryData + .fromString( + "{\"value\":[{\"resourceType\":\"umkdosvqwhbmd\",\"sku\":{\"name\":\"bjf\",\"tier\":\"PBIE_Azure\",\"capacity\":1359237516}},{\"resourceType\":\"bexppb\",\"sku\":{\"name\":\"q\",\"tier\":\"Premium\",\"capacity\":1825167031}},{\"resourceType\":\"fpsalgbqu\",\"sku\":{\"name\":\"gjyjgzjaoyfhrtxi\",\"tier\":\"PBIE_Azure\",\"capacity\":1275359394}}]}") + .toObject(SkuEnumerationForExistingResourceResultInner.class); + Assertions.assertEquals("umkdosvqwhbmd", model.value().get(0).resourceType()); + Assertions.assertEquals("bjf", model.value().get(0).sku().name()); + Assertions.assertEquals(CapacitySkuTier.PBIE_AZURE, model.value().get(0).sku().tier()); + Assertions.assertEquals(1359237516, model.value().get(0).sku().capacity()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SkuEnumerationForExistingResourceResultInner model = + new SkuEnumerationForExistingResourceResultInner() + .withValue( + Arrays + .asList( + new SkuDetailsForExistingResource() + .withResourceType("umkdosvqwhbmd") + .withSku( + new CapacitySku() + .withName("bjf") + .withTier(CapacitySkuTier.PBIE_AZURE) + .withCapacity(1359237516)), + new SkuDetailsForExistingResource() + .withResourceType("bexppb") + .withSku( + new CapacitySku() + .withName("q") + .withTier(CapacitySkuTier.PREMIUM) + .withCapacity(1825167031)), + new SkuDetailsForExistingResource() + .withResourceType("fpsalgbqu") + .withSku( + new CapacitySku() + .withName("gjyjgzjaoyfhrtxi") + .withTier(CapacitySkuTier.PBIE_AZURE) + .withCapacity(1275359394)))); + model = BinaryData.fromObject(model).toObject(SkuEnumerationForExistingResourceResultInner.class); + Assertions.assertEquals("umkdosvqwhbmd", model.value().get(0).resourceType()); + Assertions.assertEquals("bjf", model.value().get(0).sku().name()); + Assertions.assertEquals(CapacitySkuTier.PBIE_AZURE, model.value().get(0).sku().tier()); + Assertions.assertEquals(1359237516, model.value().get(0).sku().capacity()); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/SkuEnumerationForNewResourceResultInnerTests.java b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/SkuEnumerationForNewResourceResultInnerTests.java new file mode 100644 index 000000000000..71c4031ef1b3 --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/java/com/azure/resourcemanager/powerbidedicated/generated/SkuEnumerationForNewResourceResultInnerTests.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.powerbidedicated.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.powerbidedicated.fluent.models.SkuEnumerationForNewResourceResultInner; +import com.azure.resourcemanager.powerbidedicated.models.CapacitySku; +import com.azure.resourcemanager.powerbidedicated.models.CapacitySkuTier; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class SkuEnumerationForNewResourceResultInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SkuEnumerationForNewResourceResultInner model = + BinaryData + .fromString( + "{\"value\":[{\"name\":\"dmgloug\",\"tier\":\"AutoPremiumHost\",\"capacity\":815963973},{\"name\":\"mutduqktaps\",\"tier\":\"AutoPremiumHost\",\"capacity\":1678823592}]}") + .toObject(SkuEnumerationForNewResourceResultInner.class); + Assertions.assertEquals("dmgloug", model.value().get(0).name()); + Assertions.assertEquals(CapacitySkuTier.AUTO_PREMIUM_HOST, model.value().get(0).tier()); + Assertions.assertEquals(815963973, model.value().get(0).capacity()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SkuEnumerationForNewResourceResultInner model = + new SkuEnumerationForNewResourceResultInner() + .withValue( + Arrays + .asList( + new CapacitySku() + .withName("dmgloug") + .withTier(CapacitySkuTier.AUTO_PREMIUM_HOST) + .withCapacity(815963973), + new CapacitySku() + .withName("mutduqktaps") + .withTier(CapacitySkuTier.AUTO_PREMIUM_HOST) + .withCapacity(1678823592))); + model = BinaryData.fromObject(model).toObject(SkuEnumerationForNewResourceResultInner.class); + Assertions.assertEquals("dmgloug", model.value().get(0).name()); + Assertions.assertEquals(CapacitySkuTier.AUTO_PREMIUM_HOST, model.value().get(0).tier()); + Assertions.assertEquals(815963973, model.value().get(0).capacity()); + } +} diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker new file mode 100644 index 000000000000..1f0955d450f0 --- /dev/null +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker @@ -0,0 +1 @@ +mock-maker-inline