From bd5e70b4662a8710fed5075f767951a44b6b30bd Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Thu, 18 Sep 2025 15:09:35 +0800 Subject: [PATCH] mgmt, remove computerecommender --- eng/versioning/version_client.txt | 1 - pom.xml | 1 - .../CHANGELOG.md | 18 - .../README.md | 102 ------ .../SAMPLE.md | 100 ------ .../pom.xml | 74 ---- .../ComputeRecommenderManager.java | 298 ---------------- .../ComputeRecommenderManagementClient.java | 62 ---- .../fluent/OperationsClient.java | 40 --- .../fluent/SpotPlacementScoresClient.java | 73 ---- .../models/ComputeDiagnosticBaseInner.java | 155 --------- .../fluent/models/OperationInner.java | 161 --------- .../SpotPlacementScoresResponseInner.java | 169 --------- .../fluent/models/package-info.java | 9 - .../fluent/package-info.java | 9 - .../ComputeDiagnosticBaseImpl.java | 50 --- ...uteRecommenderManagementClientBuilder.java | 138 -------- ...omputeRecommenderManagementClientImpl.java | 324 ------------------ .../implementation/OperationImpl.java | 51 --- .../implementation/OperationsClientImpl.java | 284 --------------- .../implementation/OperationsImpl.java | 45 --- .../implementation/ResourceManagerUtils.java | 195 ----------- .../SpotPlacementScoresClientImpl.java | 304 ---------------- .../SpotPlacementScoresImpl.java | 79 ----- .../SpotPlacementScoresResponseImpl.java | 67 ---- .../models/OperationListResult.java | 113 ------ .../implementation/package-info.java | 9 - .../computerecommender/models/ActionType.java | 46 --- .../models/ComputeDiagnosticBase.java | 55 --- .../models/DiagnosticProperties.java | 85 ----- .../computerecommender/models/Operation.java | 58 ---- .../models/OperationDisplay.java | 136 -------- .../computerecommender/models/Operations.java | 35 -- .../computerecommender/models/Origin.java | 57 --- .../models/PlacementScore.java | 152 -------- .../models/ResourceSize.java | 93 ----- .../models/SpotPlacementScores.java | 64 ---- .../models/SpotPlacementScoresInput.java | 184 ---------- .../models/SpotPlacementScoresResponse.java | 57 --- .../models/package-info.java | 9 - .../computerecommender/package-info.java | 9 - .../src/main/java/module-info.java | 16 - ...computerecommender_apiview_properties.json | 25 -- ...cemanager-computerecommender_metadata.json | 1 - .../proxy-config.json | 1 - .../reflect-config.json | 1 - ...ourcemanager-computerecommender.properties | 1 - .../generated/OperationsListSamples.java | 36 -- .../SpotPlacementScoresGetSamples.java | 23 -- .../SpotPlacementScoresPostSamples.java | 33 -- .../ComputeDiagnosticBaseInnerTests.java | 19 - .../generated/DiagnosticPropertiesTests.java | 18 - .../generated/OperationDisplayTests.java | 17 - .../generated/OperationInnerTests.java | 17 - .../generated/OperationListResultTests.java | 19 - .../generated/OperationsListMockTests.java | 36 -- .../generated/PlacementScoreTests.java | 23 -- .../generated/ResourceSizeTests.java | 24 -- ...acementScoresGetWithResponseMockTests.java | 38 -- .../SpotPlacementScoresInputTests.java | 40 --- ...cementScoresPostWithResponseMockTests.java | 55 --- ...SpotPlacementScoresResponseInnerTests.java | 27 -- .../tsp-location.yaml | 4 - sdk/computerecommender/ci.yml | 46 --- sdk/computerecommender/pom.xml | 15 - 65 files changed, 4506 deletions(-) delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/CHANGELOG.md delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/README.md delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/SAMPLE.md delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/pom.xml delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/ComputeRecommenderManager.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/ComputeRecommenderManagementClient.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/OperationsClient.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/SpotPlacementScoresClient.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/models/ComputeDiagnosticBaseInner.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/models/OperationInner.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/models/SpotPlacementScoresResponseInner.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/models/package-info.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/package-info.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/ComputeDiagnosticBaseImpl.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/ComputeRecommenderManagementClientBuilder.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/ComputeRecommenderManagementClientImpl.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/OperationImpl.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/OperationsClientImpl.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/OperationsImpl.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/ResourceManagerUtils.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/SpotPlacementScoresClientImpl.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/SpotPlacementScoresImpl.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/SpotPlacementScoresResponseImpl.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/models/OperationListResult.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/package-info.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/ActionType.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/ComputeDiagnosticBase.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/DiagnosticProperties.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/Operation.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/OperationDisplay.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/Operations.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/Origin.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/PlacementScore.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/ResourceSize.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/SpotPlacementScores.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/SpotPlacementScoresInput.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/SpotPlacementScoresResponse.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/package-info.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/package-info.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/module-info.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/resources/META-INF/azure-resourcemanager-computerecommender_apiview_properties.json delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/resources/META-INF/azure-resourcemanager-computerecommender_metadata.json delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-computerecommender/proxy-config.json delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-computerecommender/reflect-config.json delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/resources/azure-resourcemanager-computerecommender.properties delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/samples/java/com/azure/resourcemanager/computerecommender/generated/OperationsListSamples.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/samples/java/com/azure/resourcemanager/computerecommender/generated/SpotPlacementScoresGetSamples.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/samples/java/com/azure/resourcemanager/computerecommender/generated/SpotPlacementScoresPostSamples.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/ComputeDiagnosticBaseInnerTests.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/DiagnosticPropertiesTests.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/OperationDisplayTests.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/OperationInnerTests.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/OperationListResultTests.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/OperationsListMockTests.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/PlacementScoreTests.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/ResourceSizeTests.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/SpotPlacementScoresGetWithResponseMockTests.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/SpotPlacementScoresInputTests.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/SpotPlacementScoresPostWithResponseMockTests.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/SpotPlacementScoresResponseInnerTests.java delete mode 100644 sdk/computerecommender/azure-resourcemanager-computerecommender/tsp-location.yaml delete mode 100644 sdk/computerecommender/ci.yml delete mode 100644 sdk/computerecommender/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 826f9d250dbb..11f192f5febe 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -506,7 +506,6 @@ com.azure.resourcemanager:azure-resourcemanager-playwright;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-containerservicesafeguards;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-azurestackhci-vm;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-workloadorchestration;1.0.0-beta.1;1.0.0-beta.2 -com.azure.resourcemanager:azure-resourcemanager-computerecommender;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-disconnectedoperations;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0;1.1.0-beta.1 diff --git a/pom.xml b/pom.xml index b8e56b6ce993..b0b7811b4d2e 100644 --- a/pom.xml +++ b/pom.xml @@ -51,7 +51,6 @@ sdk/communication sdk/compute sdk/computefleet - sdk/computerecommender sdk/computeschedule sdk/confidentialledger sdk/confluent diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/CHANGELOG.md b/sdk/computerecommender/azure-resourcemanager-computerecommender/CHANGELOG.md deleted file mode 100644 index db3ad396ebd7..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/CHANGELOG.md +++ /dev/null @@ -1,18 +0,0 @@ -# Release History - -## 1.0.0-beta.2 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 1.0.0-beta.1 (2025-08-29) - -- Azure Resource Manager Compute Recommender client library for Java. This package contains Microsoft Azure SDK for Compute Recommender Management SDK. The Compute Recommender Resource Provider Client. Package api-version 2025-06-05. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). -### Features Added - -- Initial release for the azure-resourcemanager-computerecommender Java SDK. diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/README.md b/sdk/computerecommender/azure-resourcemanager-computerecommender/README.md deleted file mode 100644 index ab1a84056b3f..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/README.md +++ /dev/null @@ -1,102 +0,0 @@ -# Azure Resource Manager Compute Recommender client library for Java - -Azure Resource Manager Compute Recommender client library for Java. - -This package contains Microsoft Azure SDK for Compute Recommender Management SDK. The Compute Recommender Resource Provider Client. Package api-version 2025-06-05. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). - -## We'd love to hear your feedback - -We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. - -If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. - -Thank you in advance for your collaboration. We really appreciate your time! - -## Documentation - -Various documentation is available to help you get started - -- [API reference documentation][docs] - -## Getting started - -### Prerequisites - -- [Java Development Kit (JDK)][jdk] with version 8 or above -- [Azure Subscription][azure_subscription] - -### Adding the package to your product - -[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-computerecommender;current}) -```xml - - com.azure.resourcemanager - azure-resourcemanager-computerecommender - 1.0.0-beta.1 - -``` -[//]: # ({x-version-update-end}) - -### Include the recommended packages - -Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. - -[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. - -### Authentication - -Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package. - -Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. - -Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: - -```java -AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); -TokenCredential credential = new DefaultAzureCredentialBuilder() - .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) - .build(); -ComputeRecommenderManager manager = ComputeRecommenderManager - .authenticate(credential, profile); -``` - -The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. - -See [Authentication][authenticate] for more options. - -## Key concepts - -See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. - -## Examples - -[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/computerecommender/azure-resourcemanager-computerecommender/SAMPLE.md) - - -## Troubleshooting - -## Next steps - -## Contributing - -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. - -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 -[docs]: https://azure.github.io/azure-sdk-for-java/ -[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ -[azure_subscription]: https://azure.microsoft.com/free/ -[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity -[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials -[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/computerecommender/azure-resourcemanager-computerecommender/SAMPLE.md b/sdk/computerecommender/azure-resourcemanager-computerecommender/SAMPLE.md deleted file mode 100644 index 5adb0dde61c3..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/SAMPLE.md +++ /dev/null @@ -1,100 +0,0 @@ -# Code snippets and samples - - -## Operations - -- [List](#operations_list) - -## SpotPlacementScores - -- [Get](#spotplacementscores_get) -- [Post](#spotplacementscores_post) -### Operations_List - -```java -/** - * Samples for Operations List. - */ -public final class OperationsListSamples { - /* - * x-ms-original-file: 2025-06-05/Operations_List_MinimumSet_Gen.json - */ - /** - * Sample code: Operations_List_MinimumSet_Gen. - * - * @param manager Entry point to ComputeRecommenderManager. - */ - public static void - operationsListMinimumSetGen(com.azure.resourcemanager.computerecommender.ComputeRecommenderManager manager) { - manager.operations().list(com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: 2025-06-05/Operations_List_MaximumSet_Gen.json - */ - /** - * Sample code: Operations_List_MaximumSet_Gen. - * - * @param manager Entry point to ComputeRecommenderManager. - */ - public static void - operationsListMaximumSetGen(com.azure.resourcemanager.computerecommender.ComputeRecommenderManager manager) { - manager.operations().list(com.azure.core.util.Context.NONE); - } -} -``` - -### SpotPlacementScores_Get - -```java -/** - * Samples for SpotPlacementScores Get. - */ -public final class SpotPlacementScoresGetSamples { - /* - * x-ms-original-file: 2025-06-05/GetSpotPlacementScores.json - */ - /** - * Sample code: Gets the metadata of Spot Placement Scores. - * - * @param manager Entry point to ComputeRecommenderManager. - */ - public static void getsTheMetadataOfSpotPlacementScores( - com.azure.resourcemanager.computerecommender.ComputeRecommenderManager manager) { - manager.spotPlacementScores().getWithResponse("eastus", com.azure.core.util.Context.NONE); - } -} -``` - -### SpotPlacementScores_Post - -```java -import com.azure.resourcemanager.computerecommender.models.ResourceSize; -import com.azure.resourcemanager.computerecommender.models.SpotPlacementScoresInput; -import java.util.Arrays; - -/** - * Samples for SpotPlacementScores Post. - */ -public final class SpotPlacementScoresPostSamples { - /* - * x-ms-original-file: 2025-06-05/GenerateSpotPlacementScores.json - */ - /** - * Sample code: Returns spot VM placement scores for given configurations. - * - * @param manager Entry point to ComputeRecommenderManager. - */ - public static void returnsSpotVMPlacementScoresForGivenConfigurations( - com.azure.resourcemanager.computerecommender.ComputeRecommenderManager manager) { - manager.spotPlacementScores() - .postWithResponse("eastus", - new SpotPlacementScoresInput().withDesiredLocations(Arrays.asList("eastus", "eastus2")) - .withDesiredSizes(Arrays.asList(new ResourceSize().withSku("Standard_D2_v2"))) - .withDesiredCount(1) - .withAvailabilityZones(true), - com.azure.core.util.Context.NONE); - } -} -``` - diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/pom.xml b/sdk/computerecommender/azure-resourcemanager-computerecommender/pom.xml deleted file mode 100644 index 7d89368aadbb..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/pom.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - - - com.azure.resourcemanager - azure-resourcemanager-computerecommender - 1.0.0-beta.2 - jar - - Microsoft Azure SDK for Compute Recommender Management - This package contains Microsoft Azure SDK for Compute Recommender Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Compute Recommender Resource Provider Client. Package api-version 2025-06-05. - https://github.com/Azure/azure-sdk-for-java - - - - 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 - 0 - 0 - true - - - - com.azure - azure-core - 1.56.1 - - - com.azure - azure-core-management - 1.19.1 - - - com.azure - azure-core-test - 1.27.0-beta.12 - test - - - com.azure - azure-identity - 1.18.0 - test - - - diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/ComputeRecommenderManager.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/ComputeRecommenderManager.java deleted file mode 100644 index 83bbf486a8a9..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/ComputeRecommenderManager.java +++ /dev/null @@ -1,298 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender; - -import com.azure.core.credential.TokenCredential; -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.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -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.profile.AzureProfile; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.computerecommender.fluent.ComputeRecommenderManagementClient; -import com.azure.resourcemanager.computerecommender.implementation.ComputeRecommenderManagementClientBuilder; -import com.azure.resourcemanager.computerecommender.implementation.OperationsImpl; -import com.azure.resourcemanager.computerecommender.implementation.SpotPlacementScoresImpl; -import com.azure.resourcemanager.computerecommender.models.Operations; -import com.azure.resourcemanager.computerecommender.models.SpotPlacementScores; -import java.time.Duration; -import java.time.temporal.ChronoUnit; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -/** - * Entry point to ComputeRecommenderManager. - * The Compute Recommender Resource Provider Client. - */ -public final class ComputeRecommenderManager { - private Operations operations; - - private SpotPlacementScores spotPlacementScores; - - private final ComputeRecommenderManagementClient clientObject; - - private ComputeRecommenderManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { - Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - this.clientObject = new ComputeRecommenderManagementClientBuilder().pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(profile.getSubscriptionId()) - .defaultPollInterval(defaultPollInterval) - .buildClient(); - } - - /** - * Creates an instance of Compute Recommender service API entry point. - * - * @param credential the credential to use. - * @param profile the Azure profile for client. - * @return the Compute Recommender service API instance. - */ - public static ComputeRecommenderManager authenticate(TokenCredential credential, AzureProfile profile) { - Objects.requireNonNull(credential, "'credential' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return configure().authenticate(credential, profile); - } - - /** - * Creates an instance of Compute Recommender service API entry point. - * - * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. - * @param profile the Azure profile for client. - * @return the Compute Recommender service API instance. - */ - public static ComputeRecommenderManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { - Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return new ComputeRecommenderManager(httpPipeline, profile, null); - } - - /** - * Gets a Configurable instance that can be used to create ComputeRecommenderManager with optional configuration. - * - * @return the Configurable instance allowing configurations. - */ - public static Configurable configure() { - return new ComputeRecommenderManager.Configurable(); - } - - /** - * The Configurable allowing configurations to be set. - */ - public static final class Configurable { - private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); - private static final String SDK_VERSION = "version"; - private static final Map PROPERTIES - = CoreUtils.getProperties("azure-resourcemanager-computerecommender.properties"); - - 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() { - } - - /** - * Sets the http client. - * - * @param httpClient the HTTP client. - * @return the configurable object itself. - */ - public Configurable withHttpClient(HttpClient httpClient) { - this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); - return this; - } - - /** - * Sets the logging options to the HTTP pipeline. - * - * @param httpLogOptions the HTTP log options. - * @return the configurable object itself. - */ - public Configurable withLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); - return this; - } - - /** - * Adds the pipeline policy to the HTTP pipeline. - * - * @param policy the HTTP pipeline policy. - * @return the configurable object itself. - */ - public Configurable withPolicy(HttpPipelinePolicy policy) { - this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); - 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. - * - * @param retryPolicy the HTTP pipeline retry policy. - * @return the configurable object itself. - */ - public Configurable withRetryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); - 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. - * - * @param defaultPollInterval the default poll interval. - * @return the configurable object itself. - */ - public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval - = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); - if (this.defaultPollInterval.isNegative()) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); - } - return this; - } - - /** - * Creates an instance of Compute Recommender service API entry point. - * - * @param credential the credential to use. - * @param profile the Azure profile for client. - * @return the Compute Recommender service API instance. - */ - public ComputeRecommenderManager authenticate(TokenCredential credential, AzureProfile profile) { - Objects.requireNonNull(credential, "'credential' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - - StringBuilder userAgentBuilder = new StringBuilder(); - userAgentBuilder.append("azsdk-java") - .append("-") - .append("com.azure.resourcemanager.computerecommender") - .append("/") - .append(clientVersion); - if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { - userAgentBuilder.append(" (") - .append(Configuration.getGlobalConfiguration().get("java.version")) - .append("; ") - .append(Configuration.getGlobalConfiguration().get("os.name")) - .append("; ") - .append(Configuration.getGlobalConfiguration().get("os.version")) - .append("; auto-generated)"); - } else { - userAgentBuilder.append(" (auto-generated)"); - } - - if (scopes.isEmpty()) { - scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); - } - if (retryPolicy == null) { - 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 BearerTokenAuthenticationPolicy(credential, scopes.toArray(new String[0]))); - 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 = new HttpPipelineBuilder().httpClient(httpClient) - .policies(policies.toArray(new HttpPipelinePolicy[0])) - .build(); - return new ComputeRecommenderManager(httpPipeline, profile, defaultPollInterval); - } - } - - /** - * Gets the resource collection API of Operations. - * - * @return Resource collection API of Operations. - */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(clientObject.getOperations(), this); - } - return operations; - } - - /** - * Gets the resource collection API of SpotPlacementScores. - * - * @return Resource collection API of SpotPlacementScores. - */ - public SpotPlacementScores spotPlacementScores() { - if (this.spotPlacementScores == null) { - this.spotPlacementScores = new SpotPlacementScoresImpl(clientObject.getSpotPlacementScores(), this); - } - return spotPlacementScores; - } - - /** - * Gets wrapped service client ComputeRecommenderManagementClient providing direct access to the underlying - * auto-generated API implementation, based on Azure REST API. - * - * @return Wrapped service client ComputeRecommenderManagementClient. - */ - public ComputeRecommenderManagementClient serviceClient() { - return this.clientObject; - } -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/ComputeRecommenderManagementClient.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/ComputeRecommenderManagementClient.java deleted file mode 100644 index 409c8f438cc1..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/ComputeRecommenderManagementClient.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.fluent; - -import com.azure.core.http.HttpPipeline; -import java.time.Duration; - -/** - * The interface for ComputeRecommenderManagementClient class. - */ -public interface ComputeRecommenderManagementClient { - /** - * Gets Service host. - * - * @return the endpoint value. - */ - String getEndpoint(); - - /** - * Gets Version parameter. - * - * @return the apiVersion value. - */ - String getApiVersion(); - - /** - * Gets The ID of the target subscription. The value must be an UUID. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - HttpPipeline getHttpPipeline(); - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - Duration getDefaultPollInterval(); - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - OperationsClient getOperations(); - - /** - * Gets the SpotPlacementScoresClient object to access its operations. - * - * @return the SpotPlacementScoresClient object. - */ - SpotPlacementScoresClient getSpotPlacementScores(); -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/OperationsClient.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/OperationsClient.java deleted file mode 100644 index 1aaf9e946bc6..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/OperationsClient.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.computerecommender.fluent.models.OperationInner; - -/** - * An instance of this class provides access to all the operations defined in OperationsClient. - */ -public interface OperationsClient { - /** - * List the operations for the provider. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List the operations for the provider. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/SpotPlacementScoresClient.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/SpotPlacementScoresClient.java deleted file mode 100644 index b77be5f62251..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/SpotPlacementScoresClient.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.computerecommender.fluent.models.ComputeDiagnosticBaseInner; -import com.azure.resourcemanager.computerecommender.fluent.models.SpotPlacementScoresResponseInner; -import com.azure.resourcemanager.computerecommender.models.SpotPlacementScoresInput; - -/** - * An instance of this class provides access to all the operations defined in SpotPlacementScoresClient. - */ -public interface SpotPlacementScoresClient { - /** - * Gets Spot Placement Scores metadata. - * - * @param location The name of the Azure region. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return spot Placement Scores metadata along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String location, Context context); - - /** - * Gets Spot Placement Scores metadata. - * - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return spot Placement Scores metadata. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ComputeDiagnosticBaseInner get(String location); - - /** - * Generates placement scores for Spot VM skus. - * - * @param location The name of the Azure region. - * @param spotPlacementScoresInput SpotPlacementScores object supplied in the body of the Post spot placement scores - * operation. - * @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 spotPlacementScores API response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response postWithResponse(String location, - SpotPlacementScoresInput spotPlacementScoresInput, Context context); - - /** - * Generates placement scores for Spot VM skus. - * - * @param location The name of the Azure region. - * @param spotPlacementScoresInput SpotPlacementScores object supplied in the body of the Post spot placement scores - * 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 spotPlacementScores API response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SpotPlacementScoresResponseInner post(String location, SpotPlacementScoresInput spotPlacementScoresInput); -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/models/ComputeDiagnosticBaseInner.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/models/ComputeDiagnosticBaseInner.java deleted file mode 100644 index d18e61cb621f..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/models/ComputeDiagnosticBaseInner.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.computerecommender.models.DiagnosticProperties; -import java.io.IOException; - -/** - * Contains metadata of a diagnostic type. - */ -@Immutable -public final class ComputeDiagnosticBaseInner extends ProxyResource { - /* - * Contains additional properties of a diagnostic - */ - private DiagnosticProperties properties; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of ComputeDiagnosticBaseInner class. - */ - private ComputeDiagnosticBaseInner() { - } - - /** - * Get the properties property: Contains additional properties of a diagnostic. - * - * @return the properties value. - */ - public DiagnosticProperties properties() { - return this.properties; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ComputeDiagnosticBaseInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ComputeDiagnosticBaseInner if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the ComputeDiagnosticBaseInner. - */ - public static ComputeDiagnosticBaseInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ComputeDiagnosticBaseInner deserializedComputeDiagnosticBaseInner = new ComputeDiagnosticBaseInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedComputeDiagnosticBaseInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedComputeDiagnosticBaseInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedComputeDiagnosticBaseInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedComputeDiagnosticBaseInner.properties = DiagnosticProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedComputeDiagnosticBaseInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedComputeDiagnosticBaseInner; - }); - } -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/models/OperationInner.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/models/OperationInner.java deleted file mode 100644 index 0a190b2204ac..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/models/OperationInner.java +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.computerecommender.models.ActionType; -import com.azure.resourcemanager.computerecommender.models.OperationDisplay; -import com.azure.resourcemanager.computerecommender.models.Origin; -import java.io.IOException; - -/** - * REST API Operation - * - * Details of a REST API operation, returned from the Resource Provider Operations API. - */ -@Immutable -public final class OperationInner implements JsonSerializable { - /* - * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" - */ - private String name; - - /* - * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure - * Resource Manager/control-plane operations. - */ - private Boolean isDataAction; - - /* - * Localized display information for this particular operation. - */ - private OperationDisplay display; - - /* - * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default - * value is "user,system" - */ - private Origin origin; - - /* - * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - */ - private ActionType actionType; - - /** - * Creates an instance of OperationInner class. - */ - private OperationInner() { - } - - /** - * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane - * operations and "false" for Azure Resource Manager/control-plane operations. - * - * @return the isDataAction value. - */ - public Boolean isDataAction() { - return this.isDataAction; - } - - /** - * Get the display property: Localized display information for this particular operation. - * - * @return the display value. - */ - public OperationDisplay display() { - return this.display; - } - - /** - * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and - * audit logs UX. Default value is "user,system". - * - * @return the origin value. - */ - public Origin origin() { - return this.origin; - } - - /** - * Get the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are - * for internal only APIs. - * - * @return the actionType value. - */ - public ActionType actionType() { - return this.actionType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (display() != null) { - display().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("display", this.display); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationInner if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the OperationInner. - */ - public static OperationInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationInner deserializedOperationInner = new OperationInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedOperationInner.name = reader.getString(); - } else if ("isDataAction".equals(fieldName)) { - deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean); - } else if ("display".equals(fieldName)) { - deserializedOperationInner.display = OperationDisplay.fromJson(reader); - } else if ("origin".equals(fieldName)) { - deserializedOperationInner.origin = Origin.fromString(reader.getString()); - } else if ("actionType".equals(fieldName)) { - deserializedOperationInner.actionType = ActionType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationInner; - }); - } -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/models/SpotPlacementScoresResponseInner.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/models/SpotPlacementScoresResponseInner.java deleted file mode 100644 index 7ae2a61a2964..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/models/SpotPlacementScoresResponseInner.java +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.computerecommender.models.PlacementScore; -import com.azure.resourcemanager.computerecommender.models.ResourceSize; -import java.io.IOException; -import java.util.List; - -/** - * SpotPlacementScores API response. - */ -@Immutable -public final class SpotPlacementScoresResponseInner implements JsonSerializable { - /* - * The desired regions - */ - private List desiredLocations; - - /* - * The desired virtual machine SKU sizes. - */ - private List desiredSizes; - - /* - * Desired instance count per region/zone based on the scope. - */ - private Integer desiredCount; - - /* - * Defines if the scope is zonal or regional. - */ - private Boolean availabilityZones; - - /* - * A placement score indicating the likelihood of successfully allocating the specified Spot VM(s), as well as the - * expected lifetimes of the Spot VM(s) after allocation. - */ - private List placementScores; - - /** - * Creates an instance of SpotPlacementScoresResponseInner class. - */ - private SpotPlacementScoresResponseInner() { - } - - /** - * Get the desiredLocations property: The desired regions. - * - * @return the desiredLocations value. - */ - public List desiredLocations() { - return this.desiredLocations; - } - - /** - * Get the desiredSizes property: The desired virtual machine SKU sizes. - * - * @return the desiredSizes value. - */ - public List desiredSizes() { - return this.desiredSizes; - } - - /** - * Get the desiredCount property: Desired instance count per region/zone based on the scope. - * - * @return the desiredCount value. - */ - public Integer desiredCount() { - return this.desiredCount; - } - - /** - * Get the availabilityZones property: Defines if the scope is zonal or regional. - * - * @return the availabilityZones value. - */ - public Boolean availabilityZones() { - return this.availabilityZones; - } - - /** - * Get the placementScores property: A placement score indicating the likelihood of successfully allocating the - * specified Spot VM(s), as well as the expected lifetimes of the Spot VM(s) after allocation. - * - * @return the placementScores value. - */ - public List placementScores() { - return this.placementScores; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (desiredSizes() != null) { - desiredSizes().forEach(e -> e.validate()); - } - if (placementScores() != null) { - placementScores().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("desiredLocations", this.desiredLocations, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeArrayField("desiredSizes", this.desiredSizes, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeNumberField("desiredCount", this.desiredCount); - jsonWriter.writeBooleanField("availabilityZones", this.availabilityZones); - jsonWriter.writeArrayField("placementScores", this.placementScores, - (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SpotPlacementScoresResponseInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SpotPlacementScoresResponseInner if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the SpotPlacementScoresResponseInner. - */ - public static SpotPlacementScoresResponseInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SpotPlacementScoresResponseInner deserializedSpotPlacementScoresResponseInner - = new SpotPlacementScoresResponseInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("desiredLocations".equals(fieldName)) { - List desiredLocations = reader.readArray(reader1 -> reader1.getString()); - deserializedSpotPlacementScoresResponseInner.desiredLocations = desiredLocations; - } else if ("desiredSizes".equals(fieldName)) { - List desiredSizes = reader.readArray(reader1 -> ResourceSize.fromJson(reader1)); - deserializedSpotPlacementScoresResponseInner.desiredSizes = desiredSizes; - } else if ("desiredCount".equals(fieldName)) { - deserializedSpotPlacementScoresResponseInner.desiredCount = reader.getNullable(JsonReader::getInt); - } else if ("availabilityZones".equals(fieldName)) { - deserializedSpotPlacementScoresResponseInner.availabilityZones - = reader.getNullable(JsonReader::getBoolean); - } else if ("placementScores".equals(fieldName)) { - List placementScores - = reader.readArray(reader1 -> PlacementScore.fromJson(reader1)); - deserializedSpotPlacementScoresResponseInner.placementScores = placementScores; - } else { - reader.skipChildren(); - } - } - - return deserializedSpotPlacementScoresResponseInner; - }); - } -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/models/package-info.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/models/package-info.java deleted file mode 100644 index 6d1e4773a4f3..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/models/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -/** - * Package containing the inner data models for ComputeRecommender. - * The Compute Recommender Resource Provider Client. - */ -package com.azure.resourcemanager.computerecommender.fluent.models; diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/package-info.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/package-info.java deleted file mode 100644 index 5ef2a82b8a3b..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -/** - * Package containing the service clients for ComputeRecommender. - * The Compute Recommender Resource Provider Client. - */ -package com.azure.resourcemanager.computerecommender.fluent; diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/ComputeDiagnosticBaseImpl.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/ComputeDiagnosticBaseImpl.java deleted file mode 100644 index f356abae9a50..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/ComputeDiagnosticBaseImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.computerecommender.fluent.models.ComputeDiagnosticBaseInner; -import com.azure.resourcemanager.computerecommender.models.ComputeDiagnosticBase; -import com.azure.resourcemanager.computerecommender.models.DiagnosticProperties; - -public final class ComputeDiagnosticBaseImpl implements ComputeDiagnosticBase { - private ComputeDiagnosticBaseInner innerObject; - - private final com.azure.resourcemanager.computerecommender.ComputeRecommenderManager serviceManager; - - ComputeDiagnosticBaseImpl(ComputeDiagnosticBaseInner innerObject, - com.azure.resourcemanager.computerecommender.ComputeRecommenderManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public DiagnosticProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public ComputeDiagnosticBaseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.computerecommender.ComputeRecommenderManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/ComputeRecommenderManagementClientBuilder.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/ComputeRecommenderManagementClientBuilder.java deleted file mode 100644 index efa298241949..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/ComputeRecommenderManagementClientBuilder.java +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.implementation; - -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerAdapter; -import java.time.Duration; - -/** - * A builder for creating a new instance of the ComputeRecommenderManagementClientImpl type. - */ -@ServiceClientBuilder(serviceClients = { ComputeRecommenderManagementClientImpl.class }) -public final class ComputeRecommenderManagementClientBuilder { - /* - * Service host - */ - private String endpoint; - - /** - * Sets Service host. - * - * @param endpoint the endpoint value. - * @return the ComputeRecommenderManagementClientBuilder. - */ - public ComputeRecommenderManagementClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * The ID of the target subscription. The value must be an UUID. - */ - private String subscriptionId; - - /** - * Sets The ID of the target subscription. The value must be an UUID. - * - * @param subscriptionId the subscriptionId value. - * @return the ComputeRecommenderManagementClientBuilder. - */ - public ComputeRecommenderManagementClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /* - * The environment to connect to - */ - private AzureEnvironment environment; - - /** - * Sets The environment to connect to. - * - * @param environment the environment value. - * @return the ComputeRecommenderManagementClientBuilder. - */ - public ComputeRecommenderManagementClientBuilder environment(AzureEnvironment environment) { - this.environment = environment; - return this; - } - - /* - * The HTTP pipeline to send requests through - */ - private HttpPipeline pipeline; - - /** - * Sets The HTTP pipeline to send requests through. - * - * @param pipeline the pipeline value. - * @return the ComputeRecommenderManagementClientBuilder. - */ - public ComputeRecommenderManagementClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The default poll interval for long-running operation - */ - private Duration defaultPollInterval; - - /** - * Sets The default poll interval for long-running operation. - * - * @param defaultPollInterval the defaultPollInterval value. - * @return the ComputeRecommenderManagementClientBuilder. - */ - public ComputeRecommenderManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; - return this; - } - - /* - * The serializer to serialize an object into a string - */ - private SerializerAdapter serializerAdapter; - - /** - * Sets The serializer to serialize an object into a string. - * - * @param serializerAdapter the serializerAdapter value. - * @return the ComputeRecommenderManagementClientBuilder. - */ - public ComputeRecommenderManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { - this.serializerAdapter = serializerAdapter; - return this; - } - - /** - * Builds an instance of ComputeRecommenderManagementClientImpl with the provided parameters. - * - * @return an instance of ComputeRecommenderManagementClientImpl. - */ - public ComputeRecommenderManagementClientImpl buildClient() { - 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(); - ComputeRecommenderManagementClientImpl client = new ComputeRecommenderManagementClientImpl(localPipeline, - localSerializerAdapter, localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); - return client; - } -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/ComputeRecommenderManagementClientImpl.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/ComputeRecommenderManagementClientImpl.java deleted file mode 100644 index 51380ee27f72..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/ComputeRecommenderManagementClientImpl.java +++ /dev/null @@ -1,324 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.implementation; - -import com.azure.core.annotation.ServiceClient; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.Response; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.exception.ManagementError; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.management.polling.PollerFactory; -import com.azure.core.management.polling.SyncPollerFactory; -import com.azure.core.util.BinaryData; -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; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.computerecommender.fluent.ComputeRecommenderManagementClient; -import com.azure.resourcemanager.computerecommender.fluent.OperationsClient; -import com.azure.resourcemanager.computerecommender.fluent.SpotPlacementScoresClient; -import java.io.IOException; -import java.lang.reflect.Type; -import java.nio.ByteBuffer; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.time.Duration; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the ComputeRecommenderManagementClientImpl type. - */ -@ServiceClient(builder = ComputeRecommenderManagementClientBuilder.class) -public final class ComputeRecommenderManagementClientImpl implements ComputeRecommenderManagementClient { - /** - * Service host. - */ - private final String endpoint; - - /** - * Gets Service host. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** - * Version parameter. - */ - private final String apiVersion; - - /** - * Gets Version parameter. - * - * @return the apiVersion value. - */ - public String getApiVersion() { - return this.apiVersion; - } - - /** - * The ID of the target subscription. The value must be an UUID. - */ - private final String subscriptionId; - - /** - * Gets The ID of the target subscription. The value must be an UUID. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** - * The HTTP pipeline to send requests through. - */ - private final HttpPipeline httpPipeline; - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - public HttpPipeline getHttpPipeline() { - return this.httpPipeline; - } - - /** - * The serializer to serialize an object into a string. - */ - private final SerializerAdapter serializerAdapter; - - /** - * Gets The serializer to serialize an object into a string. - * - * @return the serializerAdapter value. - */ - SerializerAdapter getSerializerAdapter() { - return this.serializerAdapter; - } - - /** - * The default poll interval for long-running operation. - */ - private final Duration defaultPollInterval; - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - public Duration getDefaultPollInterval() { - return this.defaultPollInterval; - } - - /** - * The OperationsClient object to access its operations. - */ - private final OperationsClient operations; - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - public OperationsClient getOperations() { - return this.operations; - } - - /** - * The SpotPlacementScoresClient object to access its operations. - */ - private final SpotPlacementScoresClient spotPlacementScores; - - /** - * Gets the SpotPlacementScoresClient object to access its operations. - * - * @return the SpotPlacementScoresClient object. - */ - public SpotPlacementScoresClient getSpotPlacementScores() { - return this.spotPlacementScores; - } - - /** - * Initializes an instance of ComputeRecommenderManagementClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param serializerAdapter The serializer to serialize an object into a string. - * @param defaultPollInterval The default poll interval for long-running operation. - * @param environment The Azure environment. - * @param endpoint Service host. - * @param subscriptionId The ID of the target subscription. The value must be an UUID. - */ - ComputeRecommenderManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.defaultPollInterval = defaultPollInterval; - this.endpoint = endpoint; - this.subscriptionId = subscriptionId; - this.apiVersion = "2025-06-05"; - this.operations = new OperationsClientImpl(this); - this.spotPlacementScores = new SpotPlacementScoresClientImpl(this); - } - - /** - * Gets default client context. - * - * @return the default client context. - */ - public Context getContext() { - return Context.NONE; - } - - /** - * Merges default client context with provided context. - * - * @param context the context to be merged with default client context. - * @return the merged context. - */ - public Context mergeContext(Context context) { - return CoreUtils.mergeContexts(this.getContext(), context); - } - - /** - * Gets long running operation result. - * - * @param activationResponse the response of activation operation. - * @param httpPipeline the http pipeline. - * @param pollResultType type of poll result. - * @param finalResultType type of final result. - * @param context the context shared by all requests. - * @param type of poll result. - * @param type of final result. - * @return poller flux for poll result and final result. - */ - public PollerFlux, U> getLroResult(Mono>> activationResponse, - HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) { - return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, - defaultPollInterval, activationResponse, context); - } - - /** - * Gets long running operation result. - * - * @param activationResponse the response of activation operation. - * @param pollResultType type of poll result. - * @param finalResultType type of final result. - * @param context the context shared by all requests. - * @param type of poll result. - * @param type of final result. - * @return SyncPoller for poll result and final result. - */ - public SyncPoller, U> getLroResult(Response activationResponse, - Type pollResultType, Type finalResultType, Context context) { - return SyncPollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, - defaultPollInterval, () -> activationResponse, context); - } - - /** - * Gets the final result, or an error, based on last async poll response. - * - * @param response the last async poll response. - * @param type of poll result. - * @param type of final result. - * @return the final result, or an error. - */ - public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { - if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { - String errorMessage; - ManagementError managementError = null; - HttpResponse errorResponse = null; - PollResult.Error lroError = response.getValue().getError(); - if (lroError != null) { - errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(), - lroError.getResponseBody()); - - errorMessage = response.getValue().getError().getMessage(); - String errorBody = response.getValue().getError().getResponseBody(); - if (errorBody != null) { - // try to deserialize error body to ManagementError - try { - managementError = this.getSerializerAdapter() - .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); - if (managementError.getCode() == null || managementError.getMessage() == null) { - managementError = null; - } - } catch (IOException | RuntimeException ioe) { - LOGGER.logThrowableAsWarning(ioe); - } - } - } else { - // fallback to default error message - errorMessage = "Long running operation failed."; - } - if (managementError == null) { - // fallback to default ManagementError - managementError = new ManagementError(response.getStatus().toString(), errorMessage); - } - return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); - } else { - return response.getFinalResult(); - } - } - - private static final class HttpResponseImpl extends HttpResponse { - private final int statusCode; - - private final byte[] responseBody; - - private final HttpHeaders httpHeaders; - - HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { - super(null); - this.statusCode = statusCode; - this.httpHeaders = httpHeaders; - this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); - } - - public int getStatusCode() { - return statusCode; - } - - public String getHeaderValue(String s) { - return httpHeaders.getValue(HttpHeaderName.fromString(s)); - } - - public HttpHeaders getHeaders() { - return httpHeaders; - } - - public Flux getBody() { - return Flux.just(ByteBuffer.wrap(responseBody)); - } - - public Mono getBodyAsByteArray() { - return Mono.just(responseBody); - } - - public Mono getBodyAsString() { - return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); - } - - public Mono getBodyAsString(Charset charset) { - return Mono.just(new String(responseBody, charset)); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ComputeRecommenderManagementClientImpl.class); -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/OperationImpl.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/OperationImpl.java deleted file mode 100644 index b35e0f0d2e81..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/OperationImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.implementation; - -import com.azure.resourcemanager.computerecommender.fluent.models.OperationInner; -import com.azure.resourcemanager.computerecommender.models.ActionType; -import com.azure.resourcemanager.computerecommender.models.Operation; -import com.azure.resourcemanager.computerecommender.models.OperationDisplay; -import com.azure.resourcemanager.computerecommender.models.Origin; - -public final class OperationImpl implements Operation { - private OperationInner innerObject; - - private final com.azure.resourcemanager.computerecommender.ComputeRecommenderManager serviceManager; - - OperationImpl(OperationInner innerObject, - com.azure.resourcemanager.computerecommender.ComputeRecommenderManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String name() { - return this.innerModel().name(); - } - - public Boolean isDataAction() { - return this.innerModel().isDataAction(); - } - - public OperationDisplay display() { - return this.innerModel().display(); - } - - public Origin origin() { - return this.innerModel().origin(); - } - - public ActionType actionType() { - return this.innerModel().actionType(); - } - - public OperationInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.computerecommender.ComputeRecommenderManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/OperationsClientImpl.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/OperationsClientImpl.java deleted file mode 100644 index 42da49f9b7e7..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/OperationsClientImpl.java +++ /dev/null @@ -1,284 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.computerecommender.fluent.OperationsClient; -import com.azure.resourcemanager.computerecommender.fluent.models.OperationInner; -import com.azure.resourcemanager.computerecommender.implementation.models.OperationListResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in OperationsClient. - */ -public final class OperationsClientImpl implements OperationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final OperationsService service; - - /** - * The service client containing this operation class. - */ - private final ComputeRecommenderManagementClientImpl client; - - /** - * Initializes an instance of OperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OperationsClientImpl(ComputeRecommenderManagementClientImpl client) { - this.service - = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ComputeRecommenderManagementClientOperations to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "ComputeRecommenderManagementClientOperations") - public interface OperationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Compute/operations") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Compute/operations") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * List the operations for the provider. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List the operations for the provider. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List the operations for the provider. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage() { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * List the operations for the provider. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * List the operations for the provider. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); - } - - /** - * List the operations for the provider. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - private static final ClientLogger LOGGER = new ClientLogger(OperationsClientImpl.class); -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/OperationsImpl.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/OperationsImpl.java deleted file mode 100644 index 9e2cfbdb8f0d..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/OperationsImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.computerecommender.fluent.OperationsClient; -import com.azure.resourcemanager.computerecommender.fluent.models.OperationInner; -import com.azure.resourcemanager.computerecommender.models.Operation; -import com.azure.resourcemanager.computerecommender.models.Operations; - -public final class OperationsImpl implements Operations { - private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); - - private final OperationsClient innerClient; - - private final com.azure.resourcemanager.computerecommender.ComputeRecommenderManager serviceManager; - - public OperationsImpl(OperationsClient innerClient, - com.azure.resourcemanager.computerecommender.ComputeRecommenderManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); - } - - private OperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.computerecommender.ComputeRecommenderManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/ResourceManagerUtils.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/ResourceManagerUtils.java deleted file mode 100644 index c15552844a8c..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/ResourceManagerUtils.java +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.util.CoreUtils; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; -import java.util.function.Function; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import reactor.core.publisher.Flux; - -final class ResourceManagerUtils { - private ResourceManagerUtils() { - } - - static String getValueFromIdByName(String id, String name) { - if (id == null) { - return null; - } - Iterator itr = Arrays.stream(id.split("/")).iterator(); - while (itr.hasNext()) { - String part = itr.next(); - if (part != null && !part.trim().isEmpty()) { - if (part.equalsIgnoreCase(name)) { - if (itr.hasNext()) { - return itr.next(); - } else { - return null; - } - } - } - } - return null; - } - - static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { - if (id == null || pathTemplate == null) { - return null; - } - String parameterNameParentheses = "{" + parameterName + "}"; - List idSegmentsReverted = Arrays.asList(id.split("/")); - List pathSegments = Arrays.asList(pathTemplate.split("/")); - Collections.reverse(idSegmentsReverted); - Iterator idItrReverted = idSegmentsReverted.iterator(); - int pathIndex = pathSegments.size(); - while (idItrReverted.hasNext() && pathIndex > 0) { - String idSegment = idItrReverted.next(); - String pathSegment = pathSegments.get(--pathIndex); - if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { - if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { - if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { - List segments = new ArrayList<>(); - segments.add(idSegment); - idItrReverted.forEachRemaining(segments::add); - Collections.reverse(segments); - if (!segments.isEmpty() && segments.get(0).isEmpty()) { - segments.remove(0); - } - return String.join("/", segments); - } else { - return idSegment; - } - } - } - } - return null; - } - - static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { - return new PagedIterableImpl<>(pageIterable, mapper); - } - - private static final class PagedIterableImpl extends PagedIterable { - - private final PagedIterable pagedIterable; - private final Function mapper; - private final Function, PagedResponse> pageMapper; - - private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { - super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux - .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); - this.pagedIterable = pagedIterable; - this.mapper = mapper; - this.pageMapper = getPageMapper(mapper); - } - - private static Function, PagedResponse> getPageMapper(Function mapper) { - return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(), - page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(), - null); - } - - @Override - public Stream stream() { - return pagedIterable.stream().map(mapper); - } - - @Override - public Stream> streamByPage() { - return pagedIterable.streamByPage().map(pageMapper); - } - - @Override - public Stream> streamByPage(String continuationToken) { - return pagedIterable.streamByPage(continuationToken).map(pageMapper); - } - - @Override - public Stream> streamByPage(int preferredPageSize) { - return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); - } - - @Override - public Stream> streamByPage(String continuationToken, int preferredPageSize) { - return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); - } - - @Override - public Iterator iterator() { - return new IteratorImpl<>(pagedIterable.iterator(), mapper); - } - - @Override - public Iterable> iterableByPage() { - return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); - } - - @Override - public Iterable> iterableByPage(String continuationToken) { - return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); - } - - @Override - public Iterable> iterableByPage(int preferredPageSize) { - return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); - } - - @Override - public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { - return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); - } - } - - private static final class IteratorImpl implements Iterator { - - private final Iterator iterator; - private final Function mapper; - - private IteratorImpl(Iterator iterator, Function mapper) { - this.iterator = iterator; - this.mapper = mapper; - } - - @Override - public boolean hasNext() { - return iterator.hasNext(); - } - - @Override - public S next() { - return mapper.apply(iterator.next()); - } - - @Override - public void remove() { - iterator.remove(); - } - } - - private static final class IterableImpl implements Iterable { - - private final Iterable iterable; - private final Function mapper; - - private IterableImpl(Iterable iterable, Function mapper) { - this.iterable = iterable; - this.mapper = mapper; - } - - @Override - public Iterator iterator() { - return new IteratorImpl<>(iterable.iterator(), mapper); - } - } -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/SpotPlacementScoresClientImpl.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/SpotPlacementScoresClientImpl.java deleted file mode 100644 index ededcb6e9224..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/SpotPlacementScoresClientImpl.java +++ /dev/null @@ -1,304 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.computerecommender.fluent.SpotPlacementScoresClient; -import com.azure.resourcemanager.computerecommender.fluent.models.ComputeDiagnosticBaseInner; -import com.azure.resourcemanager.computerecommender.fluent.models.SpotPlacementScoresResponseInner; -import com.azure.resourcemanager.computerecommender.models.SpotPlacementScoresInput; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in SpotPlacementScoresClient. - */ -public final class SpotPlacementScoresClientImpl implements SpotPlacementScoresClient { - /** - * The proxy service used to perform REST calls. - */ - private final SpotPlacementScoresService service; - - /** - * The service client containing this operation class. - */ - private final ComputeRecommenderManagementClientImpl client; - - /** - * Initializes an instance of SpotPlacementScoresClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SpotPlacementScoresClientImpl(ComputeRecommenderManagementClientImpl client) { - this.service = RestProxy.create(SpotPlacementScoresService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ComputeRecommenderManagementClientSpotPlacementScores to be used by - * the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "ComputeRecommenderManagementClientSpotPlacementScores") - public interface SpotPlacementScoresService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/placementScores/spot") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/placementScores/spot") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); - - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/placementScores/spot/generate") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> post(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, - @BodyParam("application/json") SpotPlacementScoresInput spotPlacementScoresInput, Context context); - - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/placementScores/spot/generate") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response postSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, - @BodyParam("application/json") SpotPlacementScoresInput spotPlacementScoresInput, Context context); - } - - /** - * Gets Spot Placement Scores metadata. - * - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return spot Placement Scores metadata along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String location) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), location, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets Spot Placement Scores metadata. - * - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return spot Placement Scores metadata on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String location) { - return getWithResponseAsync(location).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets Spot Placement Scores metadata. - * - * @param location The name of the Azure region. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return spot Placement Scores metadata along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String location, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - location, accept, context); - } - - /** - * Gets Spot Placement Scores metadata. - * - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return spot Placement Scores metadata. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ComputeDiagnosticBaseInner get(String location) { - return getWithResponse(location, Context.NONE).getValue(); - } - - /** - * Generates placement scores for Spot VM skus. - * - * @param location The name of the Azure region. - * @param spotPlacementScoresInput SpotPlacementScores object supplied in the body of the Post spot placement scores - * 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 spotPlacementScores API response along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> postWithResponseAsync(String location, - SpotPlacementScoresInput spotPlacementScoresInput) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (spotPlacementScoresInput == null) { - return Mono.error( - new IllegalArgumentException("Parameter spotPlacementScoresInput is required and cannot be null.")); - } else { - spotPlacementScoresInput.validate(); - } - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.post(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), location, contentType, accept, spotPlacementScoresInput, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Generates placement scores for Spot VM skus. - * - * @param location The name of the Azure region. - * @param spotPlacementScoresInput SpotPlacementScores object supplied in the body of the Post spot placement scores - * 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 spotPlacementScores API response on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono postAsync(String location, - SpotPlacementScoresInput spotPlacementScoresInput) { - return postWithResponseAsync(location, spotPlacementScoresInput) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Generates placement scores for Spot VM skus. - * - * @param location The name of the Azure region. - * @param spotPlacementScoresInput SpotPlacementScores object supplied in the body of the Post spot placement scores - * operation. - * @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 spotPlacementScores API response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response postWithResponse(String location, - SpotPlacementScoresInput spotPlacementScoresInput, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (spotPlacementScoresInput == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Parameter spotPlacementScoresInput is required and cannot be null.")); - } else { - spotPlacementScoresInput.validate(); - } - final String contentType = "application/json"; - final String accept = "application/json"; - return service.postSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - location, contentType, accept, spotPlacementScoresInput, context); - } - - /** - * Generates placement scores for Spot VM skus. - * - * @param location The name of the Azure region. - * @param spotPlacementScoresInput SpotPlacementScores object supplied in the body of the Post spot placement scores - * 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 spotPlacementScores API response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SpotPlacementScoresResponseInner post(String location, SpotPlacementScoresInput spotPlacementScoresInput) { - return postWithResponse(location, spotPlacementScoresInput, Context.NONE).getValue(); - } - - private static final ClientLogger LOGGER = new ClientLogger(SpotPlacementScoresClientImpl.class); -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/SpotPlacementScoresImpl.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/SpotPlacementScoresImpl.java deleted file mode 100644 index 1975479c976d..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/SpotPlacementScoresImpl.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.computerecommender.fluent.SpotPlacementScoresClient; -import com.azure.resourcemanager.computerecommender.fluent.models.ComputeDiagnosticBaseInner; -import com.azure.resourcemanager.computerecommender.fluent.models.SpotPlacementScoresResponseInner; -import com.azure.resourcemanager.computerecommender.models.ComputeDiagnosticBase; -import com.azure.resourcemanager.computerecommender.models.SpotPlacementScores; -import com.azure.resourcemanager.computerecommender.models.SpotPlacementScoresInput; -import com.azure.resourcemanager.computerecommender.models.SpotPlacementScoresResponse; - -public final class SpotPlacementScoresImpl implements SpotPlacementScores { - private static final ClientLogger LOGGER = new ClientLogger(SpotPlacementScoresImpl.class); - - private final SpotPlacementScoresClient innerClient; - - private final com.azure.resourcemanager.computerecommender.ComputeRecommenderManager serviceManager; - - public SpotPlacementScoresImpl(SpotPlacementScoresClient innerClient, - com.azure.resourcemanager.computerecommender.ComputeRecommenderManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String location, Context context) { - Response inner = this.serviceClient().getWithResponse(location, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ComputeDiagnosticBaseImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ComputeDiagnosticBase get(String location) { - ComputeDiagnosticBaseInner inner = this.serviceClient().get(location); - if (inner != null) { - return new ComputeDiagnosticBaseImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response postWithResponse(String location, - SpotPlacementScoresInput spotPlacementScoresInput, Context context) { - Response inner - = this.serviceClient().postWithResponse(location, spotPlacementScoresInput, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SpotPlacementScoresResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public SpotPlacementScoresResponse post(String location, SpotPlacementScoresInput spotPlacementScoresInput) { - SpotPlacementScoresResponseInner inner = this.serviceClient().post(location, spotPlacementScoresInput); - if (inner != null) { - return new SpotPlacementScoresResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - private SpotPlacementScoresClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.computerecommender.ComputeRecommenderManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/SpotPlacementScoresResponseImpl.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/SpotPlacementScoresResponseImpl.java deleted file mode 100644 index 7e72cd74380b..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/SpotPlacementScoresResponseImpl.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.implementation; - -import com.azure.resourcemanager.computerecommender.fluent.models.SpotPlacementScoresResponseInner; -import com.azure.resourcemanager.computerecommender.models.PlacementScore; -import com.azure.resourcemanager.computerecommender.models.ResourceSize; -import com.azure.resourcemanager.computerecommender.models.SpotPlacementScoresResponse; -import java.util.Collections; -import java.util.List; - -public final class SpotPlacementScoresResponseImpl implements SpotPlacementScoresResponse { - private SpotPlacementScoresResponseInner innerObject; - - private final com.azure.resourcemanager.computerecommender.ComputeRecommenderManager serviceManager; - - SpotPlacementScoresResponseImpl(SpotPlacementScoresResponseInner innerObject, - com.azure.resourcemanager.computerecommender.ComputeRecommenderManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List desiredLocations() { - List inner = this.innerModel().desiredLocations(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List desiredSizes() { - List inner = this.innerModel().desiredSizes(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public Integer desiredCount() { - return this.innerModel().desiredCount(); - } - - public Boolean availabilityZones() { - return this.innerModel().availabilityZones(); - } - - public List placementScores() { - List inner = this.innerModel().placementScores(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public SpotPlacementScoresResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.computerecommender.ComputeRecommenderManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/models/OperationListResult.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/models/OperationListResult.java deleted file mode 100644 index ab3cb4942819..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/models/OperationListResult.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.computerecommender.fluent.models.OperationInner; -import java.io.IOException; -import java.util.List; - -/** - * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of - * results. - */ -@Immutable -public final class OperationListResult implements JsonSerializable { - /* - * The Operation items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of OperationListResult class. - */ - private OperationListResult() { - } - - /** - * Get the value property: The Operation items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property value in model OperationListResult")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(OperationListResult.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationListResult if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the OperationListResult. - */ - public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationListResult deserializedOperationListResult = new OperationListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1)); - deserializedOperationListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedOperationListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationListResult; - }); - } -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/package-info.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/package-info.java deleted file mode 100644 index 6c267d22736c..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -/** - * Package containing the implementations for ComputeRecommender. - * The Compute Recommender Resource Provider Client. - */ -package com.azure.resourcemanager.computerecommender.implementation; diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/ActionType.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/ActionType.java deleted file mode 100644 index 3e1ca43a1ca2..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/ActionType.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - */ -public final class ActionType extends ExpandableStringEnum { - /** - * Actions are for internal-only APIs. - */ - public static final ActionType INTERNAL = fromString("Internal"); - - /** - * Creates a new instance of ActionType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ActionType() { - } - - /** - * Creates or finds a ActionType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ActionType. - */ - public static ActionType fromString(String name) { - return fromString(name, ActionType.class); - } - - /** - * Gets known ActionType values. - * - * @return known ActionType values. - */ - public static Collection values() { - return values(ActionType.class); - } -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/ComputeDiagnosticBase.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/ComputeDiagnosticBase.java deleted file mode 100644 index ba32cf168053..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/ComputeDiagnosticBase.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.computerecommender.fluent.models.ComputeDiagnosticBaseInner; - -/** - * An immutable client-side representation of ComputeDiagnosticBase. - */ -public interface ComputeDiagnosticBase { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the properties property: Contains additional properties of a diagnostic. - * - * @return the properties value. - */ - DiagnosticProperties properties(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the inner com.azure.resourcemanager.computerecommender.fluent.models.ComputeDiagnosticBaseInner object. - * - * @return the inner object. - */ - ComputeDiagnosticBaseInner innerModel(); -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/DiagnosticProperties.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/DiagnosticProperties.java deleted file mode 100644 index 945b1abbcd2f..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/DiagnosticProperties.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Contains additional properties of a diagnostic. - */ -@Immutable -public final class DiagnosticProperties implements JsonSerializable { - /* - * Describes what are the supported resource types for a diagnostic. - */ - private List supportedResourceTypes; - - /** - * Creates an instance of DiagnosticProperties class. - */ - private DiagnosticProperties() { - } - - /** - * Get the supportedResourceTypes property: Describes what are the supported resource types for a diagnostic. - * - * @return the supportedResourceTypes value. - */ - public List supportedResourceTypes() { - return this.supportedResourceTypes; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("supportedResourceTypes", this.supportedResourceTypes, - (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DiagnosticProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DiagnosticProperties if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the DiagnosticProperties. - */ - public static DiagnosticProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DiagnosticProperties deserializedDiagnosticProperties = new DiagnosticProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("supportedResourceTypes".equals(fieldName)) { - List supportedResourceTypes = reader.readArray(reader1 -> reader1.getString()); - deserializedDiagnosticProperties.supportedResourceTypes = supportedResourceTypes; - } else { - reader.skipChildren(); - } - } - - return deserializedDiagnosticProperties; - }); - } -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/Operation.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/Operation.java deleted file mode 100644 index 94a4c2736488..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/Operation.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.models; - -import com.azure.resourcemanager.computerecommender.fluent.models.OperationInner; - -/** - * An immutable client-side representation of Operation. - */ -public interface Operation { - /** - * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - * - * @return the name value. - */ - String name(); - - /** - * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane - * operations and "false" for Azure Resource Manager/control-plane operations. - * - * @return the isDataAction value. - */ - Boolean isDataAction(); - - /** - * Gets the display property: Localized display information for this particular operation. - * - * @return the display value. - */ - OperationDisplay display(); - - /** - * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and - * audit logs UX. Default value is "user,system". - * - * @return the origin value. - */ - Origin origin(); - - /** - * Gets the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are - * for internal only APIs. - * - * @return the actionType value. - */ - ActionType actionType(); - - /** - * Gets the inner com.azure.resourcemanager.computerecommender.fluent.models.OperationInner object. - * - * @return the inner object. - */ - OperationInner innerModel(); -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/OperationDisplay.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/OperationDisplay.java deleted file mode 100644 index ef1c9965b4cc..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/OperationDisplay.java +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Localized display information for and operation. - */ -@Immutable -public final class OperationDisplay implements JsonSerializable { - /* - * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or - * "Microsoft Compute". - */ - private String provider; - - /* - * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or - * "Job Schedule Collections". - */ - private String resource; - - /* - * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. - * "Create or Update Virtual Machine", "Restart Virtual Machine". - */ - private String operation; - - /* - * The short, localized friendly description of the operation; suitable for tool tips and detailed views. - */ - private String description; - - /** - * Creates an instance of OperationDisplay class. - */ - private OperationDisplay() { - } - - /** - * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring - * Insights" or "Microsoft Compute". - * - * @return the provider value. - */ - public String provider() { - return this.provider; - } - - /** - * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. - * "Virtual Machines" or "Job Schedule Collections". - * - * @return the resource value. - */ - public String resource() { - return this.resource; - } - - /** - * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. - * "Create or Update Virtual Machine", "Restart Virtual Machine". - * - * @return the operation value. - */ - public String operation() { - return this.operation; - } - - /** - * Get the description property: The short, localized friendly description of the operation; suitable for tool tips - * and detailed views. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationDisplay from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationDisplay if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the OperationDisplay. - */ - public static OperationDisplay fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationDisplay deserializedOperationDisplay = new OperationDisplay(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("provider".equals(fieldName)) { - deserializedOperationDisplay.provider = reader.getString(); - } else if ("resource".equals(fieldName)) { - deserializedOperationDisplay.resource = reader.getString(); - } else if ("operation".equals(fieldName)) { - deserializedOperationDisplay.operation = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedOperationDisplay.description = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationDisplay; - }); - } -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/Operations.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/Operations.java deleted file mode 100644 index 2c8ffdb66304..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/Operations.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** - * Resource collection API of Operations. - */ -public interface Operations { - /** - * List the operations for the provider. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * List the operations for the provider. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(Context context); -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/Origin.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/Origin.java deleted file mode 100644 index 2897713dc336..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/Origin.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value - * is "user,system". - */ -public final class Origin extends ExpandableStringEnum { - /** - * Indicates the operation is initiated by a user. - */ - public static final Origin USER = fromString("user"); - - /** - * Indicates the operation is initiated by a system. - */ - public static final Origin SYSTEM = fromString("system"); - - /** - * Indicates the operation is initiated by a user or system. - */ - public static final Origin USER_SYSTEM = fromString("user,system"); - - /** - * Creates a new instance of Origin value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public Origin() { - } - - /** - * Creates or finds a Origin from its string representation. - * - * @param name a name to look for. - * @return the corresponding Origin. - */ - public static Origin fromString(String name) { - return fromString(name, Origin.class); - } - - /** - * Gets known Origin values. - * - * @return known Origin values. - */ - public static Collection values() { - return values(Origin.class); - } -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/PlacementScore.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/PlacementScore.java deleted file mode 100644 index c4c6ea7c911e..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/PlacementScore.java +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The spot placement score for sku/region/zone combination. - */ -@Immutable -public final class PlacementScore implements JsonSerializable { - /* - * The resource's CRP virtual machine SKU size. - */ - private String sku; - - /* - * The region. - */ - private String region; - - /* - * The availability zone. - */ - private String availabilityZone; - - /* - * A placement score indicating the likelihood of successfully allocating the specified Spot VM(s), as well as the - * expected lifetimes of the Spot VM(s) after allocation. - */ - private String score; - - /* - * Whether the desired quota is available. - */ - private Boolean isQuotaAvailable; - - /** - * Creates an instance of PlacementScore class. - */ - private PlacementScore() { - } - - /** - * Get the sku property: The resource's CRP virtual machine SKU size. - * - * @return the sku value. - */ - public String sku() { - return this.sku; - } - - /** - * Get the region property: The region. - * - * @return the region value. - */ - public String region() { - return this.region; - } - - /** - * Get the availabilityZone property: The availability zone. - * - * @return the availabilityZone value. - */ - public String availabilityZone() { - return this.availabilityZone; - } - - /** - * Get the score property: A placement score indicating the likelihood of successfully allocating the specified Spot - * VM(s), as well as the expected lifetimes of the Spot VM(s) after allocation. - * - * @return the score value. - */ - public String score() { - return this.score; - } - - /** - * Get the isQuotaAvailable property: Whether the desired quota is available. - * - * @return the isQuotaAvailable value. - */ - public Boolean isQuotaAvailable() { - return this.isQuotaAvailable; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("sku", this.sku); - jsonWriter.writeStringField("region", this.region); - jsonWriter.writeStringField("availabilityZone", this.availabilityZone); - jsonWriter.writeStringField("score", this.score); - jsonWriter.writeBooleanField("isQuotaAvailable", this.isQuotaAvailable); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PlacementScore from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PlacementScore if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the PlacementScore. - */ - public static PlacementScore fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PlacementScore deserializedPlacementScore = new PlacementScore(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("sku".equals(fieldName)) { - deserializedPlacementScore.sku = reader.getString(); - } else if ("region".equals(fieldName)) { - deserializedPlacementScore.region = reader.getString(); - } else if ("availabilityZone".equals(fieldName)) { - deserializedPlacementScore.availabilityZone = reader.getString(); - } else if ("score".equals(fieldName)) { - deserializedPlacementScore.score = reader.getString(); - } else if ("isQuotaAvailable".equals(fieldName)) { - deserializedPlacementScore.isQuotaAvailable = reader.getNullable(JsonReader::getBoolean); - } else { - reader.skipChildren(); - } - } - - return deserializedPlacementScore; - }); - } -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/ResourceSize.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/ResourceSize.java deleted file mode 100644 index 5b511966eb4a..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/ResourceSize.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * SpotPlacementRecommender API response. - */ -@Fluent -public final class ResourceSize implements JsonSerializable { - /* - * The resource's CRP virtual machine SKU size. - */ - private String sku; - - /** - * Creates an instance of ResourceSize class. - */ - public ResourceSize() { - } - - /** - * Get the sku property: The resource's CRP virtual machine SKU size. - * - * @return the sku value. - */ - public String sku() { - return this.sku; - } - - /** - * Set the sku property: The resource's CRP virtual machine SKU size. - * - * @param sku the sku value to set. - * @return the ResourceSize object itself. - */ - public ResourceSize withSku(String sku) { - this.sku = sku; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("sku", this.sku); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ResourceSize from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ResourceSize if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the ResourceSize. - */ - public static ResourceSize fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ResourceSize deserializedResourceSize = new ResourceSize(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("sku".equals(fieldName)) { - deserializedResourceSize.sku = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedResourceSize; - }); - } -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/SpotPlacementScores.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/SpotPlacementScores.java deleted file mode 100644 index 309edca01a51..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/SpotPlacementScores.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of SpotPlacementScores. - */ -public interface SpotPlacementScores { - /** - * Gets Spot Placement Scores metadata. - * - * @param location The name of the Azure region. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return spot Placement Scores metadata along with {@link Response}. - */ - Response getWithResponse(String location, Context context); - - /** - * Gets Spot Placement Scores metadata. - * - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return spot Placement Scores metadata. - */ - ComputeDiagnosticBase get(String location); - - /** - * Generates placement scores for Spot VM skus. - * - * @param location The name of the Azure region. - * @param spotPlacementScoresInput SpotPlacementScores object supplied in the body of the Post spot placement scores - * operation. - * @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 spotPlacementScores API response along with {@link Response}. - */ - Response postWithResponse(String location, - SpotPlacementScoresInput spotPlacementScoresInput, Context context); - - /** - * Generates placement scores for Spot VM skus. - * - * @param location The name of the Azure region. - * @param spotPlacementScoresInput SpotPlacementScores object supplied in the body of the Post spot placement scores - * 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 spotPlacementScores API response. - */ - SpotPlacementScoresResponse post(String location, SpotPlacementScoresInput spotPlacementScoresInput); -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/SpotPlacementScoresInput.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/SpotPlacementScoresInput.java deleted file mode 100644 index 969cce874531..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/SpotPlacementScoresInput.java +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * SpotPlacementScores API Input. - */ -@Fluent -public final class SpotPlacementScoresInput implements JsonSerializable { - /* - * The desired regions - */ - private List desiredLocations; - - /* - * The desired virtual machine SKU sizes. - */ - private List desiredSizes; - - /* - * Desired instance count per region/zone based on the scope. - */ - private Integer desiredCount; - - /* - * Defines if the scope is zonal or regional. - */ - private Boolean availabilityZones; - - /** - * Creates an instance of SpotPlacementScoresInput class. - */ - public SpotPlacementScoresInput() { - } - - /** - * Get the desiredLocations property: The desired regions. - * - * @return the desiredLocations value. - */ - public List desiredLocations() { - return this.desiredLocations; - } - - /** - * Set the desiredLocations property: The desired regions. - * - * @param desiredLocations the desiredLocations value to set. - * @return the SpotPlacementScoresInput object itself. - */ - public SpotPlacementScoresInput withDesiredLocations(List desiredLocations) { - this.desiredLocations = desiredLocations; - return this; - } - - /** - * Get the desiredSizes property: The desired virtual machine SKU sizes. - * - * @return the desiredSizes value. - */ - public List desiredSizes() { - return this.desiredSizes; - } - - /** - * Set the desiredSizes property: The desired virtual machine SKU sizes. - * - * @param desiredSizes the desiredSizes value to set. - * @return the SpotPlacementScoresInput object itself. - */ - public SpotPlacementScoresInput withDesiredSizes(List desiredSizes) { - this.desiredSizes = desiredSizes; - return this; - } - - /** - * Get the desiredCount property: Desired instance count per region/zone based on the scope. - * - * @return the desiredCount value. - */ - public Integer desiredCount() { - return this.desiredCount; - } - - /** - * Set the desiredCount property: Desired instance count per region/zone based on the scope. - * - * @param desiredCount the desiredCount value to set. - * @return the SpotPlacementScoresInput object itself. - */ - public SpotPlacementScoresInput withDesiredCount(Integer desiredCount) { - this.desiredCount = desiredCount; - return this; - } - - /** - * Get the availabilityZones property: Defines if the scope is zonal or regional. - * - * @return the availabilityZones value. - */ - public Boolean availabilityZones() { - return this.availabilityZones; - } - - /** - * Set the availabilityZones property: Defines if the scope is zonal or regional. - * - * @param availabilityZones the availabilityZones value to set. - * @return the SpotPlacementScoresInput object itself. - */ - public SpotPlacementScoresInput withAvailabilityZones(Boolean availabilityZones) { - this.availabilityZones = availabilityZones; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (desiredSizes() != null) { - desiredSizes().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("desiredLocations", this.desiredLocations, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeArrayField("desiredSizes", this.desiredSizes, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeNumberField("desiredCount", this.desiredCount); - jsonWriter.writeBooleanField("availabilityZones", this.availabilityZones); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SpotPlacementScoresInput from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SpotPlacementScoresInput if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the SpotPlacementScoresInput. - */ - public static SpotPlacementScoresInput fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SpotPlacementScoresInput deserializedSpotPlacementScoresInput = new SpotPlacementScoresInput(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("desiredLocations".equals(fieldName)) { - List desiredLocations = reader.readArray(reader1 -> reader1.getString()); - deserializedSpotPlacementScoresInput.desiredLocations = desiredLocations; - } else if ("desiredSizes".equals(fieldName)) { - List desiredSizes = reader.readArray(reader1 -> ResourceSize.fromJson(reader1)); - deserializedSpotPlacementScoresInput.desiredSizes = desiredSizes; - } else if ("desiredCount".equals(fieldName)) { - deserializedSpotPlacementScoresInput.desiredCount = reader.getNullable(JsonReader::getInt); - } else if ("availabilityZones".equals(fieldName)) { - deserializedSpotPlacementScoresInput.availabilityZones = reader.getNullable(JsonReader::getBoolean); - } else { - reader.skipChildren(); - } - } - - return deserializedSpotPlacementScoresInput; - }); - } -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/SpotPlacementScoresResponse.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/SpotPlacementScoresResponse.java deleted file mode 100644 index e3dce8b6d6e2..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/SpotPlacementScoresResponse.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.models; - -import com.azure.resourcemanager.computerecommender.fluent.models.SpotPlacementScoresResponseInner; -import java.util.List; - -/** - * An immutable client-side representation of SpotPlacementScoresResponse. - */ -public interface SpotPlacementScoresResponse { - /** - * Gets the desiredLocations property: The desired regions. - * - * @return the desiredLocations value. - */ - List desiredLocations(); - - /** - * Gets the desiredSizes property: The desired virtual machine SKU sizes. - * - * @return the desiredSizes value. - */ - List desiredSizes(); - - /** - * Gets the desiredCount property: Desired instance count per region/zone based on the scope. - * - * @return the desiredCount value. - */ - Integer desiredCount(); - - /** - * Gets the availabilityZones property: Defines if the scope is zonal or regional. - * - * @return the availabilityZones value. - */ - Boolean availabilityZones(); - - /** - * Gets the placementScores property: A placement score indicating the likelihood of successfully allocating the - * specified Spot VM(s), as well as the expected lifetimes of the Spot VM(s) after allocation. - * - * @return the placementScores value. - */ - List placementScores(); - - /** - * Gets the inner com.azure.resourcemanager.computerecommender.fluent.models.SpotPlacementScoresResponseInner - * object. - * - * @return the inner object. - */ - SpotPlacementScoresResponseInner innerModel(); -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/package-info.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/package-info.java deleted file mode 100644 index fd1003bc0b86..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -/** - * Package containing the data models for ComputeRecommender. - * The Compute Recommender Resource Provider Client. - */ -package com.azure.resourcemanager.computerecommender.models; diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/package-info.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/package-info.java deleted file mode 100644 index 22e0bd7d6aa9..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -/** - * Package containing the classes for ComputeRecommender. - * The Compute Recommender Resource Provider Client. - */ -package com.azure.resourcemanager.computerecommender; diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/module-info.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/module-info.java deleted file mode 100644 index 27edc446481d..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/module-info.java +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -module com.azure.resourcemanager.computerecommender { - requires transitive com.azure.core.management; - - exports com.azure.resourcemanager.computerecommender; - exports com.azure.resourcemanager.computerecommender.fluent; - exports com.azure.resourcemanager.computerecommender.fluent.models; - exports com.azure.resourcemanager.computerecommender.models; - - opens com.azure.resourcemanager.computerecommender.fluent.models to com.azure.core; - opens com.azure.resourcemanager.computerecommender.models to com.azure.core; - opens com.azure.resourcemanager.computerecommender.implementation.models to com.azure.core; -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/resources/META-INF/azure-resourcemanager-computerecommender_apiview_properties.json b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/resources/META-INF/azure-resourcemanager-computerecommender_apiview_properties.json deleted file mode 100644 index 9790322889a2..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/resources/META-INF/azure-resourcemanager-computerecommender_apiview_properties.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "flavor": "azure", - "CrossLanguageDefinitionId": { - "com.azure.resourcemanager.computerecommender.fluent.ComputeRecommenderManagementClient": "Microsoft.Compute", - "com.azure.resourcemanager.computerecommender.fluent.OperationsClient": "Microsoft.Compute.Operations", - "com.azure.resourcemanager.computerecommender.fluent.OperationsClient.list": "Azure.ResourceManager.Operations.list", - "com.azure.resourcemanager.computerecommender.fluent.SpotPlacementScoresClient": "Microsoft.Compute", - "com.azure.resourcemanager.computerecommender.fluent.SpotPlacementScoresClient.get": "Microsoft.Compute.ComputeDiagnosticBases.get", - "com.azure.resourcemanager.computerecommender.fluent.SpotPlacementScoresClient.getWithResponse": "Microsoft.Compute.ComputeDiagnosticBases.get", - "com.azure.resourcemanager.computerecommender.fluent.SpotPlacementScoresClient.post": "Microsoft.Compute.ComputeDiagnosticBases.post", - "com.azure.resourcemanager.computerecommender.fluent.SpotPlacementScoresClient.postWithResponse": "Microsoft.Compute.ComputeDiagnosticBases.post", - "com.azure.resourcemanager.computerecommender.fluent.models.ComputeDiagnosticBaseInner": "Microsoft.Compute.ComputeDiagnosticBase", - "com.azure.resourcemanager.computerecommender.fluent.models.OperationInner": "Azure.ResourceManager.CommonTypes.Operation", - "com.azure.resourcemanager.computerecommender.fluent.models.SpotPlacementScoresResponseInner": "Microsoft.Compute.SpotPlacementScoresResponse", - "com.azure.resourcemanager.computerecommender.implementation.ComputeRecommenderManagementClientBuilder": "Microsoft.Compute", - "com.azure.resourcemanager.computerecommender.implementation.models.OperationListResult": "Azure.ResourceManager.CommonTypes.OperationListResult", - "com.azure.resourcemanager.computerecommender.models.ActionType": "Azure.ResourceManager.CommonTypes.ActionType", - "com.azure.resourcemanager.computerecommender.models.DiagnosticProperties": "Microsoft.Compute.DiagnosticProperties", - "com.azure.resourcemanager.computerecommender.models.OperationDisplay": "Azure.ResourceManager.CommonTypes.OperationDisplay", - "com.azure.resourcemanager.computerecommender.models.Origin": "Azure.ResourceManager.CommonTypes.Origin", - "com.azure.resourcemanager.computerecommender.models.PlacementScore": "Microsoft.Compute.PlacementScore", - "com.azure.resourcemanager.computerecommender.models.ResourceSize": "Microsoft.Compute.ResourceSize", - "com.azure.resourcemanager.computerecommender.models.SpotPlacementScoresInput": "Microsoft.Compute.SpotPlacementScoresInput" - } -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/resources/META-INF/azure-resourcemanager-computerecommender_metadata.json b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/resources/META-INF/azure-resourcemanager-computerecommender_metadata.json deleted file mode 100644 index a8a480cb227e..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/resources/META-INF/azure-resourcemanager-computerecommender_metadata.json +++ /dev/null @@ -1 +0,0 @@ -{"flavor":"azure","apiVersion":"2025-06-05","crossLanguageDefinitions":{"com.azure.resourcemanager.computerecommender.fluent.ComputeRecommenderManagementClient":"Microsoft.Compute","com.azure.resourcemanager.computerecommender.fluent.OperationsClient":"Microsoft.Compute.Operations","com.azure.resourcemanager.computerecommender.fluent.OperationsClient.list":"Azure.ResourceManager.Operations.list","com.azure.resourcemanager.computerecommender.fluent.SpotPlacementScoresClient":"Microsoft.Compute","com.azure.resourcemanager.computerecommender.fluent.SpotPlacementScoresClient.get":"Microsoft.Compute.ComputeDiagnosticBases.get","com.azure.resourcemanager.computerecommender.fluent.SpotPlacementScoresClient.getWithResponse":"Microsoft.Compute.ComputeDiagnosticBases.get","com.azure.resourcemanager.computerecommender.fluent.SpotPlacementScoresClient.post":"Microsoft.Compute.ComputeDiagnosticBases.post","com.azure.resourcemanager.computerecommender.fluent.SpotPlacementScoresClient.postWithResponse":"Microsoft.Compute.ComputeDiagnosticBases.post","com.azure.resourcemanager.computerecommender.fluent.models.ComputeDiagnosticBaseInner":"Microsoft.Compute.ComputeDiagnosticBase","com.azure.resourcemanager.computerecommender.fluent.models.OperationInner":"Azure.ResourceManager.CommonTypes.Operation","com.azure.resourcemanager.computerecommender.fluent.models.SpotPlacementScoresResponseInner":"Microsoft.Compute.SpotPlacementScoresResponse","com.azure.resourcemanager.computerecommender.implementation.ComputeRecommenderManagementClientBuilder":"Microsoft.Compute","com.azure.resourcemanager.computerecommender.implementation.models.OperationListResult":"Azure.ResourceManager.CommonTypes.OperationListResult","com.azure.resourcemanager.computerecommender.models.ActionType":"Azure.ResourceManager.CommonTypes.ActionType","com.azure.resourcemanager.computerecommender.models.DiagnosticProperties":"Microsoft.Compute.DiagnosticProperties","com.azure.resourcemanager.computerecommender.models.OperationDisplay":"Azure.ResourceManager.CommonTypes.OperationDisplay","com.azure.resourcemanager.computerecommender.models.Origin":"Azure.ResourceManager.CommonTypes.Origin","com.azure.resourcemanager.computerecommender.models.PlacementScore":"Microsoft.Compute.PlacementScore","com.azure.resourcemanager.computerecommender.models.ResourceSize":"Microsoft.Compute.ResourceSize","com.azure.resourcemanager.computerecommender.models.SpotPlacementScoresInput":"Microsoft.Compute.SpotPlacementScoresInput"},"generatedFiles":["src/main/java/com/azure/resourcemanager/computerecommender/ComputeRecommenderManager.java","src/main/java/com/azure/resourcemanager/computerecommender/fluent/ComputeRecommenderManagementClient.java","src/main/java/com/azure/resourcemanager/computerecommender/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/computerecommender/fluent/SpotPlacementScoresClient.java","src/main/java/com/azure/resourcemanager/computerecommender/fluent/models/ComputeDiagnosticBaseInner.java","src/main/java/com/azure/resourcemanager/computerecommender/fluent/models/OperationInner.java","src/main/java/com/azure/resourcemanager/computerecommender/fluent/models/SpotPlacementScoresResponseInner.java","src/main/java/com/azure/resourcemanager/computerecommender/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/computerecommender/fluent/package-info.java","src/main/java/com/azure/resourcemanager/computerecommender/implementation/ComputeDiagnosticBaseImpl.java","src/main/java/com/azure/resourcemanager/computerecommender/implementation/ComputeRecommenderManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/computerecommender/implementation/ComputeRecommenderManagementClientImpl.java","src/main/java/com/azure/resourcemanager/computerecommender/implementation/OperationImpl.java","src/main/java/com/azure/resourcemanager/computerecommender/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/computerecommender/implementation/OperationsImpl.java","src/main/java/com/azure/resourcemanager/computerecommender/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/computerecommender/implementation/SpotPlacementScoresClientImpl.java","src/main/java/com/azure/resourcemanager/computerecommender/implementation/SpotPlacementScoresImpl.java","src/main/java/com/azure/resourcemanager/computerecommender/implementation/SpotPlacementScoresResponseImpl.java","src/main/java/com/azure/resourcemanager/computerecommender/implementation/models/OperationListResult.java","src/main/java/com/azure/resourcemanager/computerecommender/implementation/package-info.java","src/main/java/com/azure/resourcemanager/computerecommender/models/ActionType.java","src/main/java/com/azure/resourcemanager/computerecommender/models/ComputeDiagnosticBase.java","src/main/java/com/azure/resourcemanager/computerecommender/models/DiagnosticProperties.java","src/main/java/com/azure/resourcemanager/computerecommender/models/Operation.java","src/main/java/com/azure/resourcemanager/computerecommender/models/OperationDisplay.java","src/main/java/com/azure/resourcemanager/computerecommender/models/Operations.java","src/main/java/com/azure/resourcemanager/computerecommender/models/Origin.java","src/main/java/com/azure/resourcemanager/computerecommender/models/PlacementScore.java","src/main/java/com/azure/resourcemanager/computerecommender/models/ResourceSize.java","src/main/java/com/azure/resourcemanager/computerecommender/models/SpotPlacementScores.java","src/main/java/com/azure/resourcemanager/computerecommender/models/SpotPlacementScoresInput.java","src/main/java/com/azure/resourcemanager/computerecommender/models/SpotPlacementScoresResponse.java","src/main/java/com/azure/resourcemanager/computerecommender/models/package-info.java","src/main/java/com/azure/resourcemanager/computerecommender/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-computerecommender/proxy-config.json b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-computerecommender/proxy-config.json deleted file mode 100644 index c4e71646ce5a..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-computerecommender/proxy-config.json +++ /dev/null @@ -1 +0,0 @@ -[["com.azure.resourcemanager.computerecommender.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.computerecommender.implementation.SpotPlacementScoresClientImpl$SpotPlacementScoresService"]] \ No newline at end of file diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-computerecommender/reflect-config.json b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-computerecommender/reflect-config.json deleted file mode 100644 index 0637a088a01e..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-computerecommender/reflect-config.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/resources/azure-resourcemanager-computerecommender.properties b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/resources/azure-resourcemanager-computerecommender.properties deleted file mode 100644 index defbd48204e4..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/resources/azure-resourcemanager-computerecommender.properties +++ /dev/null @@ -1 +0,0 @@ -version=${project.version} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/samples/java/com/azure/resourcemanager/computerecommender/generated/OperationsListSamples.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/samples/java/com/azure/resourcemanager/computerecommender/generated/OperationsListSamples.java deleted file mode 100644 index 46b24dc968dc..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/samples/java/com/azure/resourcemanager/computerecommender/generated/OperationsListSamples.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.generated; - -/** - * Samples for Operations List. - */ -public final class OperationsListSamples { - /* - * x-ms-original-file: 2025-06-05/Operations_List_MinimumSet_Gen.json - */ - /** - * Sample code: Operations_List_MinimumSet_Gen. - * - * @param manager Entry point to ComputeRecommenderManager. - */ - public static void - operationsListMinimumSetGen(com.azure.resourcemanager.computerecommender.ComputeRecommenderManager manager) { - manager.operations().list(com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: 2025-06-05/Operations_List_MaximumSet_Gen.json - */ - /** - * Sample code: Operations_List_MaximumSet_Gen. - * - * @param manager Entry point to ComputeRecommenderManager. - */ - public static void - operationsListMaximumSetGen(com.azure.resourcemanager.computerecommender.ComputeRecommenderManager manager) { - manager.operations().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/samples/java/com/azure/resourcemanager/computerecommender/generated/SpotPlacementScoresGetSamples.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/samples/java/com/azure/resourcemanager/computerecommender/generated/SpotPlacementScoresGetSamples.java deleted file mode 100644 index df170db2f582..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/samples/java/com/azure/resourcemanager/computerecommender/generated/SpotPlacementScoresGetSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.generated; - -/** - * Samples for SpotPlacementScores Get. - */ -public final class SpotPlacementScoresGetSamples { - /* - * x-ms-original-file: 2025-06-05/GetSpotPlacementScores.json - */ - /** - * Sample code: Gets the metadata of Spot Placement Scores. - * - * @param manager Entry point to ComputeRecommenderManager. - */ - public static void getsTheMetadataOfSpotPlacementScores( - com.azure.resourcemanager.computerecommender.ComputeRecommenderManager manager) { - manager.spotPlacementScores().getWithResponse("eastus", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/samples/java/com/azure/resourcemanager/computerecommender/generated/SpotPlacementScoresPostSamples.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/samples/java/com/azure/resourcemanager/computerecommender/generated/SpotPlacementScoresPostSamples.java deleted file mode 100644 index f62518c4b2d1..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/samples/java/com/azure/resourcemanager/computerecommender/generated/SpotPlacementScoresPostSamples.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.generated; - -import com.azure.resourcemanager.computerecommender.models.ResourceSize; -import com.azure.resourcemanager.computerecommender.models.SpotPlacementScoresInput; -import java.util.Arrays; - -/** - * Samples for SpotPlacementScores Post. - */ -public final class SpotPlacementScoresPostSamples { - /* - * x-ms-original-file: 2025-06-05/GenerateSpotPlacementScores.json - */ - /** - * Sample code: Returns spot VM placement scores for given configurations. - * - * @param manager Entry point to ComputeRecommenderManager. - */ - public static void returnsSpotVMPlacementScoresForGivenConfigurations( - com.azure.resourcemanager.computerecommender.ComputeRecommenderManager manager) { - manager.spotPlacementScores() - .postWithResponse("eastus", - new SpotPlacementScoresInput().withDesiredLocations(Arrays.asList("eastus", "eastus2")) - .withDesiredSizes(Arrays.asList(new ResourceSize().withSku("Standard_D2_v2"))) - .withDesiredCount(1) - .withAvailabilityZones(true), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/ComputeDiagnosticBaseInnerTests.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/ComputeDiagnosticBaseInnerTests.java deleted file mode 100644 index ee2594ce947d..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/ComputeDiagnosticBaseInnerTests.java +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.computerecommender.fluent.models.ComputeDiagnosticBaseInner; -import org.junit.jupiter.api.Assertions; - -public final class ComputeDiagnosticBaseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComputeDiagnosticBaseInner model = BinaryData.fromString( - "{\"properties\":{\"supportedResourceTypes\":[\"bpzvgn\",\"zsymglzufcyzkohd\",\"ihanuf\",\"fcbjysagithxqha\"]},\"id\":\"fpikxwczb\",\"name\":\"scnpqxuhivy\",\"type\":\"n\"}") - .toObject(ComputeDiagnosticBaseInner.class); - Assertions.assertEquals("bpzvgn", model.properties().supportedResourceTypes().get(0)); - } -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/DiagnosticPropertiesTests.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/DiagnosticPropertiesTests.java deleted file mode 100644 index 7cf42943ba90..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/DiagnosticPropertiesTests.java +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.computerecommender.models.DiagnosticProperties; -import org.junit.jupiter.api.Assertions; - -public final class DiagnosticPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DiagnosticProperties model - = BinaryData.fromString("{\"supportedResourceTypes\":[\"ybrk\"]}").toObject(DiagnosticProperties.class); - Assertions.assertEquals("ybrk", model.supportedResourceTypes().get(0)); - } -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/OperationDisplayTests.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/OperationDisplayTests.java deleted file mode 100644 index c36cf61e7d12..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/OperationDisplayTests.java +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.computerecommender.models.OperationDisplay; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = BinaryData.fromString( - "{\"provider\":\"cdm\",\"resource\":\"rcryuanzwuxzdxta\",\"operation\":\"lhmwhfpmrqobm\",\"description\":\"kknryrtihf\"}") - .toObject(OperationDisplay.class); - } -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/OperationInnerTests.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/OperationInnerTests.java deleted file mode 100644 index 17db54d1a770..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/OperationInnerTests.java +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.computerecommender.fluent.models.OperationInner; - -public final class OperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInner model = BinaryData.fromString( - "{\"name\":\"nygj\",\"isDataAction\":true,\"display\":{\"provider\":\"eqsrdeupewnwreit\",\"resource\":\"yflusarhmofc\",\"operation\":\"smy\",\"description\":\"kdtmlxhekuk\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") - .toObject(OperationInner.class); - } -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/OperationListResultTests.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/OperationListResultTests.java deleted file mode 100644 index a8c8432d8139..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/OperationListResultTests.java +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.computerecommender.implementation.models.OperationListResult; -import org.junit.jupiter.api.Assertions; - -public final class OperationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationListResult model = BinaryData.fromString( - "{\"value\":[{\"name\":\"hq\",\"isDataAction\":true,\"display\":{\"provider\":\"pybczmehmtzopb\",\"resource\":\"h\",\"operation\":\"pidgsybbejhphoyc\",\"description\":\"xaobhdxbmtqioqjz\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"fpownoizhwlr\",\"isDataAction\":false,\"display\":{\"provider\":\"oqijgkdmbpaz\",\"resource\":\"bc\",\"operation\":\"pdznrbtcqqjnqgl\",\"description\":\"gnufoooj\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"esaagdfm\",\"isDataAction\":true,\"display\":{\"provider\":\"j\",\"resource\":\"ifkwmrvktsizntoc\",\"operation\":\"a\",\"description\":\"ajpsquc\"},\"origin\":\"system\",\"actionType\":\"Internal\"}],\"nextLink\":\"kfo\"}") - .toObject(OperationListResult.class); - Assertions.assertEquals("kfo", model.nextLink()); - } -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/OperationsListMockTests.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/OperationsListMockTests.java deleted file mode 100644 index 1049cf8b3a97..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/OperationsListMockTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.computerecommender.ComputeRecommenderManager; -import com.azure.resourcemanager.computerecommender.models.Operation; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class OperationsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"name\":\"f\",\"isDataAction\":false,\"display\":{\"provider\":\"zgvfcjrwz\",\"resource\":\"xjtfelluwfzit\",\"operation\":\"peqfpjkjl\",\"description\":\"fpdvhpfxxypi\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ComputeRecommenderManager manager = ComputeRecommenderManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/PlacementScoreTests.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/PlacementScoreTests.java deleted file mode 100644 index 8c8119a7846e..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/PlacementScoreTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.computerecommender.models.PlacementScore; -import org.junit.jupiter.api.Assertions; - -public final class PlacementScoreTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PlacementScore model = BinaryData.fromString( - "{\"sku\":\"hbcryffdfdosyge\",\"region\":\"aojakhmsbzjhcrz\",\"availabilityZone\":\"dphlxaolt\",\"score\":\"trg\",\"isQuotaAvailable\":false}") - .toObject(PlacementScore.class); - Assertions.assertEquals("hbcryffdfdosyge", model.sku()); - Assertions.assertEquals("aojakhmsbzjhcrz", model.region()); - Assertions.assertEquals("dphlxaolt", model.availabilityZone()); - Assertions.assertEquals("trg", model.score()); - Assertions.assertFalse(model.isQuotaAvailable()); - } -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/ResourceSizeTests.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/ResourceSizeTests.java deleted file mode 100644 index 326791ecbbf1..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/ResourceSizeTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.computerecommender.models.ResourceSize; -import org.junit.jupiter.api.Assertions; - -public final class ResourceSizeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceSize model = BinaryData.fromString("{\"sku\":\"ahuxinpm\"}").toObject(ResourceSize.class); - Assertions.assertEquals("ahuxinpm", model.sku()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceSize model = new ResourceSize().withSku("ahuxinpm"); - model = BinaryData.fromObject(model).toObject(ResourceSize.class); - Assertions.assertEquals("ahuxinpm", model.sku()); - } -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/SpotPlacementScoresGetWithResponseMockTests.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/SpotPlacementScoresGetWithResponseMockTests.java deleted file mode 100644 index 5fb24b273ecd..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/SpotPlacementScoresGetWithResponseMockTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.computerecommender.ComputeRecommenderManager; -import com.azure.resourcemanager.computerecommender.models.ComputeDiagnosticBase; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SpotPlacementScoresGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"supportedResourceTypes\":[\"ginuvamih\",\"ognarxzxtheotus\",\"vyevcciqi\",\"nhungbw\"]},\"id\":\"rnfygxgispem\",\"name\":\"tzfkufubl\",\"type\":\"ofx\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ComputeRecommenderManager manager = ComputeRecommenderManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - ComputeDiagnosticBase response - = manager.spotPlacementScores().getWithResponse("yhuybbkpod", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("ginuvamih", response.properties().supportedResourceTypes().get(0)); - } -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/SpotPlacementScoresInputTests.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/SpotPlacementScoresInputTests.java deleted file mode 100644 index edd5d0005f22..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/SpotPlacementScoresInputTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.computerecommender.models.ResourceSize; -import com.azure.resourcemanager.computerecommender.models.SpotPlacementScoresInput; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SpotPlacementScoresInputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SpotPlacementScoresInput model = BinaryData.fromString( - "{\"desiredLocations\":[\"umjgrtfwvuk\",\"gaudcc\",\"nhsjcnyej\"],\"desiredSizes\":[{\"sku\":\"htnapczwlokjyem\"},{\"sku\":\"vnipjox\"},{\"sku\":\"nchgej\"},{\"sku\":\"odmailzyd\"}],\"desiredCount\":52138230,\"availabilityZones\":true}") - .toObject(SpotPlacementScoresInput.class); - Assertions.assertEquals("umjgrtfwvuk", model.desiredLocations().get(0)); - Assertions.assertEquals("htnapczwlokjyem", model.desiredSizes().get(0).sku()); - Assertions.assertEquals(52138230, model.desiredCount()); - Assertions.assertTrue(model.availabilityZones()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SpotPlacementScoresInput model - = new SpotPlacementScoresInput().withDesiredLocations(Arrays.asList("umjgrtfwvuk", "gaudcc", "nhsjcnyej")) - .withDesiredSizes( - Arrays.asList(new ResourceSize().withSku("htnapczwlokjyem"), new ResourceSize().withSku("vnipjox"), - new ResourceSize().withSku("nchgej"), new ResourceSize().withSku("odmailzyd"))) - .withDesiredCount(52138230) - .withAvailabilityZones(true); - model = BinaryData.fromObject(model).toObject(SpotPlacementScoresInput.class); - Assertions.assertEquals("umjgrtfwvuk", model.desiredLocations().get(0)); - Assertions.assertEquals("htnapczwlokjyem", model.desiredSizes().get(0).sku()); - Assertions.assertEquals(52138230, model.desiredCount()); - Assertions.assertTrue(model.availabilityZones()); - } -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/SpotPlacementScoresPostWithResponseMockTests.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/SpotPlacementScoresPostWithResponseMockTests.java deleted file mode 100644 index 76332f1e75dc..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/SpotPlacementScoresPostWithResponseMockTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.computerecommender.ComputeRecommenderManager; -import com.azure.resourcemanager.computerecommender.models.ResourceSize; -import com.azure.resourcemanager.computerecommender.models.SpotPlacementScoresInput; -import com.azure.resourcemanager.computerecommender.models.SpotPlacementScoresResponse; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SpotPlacementScoresPostWithResponseMockTests { - @Test - public void testPostWithResponse() throws Exception { - String responseStr - = "{\"desiredLocations\":[\"wrwclxxwrljd\",\"uskcqvkocrcj\",\"kwt\",\"hxbnjbiksqrg\"],\"desiredSizes\":[{\"sku\":\"inqpjwnzll\"},{\"sku\":\"mppeebvmgxs\"},{\"sku\":\"kyqduujit\"}],\"desiredCount\":1447556622,\"availabilityZones\":true,\"placementScores\":[{\"sku\":\"ndhkrw\",\"region\":\"appd\",\"availabilityZone\":\"dkvwrwjfe\",\"score\":\"nhutjeltmrldhugj\",\"isQuotaAvailable\":true},{\"sku\":\"tqxhocdgeab\",\"region\":\"phut\",\"availabilityZone\":\"ndv\",\"score\":\"ozwyiftyhxhuro\",\"isQuotaAvailable\":true}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ComputeRecommenderManager manager = ComputeRecommenderManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - SpotPlacementScoresResponse response = manager.spotPlacementScores() - .postWithResponse("eofjaeqjh", - new SpotPlacementScoresInput().withDesiredLocations(Arrays.asList("asvm")) - .withDesiredSizes(Arrays.asList(new ResourceSize().withSku("ulngsntn"))) - .withDesiredCount(588307069) - .withAvailabilityZones(false), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("wrwclxxwrljd", response.desiredLocations().get(0)); - Assertions.assertEquals("inqpjwnzll", response.desiredSizes().get(0).sku()); - Assertions.assertEquals(1447556622, response.desiredCount()); - Assertions.assertTrue(response.availabilityZones()); - Assertions.assertEquals("ndhkrw", response.placementScores().get(0).sku()); - Assertions.assertEquals("appd", response.placementScores().get(0).region()); - Assertions.assertEquals("dkvwrwjfe", response.placementScores().get(0).availabilityZone()); - Assertions.assertEquals("nhutjeltmrldhugj", response.placementScores().get(0).score()); - Assertions.assertTrue(response.placementScores().get(0).isQuotaAvailable()); - } -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/SpotPlacementScoresResponseInnerTests.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/SpotPlacementScoresResponseInnerTests.java deleted file mode 100644 index a854d0452bfe..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/SpotPlacementScoresResponseInnerTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.computerecommender.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.computerecommender.fluent.models.SpotPlacementScoresResponseInner; -import org.junit.jupiter.api.Assertions; - -public final class SpotPlacementScoresResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SpotPlacementScoresResponseInner model = BinaryData.fromString( - "{\"desiredLocations\":[\"aqwi\",\"jsprozvcpute\",\"jvwmfda\"],\"desiredSizes\":[{\"sku\":\"dvpjhulsuuvmk\"}],\"desiredCount\":1523765181,\"availabilityZones\":false,\"placementScores\":[{\"sku\":\"dio\",\"region\":\"pslwejdpvw\",\"availabilityZone\":\"oqpsoa\",\"score\":\"tazak\",\"isQuotaAvailable\":true}]}") - .toObject(SpotPlacementScoresResponseInner.class); - Assertions.assertEquals("aqwi", model.desiredLocations().get(0)); - Assertions.assertEquals("dvpjhulsuuvmk", model.desiredSizes().get(0).sku()); - Assertions.assertEquals(1523765181, model.desiredCount()); - Assertions.assertFalse(model.availabilityZones()); - Assertions.assertEquals("dio", model.placementScores().get(0).sku()); - Assertions.assertEquals("pslwejdpvw", model.placementScores().get(0).region()); - Assertions.assertEquals("oqpsoa", model.placementScores().get(0).availabilityZone()); - Assertions.assertEquals("tazak", model.placementScores().get(0).score()); - Assertions.assertTrue(model.placementScores().get(0).isQuotaAvailable()); - } -} diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/tsp-location.yaml b/sdk/computerecommender/azure-resourcemanager-computerecommender/tsp-location.yaml deleted file mode 100644 index 036339702cd9..000000000000 --- a/sdk/computerecommender/azure-resourcemanager-computerecommender/tsp-location.yaml +++ /dev/null @@ -1,4 +0,0 @@ -directory: specification/compute/resource-manager/Microsoft.Compute/RecommenderRP -commit: 222af3670e36c5083cb0dc8a9c2677a8f77f8958 -repo: Azure/azure-rest-api-specs -additionalDirectories: diff --git a/sdk/computerecommender/ci.yml b/sdk/computerecommender/ci.yml deleted file mode 100644 index 2933b4c50820..000000000000 --- a/sdk/computerecommender/ci.yml +++ /dev/null @@ -1,46 +0,0 @@ -# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. - -trigger: - branches: - include: - - main - - hotfix/* - - release/* - paths: - include: - - sdk/computerecommender/ci.yml - - sdk/computerecommender/azure-resourcemanager-computerecommender/ - exclude: - - sdk/computerecommender/pom.xml - - sdk/computerecommender/azure-resourcemanager-computerecommender/pom.xml - -pr: - branches: - include: - - main - - feature/* - - hotfix/* - - release/* - paths: - include: - - sdk/computerecommender/ci.yml - - sdk/computerecommender/azure-resourcemanager-computerecommender/ - exclude: - - sdk/computerecommender/pom.xml - - sdk/computerecommender/azure-resourcemanager-computerecommender/pom.xml - -parameters: - - name: release_azureresourcemanagercomputerecommender - displayName: azure-resourcemanager-computerecommender - type: boolean - default: false - -extends: - template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml - parameters: - ServiceDirectory: computerecommender - Artifacts: - - name: azure-resourcemanager-computerecommender - groupId: com.azure.resourcemanager - safeName: azureresourcemanagercomputerecommender - releaseInBatch: ${{ parameters.release_azureresourcemanagercomputerecommender }} diff --git a/sdk/computerecommender/pom.xml b/sdk/computerecommender/pom.xml deleted file mode 100644 index 5c3ef6a5d882..000000000000 --- a/sdk/computerecommender/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - com.azure - azure-computerecommender-service - pom - 1.0.0 - - - azure-resourcemanager-computerecommender - -