From 69d15e2b6a9bed85ba543aab93f93915fa0d4e50 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Fri, 17 Apr 2026 18:46:07 +0000 Subject: [PATCH] Configurations: 'specification/computelimit/resource-manager/Microsoft.ComputeLimit/ComputeLimit/tspconfig.yaml', API Version: 2026-04-30, SDK Release Type: stable, and CommitSHA: 'fecd9f0cc1b1589c66295932e97f18226f51a28b' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6173518 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- eng/versioning/version_client.txt | 2 +- .../CHANGELOG.md | 25 +- .../README.md | 4 +- .../SAMPLE.md | 168 ++++- .../pom.xml | 8 +- .../computelimit/ComputeLimitManager.java | 32 + .../fluent/ComputeLimitClient.java | 14 + .../computelimit/fluent/FeaturesClient.java | 184 +++++ .../computelimit/fluent/VmFamiliesClient.java | 71 ++ .../fluent/models/FeatureInner.java | 144 ++++ .../models/OperationStatusResultInner.java | 222 ++++++ .../fluent/models/VmFamilyInner.java | 144 ++++ .../ComputeLimitClientImpl.java | 34 +- .../implementation/FeatureImpl.java | 49 ++ .../implementation/FeaturesClientImpl.java | 701 ++++++++++++++++++ .../implementation/FeaturesImpl.java | 100 +++ .../OperationStatusResultImpl.java | 76 ++ .../implementation/VmFamiliesClientImpl.java | 377 ++++++++++ .../implementation/VmFamiliesImpl.java | 63 ++ .../implementation/VmFamilyImpl.java | 49 ++ .../models/FeatureListResult.java | 95 +++ .../models/VmFamilyListResult.java | 95 +++ .../computelimit/models/Feature.java | 55 ++ .../models/FeatureProperties.java | 91 +++ .../computelimit/models/FeatureState.java | 51 ++ .../computelimit/models/Features.java | 112 +++ .../models/OperationStatusResult.java | 86 +++ .../computelimit/models/VmFamilies.java | 64 ++ .../computelimit/models/VmFamily.java | 55 ++ .../models/VmFamilyProperties.java | 91 +++ ...resourcemanager-computelimit_metadata.json | 2 +- .../proxy-config.json | 2 +- .../generated/FeaturesDisableSamples.java | 22 + .../generated/FeaturesEnableSamples.java | 22 + .../generated/FeaturesGetSamples.java | 34 + ...BySubscriptionLocationResourceSamples.java | 22 + .../GuestSubscriptionsCreateSamples.java | 2 +- .../GuestSubscriptionsDeleteSamples.java | 2 +- .../GuestSubscriptionsGetSamples.java | 2 +- ...BySubscriptionLocationResourceSamples.java | 2 +- .../generated/OperationsListSamples.java | 2 +- .../generated/SharedLimitsCreateSamples.java | 2 +- .../generated/SharedLimitsDeleteSamples.java | 2 +- .../generated/SharedLimitsGetSamples.java | 2 +- ...BySubscriptionLocationResourceSamples.java | 2 +- .../generated/VmFamiliesGetSamples.java | 22 + ...BySubscriptionLocationResourceSamples.java | 22 + .../generated/FeatureInnerTests.java | 20 + .../generated/FeatureListResultTests.java | 21 + .../generated/FeaturePropertiesTests.java | 19 + .../FeaturesGetWithResponseMockTests.java | 40 + ...SubscriptionLocationResourceMockTests.java | 40 + ...scriptionsCreateWithResponseMockTests.java | 6 +- ...eByResourceGroupWithResponseMockTests.java | 2 +- ...SubscriptionsGetWithResponseMockTests.java | 4 +- ...SubscriptionLocationResourceMockTests.java | 6 +- .../generated/OperationsListMockTests.java | 2 +- ...aredLimitsCreateWithResponseMockTests.java | 6 +- ...eByResourceGroupWithResponseMockTests.java | 3 +- .../SharedLimitsGetWithResponseMockTests.java | 7 +- ...SubscriptionLocationResourceMockTests.java | 6 +- .../VmFamiliesGetWithResponseMockTests.java | 39 + ...SubscriptionLocationResourceMockTests.java | 39 + .../generated/VmFamilyInnerTests.java | 19 + .../generated/VmFamilyListResultTests.java | 20 + .../generated/VmFamilyPropertiesTests.java | 18 + .../tsp-location.yaml | 2 +- 67 files changed, 3694 insertions(+), 53 deletions(-) create mode 100644 sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/fluent/FeaturesClient.java create mode 100644 sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/fluent/VmFamiliesClient.java create mode 100644 sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/fluent/models/FeatureInner.java create mode 100644 sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/fluent/models/OperationStatusResultInner.java create mode 100644 sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/fluent/models/VmFamilyInner.java create mode 100644 sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/implementation/FeatureImpl.java create mode 100644 sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/implementation/FeaturesClientImpl.java create mode 100644 sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/implementation/FeaturesImpl.java create mode 100644 sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/implementation/OperationStatusResultImpl.java create mode 100644 sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/implementation/VmFamiliesClientImpl.java create mode 100644 sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/implementation/VmFamiliesImpl.java create mode 100644 sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/implementation/VmFamilyImpl.java create mode 100644 sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/implementation/models/FeatureListResult.java create mode 100644 sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/implementation/models/VmFamilyListResult.java create mode 100644 sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/models/Feature.java create mode 100644 sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/models/FeatureProperties.java create mode 100644 sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/models/FeatureState.java create mode 100644 sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/models/Features.java create mode 100644 sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/models/OperationStatusResult.java create mode 100644 sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/models/VmFamilies.java create mode 100644 sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/models/VmFamily.java create mode 100644 sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/models/VmFamilyProperties.java create mode 100644 sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/FeaturesDisableSamples.java create mode 100644 sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/FeaturesEnableSamples.java create mode 100644 sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/FeaturesGetSamples.java create mode 100644 sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/FeaturesListBySubscriptionLocationResourceSamples.java create mode 100644 sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/VmFamiliesGetSamples.java create mode 100644 sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/VmFamiliesListBySubscriptionLocationResourceSamples.java create mode 100644 sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/FeatureInnerTests.java create mode 100644 sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/FeatureListResultTests.java create mode 100644 sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/FeaturePropertiesTests.java create mode 100644 sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/FeaturesGetWithResponseMockTests.java create mode 100644 sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/FeaturesListBySubscriptionLocationResourceMockTests.java create mode 100644 sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/VmFamiliesGetWithResponseMockTests.java create mode 100644 sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/VmFamiliesListBySubscriptionLocationResourceMockTests.java create mode 100644 sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/VmFamilyInnerTests.java create mode 100644 sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/VmFamilyListResultTests.java create mode 100644 sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/VmFamilyPropertiesTests.java diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 85ad7d2a5dc0..7c85c2ef6760 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -515,7 +515,7 @@ com.azure.resourcemanager:azure-resourcemanager-azurestackhci-vm;1.0.0-beta.1;1. com.azure.resourcemanager:azure-resourcemanager-workloadorchestration;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-disconnectedoperations;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-compute-recommender;1.0.0-beta.1;1.0.0-beta.2 -com.azure.resourcemanager:azure-resourcemanager-computelimit;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-computelimit;1.0.0-beta.1;1.0.0 com.azure.resourcemanager:azure-resourcemanager-containerregistry-tasks;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-virtualenclaves;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-edgeactions;1.0.0-beta.1;1.0.0-beta.2 diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/CHANGELOG.md b/sdk/computelimit/azure-resourcemanager-computelimit/CHANGELOG.md index 3dc86eb03faf..4096a2924273 100644 --- a/sdk/computelimit/azure-resourcemanager-computelimit/CHANGELOG.md +++ b/sdk/computelimit/azure-resourcemanager-computelimit/CHANGELOG.md @@ -1,14 +1,31 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0 (2026-04-17) + +- Azure Resource Manager ComputeLimit client library for Java. This package contains Microsoft Azure SDK for ComputeLimit Management SDK. Microsoft Azure Compute Limit Resource Provider. Package api-version 2026-04-30. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added -### Breaking Changes +* `models.OperationStatusResult` was added + +* `models.VmFamilyProperties` was added + +* `models.VmFamilies` was added + +* `models.VmFamily` was added + +* `models.FeatureProperties` was added + +* `models.Feature` was added + +* `models.FeatureState` was added + +* `models.Features` was added -### Bugs Fixed +#### `ComputeLimitManager` was modified -### Other Changes +* `features()` was added +* `vmFamilies()` was added ## 1.0.0-beta.1 (2025-11-12) diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/README.md b/sdk/computelimit/azure-resourcemanager-computelimit/README.md index 79f527144d67..741b0771382c 100644 --- a/sdk/computelimit/azure-resourcemanager-computelimit/README.md +++ b/sdk/computelimit/azure-resourcemanager-computelimit/README.md @@ -2,7 +2,7 @@ Azure Resource Manager ComputeLimit client library for Java. -This package contains Microsoft Azure SDK for ComputeLimit Management SDK. Microsoft Azure Compute Limit Resource Provider. Package api-version 2025-08-15. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for ComputeLimit Management SDK. Microsoft Azure Compute Limit Resource Provider. Package api-version 2026-04-30. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-computelimit - 1.0.0-beta.1 + 1.0.0 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/SAMPLE.md b/sdk/computelimit/azure-resourcemanager-computelimit/SAMPLE.md index ab824a3708d1..608c8c3149b5 100644 --- a/sdk/computelimit/azure-resourcemanager-computelimit/SAMPLE.md +++ b/sdk/computelimit/azure-resourcemanager-computelimit/SAMPLE.md @@ -1,6 +1,13 @@ # Code snippets and samples +## Features + +- [Disable](#features_disable) +- [Enable](#features_enable) +- [Get](#features_get) +- [ListBySubscriptionLocationResource](#features_listbysubscriptionlocationresource) + ## GuestSubscriptions - [Create](#guestsubscriptions_create) @@ -18,6 +25,107 @@ - [Delete](#sharedlimits_delete) - [Get](#sharedlimits_get) - [ListBySubscriptionLocationResource](#sharedlimits_listbysubscriptionlocationresource) + +## VmFamilies + +- [Get](#vmfamilies_get) +- [ListBySubscriptionLocationResource](#vmfamilies_listbysubscriptionlocationresource) +### Features_Disable + +```java +/** + * Samples for Features Disable. + */ +public final class FeaturesDisableSamples { + /* + * x-ms-original-file: 2026-04-30/Features_Disable.json + */ + /** + * Sample code: Disable feature. + * + * @param manager Entry point to ComputeLimitManager. + */ + public static void disableFeature(com.azure.resourcemanager.computelimit.ComputeLimitManager manager) { + manager.features().disable("eastus", "VmCategoryQuota", com.azure.core.util.Context.NONE); + } +} +``` + +### Features_Enable + +```java +/** + * Samples for Features Enable. + */ +public final class FeaturesEnableSamples { + /* + * x-ms-original-file: 2026-04-30/Features_Enable.json + */ + /** + * Sample code: Enable feature. + * + * @param manager Entry point to ComputeLimitManager. + */ + public static void enableFeature(com.azure.resourcemanager.computelimit.ComputeLimitManager manager) { + manager.features().enable("eastus", "VmCategoryQuota", com.azure.core.util.Context.NONE); + } +} +``` + +### Features_Get + +```java +/** + * Samples for Features Get. + */ +public final class FeaturesGetSamples { + /* + * x-ms-original-file: 2026-04-30/Features_Get_SharedLimit.json + */ + /** + * Sample code: Get SharedLimit feature. + * + * @param manager Entry point to ComputeLimitManager. + */ + public static void getSharedLimitFeature(com.azure.resourcemanager.computelimit.ComputeLimitManager manager) { + manager.features().getWithResponse("eastus", "SharedLimit", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-04-30/Features_Get.json + */ + /** + * Sample code: Get feature. + * + * @param manager Entry point to ComputeLimitManager. + */ + public static void getFeature(com.azure.resourcemanager.computelimit.ComputeLimitManager manager) { + manager.features().getWithResponse("eastus", "VmCategoryQuota", com.azure.core.util.Context.NONE); + } +} +``` + +### Features_ListBySubscriptionLocationResource + +```java +/** + * Samples for Features ListBySubscriptionLocationResource. + */ +public final class FeaturesListBySubscriptionLocationResourceSamples { + /* + * x-ms-original-file: 2026-04-30/Features_List.json + */ + /** + * Sample code: List features. + * + * @param manager Entry point to ComputeLimitManager. + */ + public static void listFeatures(com.azure.resourcemanager.computelimit.ComputeLimitManager manager) { + manager.features().listBySubscriptionLocationResource("eastus", com.azure.core.util.Context.NONE); + } +} +``` + ### GuestSubscriptions_Create ```java @@ -28,7 +136,7 @@ import com.azure.resourcemanager.computelimit.models.GuestSubscriptionProperties */ public final class GuestSubscriptionsCreateSamples { /* - * x-ms-original-file: 2025-08-15/GuestSubscriptions_Create.json + * x-ms-original-file: 2026-04-30/GuestSubscriptions_Create.json */ /** * Sample code: Create a guest subscription. @@ -53,7 +161,7 @@ public final class GuestSubscriptionsCreateSamples { */ public final class GuestSubscriptionsDeleteSamples { /* - * x-ms-original-file: 2025-08-15/GuestSubscriptions_Delete.json + * x-ms-original-file: 2026-04-30/GuestSubscriptions_Delete.json */ /** * Sample code: Delete a guest subscription. @@ -76,7 +184,7 @@ public final class GuestSubscriptionsDeleteSamples { */ public final class GuestSubscriptionsGetSamples { /* - * x-ms-original-file: 2025-08-15/GuestSubscriptions_Get.json + * x-ms-original-file: 2026-04-30/GuestSubscriptions_Get.json */ /** * Sample code: Get a guest subscription. @@ -98,7 +206,7 @@ public final class GuestSubscriptionsGetSamples { */ public final class GuestSubscriptionsListBySubscriptionLocationResourceSamples { /* - * x-ms-original-file: 2025-08-15/GuestSubscriptions_List.json + * x-ms-original-file: 2026-04-30/GuestSubscriptions_List.json */ /** * Sample code: List guest subscriptions for a scope. @@ -120,7 +228,7 @@ public final class GuestSubscriptionsListBySubscriptionLocationResourceSamples { */ public final class OperationsListSamples { /* - * x-ms-original-file: 2025-08-15/Operations_List.json + * x-ms-original-file: 2026-04-30/Operations_List.json */ /** * Sample code: List operations. @@ -143,7 +251,7 @@ import com.azure.resourcemanager.computelimit.models.SharedLimitProperties; */ public final class SharedLimitsCreateSamples { /* - * x-ms-original-file: 2025-08-15/SharedLimits_Create.json + * x-ms-original-file: 2026-04-30/SharedLimits_Create.json */ /** * Sample code: Create a shared limit. @@ -168,7 +276,7 @@ public final class SharedLimitsCreateSamples { */ public final class SharedLimitsDeleteSamples { /* - * x-ms-original-file: 2025-08-15/SharedLimits_Delete.json + * x-ms-original-file: 2026-04-30/SharedLimits_Delete.json */ /** * Sample code: Delete a shared limit. @@ -190,7 +298,7 @@ public final class SharedLimitsDeleteSamples { */ public final class SharedLimitsGetSamples { /* - * x-ms-original-file: 2025-08-15/SharedLimits_Get.json + * x-ms-original-file: 2026-04-30/SharedLimits_Get.json */ /** * Sample code: Get a shared limit. @@ -211,7 +319,7 @@ public final class SharedLimitsGetSamples { */ public final class SharedLimitsListBySubscriptionLocationResourceSamples { /* - * x-ms-original-file: 2025-08-15/SharedLimits_List.json + * x-ms-original-file: 2026-04-30/SharedLimits_List.json */ /** * Sample code: List all shared limits for a scope. @@ -225,3 +333,45 @@ public final class SharedLimitsListBySubscriptionLocationResourceSamples { } ``` +### VmFamilies_Get + +```java +/** + * Samples for VmFamilies Get. + */ +public final class VmFamiliesGetSamples { + /* + * x-ms-original-file: 2026-04-30/VmFamilies_Get.json + */ + /** + * Sample code: Get a VM family. + * + * @param manager Entry point to ComputeLimitManager. + */ + public static void getAVMFamily(com.azure.resourcemanager.computelimit.ComputeLimitManager manager) { + manager.vmFamilies().getWithResponse("eastus", "standardDSv2Family", com.azure.core.util.Context.NONE); + } +} +``` + +### VmFamilies_ListBySubscriptionLocationResource + +```java +/** + * Samples for VmFamilies ListBySubscriptionLocationResource. + */ +public final class VmFamiliesListBySubscriptionLocationResourceSamples { + /* + * x-ms-original-file: 2026-04-30/VmFamilies_List.json + */ + /** + * Sample code: List VM families. + * + * @param manager Entry point to ComputeLimitManager. + */ + public static void listVMFamilies(com.azure.resourcemanager.computelimit.ComputeLimitManager manager) { + manager.vmFamilies().listBySubscriptionLocationResource("eastus", null, com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/pom.xml b/sdk/computelimit/azure-resourcemanager-computelimit/pom.xml index da4195b97a51..d71159a79a60 100644 --- a/sdk/computelimit/azure-resourcemanager-computelimit/pom.xml +++ b/sdk/computelimit/azure-resourcemanager-computelimit/pom.xml @@ -3,7 +3,7 @@ ~ Licensed under the MIT License. ~ Code generated by Microsoft (R) TypeSpec Code Generator. --> - + 4.0.0 com.azure @@ -14,11 +14,11 @@ com.azure.resourcemanager azure-resourcemanager-computelimit - 1.0.0-beta.2 + 1.0.0 jar Microsoft Azure SDK for ComputeLimit Management - This package contains Microsoft Azure SDK for ComputeLimit Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Microsoft Azure Compute Limit Resource Provider. Package api-version 2025-08-15. + This package contains Microsoft Azure SDK for ComputeLimit Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Microsoft Azure Compute Limit Resource Provider. Package api-version 2026-04-30. https://github.com/Azure/azure-sdk-for-java @@ -45,7 +45,7 @@ UTF-8 0 0 - true + false diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/ComputeLimitManager.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/ComputeLimitManager.java index b77ac1d00a54..dca0198f754e 100644 --- a/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/ComputeLimitManager.java +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/ComputeLimitManager.java @@ -26,12 +26,16 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.computelimit.fluent.ComputeLimitClient; import com.azure.resourcemanager.computelimit.implementation.ComputeLimitClientBuilder; +import com.azure.resourcemanager.computelimit.implementation.FeaturesImpl; import com.azure.resourcemanager.computelimit.implementation.GuestSubscriptionsImpl; import com.azure.resourcemanager.computelimit.implementation.OperationsImpl; import com.azure.resourcemanager.computelimit.implementation.SharedLimitsImpl; +import com.azure.resourcemanager.computelimit.implementation.VmFamiliesImpl; +import com.azure.resourcemanager.computelimit.models.Features; import com.azure.resourcemanager.computelimit.models.GuestSubscriptions; import com.azure.resourcemanager.computelimit.models.Operations; import com.azure.resourcemanager.computelimit.models.SharedLimits; +import com.azure.resourcemanager.computelimit.models.VmFamilies; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; @@ -51,6 +55,10 @@ public final class ComputeLimitManager { private SharedLimits sharedLimits; + private Features features; + + private VmFamilies vmFamilies; + private final ComputeLimitClient clientObject; private ComputeLimitManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -302,6 +310,30 @@ public SharedLimits sharedLimits() { return sharedLimits; } + /** + * Gets the resource collection API of Features. + * + * @return Resource collection API of Features. + */ + public Features features() { + if (this.features == null) { + this.features = new FeaturesImpl(clientObject.getFeatures(), this); + } + return features; + } + + /** + * Gets the resource collection API of VmFamilies. + * + * @return Resource collection API of VmFamilies. + */ + public VmFamilies vmFamilies() { + if (this.vmFamilies == null) { + this.vmFamilies = new VmFamiliesImpl(clientObject.getVmFamilies(), this); + } + return vmFamilies; + } + /** * Gets wrapped service client ComputeLimitClient providing direct access to the underlying auto-generated API * implementation, based on Azure REST API. diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/fluent/ComputeLimitClient.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/fluent/ComputeLimitClient.java index bcfdb86405c1..3354e2847304 100644 --- a/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/fluent/ComputeLimitClient.java +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/fluent/ComputeLimitClient.java @@ -66,4 +66,18 @@ public interface ComputeLimitClient { * @return the SharedLimitsClient object. */ SharedLimitsClient getSharedLimits(); + + /** + * Gets the FeaturesClient object to access its operations. + * + * @return the FeaturesClient object. + */ + FeaturesClient getFeatures(); + + /** + * Gets the VmFamiliesClient object to access its operations. + * + * @return the VmFamiliesClient object. + */ + VmFamiliesClient getVmFamilies(); } diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/fluent/FeaturesClient.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/fluent/FeaturesClient.java new file mode 100644 index 000000000000..c611f1e3c52a --- /dev/null +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/fluent/FeaturesClient.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computelimit.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.computelimit.fluent.models.FeatureInner; +import com.azure.resourcemanager.computelimit.fluent.models.OperationStatusResultInner; + +/** + * An instance of this class provides access to all the operations defined in FeaturesClient. + */ +public interface FeaturesClient { + /** + * Gets the properties of a compute limit feature. + * + * @param location The name of the Azure region. + * @param featureName The name of the Feature. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a compute limit feature along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String location, String featureName, Context context); + + /** + * Gets the properties of a compute limit feature. + * + * @param location The name of the Azure region. + * @param featureName The name of the Feature. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a compute limit feature. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FeatureInner get(String location, String featureName); + + /** + * Lists all compute limit features for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Feature list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySubscriptionLocationResource(String location); + + /** + * Lists all compute limit features for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Feature list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySubscriptionLocationResource(String location, Context context); + + /** + * Enables a compute limit feature for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @param featureName The name of the Feature. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusResultInner> beginEnable(String location, + String featureName); + + /** + * Enables a compute limit feature for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @param featureName The name of the Feature. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusResultInner> beginEnable(String location, + String featureName, Context context); + + /** + * Enables a compute limit feature for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @param featureName The name of the Feature. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusResultInner enable(String location, String featureName); + + /** + * Enables a compute limit feature for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @param featureName The name of the Feature. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusResultInner enable(String location, String featureName, Context context); + + /** + * Disables a compute limit feature for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @param featureName The name of the Feature. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusResultInner> beginDisable(String location, + String featureName); + + /** + * Disables a compute limit feature for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @param featureName The name of the Feature. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusResultInner> beginDisable(String location, + String featureName, Context context); + + /** + * Disables a compute limit feature for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @param featureName The name of the Feature. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusResultInner disable(String location, String featureName); + + /** + * Disables a compute limit feature for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @param featureName The name of the Feature. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusResultInner disable(String location, String featureName, Context context); +} diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/fluent/VmFamiliesClient.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/fluent/VmFamiliesClient.java new file mode 100644 index 000000000000..c4a4d02c0ee8 --- /dev/null +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/fluent/VmFamiliesClient.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computelimit.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.computelimit.fluent.models.VmFamilyInner; + +/** + * An instance of this class provides access to all the operations defined in VmFamiliesClient. + */ +public interface VmFamiliesClient { + /** + * Gets the properties of a VM family. + * + * @param location The name of the Azure region. + * @param vmFamilyName The name of the VmFamily. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a VM family along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String location, String vmFamilyName, Context context); + + /** + * Gets the properties of a VM family. + * + * @param location The name of the Azure region. + * @param vmFamilyName The name of the VmFamily. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a VM family. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VmFamilyInner get(String location, String vmFamilyName); + + /** + * Lists all VM families for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a VmFamily list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySubscriptionLocationResource(String location); + + /** + * Lists all VM families for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @param filter The filter to apply to the list operation. Filter can be applied to the 'category' property. + * Example: $filter=category eq 'generalPurposeCategory'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a VmFamily list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySubscriptionLocationResource(String location, String filter, Context context); +} diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/fluent/models/FeatureInner.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/fluent/models/FeatureInner.java new file mode 100644 index 000000000000..1ba75e3bb263 --- /dev/null +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/fluent/models/FeatureInner.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computelimit.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.computelimit.models.FeatureProperties; +import java.io.IOException; + +/** + * Compute limit feature. + */ +@Immutable +public final class FeatureInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private FeatureProperties 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 FeatureInner class. + */ + private FeatureInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public FeatureProperties 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FeatureInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FeatureInner 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 FeatureInner. + */ + public static FeatureInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FeatureInner deserializedFeatureInner = new FeatureInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedFeatureInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedFeatureInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedFeatureInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedFeatureInner.properties = FeatureProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedFeatureInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFeatureInner; + }); + } +} diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/fluent/models/OperationStatusResultInner.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/fluent/models/OperationStatusResultInner.java new file mode 100644 index 000000000000..1a56f31a1aa5 --- /dev/null +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/fluent/models/OperationStatusResultInner.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computelimit.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.CoreUtils; +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.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * The current status of an async operation. + */ +@Immutable +public final class OperationStatusResultInner implements JsonSerializable { + /* + * Fully qualified ID for the async operation. + */ + private String id; + + /* + * Name of the async operation. + */ + private String name; + + /* + * Operation status. + */ + private String status; + + /* + * Percent of the operation that is complete. + */ + private Double percentComplete; + + /* + * The start time of the operation. + */ + private OffsetDateTime startTime; + + /* + * The end time of the operation. + */ + private OffsetDateTime endTime; + + /* + * The operations list. + */ + private List operations; + + /* + * If present, details of the operation error. + */ + private ManagementError error; + + /* + * Fully qualified ID of the resource against which the original async operation was started. + */ + private String resourceId; + + /** + * Creates an instance of OperationStatusResultInner class. + */ + private OperationStatusResultInner() { + } + + /** + * Get the id property: Fully qualified ID for the async operation. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: Name of the async operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the status property: Operation status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Get the percentComplete property: Percent of the operation that is complete. + * + * @return the percentComplete value. + */ + public Double percentComplete() { + return this.percentComplete; + } + + /** + * Get the startTime property: The start time of the operation. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the endTime property: The end time of the operation. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Get the operations property: The operations list. + * + * @return the operations value. + */ + public List operations() { + return this.operations; + } + + /** + * Get the error property: If present, details of the operation error. + * + * @return the error value. + */ + public ManagementError error() { + return this.error; + } + + /** + * Get the resourceId property: Fully qualified ID of the resource against which the original async operation was + * started. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeNumberField("percentComplete", this.percentComplete); + jsonWriter.writeStringField("startTime", + this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime)); + jsonWriter.writeStringField("endTime", + this.endTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTime)); + jsonWriter.writeArrayField("operations", this.operations, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("error", this.error); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationStatusResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationStatusResultInner 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 OperationStatusResultInner. + */ + public static OperationStatusResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationStatusResultInner deserializedOperationStatusResultInner = new OperationStatusResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedOperationStatusResultInner.status = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedOperationStatusResultInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedOperationStatusResultInner.name = reader.getString(); + } else if ("percentComplete".equals(fieldName)) { + deserializedOperationStatusResultInner.percentComplete = reader.getNullable(JsonReader::getDouble); + } else if ("startTime".equals(fieldName)) { + deserializedOperationStatusResultInner.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endTime".equals(fieldName)) { + deserializedOperationStatusResultInner.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("operations".equals(fieldName)) { + List operations + = reader.readArray(reader1 -> OperationStatusResultInner.fromJson(reader1)); + deserializedOperationStatusResultInner.operations = operations; + } else if ("error".equals(fieldName)) { + deserializedOperationStatusResultInner.error = ManagementError.fromJson(reader); + } else if ("resourceId".equals(fieldName)) { + deserializedOperationStatusResultInner.resourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationStatusResultInner; + }); + } +} diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/fluent/models/VmFamilyInner.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/fluent/models/VmFamilyInner.java new file mode 100644 index 000000000000..cff91ba3817f --- /dev/null +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/fluent/models/VmFamilyInner.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computelimit.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.computelimit.models.VmFamilyProperties; +import java.io.IOException; + +/** + * VM family resource representing a virtual machine family and its category. + */ +@Immutable +public final class VmFamilyInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private VmFamilyProperties 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 VmFamilyInner class. + */ + private VmFamilyInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public VmFamilyProperties 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VmFamilyInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VmFamilyInner 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 VmFamilyInner. + */ + public static VmFamilyInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VmFamilyInner deserializedVmFamilyInner = new VmFamilyInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedVmFamilyInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedVmFamilyInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedVmFamilyInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedVmFamilyInner.properties = VmFamilyProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedVmFamilyInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVmFamilyInner; + }); + } +} diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/implementation/ComputeLimitClientImpl.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/implementation/ComputeLimitClientImpl.java index 05db610b8e1a..4131ced1ad48 100644 --- a/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/implementation/ComputeLimitClientImpl.java +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/implementation/ComputeLimitClientImpl.java @@ -27,9 +27,11 @@ import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.computelimit.fluent.ComputeLimitClient; +import com.azure.resourcemanager.computelimit.fluent.FeaturesClient; import com.azure.resourcemanager.computelimit.fluent.GuestSubscriptionsClient; import com.azure.resourcemanager.computelimit.fluent.OperationsClient; import com.azure.resourcemanager.computelimit.fluent.SharedLimitsClient; +import com.azure.resourcemanager.computelimit.fluent.VmFamiliesClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -170,6 +172,34 @@ public SharedLimitsClient getSharedLimits() { return this.sharedLimits; } + /** + * The FeaturesClient object to access its operations. + */ + private final FeaturesClient features; + + /** + * Gets the FeaturesClient object to access its operations. + * + * @return the FeaturesClient object. + */ + public FeaturesClient getFeatures() { + return this.features; + } + + /** + * The VmFamiliesClient object to access its operations. + */ + private final VmFamiliesClient vmFamilies; + + /** + * Gets the VmFamiliesClient object to access its operations. + * + * @return the VmFamiliesClient object. + */ + public VmFamiliesClient getVmFamilies() { + return this.vmFamilies; + } + /** * Initializes an instance of ComputeLimitClient client. * @@ -187,10 +217,12 @@ public SharedLimitsClient getSharedLimits() { this.defaultPollInterval = defaultPollInterval; this.endpoint = endpoint; this.subscriptionId = subscriptionId; - this.apiVersion = "2025-08-15"; + this.apiVersion = "2026-04-30"; this.operations = new OperationsClientImpl(this); this.guestSubscriptions = new GuestSubscriptionsClientImpl(this); this.sharedLimits = new SharedLimitsClientImpl(this); + this.features = new FeaturesClientImpl(this); + this.vmFamilies = new VmFamiliesClientImpl(this); } /** diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/implementation/FeatureImpl.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/implementation/FeatureImpl.java new file mode 100644 index 000000000000..443df7872e55 --- /dev/null +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/implementation/FeatureImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computelimit.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.computelimit.fluent.models.FeatureInner; +import com.azure.resourcemanager.computelimit.models.Feature; +import com.azure.resourcemanager.computelimit.models.FeatureProperties; + +public final class FeatureImpl implements Feature { + private FeatureInner innerObject; + + private final com.azure.resourcemanager.computelimit.ComputeLimitManager serviceManager; + + FeatureImpl(FeatureInner innerObject, com.azure.resourcemanager.computelimit.ComputeLimitManager 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 FeatureProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public FeatureInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.computelimit.ComputeLimitManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/implementation/FeaturesClientImpl.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/implementation/FeaturesClientImpl.java new file mode 100644 index 000000000000..ebc359162f05 --- /dev/null +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/implementation/FeaturesClientImpl.java @@ -0,0 +1,701 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computelimit.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.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.computelimit.fluent.FeaturesClient; +import com.azure.resourcemanager.computelimit.fluent.models.FeatureInner; +import com.azure.resourcemanager.computelimit.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.computelimit.implementation.models.FeatureListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in FeaturesClient. + */ +public final class FeaturesClientImpl implements FeaturesClient { + /** + * The proxy service used to perform REST calls. + */ + private final FeaturesService service; + + /** + * The service client containing this operation class. + */ + private final ComputeLimitClientImpl client; + + /** + * Initializes an instance of FeaturesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FeaturesClientImpl(ComputeLimitClientImpl client) { + this.service = RestProxy.create(FeaturesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeLimitClientFeatures to be used by the proxy service to perform + * REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ComputeLimitClientFeatures") + public interface FeaturesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ComputeLimit/locations/{location}/features/{featureName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @PathParam("featureName") String featureName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ComputeLimit/locations/{location}/features/{featureName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @PathParam("featureName") String featureName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ComputeLimit/locations/{location}/features") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionLocationResource(@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.ComputeLimit/locations/{location}/features") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionLocationResourceSync(@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" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.ComputeLimit/locations/{location}/features/{featureName}/enable") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> enable(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @PathParam("featureName") String featureName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.ComputeLimit/locations/{location}/features/{featureName}/enable") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response enableSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @PathParam("featureName") String featureName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.ComputeLimit/locations/{location}/features/{featureName}/disable") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> disable(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @PathParam("featureName") String featureName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.ComputeLimit/locations/{location}/features/{featureName}/disable") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response disableSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @PathParam("featureName") String featureName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionLocationResourceNext( + @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 listBySubscriptionLocationResourceNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets the properties of a compute limit feature. + * + * @param location The name of the Azure region. + * @param featureName The name of the Feature. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a compute limit feature along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String location, String featureName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, featureName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the properties of a compute limit feature. + * + * @param location The name of the Azure region. + * @param featureName The name of the Feature. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a compute limit feature on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String location, String featureName) { + return getWithResponseAsync(location, featureName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the properties of a compute limit feature. + * + * @param location The name of the Azure region. + * @param featureName The name of the Feature. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a compute limit feature along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String location, String featureName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + location, featureName, accept, context); + } + + /** + * Gets the properties of a compute limit feature. + * + * @param location The name of the Azure region. + * @param featureName The name of the Feature. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a compute limit feature. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FeatureInner get(String location, String featureName) { + return getWithResponse(location, featureName, Context.NONE).getValue(); + } + + /** + * Lists all compute limit features for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Feature list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionLocationResourceSinglePageAsync(String location) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listBySubscriptionLocationResource(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), location, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all compute limit features for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Feature list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySubscriptionLocationResourceAsync(String location) { + return new PagedFlux<>(() -> listBySubscriptionLocationResourceSinglePageAsync(location), + nextLink -> listBySubscriptionLocationResourceNextSinglePageAsync(nextLink)); + } + + /** + * Lists all compute limit features for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Feature list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionLocationResourceSinglePage(String location) { + final String accept = "application/json"; + Response res = service.listBySubscriptionLocationResourceSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), location, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all compute limit features for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Feature list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionLocationResourceSinglePage(String location, Context context) { + final String accept = "application/json"; + Response res = service.listBySubscriptionLocationResourceSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), location, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all compute limit features for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Feature list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySubscriptionLocationResource(String location) { + return new PagedIterable<>(() -> listBySubscriptionLocationResourceSinglePage(location), + nextLink -> listBySubscriptionLocationResourceNextSinglePage(nextLink)); + } + + /** + * Lists all compute limit features for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Feature list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySubscriptionLocationResource(String location, Context context) { + return new PagedIterable<>(() -> listBySubscriptionLocationResourceSinglePage(location, context), + nextLink -> listBySubscriptionLocationResourceNextSinglePage(nextLink, context)); + } + + /** + * Enables a compute limit feature for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @param featureName The name of the Feature. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> enableWithResponseAsync(String location, String featureName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.enable(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, featureName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Enables a compute limit feature for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @param featureName The name of the Feature. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response enableWithResponse(String location, String featureName) { + final String accept = "application/json"; + return service.enableSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, featureName, accept, Context.NONE); + } + + /** + * Enables a compute limit feature for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @param featureName The name of the Feature. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response enableWithResponse(String location, String featureName, Context context) { + final String accept = "application/json"; + return service.enableSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, featureName, accept, context); + } + + /** + * Enables a compute limit feature for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @param featureName The name of the Feature. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusResultInner> + beginEnableAsync(String location, String featureName) { + Mono>> mono = enableWithResponseAsync(location, featureName); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, + this.client.getContext()); + } + + /** + * Enables a compute limit feature for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @param featureName The name of the Feature. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusResultInner> beginEnable(String location, + String featureName) { + Response response = enableWithResponse(location, featureName); + return this.client.getLroResult(response, + OperationStatusResultInner.class, OperationStatusResultInner.class, Context.NONE); + } + + /** + * Enables a compute limit feature for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @param featureName The name of the Feature. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusResultInner> beginEnable(String location, + String featureName, Context context) { + Response response = enableWithResponse(location, featureName, context); + return this.client.getLroResult(response, + OperationStatusResultInner.class, OperationStatusResultInner.class, context); + } + + /** + * Enables a compute limit feature for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @param featureName The name of the Feature. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono enableAsync(String location, String featureName) { + return beginEnableAsync(location, featureName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Enables a compute limit feature for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @param featureName The name of the Feature. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner enable(String location, String featureName) { + return beginEnable(location, featureName).getFinalResult(); + } + + /** + * Enables a compute limit feature for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @param featureName The name of the Feature. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner enable(String location, String featureName, Context context) { + return beginEnable(location, featureName, context).getFinalResult(); + } + + /** + * Disables a compute limit feature for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @param featureName The name of the Feature. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> disableWithResponseAsync(String location, String featureName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.disable(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, featureName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Disables a compute limit feature for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @param featureName The name of the Feature. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response disableWithResponse(String location, String featureName) { + final String accept = "application/json"; + return service.disableSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, featureName, accept, Context.NONE); + } + + /** + * Disables a compute limit feature for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @param featureName The name of the Feature. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response disableWithResponse(String location, String featureName, Context context) { + final String accept = "application/json"; + return service.disableSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, featureName, accept, context); + } + + /** + * Disables a compute limit feature for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @param featureName The name of the Feature. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusResultInner> + beginDisableAsync(String location, String featureName) { + Mono>> mono = disableWithResponseAsync(location, featureName); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, + this.client.getContext()); + } + + /** + * Disables a compute limit feature for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @param featureName The name of the Feature. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusResultInner> beginDisable(String location, + String featureName) { + Response response = disableWithResponse(location, featureName); + return this.client.getLroResult(response, + OperationStatusResultInner.class, OperationStatusResultInner.class, Context.NONE); + } + + /** + * Disables a compute limit feature for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @param featureName The name of the Feature. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusResultInner> beginDisable(String location, + String featureName, Context context) { + Response response = disableWithResponse(location, featureName, context); + return this.client.getLroResult(response, + OperationStatusResultInner.class, OperationStatusResultInner.class, context); + } + + /** + * Disables a compute limit feature for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @param featureName The name of the Feature. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono disableAsync(String location, String featureName) { + return beginDisableAsync(location, featureName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Disables a compute limit feature for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @param featureName The name of the Feature. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner disable(String location, String featureName) { + return beginDisable(location, featureName).getFinalResult(); + } + + /** + * Disables a compute limit feature for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @param featureName The name of the Feature. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner disable(String location, String featureName, Context context) { + return beginDisable(location, featureName, context).getFinalResult(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Feature list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionLocationResourceNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listBySubscriptionLocationResourceNext(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 the response of a Feature list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionLocationResourceNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res = service.listBySubscriptionLocationResourceNextSync(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 the response of a Feature list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionLocationResourceNextSinglePage(String nextLink, + Context context) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionLocationResourceNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/implementation/FeaturesImpl.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/implementation/FeaturesImpl.java new file mode 100644 index 000000000000..e3d1ebd20973 --- /dev/null +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/implementation/FeaturesImpl.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computelimit.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.computelimit.fluent.FeaturesClient; +import com.azure.resourcemanager.computelimit.fluent.models.FeatureInner; +import com.azure.resourcemanager.computelimit.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.computelimit.models.Feature; +import com.azure.resourcemanager.computelimit.models.Features; +import com.azure.resourcemanager.computelimit.models.OperationStatusResult; + +public final class FeaturesImpl implements Features { + private static final ClientLogger LOGGER = new ClientLogger(FeaturesImpl.class); + + private final FeaturesClient innerClient; + + private final com.azure.resourcemanager.computelimit.ComputeLimitManager serviceManager; + + public FeaturesImpl(FeaturesClient innerClient, + com.azure.resourcemanager.computelimit.ComputeLimitManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String location, String featureName, Context context) { + Response inner = this.serviceClient().getWithResponse(location, featureName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new FeatureImpl(inner.getValue(), this.manager())); + } + + public Feature get(String location, String featureName) { + FeatureInner inner = this.serviceClient().get(location, featureName); + if (inner != null) { + return new FeatureImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listBySubscriptionLocationResource(String location) { + PagedIterable inner = this.serviceClient().listBySubscriptionLocationResource(location); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FeatureImpl(inner1, this.manager())); + } + + public PagedIterable listBySubscriptionLocationResource(String location, Context context) { + PagedIterable inner = this.serviceClient().listBySubscriptionLocationResource(location, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FeatureImpl(inner1, this.manager())); + } + + public OperationStatusResult enable(String location, String featureName) { + OperationStatusResultInner inner = this.serviceClient().enable(location, featureName); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatusResult enable(String location, String featureName, Context context) { + OperationStatusResultInner inner = this.serviceClient().enable(location, featureName, context); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatusResult disable(String location, String featureName) { + OperationStatusResultInner inner = this.serviceClient().disable(location, featureName); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatusResult disable(String location, String featureName, Context context) { + OperationStatusResultInner inner = this.serviceClient().disable(location, featureName, context); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + private FeaturesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.computelimit.ComputeLimitManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/implementation/OperationStatusResultImpl.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/implementation/OperationStatusResultImpl.java new file mode 100644 index 000000000000..1d0de8494c05 --- /dev/null +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/implementation/OperationStatusResultImpl.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computelimit.implementation; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.computelimit.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.computelimit.models.OperationStatusResult; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class OperationStatusResultImpl implements OperationStatusResult { + private OperationStatusResultInner innerObject; + + private final com.azure.resourcemanager.computelimit.ComputeLimitManager serviceManager; + + OperationStatusResultImpl(OperationStatusResultInner innerObject, + com.azure.resourcemanager.computelimit.ComputeLimitManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String status() { + return this.innerModel().status(); + } + + public Double percentComplete() { + return this.innerModel().percentComplete(); + } + + public OffsetDateTime startTime() { + return this.innerModel().startTime(); + } + + public OffsetDateTime endTime() { + return this.innerModel().endTime(); + } + + public List operations() { + List inner = this.innerModel().operations(); + if (inner != null) { + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new OperationStatusResultImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public ManagementError error() { + return this.innerModel().error(); + } + + public String resourceId() { + return this.innerModel().resourceId(); + } + + public OperationStatusResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.computelimit.ComputeLimitManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/implementation/VmFamiliesClientImpl.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/implementation/VmFamiliesClientImpl.java new file mode 100644 index 000000000000..d404054075a3 --- /dev/null +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/implementation/VmFamiliesClientImpl.java @@ -0,0 +1,377 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computelimit.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.computelimit.fluent.VmFamiliesClient; +import com.azure.resourcemanager.computelimit.fluent.models.VmFamilyInner; +import com.azure.resourcemanager.computelimit.implementation.models.VmFamilyListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in VmFamiliesClient. + */ +public final class VmFamiliesClientImpl implements VmFamiliesClient { + /** + * The proxy service used to perform REST calls. + */ + private final VmFamiliesService service; + + /** + * The service client containing this operation class. + */ + private final ComputeLimitClientImpl client; + + /** + * Initializes an instance of VmFamiliesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VmFamiliesClientImpl(ComputeLimitClientImpl client) { + this.service + = RestProxy.create(VmFamiliesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeLimitClientVmFamilies to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ComputeLimitClientVmFamilies") + public interface VmFamiliesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ComputeLimit/locations/{location}/vmFamilies/{vmFamilyName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @PathParam("vmFamilyName") String vmFamilyName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ComputeLimit/locations/{location}/vmFamilies/{vmFamilyName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @PathParam("vmFamilyName") String vmFamilyName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ComputeLimit/locations/{location}/vmFamilies") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionLocationResource(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ComputeLimit/locations/{location}/vmFamilies") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionLocationResourceSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionLocationResourceNext( + @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 listBySubscriptionLocationResourceNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets the properties of a VM family. + * + * @param location The name of the Azure region. + * @param vmFamilyName The name of the VmFamily. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a VM family along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String location, String vmFamilyName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, vmFamilyName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the properties of a VM family. + * + * @param location The name of the Azure region. + * @param vmFamilyName The name of the VmFamily. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a VM family on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String location, String vmFamilyName) { + return getWithResponseAsync(location, vmFamilyName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the properties of a VM family. + * + * @param location The name of the Azure region. + * @param vmFamilyName The name of the VmFamily. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a VM family along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String location, String vmFamilyName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + location, vmFamilyName, accept, context); + } + + /** + * Gets the properties of a VM family. + * + * @param location The name of the Azure region. + * @param vmFamilyName The name of the VmFamily. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a VM family. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VmFamilyInner get(String location, String vmFamilyName) { + return getWithResponse(location, vmFamilyName, Context.NONE).getValue(); + } + + /** + * Lists all VM families for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @param filter The filter to apply to the list operation. Filter can be applied to the 'category' property. + * Example: $filter=category eq 'generalPurposeCategory'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a VmFamily list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionLocationResourceSinglePageAsync(String location, + String filter) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listBySubscriptionLocationResource(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), location, filter, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all VM families for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @param filter The filter to apply to the list operation. Filter can be applied to the 'category' property. + * Example: $filter=category eq 'generalPurposeCategory'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a VmFamily list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySubscriptionLocationResourceAsync(String location, String filter) { + return new PagedFlux<>(() -> listBySubscriptionLocationResourceSinglePageAsync(location, filter), + nextLink -> listBySubscriptionLocationResourceNextSinglePageAsync(nextLink)); + } + + /** + * Lists all VM families for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a VmFamily list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySubscriptionLocationResourceAsync(String location) { + final String filter = null; + return new PagedFlux<>(() -> listBySubscriptionLocationResourceSinglePageAsync(location, filter), + nextLink -> listBySubscriptionLocationResourceNextSinglePageAsync(nextLink)); + } + + /** + * Lists all VM families for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @param filter The filter to apply to the list operation. Filter can be applied to the 'category' property. + * Example: $filter=category eq 'generalPurposeCategory'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a VmFamily list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionLocationResourceSinglePage(String location, String filter) { + final String accept = "application/json"; + Response res = service.listBySubscriptionLocationResourceSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), location, filter, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all VM families for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @param filter The filter to apply to the list operation. Filter can be applied to the 'category' property. + * Example: $filter=category eq 'generalPurposeCategory'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a VmFamily list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionLocationResourceSinglePage(String location, String filter, + Context context) { + final String accept = "application/json"; + Response res = service.listBySubscriptionLocationResourceSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), location, filter, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all VM families for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a VmFamily list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySubscriptionLocationResource(String location) { + final String filter = null; + return new PagedIterable<>(() -> listBySubscriptionLocationResourceSinglePage(location, filter), + nextLink -> listBySubscriptionLocationResourceNextSinglePage(nextLink)); + } + + /** + * Lists all VM families for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @param filter The filter to apply to the list operation. Filter can be applied to the 'category' property. + * Example: $filter=category eq 'generalPurposeCategory'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a VmFamily list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySubscriptionLocationResource(String location, String filter, + Context context) { + return new PagedIterable<>(() -> listBySubscriptionLocationResourceSinglePage(location, filter, context), + nextLink -> listBySubscriptionLocationResourceNextSinglePage(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 the response of a VmFamily list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionLocationResourceNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listBySubscriptionLocationResourceNext(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 the response of a VmFamily list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionLocationResourceNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res = service.listBySubscriptionLocationResourceNextSync(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 the response of a VmFamily list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionLocationResourceNextSinglePage(String nextLink, + Context context) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionLocationResourceNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/implementation/VmFamiliesImpl.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/implementation/VmFamiliesImpl.java new file mode 100644 index 000000000000..a9b4b061b1f1 --- /dev/null +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/implementation/VmFamiliesImpl.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computelimit.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.computelimit.fluent.VmFamiliesClient; +import com.azure.resourcemanager.computelimit.fluent.models.VmFamilyInner; +import com.azure.resourcemanager.computelimit.models.VmFamilies; +import com.azure.resourcemanager.computelimit.models.VmFamily; + +public final class VmFamiliesImpl implements VmFamilies { + private static final ClientLogger LOGGER = new ClientLogger(VmFamiliesImpl.class); + + private final VmFamiliesClient innerClient; + + private final com.azure.resourcemanager.computelimit.ComputeLimitManager serviceManager; + + public VmFamiliesImpl(VmFamiliesClient innerClient, + com.azure.resourcemanager.computelimit.ComputeLimitManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String location, String vmFamilyName, Context context) { + Response inner = this.serviceClient().getWithResponse(location, vmFamilyName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new VmFamilyImpl(inner.getValue(), this.manager())); + } + + public VmFamily get(String location, String vmFamilyName) { + VmFamilyInner inner = this.serviceClient().get(location, vmFamilyName); + if (inner != null) { + return new VmFamilyImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listBySubscriptionLocationResource(String location) { + PagedIterable inner = this.serviceClient().listBySubscriptionLocationResource(location); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VmFamilyImpl(inner1, this.manager())); + } + + public PagedIterable listBySubscriptionLocationResource(String location, String filter, Context context) { + PagedIterable inner + = this.serviceClient().listBySubscriptionLocationResource(location, filter, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VmFamilyImpl(inner1, this.manager())); + } + + private VmFamiliesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.computelimit.ComputeLimitManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/implementation/VmFamilyImpl.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/implementation/VmFamilyImpl.java new file mode 100644 index 000000000000..afcb12f65a0c --- /dev/null +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/implementation/VmFamilyImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computelimit.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.computelimit.fluent.models.VmFamilyInner; +import com.azure.resourcemanager.computelimit.models.VmFamily; +import com.azure.resourcemanager.computelimit.models.VmFamilyProperties; + +public final class VmFamilyImpl implements VmFamily { + private VmFamilyInner innerObject; + + private final com.azure.resourcemanager.computelimit.ComputeLimitManager serviceManager; + + VmFamilyImpl(VmFamilyInner innerObject, com.azure.resourcemanager.computelimit.ComputeLimitManager 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 VmFamilyProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public VmFamilyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.computelimit.ComputeLimitManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/implementation/models/FeatureListResult.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/implementation/models/FeatureListResult.java new file mode 100644 index 000000000000..1340ec770a95 --- /dev/null +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/implementation/models/FeatureListResult.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computelimit.implementation.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.computelimit.fluent.models.FeatureInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Feature list operation. + */ +@Immutable +public final class FeatureListResult implements JsonSerializable { + /* + * The Feature items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of FeatureListResult class. + */ + private FeatureListResult() { + } + + /** + * Get the value property: The Feature 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; + } + + /** + * {@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 FeatureListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FeatureListResult 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 FeatureListResult. + */ + public static FeatureListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FeatureListResult deserializedFeatureListResult = new FeatureListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> FeatureInner.fromJson(reader1)); + deserializedFeatureListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedFeatureListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFeatureListResult; + }); + } +} diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/implementation/models/VmFamilyListResult.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/implementation/models/VmFamilyListResult.java new file mode 100644 index 000000000000..0e74447da913 --- /dev/null +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/implementation/models/VmFamilyListResult.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computelimit.implementation.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.computelimit.fluent.models.VmFamilyInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a VmFamily list operation. + */ +@Immutable +public final class VmFamilyListResult implements JsonSerializable { + /* + * The VmFamily items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of VmFamilyListResult class. + */ + private VmFamilyListResult() { + } + + /** + * Get the value property: The VmFamily 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; + } + + /** + * {@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 VmFamilyListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VmFamilyListResult 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 VmFamilyListResult. + */ + public static VmFamilyListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VmFamilyListResult deserializedVmFamilyListResult = new VmFamilyListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> VmFamilyInner.fromJson(reader1)); + deserializedVmFamilyListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedVmFamilyListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVmFamilyListResult; + }); + } +} diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/models/Feature.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/models/Feature.java new file mode 100644 index 000000000000..366256897764 --- /dev/null +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/models/Feature.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computelimit.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.computelimit.fluent.models.FeatureInner; + +/** + * An immutable client-side representation of Feature. + */ +public interface Feature { + /** + * 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: The resource-specific properties for this resource. + * + * @return the properties value. + */ + FeatureProperties 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.computelimit.fluent.models.FeatureInner object. + * + * @return the inner object. + */ + FeatureInner innerModel(); +} diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/models/FeatureProperties.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/models/FeatureProperties.java new file mode 100644 index 000000000000..dbbefaf48ed0 --- /dev/null +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/models/FeatureProperties.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computelimit.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; + +/** + * Properties of the compute limit feature. + */ +@Immutable +public final class FeatureProperties implements JsonSerializable { + /* + * The current state of the feature (for example, Enabled, Disabled). + */ + private FeatureState state; + + /* + * The provisioning state of the resource. + */ + private ResourceProvisioningState provisioningState; + + /** + * Creates an instance of FeatureProperties class. + */ + private FeatureProperties() { + } + + /** + * Get the state property: The current state of the feature (for example, Enabled, Disabled). + * + * @return the state value. + */ + public FeatureState state() { + return this.state; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ResourceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FeatureProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FeatureProperties 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 FeatureProperties. + */ + public static FeatureProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FeatureProperties deserializedFeatureProperties = new FeatureProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("state".equals(fieldName)) { + deserializedFeatureProperties.state = FeatureState.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedFeatureProperties.provisioningState + = ResourceProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedFeatureProperties; + }); + } +} diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/models/FeatureState.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/models/FeatureState.java new file mode 100644 index 000000000000..c16cdcb7e15b --- /dev/null +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/models/FeatureState.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computelimit.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The allowed states for a compute limit feature. + */ +public final class FeatureState extends ExpandableStringEnum { + /** + * The feature is enabled. + */ + public static final FeatureState ENABLED = fromString("Enabled"); + + /** + * The feature is disabled. + */ + public static final FeatureState DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of FeatureState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FeatureState() { + } + + /** + * Creates or finds a FeatureState from its string representation. + * + * @param name a name to look for. + * @return the corresponding FeatureState. + */ + public static FeatureState fromString(String name) { + return fromString(name, FeatureState.class); + } + + /** + * Gets known FeatureState values. + * + * @return known FeatureState values. + */ + public static Collection values() { + return values(FeatureState.class); + } +} diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/models/Features.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/models/Features.java new file mode 100644 index 000000000000..05a5c8c41828 --- /dev/null +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/models/Features.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computelimit.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Features. + */ +public interface Features { + /** + * Gets the properties of a compute limit feature. + * + * @param location The name of the Azure region. + * @param featureName The name of the Feature. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a compute limit feature along with {@link Response}. + */ + Response getWithResponse(String location, String featureName, Context context); + + /** + * Gets the properties of a compute limit feature. + * + * @param location The name of the Azure region. + * @param featureName The name of the Feature. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a compute limit feature. + */ + Feature get(String location, String featureName); + + /** + * Lists all compute limit features for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Feature list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listBySubscriptionLocationResource(String location); + + /** + * Lists all compute limit features for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Feature list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listBySubscriptionLocationResource(String location, Context context); + + /** + * Enables a compute limit feature for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @param featureName The name of the Feature. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + OperationStatusResult enable(String location, String featureName); + + /** + * Enables a compute limit feature for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @param featureName The name of the Feature. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + OperationStatusResult enable(String location, String featureName, Context context); + + /** + * Disables a compute limit feature for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @param featureName The name of the Feature. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + OperationStatusResult disable(String location, String featureName); + + /** + * Disables a compute limit feature for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @param featureName The name of the Feature. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + OperationStatusResult disable(String location, String featureName, Context context); +} diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/models/OperationStatusResult.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/models/OperationStatusResult.java new file mode 100644 index 000000000000..0d1e6bdc4de6 --- /dev/null +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/models/OperationStatusResult.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computelimit.models; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.computelimit.fluent.models.OperationStatusResultInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * An immutable client-side representation of OperationStatusResult. + */ +public interface OperationStatusResult { + /** + * Gets the id property: Fully qualified ID for the async operation. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Name of the async operation. + * + * @return the name value. + */ + String name(); + + /** + * Gets the status property: Operation status. + * + * @return the status value. + */ + String status(); + + /** + * Gets the percentComplete property: Percent of the operation that is complete. + * + * @return the percentComplete value. + */ + Double percentComplete(); + + /** + * Gets the startTime property: The start time of the operation. + * + * @return the startTime value. + */ + OffsetDateTime startTime(); + + /** + * Gets the endTime property: The end time of the operation. + * + * @return the endTime value. + */ + OffsetDateTime endTime(); + + /** + * Gets the operations property: The operations list. + * + * @return the operations value. + */ + List operations(); + + /** + * Gets the error property: If present, details of the operation error. + * + * @return the error value. + */ + ManagementError error(); + + /** + * Gets the resourceId property: Fully qualified ID of the resource against which the original async operation was + * started. + * + * @return the resourceId value. + */ + String resourceId(); + + /** + * Gets the inner com.azure.resourcemanager.computelimit.fluent.models.OperationStatusResultInner object. + * + * @return the inner object. + */ + OperationStatusResultInner innerModel(); +} diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/models/VmFamilies.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/models/VmFamilies.java new file mode 100644 index 000000000000..66343d02ce19 --- /dev/null +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/models/VmFamilies.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computelimit.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of VmFamilies. + */ +public interface VmFamilies { + /** + * Gets the properties of a VM family. + * + * @param location The name of the Azure region. + * @param vmFamilyName The name of the VmFamily. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a VM family along with {@link Response}. + */ + Response getWithResponse(String location, String vmFamilyName, Context context); + + /** + * Gets the properties of a VM family. + * + * @param location The name of the Azure region. + * @param vmFamilyName The name of the VmFamily. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a VM family. + */ + VmFamily get(String location, String vmFamilyName); + + /** + * Lists all VM families for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a VmFamily list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listBySubscriptionLocationResource(String location); + + /** + * Lists all VM families for the subscription at the specified location. + * + * @param location The name of the Azure region. + * @param filter The filter to apply to the list operation. Filter can be applied to the 'category' property. + * Example: $filter=category eq 'generalPurposeCategory'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a VmFamily list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listBySubscriptionLocationResource(String location, String filter, Context context); +} diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/models/VmFamily.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/models/VmFamily.java new file mode 100644 index 000000000000..9eeeb8e481db --- /dev/null +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/models/VmFamily.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computelimit.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.computelimit.fluent.models.VmFamilyInner; + +/** + * An immutable client-side representation of VmFamily. + */ +public interface VmFamily { + /** + * 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: The resource-specific properties for this resource. + * + * @return the properties value. + */ + VmFamilyProperties 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.computelimit.fluent.models.VmFamilyInner object. + * + * @return the inner object. + */ + VmFamilyInner innerModel(); +} diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/models/VmFamilyProperties.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/models/VmFamilyProperties.java new file mode 100644 index 000000000000..b9bce1f615c1 --- /dev/null +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/java/com/azure/resourcemanager/computelimit/models/VmFamilyProperties.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computelimit.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; + +/** + * Properties of a VM family resource. + */ +@Immutable +public final class VmFamilyProperties implements JsonSerializable { + /* + * The category of the VM family (for example, GeneralPurpose, ComputeOptimized). + */ + private String category; + + /* + * The provisioning state of the resource. + */ + private ResourceProvisioningState provisioningState; + + /** + * Creates an instance of VmFamilyProperties class. + */ + private VmFamilyProperties() { + } + + /** + * Get the category property: The category of the VM family (for example, GeneralPurpose, ComputeOptimized). + * + * @return the category value. + */ + public String category() { + return this.category; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ResourceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", this.category); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VmFamilyProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VmFamilyProperties 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 VmFamilyProperties. + */ + public static VmFamilyProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VmFamilyProperties deserializedVmFamilyProperties = new VmFamilyProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedVmFamilyProperties.category = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedVmFamilyProperties.provisioningState + = ResourceProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedVmFamilyProperties; + }); + } +} diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/main/resources/META-INF/azure-resourcemanager-computelimit_metadata.json b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/resources/META-INF/azure-resourcemanager-computelimit_metadata.json index 283fa6ee7bfc..789a62fd4705 100644 --- a/sdk/computelimit/azure-resourcemanager-computelimit/src/main/resources/META-INF/azure-resourcemanager-computelimit_metadata.json +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/resources/META-INF/azure-resourcemanager-computelimit_metadata.json @@ -1 +1 @@ -{"flavor":"azure","apiVersions":{"Microsoft.ComputeLimit":"2025-08-15"},"crossLanguageDefinitions":{"com.azure.resourcemanager.computelimit.fluent.ComputeLimitClient":"Microsoft.ComputeLimit","com.azure.resourcemanager.computelimit.fluent.GuestSubscriptionsClient":"Microsoft.ComputeLimit.GuestSubscriptions","com.azure.resourcemanager.computelimit.fluent.GuestSubscriptionsClient.create":"Microsoft.ComputeLimit.GuestSubscriptions.create","com.azure.resourcemanager.computelimit.fluent.GuestSubscriptionsClient.createWithResponse":"Microsoft.ComputeLimit.GuestSubscriptions.create","com.azure.resourcemanager.computelimit.fluent.GuestSubscriptionsClient.delete":"Microsoft.ComputeLimit.GuestSubscriptions.delete","com.azure.resourcemanager.computelimit.fluent.GuestSubscriptionsClient.deleteWithResponse":"Microsoft.ComputeLimit.GuestSubscriptions.delete","com.azure.resourcemanager.computelimit.fluent.GuestSubscriptionsClient.get":"Microsoft.ComputeLimit.GuestSubscriptions.get","com.azure.resourcemanager.computelimit.fluent.GuestSubscriptionsClient.getWithResponse":"Microsoft.ComputeLimit.GuestSubscriptions.get","com.azure.resourcemanager.computelimit.fluent.GuestSubscriptionsClient.listBySubscriptionLocationResource":"Microsoft.ComputeLimit.GuestSubscriptions.listBySubscriptionLocationResource","com.azure.resourcemanager.computelimit.fluent.OperationsClient":"Microsoft.ComputeLimit.Operations","com.azure.resourcemanager.computelimit.fluent.OperationsClient.list":"Azure.ResourceManager.Operations.list","com.azure.resourcemanager.computelimit.fluent.SharedLimitsClient":"Microsoft.ComputeLimit.SharedLimits","com.azure.resourcemanager.computelimit.fluent.SharedLimitsClient.create":"Microsoft.ComputeLimit.SharedLimits.create","com.azure.resourcemanager.computelimit.fluent.SharedLimitsClient.createWithResponse":"Microsoft.ComputeLimit.SharedLimits.create","com.azure.resourcemanager.computelimit.fluent.SharedLimitsClient.delete":"Microsoft.ComputeLimit.SharedLimits.delete","com.azure.resourcemanager.computelimit.fluent.SharedLimitsClient.deleteWithResponse":"Microsoft.ComputeLimit.SharedLimits.delete","com.azure.resourcemanager.computelimit.fluent.SharedLimitsClient.get":"Microsoft.ComputeLimit.SharedLimits.get","com.azure.resourcemanager.computelimit.fluent.SharedLimitsClient.getWithResponse":"Microsoft.ComputeLimit.SharedLimits.get","com.azure.resourcemanager.computelimit.fluent.SharedLimitsClient.listBySubscriptionLocationResource":"Microsoft.ComputeLimit.SharedLimits.listBySubscriptionLocationResource","com.azure.resourcemanager.computelimit.fluent.models.GuestSubscriptionInner":"Microsoft.ComputeLimit.GuestSubscription","com.azure.resourcemanager.computelimit.fluent.models.OperationInner":"Azure.ResourceManager.CommonTypes.Operation","com.azure.resourcemanager.computelimit.fluent.models.SharedLimitInner":"Microsoft.ComputeLimit.SharedLimit","com.azure.resourcemanager.computelimit.implementation.ComputeLimitClientBuilder":"Microsoft.ComputeLimit","com.azure.resourcemanager.computelimit.implementation.models.GuestSubscriptionListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.computelimit.implementation.models.OperationListResult":"Azure.ResourceManager.CommonTypes.OperationListResult","com.azure.resourcemanager.computelimit.implementation.models.SharedLimitListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.computelimit.models.ActionType":"Azure.ResourceManager.CommonTypes.ActionType","com.azure.resourcemanager.computelimit.models.GuestSubscriptionProperties":"Microsoft.ComputeLimit.GuestSubscriptionProperties","com.azure.resourcemanager.computelimit.models.LimitName":"Microsoft.ComputeLimit.LimitName","com.azure.resourcemanager.computelimit.models.OperationDisplay":"Azure.ResourceManager.CommonTypes.OperationDisplay","com.azure.resourcemanager.computelimit.models.Origin":"Azure.ResourceManager.CommonTypes.Origin","com.azure.resourcemanager.computelimit.models.ResourceProvisioningState":"Azure.ResourceManager.ResourceProvisioningState","com.azure.resourcemanager.computelimit.models.SharedLimitProperties":"Microsoft.ComputeLimit.SharedLimitProperties"},"generatedFiles":["src/main/java/com/azure/resourcemanager/computelimit/ComputeLimitManager.java","src/main/java/com/azure/resourcemanager/computelimit/fluent/ComputeLimitClient.java","src/main/java/com/azure/resourcemanager/computelimit/fluent/GuestSubscriptionsClient.java","src/main/java/com/azure/resourcemanager/computelimit/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/computelimit/fluent/SharedLimitsClient.java","src/main/java/com/azure/resourcemanager/computelimit/fluent/models/GuestSubscriptionInner.java","src/main/java/com/azure/resourcemanager/computelimit/fluent/models/OperationInner.java","src/main/java/com/azure/resourcemanager/computelimit/fluent/models/SharedLimitInner.java","src/main/java/com/azure/resourcemanager/computelimit/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/computelimit/fluent/package-info.java","src/main/java/com/azure/resourcemanager/computelimit/implementation/ComputeLimitClientBuilder.java","src/main/java/com/azure/resourcemanager/computelimit/implementation/ComputeLimitClientImpl.java","src/main/java/com/azure/resourcemanager/computelimit/implementation/GuestSubscriptionImpl.java","src/main/java/com/azure/resourcemanager/computelimit/implementation/GuestSubscriptionsClientImpl.java","src/main/java/com/azure/resourcemanager/computelimit/implementation/GuestSubscriptionsImpl.java","src/main/java/com/azure/resourcemanager/computelimit/implementation/OperationImpl.java","src/main/java/com/azure/resourcemanager/computelimit/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/computelimit/implementation/OperationsImpl.java","src/main/java/com/azure/resourcemanager/computelimit/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/computelimit/implementation/SharedLimitImpl.java","src/main/java/com/azure/resourcemanager/computelimit/implementation/SharedLimitsClientImpl.java","src/main/java/com/azure/resourcemanager/computelimit/implementation/SharedLimitsImpl.java","src/main/java/com/azure/resourcemanager/computelimit/implementation/models/GuestSubscriptionListResult.java","src/main/java/com/azure/resourcemanager/computelimit/implementation/models/OperationListResult.java","src/main/java/com/azure/resourcemanager/computelimit/implementation/models/SharedLimitListResult.java","src/main/java/com/azure/resourcemanager/computelimit/implementation/package-info.java","src/main/java/com/azure/resourcemanager/computelimit/models/ActionType.java","src/main/java/com/azure/resourcemanager/computelimit/models/GuestSubscription.java","src/main/java/com/azure/resourcemanager/computelimit/models/GuestSubscriptionProperties.java","src/main/java/com/azure/resourcemanager/computelimit/models/GuestSubscriptions.java","src/main/java/com/azure/resourcemanager/computelimit/models/LimitName.java","src/main/java/com/azure/resourcemanager/computelimit/models/Operation.java","src/main/java/com/azure/resourcemanager/computelimit/models/OperationDisplay.java","src/main/java/com/azure/resourcemanager/computelimit/models/Operations.java","src/main/java/com/azure/resourcemanager/computelimit/models/Origin.java","src/main/java/com/azure/resourcemanager/computelimit/models/ResourceProvisioningState.java","src/main/java/com/azure/resourcemanager/computelimit/models/SharedLimit.java","src/main/java/com/azure/resourcemanager/computelimit/models/SharedLimitProperties.java","src/main/java/com/azure/resourcemanager/computelimit/models/SharedLimits.java","src/main/java/com/azure/resourcemanager/computelimit/models/package-info.java","src/main/java/com/azure/resourcemanager/computelimit/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file +{"flavor":"azure","apiVersions":{"Microsoft.ComputeLimit":"2026-04-30"},"crossLanguageDefinitions":{"com.azure.resourcemanager.computelimit.fluent.ComputeLimitClient":"Microsoft.ComputeLimit","com.azure.resourcemanager.computelimit.fluent.FeaturesClient":"Microsoft.ComputeLimit.Features","com.azure.resourcemanager.computelimit.fluent.FeaturesClient.beginDisable":"Microsoft.ComputeLimit.Features.disable","com.azure.resourcemanager.computelimit.fluent.FeaturesClient.beginEnable":"Microsoft.ComputeLimit.Features.enable","com.azure.resourcemanager.computelimit.fluent.FeaturesClient.disable":"Microsoft.ComputeLimit.Features.disable","com.azure.resourcemanager.computelimit.fluent.FeaturesClient.enable":"Microsoft.ComputeLimit.Features.enable","com.azure.resourcemanager.computelimit.fluent.FeaturesClient.get":"Microsoft.ComputeLimit.Features.get","com.azure.resourcemanager.computelimit.fluent.FeaturesClient.getWithResponse":"Microsoft.ComputeLimit.Features.get","com.azure.resourcemanager.computelimit.fluent.FeaturesClient.listBySubscriptionLocationResource":"Microsoft.ComputeLimit.Features.listBySubscriptionLocationResource","com.azure.resourcemanager.computelimit.fluent.GuestSubscriptionsClient":"Microsoft.ComputeLimit.GuestSubscriptions","com.azure.resourcemanager.computelimit.fluent.GuestSubscriptionsClient.create":"Microsoft.ComputeLimit.GuestSubscriptions.create","com.azure.resourcemanager.computelimit.fluent.GuestSubscriptionsClient.createWithResponse":"Microsoft.ComputeLimit.GuestSubscriptions.create","com.azure.resourcemanager.computelimit.fluent.GuestSubscriptionsClient.delete":"Microsoft.ComputeLimit.GuestSubscriptions.delete","com.azure.resourcemanager.computelimit.fluent.GuestSubscriptionsClient.deleteWithResponse":"Microsoft.ComputeLimit.GuestSubscriptions.delete","com.azure.resourcemanager.computelimit.fluent.GuestSubscriptionsClient.get":"Microsoft.ComputeLimit.GuestSubscriptions.get","com.azure.resourcemanager.computelimit.fluent.GuestSubscriptionsClient.getWithResponse":"Microsoft.ComputeLimit.GuestSubscriptions.get","com.azure.resourcemanager.computelimit.fluent.GuestSubscriptionsClient.listBySubscriptionLocationResource":"Microsoft.ComputeLimit.GuestSubscriptions.listBySubscriptionLocationResource","com.azure.resourcemanager.computelimit.fluent.OperationsClient":"Microsoft.ComputeLimit.Operations","com.azure.resourcemanager.computelimit.fluent.OperationsClient.list":"Azure.ResourceManager.Operations.list","com.azure.resourcemanager.computelimit.fluent.SharedLimitsClient":"Microsoft.ComputeLimit.SharedLimits","com.azure.resourcemanager.computelimit.fluent.SharedLimitsClient.create":"Microsoft.ComputeLimit.SharedLimits.create","com.azure.resourcemanager.computelimit.fluent.SharedLimitsClient.createWithResponse":"Microsoft.ComputeLimit.SharedLimits.create","com.azure.resourcemanager.computelimit.fluent.SharedLimitsClient.delete":"Microsoft.ComputeLimit.SharedLimits.delete","com.azure.resourcemanager.computelimit.fluent.SharedLimitsClient.deleteWithResponse":"Microsoft.ComputeLimit.SharedLimits.delete","com.azure.resourcemanager.computelimit.fluent.SharedLimitsClient.get":"Microsoft.ComputeLimit.SharedLimits.get","com.azure.resourcemanager.computelimit.fluent.SharedLimitsClient.getWithResponse":"Microsoft.ComputeLimit.SharedLimits.get","com.azure.resourcemanager.computelimit.fluent.SharedLimitsClient.listBySubscriptionLocationResource":"Microsoft.ComputeLimit.SharedLimits.listBySubscriptionLocationResource","com.azure.resourcemanager.computelimit.fluent.VmFamiliesClient":"Microsoft.ComputeLimit.VmFamilies","com.azure.resourcemanager.computelimit.fluent.VmFamiliesClient.get":"Microsoft.ComputeLimit.VmFamilies.get","com.azure.resourcemanager.computelimit.fluent.VmFamiliesClient.getWithResponse":"Microsoft.ComputeLimit.VmFamilies.get","com.azure.resourcemanager.computelimit.fluent.VmFamiliesClient.listBySubscriptionLocationResource":"Microsoft.ComputeLimit.VmFamilies.listBySubscriptionLocationResource","com.azure.resourcemanager.computelimit.fluent.models.FeatureInner":"Microsoft.ComputeLimit.Feature","com.azure.resourcemanager.computelimit.fluent.models.GuestSubscriptionInner":"Microsoft.ComputeLimit.GuestSubscription","com.azure.resourcemanager.computelimit.fluent.models.OperationInner":"Azure.ResourceManager.CommonTypes.Operation","com.azure.resourcemanager.computelimit.fluent.models.OperationStatusResultInner":"Azure.ResourceManager.CommonTypes.OperationStatusResult","com.azure.resourcemanager.computelimit.fluent.models.SharedLimitInner":"Microsoft.ComputeLimit.SharedLimit","com.azure.resourcemanager.computelimit.fluent.models.VmFamilyInner":"Microsoft.ComputeLimit.VmFamily","com.azure.resourcemanager.computelimit.implementation.ComputeLimitClientBuilder":"Microsoft.ComputeLimit","com.azure.resourcemanager.computelimit.implementation.models.FeatureListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.computelimit.implementation.models.GuestSubscriptionListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.computelimit.implementation.models.OperationListResult":"Azure.ResourceManager.CommonTypes.OperationListResult","com.azure.resourcemanager.computelimit.implementation.models.SharedLimitListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.computelimit.implementation.models.VmFamilyListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.computelimit.models.ActionType":"Azure.ResourceManager.CommonTypes.ActionType","com.azure.resourcemanager.computelimit.models.FeatureProperties":"Microsoft.ComputeLimit.FeatureProperties","com.azure.resourcemanager.computelimit.models.FeatureState":"Microsoft.ComputeLimit.FeatureState","com.azure.resourcemanager.computelimit.models.GuestSubscriptionProperties":"Microsoft.ComputeLimit.GuestSubscriptionProperties","com.azure.resourcemanager.computelimit.models.LimitName":"Microsoft.ComputeLimit.LimitName","com.azure.resourcemanager.computelimit.models.OperationDisplay":"Azure.ResourceManager.CommonTypes.OperationDisplay","com.azure.resourcemanager.computelimit.models.Origin":"Azure.ResourceManager.CommonTypes.Origin","com.azure.resourcemanager.computelimit.models.ResourceProvisioningState":"Azure.ResourceManager.ResourceProvisioningState","com.azure.resourcemanager.computelimit.models.SharedLimitProperties":"Microsoft.ComputeLimit.SharedLimitProperties","com.azure.resourcemanager.computelimit.models.VmFamilyProperties":"Microsoft.ComputeLimit.VmFamilyProperties"},"generatedFiles":["src/main/java/com/azure/resourcemanager/computelimit/ComputeLimitManager.java","src/main/java/com/azure/resourcemanager/computelimit/fluent/ComputeLimitClient.java","src/main/java/com/azure/resourcemanager/computelimit/fluent/FeaturesClient.java","src/main/java/com/azure/resourcemanager/computelimit/fluent/GuestSubscriptionsClient.java","src/main/java/com/azure/resourcemanager/computelimit/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/computelimit/fluent/SharedLimitsClient.java","src/main/java/com/azure/resourcemanager/computelimit/fluent/VmFamiliesClient.java","src/main/java/com/azure/resourcemanager/computelimit/fluent/models/FeatureInner.java","src/main/java/com/azure/resourcemanager/computelimit/fluent/models/GuestSubscriptionInner.java","src/main/java/com/azure/resourcemanager/computelimit/fluent/models/OperationInner.java","src/main/java/com/azure/resourcemanager/computelimit/fluent/models/OperationStatusResultInner.java","src/main/java/com/azure/resourcemanager/computelimit/fluent/models/SharedLimitInner.java","src/main/java/com/azure/resourcemanager/computelimit/fluent/models/VmFamilyInner.java","src/main/java/com/azure/resourcemanager/computelimit/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/computelimit/fluent/package-info.java","src/main/java/com/azure/resourcemanager/computelimit/implementation/ComputeLimitClientBuilder.java","src/main/java/com/azure/resourcemanager/computelimit/implementation/ComputeLimitClientImpl.java","src/main/java/com/azure/resourcemanager/computelimit/implementation/FeatureImpl.java","src/main/java/com/azure/resourcemanager/computelimit/implementation/FeaturesClientImpl.java","src/main/java/com/azure/resourcemanager/computelimit/implementation/FeaturesImpl.java","src/main/java/com/azure/resourcemanager/computelimit/implementation/GuestSubscriptionImpl.java","src/main/java/com/azure/resourcemanager/computelimit/implementation/GuestSubscriptionsClientImpl.java","src/main/java/com/azure/resourcemanager/computelimit/implementation/GuestSubscriptionsImpl.java","src/main/java/com/azure/resourcemanager/computelimit/implementation/OperationImpl.java","src/main/java/com/azure/resourcemanager/computelimit/implementation/OperationStatusResultImpl.java","src/main/java/com/azure/resourcemanager/computelimit/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/computelimit/implementation/OperationsImpl.java","src/main/java/com/azure/resourcemanager/computelimit/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/computelimit/implementation/SharedLimitImpl.java","src/main/java/com/azure/resourcemanager/computelimit/implementation/SharedLimitsClientImpl.java","src/main/java/com/azure/resourcemanager/computelimit/implementation/SharedLimitsImpl.java","src/main/java/com/azure/resourcemanager/computelimit/implementation/VmFamiliesClientImpl.java","src/main/java/com/azure/resourcemanager/computelimit/implementation/VmFamiliesImpl.java","src/main/java/com/azure/resourcemanager/computelimit/implementation/VmFamilyImpl.java","src/main/java/com/azure/resourcemanager/computelimit/implementation/models/FeatureListResult.java","src/main/java/com/azure/resourcemanager/computelimit/implementation/models/GuestSubscriptionListResult.java","src/main/java/com/azure/resourcemanager/computelimit/implementation/models/OperationListResult.java","src/main/java/com/azure/resourcemanager/computelimit/implementation/models/SharedLimitListResult.java","src/main/java/com/azure/resourcemanager/computelimit/implementation/models/VmFamilyListResult.java","src/main/java/com/azure/resourcemanager/computelimit/implementation/package-info.java","src/main/java/com/azure/resourcemanager/computelimit/models/ActionType.java","src/main/java/com/azure/resourcemanager/computelimit/models/Feature.java","src/main/java/com/azure/resourcemanager/computelimit/models/FeatureProperties.java","src/main/java/com/azure/resourcemanager/computelimit/models/FeatureState.java","src/main/java/com/azure/resourcemanager/computelimit/models/Features.java","src/main/java/com/azure/resourcemanager/computelimit/models/GuestSubscription.java","src/main/java/com/azure/resourcemanager/computelimit/models/GuestSubscriptionProperties.java","src/main/java/com/azure/resourcemanager/computelimit/models/GuestSubscriptions.java","src/main/java/com/azure/resourcemanager/computelimit/models/LimitName.java","src/main/java/com/azure/resourcemanager/computelimit/models/Operation.java","src/main/java/com/azure/resourcemanager/computelimit/models/OperationDisplay.java","src/main/java/com/azure/resourcemanager/computelimit/models/OperationStatusResult.java","src/main/java/com/azure/resourcemanager/computelimit/models/Operations.java","src/main/java/com/azure/resourcemanager/computelimit/models/Origin.java","src/main/java/com/azure/resourcemanager/computelimit/models/ResourceProvisioningState.java","src/main/java/com/azure/resourcemanager/computelimit/models/SharedLimit.java","src/main/java/com/azure/resourcemanager/computelimit/models/SharedLimitProperties.java","src/main/java/com/azure/resourcemanager/computelimit/models/SharedLimits.java","src/main/java/com/azure/resourcemanager/computelimit/models/VmFamilies.java","src/main/java/com/azure/resourcemanager/computelimit/models/VmFamily.java","src/main/java/com/azure/resourcemanager/computelimit/models/VmFamilyProperties.java","src/main/java/com/azure/resourcemanager/computelimit/models/package-info.java","src/main/java/com/azure/resourcemanager/computelimit/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-computelimit/proxy-config.json b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-computelimit/proxy-config.json index 31d42060d9dd..7729ba8b07b1 100644 --- a/sdk/computelimit/azure-resourcemanager-computelimit/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-computelimit/proxy-config.json +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-computelimit/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.computelimit.implementation.GuestSubscriptionsClientImpl$GuestSubscriptionsService"],["com.azure.resourcemanager.computelimit.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.computelimit.implementation.SharedLimitsClientImpl$SharedLimitsService"]] \ No newline at end of file +[["com.azure.resourcemanager.computelimit.implementation.FeaturesClientImpl$FeaturesService"],["com.azure.resourcemanager.computelimit.implementation.GuestSubscriptionsClientImpl$GuestSubscriptionsService"],["com.azure.resourcemanager.computelimit.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.computelimit.implementation.SharedLimitsClientImpl$SharedLimitsService"],["com.azure.resourcemanager.computelimit.implementation.VmFamiliesClientImpl$VmFamiliesService"]] \ No newline at end of file diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/FeaturesDisableSamples.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/FeaturesDisableSamples.java new file mode 100644 index 000000000000..fc5ac2418195 --- /dev/null +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/FeaturesDisableSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computelimit.generated; + +/** + * Samples for Features Disable. + */ +public final class FeaturesDisableSamples { + /* + * x-ms-original-file: 2026-04-30/Features_Disable.json + */ + /** + * Sample code: Disable feature. + * + * @param manager Entry point to ComputeLimitManager. + */ + public static void disableFeature(com.azure.resourcemanager.computelimit.ComputeLimitManager manager) { + manager.features().disable("eastus", "VmCategoryQuota", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/FeaturesEnableSamples.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/FeaturesEnableSamples.java new file mode 100644 index 000000000000..e4edc2c88034 --- /dev/null +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/FeaturesEnableSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computelimit.generated; + +/** + * Samples for Features Enable. + */ +public final class FeaturesEnableSamples { + /* + * x-ms-original-file: 2026-04-30/Features_Enable.json + */ + /** + * Sample code: Enable feature. + * + * @param manager Entry point to ComputeLimitManager. + */ + public static void enableFeature(com.azure.resourcemanager.computelimit.ComputeLimitManager manager) { + manager.features().enable("eastus", "VmCategoryQuota", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/FeaturesGetSamples.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/FeaturesGetSamples.java new file mode 100644 index 000000000000..2715d2e4a548 --- /dev/null +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/FeaturesGetSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computelimit.generated; + +/** + * Samples for Features Get. + */ +public final class FeaturesGetSamples { + /* + * x-ms-original-file: 2026-04-30/Features_Get_SharedLimit.json + */ + /** + * Sample code: Get SharedLimit feature. + * + * @param manager Entry point to ComputeLimitManager. + */ + public static void getSharedLimitFeature(com.azure.resourcemanager.computelimit.ComputeLimitManager manager) { + manager.features().getWithResponse("eastus", "SharedLimit", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-04-30/Features_Get.json + */ + /** + * Sample code: Get feature. + * + * @param manager Entry point to ComputeLimitManager. + */ + public static void getFeature(com.azure.resourcemanager.computelimit.ComputeLimitManager manager) { + manager.features().getWithResponse("eastus", "VmCategoryQuota", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/FeaturesListBySubscriptionLocationResourceSamples.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/FeaturesListBySubscriptionLocationResourceSamples.java new file mode 100644 index 000000000000..fa6e88fcc3cb --- /dev/null +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/FeaturesListBySubscriptionLocationResourceSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computelimit.generated; + +/** + * Samples for Features ListBySubscriptionLocationResource. + */ +public final class FeaturesListBySubscriptionLocationResourceSamples { + /* + * x-ms-original-file: 2026-04-30/Features_List.json + */ + /** + * Sample code: List features. + * + * @param manager Entry point to ComputeLimitManager. + */ + public static void listFeatures(com.azure.resourcemanager.computelimit.ComputeLimitManager manager) { + manager.features().listBySubscriptionLocationResource("eastus", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/GuestSubscriptionsCreateSamples.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/GuestSubscriptionsCreateSamples.java index f63048609e3f..821e6f755dfc 100644 --- a/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/GuestSubscriptionsCreateSamples.java +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/GuestSubscriptionsCreateSamples.java @@ -11,7 +11,7 @@ */ public final class GuestSubscriptionsCreateSamples { /* - * x-ms-original-file: 2025-08-15/GuestSubscriptions_Create.json + * x-ms-original-file: 2026-04-30/GuestSubscriptions_Create.json */ /** * Sample code: Create a guest subscription. diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/GuestSubscriptionsDeleteSamples.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/GuestSubscriptionsDeleteSamples.java index 8feea3e2f2be..9855fd867b2e 100644 --- a/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/GuestSubscriptionsDeleteSamples.java +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/GuestSubscriptionsDeleteSamples.java @@ -9,7 +9,7 @@ */ public final class GuestSubscriptionsDeleteSamples { /* - * x-ms-original-file: 2025-08-15/GuestSubscriptions_Delete.json + * x-ms-original-file: 2026-04-30/GuestSubscriptions_Delete.json */ /** * Sample code: Delete a guest subscription. diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/GuestSubscriptionsGetSamples.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/GuestSubscriptionsGetSamples.java index d0ad7032e1cd..3fa4b5cfdd08 100644 --- a/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/GuestSubscriptionsGetSamples.java +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/GuestSubscriptionsGetSamples.java @@ -9,7 +9,7 @@ */ public final class GuestSubscriptionsGetSamples { /* - * x-ms-original-file: 2025-08-15/GuestSubscriptions_Get.json + * x-ms-original-file: 2026-04-30/GuestSubscriptions_Get.json */ /** * Sample code: Get a guest subscription. diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/GuestSubscriptionsListBySubscriptionLocationResourceSamples.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/GuestSubscriptionsListBySubscriptionLocationResourceSamples.java index 266fcac71fbc..44994d04fc4e 100644 --- a/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/GuestSubscriptionsListBySubscriptionLocationResourceSamples.java +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/GuestSubscriptionsListBySubscriptionLocationResourceSamples.java @@ -9,7 +9,7 @@ */ public final class GuestSubscriptionsListBySubscriptionLocationResourceSamples { /* - * x-ms-original-file: 2025-08-15/GuestSubscriptions_List.json + * x-ms-original-file: 2026-04-30/GuestSubscriptions_List.json */ /** * Sample code: List guest subscriptions for a scope. diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/OperationsListSamples.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/OperationsListSamples.java index 20fc786b9b1b..691cab2a52ca 100644 --- a/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/OperationsListSamples.java +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/OperationsListSamples.java @@ -9,7 +9,7 @@ */ public final class OperationsListSamples { /* - * x-ms-original-file: 2025-08-15/Operations_List.json + * x-ms-original-file: 2026-04-30/Operations_List.json */ /** * Sample code: List operations. diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/SharedLimitsCreateSamples.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/SharedLimitsCreateSamples.java index 99cabc0dcdd3..6e4c1f1d44f9 100644 --- a/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/SharedLimitsCreateSamples.java +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/SharedLimitsCreateSamples.java @@ -11,7 +11,7 @@ */ public final class SharedLimitsCreateSamples { /* - * x-ms-original-file: 2025-08-15/SharedLimits_Create.json + * x-ms-original-file: 2026-04-30/SharedLimits_Create.json */ /** * Sample code: Create a shared limit. diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/SharedLimitsDeleteSamples.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/SharedLimitsDeleteSamples.java index 488f41e8e5f8..ecd773290a07 100644 --- a/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/SharedLimitsDeleteSamples.java +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/SharedLimitsDeleteSamples.java @@ -9,7 +9,7 @@ */ public final class SharedLimitsDeleteSamples { /* - * x-ms-original-file: 2025-08-15/SharedLimits_Delete.json + * x-ms-original-file: 2026-04-30/SharedLimits_Delete.json */ /** * Sample code: Delete a shared limit. diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/SharedLimitsGetSamples.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/SharedLimitsGetSamples.java index cb58d0f2c6b3..39abf22e2ff8 100644 --- a/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/SharedLimitsGetSamples.java +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/SharedLimitsGetSamples.java @@ -9,7 +9,7 @@ */ public final class SharedLimitsGetSamples { /* - * x-ms-original-file: 2025-08-15/SharedLimits_Get.json + * x-ms-original-file: 2026-04-30/SharedLimits_Get.json */ /** * Sample code: Get a shared limit. diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/SharedLimitsListBySubscriptionLocationResourceSamples.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/SharedLimitsListBySubscriptionLocationResourceSamples.java index 1d239b10abc9..2cf5c3cf1106 100644 --- a/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/SharedLimitsListBySubscriptionLocationResourceSamples.java +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/SharedLimitsListBySubscriptionLocationResourceSamples.java @@ -9,7 +9,7 @@ */ public final class SharedLimitsListBySubscriptionLocationResourceSamples { /* - * x-ms-original-file: 2025-08-15/SharedLimits_List.json + * x-ms-original-file: 2026-04-30/SharedLimits_List.json */ /** * Sample code: List all shared limits for a scope. diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/VmFamiliesGetSamples.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/VmFamiliesGetSamples.java new file mode 100644 index 000000000000..e01049fd6d65 --- /dev/null +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/VmFamiliesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computelimit.generated; + +/** + * Samples for VmFamilies Get. + */ +public final class VmFamiliesGetSamples { + /* + * x-ms-original-file: 2026-04-30/VmFamilies_Get.json + */ + /** + * Sample code: Get a VM family. + * + * @param manager Entry point to ComputeLimitManager. + */ + public static void getAVMFamily(com.azure.resourcemanager.computelimit.ComputeLimitManager manager) { + manager.vmFamilies().getWithResponse("eastus", "standardDSv2Family", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/VmFamiliesListBySubscriptionLocationResourceSamples.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/VmFamiliesListBySubscriptionLocationResourceSamples.java new file mode 100644 index 000000000000..ade111a2bace --- /dev/null +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/samples/java/com/azure/resourcemanager/computelimit/generated/VmFamiliesListBySubscriptionLocationResourceSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computelimit.generated; + +/** + * Samples for VmFamilies ListBySubscriptionLocationResource. + */ +public final class VmFamiliesListBySubscriptionLocationResourceSamples { + /* + * x-ms-original-file: 2026-04-30/VmFamilies_List.json + */ + /** + * Sample code: List VM families. + * + * @param manager Entry point to ComputeLimitManager. + */ + public static void listVMFamilies(com.azure.resourcemanager.computelimit.ComputeLimitManager manager) { + manager.vmFamilies().listBySubscriptionLocationResource("eastus", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/FeatureInnerTests.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/FeatureInnerTests.java new file mode 100644 index 000000000000..4c5657c6fce8 --- /dev/null +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/FeatureInnerTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computelimit.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computelimit.fluent.models.FeatureInner; +import com.azure.resourcemanager.computelimit.models.FeatureState; +import org.junit.jupiter.api.Assertions; + +public final class FeatureInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FeatureInner model = BinaryData.fromString( + "{\"properties\":{\"state\":\"Disabled\",\"provisioningState\":\"Failed\"},\"id\":\"it\",\"name\":\"np\",\"type\":\"qfpjk\"}") + .toObject(FeatureInner.class); + Assertions.assertEquals(FeatureState.DISABLED, model.properties().state()); + } +} diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/FeatureListResultTests.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/FeatureListResultTests.java new file mode 100644 index 000000000000..9bb3e4943a16 --- /dev/null +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/FeatureListResultTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computelimit.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computelimit.implementation.models.FeatureListResult; +import com.azure.resourcemanager.computelimit.models.FeatureState; +import org.junit.jupiter.api.Assertions; + +public final class FeatureListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FeatureListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"state\":\"Enabled\",\"provisioningState\":\"Canceled\"},\"id\":\"xypininmayhuybbk\",\"name\":\"odepoogin\",\"type\":\"vamih\"},{\"properties\":{\"state\":\"Disabled\",\"provisioningState\":\"Canceled\"},\"id\":\"zxtheotusivyevcc\",\"name\":\"qi\",\"type\":\"nhungbw\"},{\"properties\":{\"state\":\"Disabled\",\"provisioningState\":\"Failed\"},\"id\":\"xgispemvtzfkufu\",\"name\":\"ljofxqeofjaeqjh\",\"type\":\"jbasvmsmjqulngs\"}],\"nextLink\":\"nbybkzgcwrwcl\"}") + .toObject(FeatureListResult.class); + Assertions.assertEquals(FeatureState.ENABLED, model.value().get(0).properties().state()); + Assertions.assertEquals("nbybkzgcwrwcl", model.nextLink()); + } +} diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/FeaturePropertiesTests.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/FeaturePropertiesTests.java new file mode 100644 index 000000000000..a6a9beaac9b6 --- /dev/null +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/FeaturePropertiesTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computelimit.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computelimit.models.FeatureProperties; +import com.azure.resourcemanager.computelimit.models.FeatureState; +import org.junit.jupiter.api.Assertions; + +public final class FeaturePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FeatureProperties model = BinaryData.fromString("{\"state\":\"Disabled\",\"provisioningState\":\"Succeeded\"}") + .toObject(FeatureProperties.class); + Assertions.assertEquals(FeatureState.DISABLED, model.state()); + } +} diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/FeaturesGetWithResponseMockTests.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/FeaturesGetWithResponseMockTests.java new file mode 100644 index 000000000000..ff29381eb045 --- /dev/null +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/FeaturesGetWithResponseMockTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computelimit.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.computelimit.ComputeLimitManager; +import com.azure.resourcemanager.computelimit.models.Feature; +import com.azure.resourcemanager.computelimit.models.FeatureState; +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 FeaturesGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"state\":\"Enabled\",\"provisioningState\":\"Succeeded\"},\"id\":\"a\",\"name\":\"a\",\"type\":\"hrzayvvtpgvdf\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ComputeLimitManager manager = ComputeLimitManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Feature response = manager.features() + .getWithResponse("ciwqvhk", "ixuigdtopbobj", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(FeatureState.ENABLED, response.properties().state()); + } +} diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/FeaturesListBySubscriptionLocationResourceMockTests.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/FeaturesListBySubscriptionLocationResourceMockTests.java new file mode 100644 index 000000000000..fb7b2fe6be06 --- /dev/null +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/FeaturesListBySubscriptionLocationResourceMockTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computelimit.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.computelimit.ComputeLimitManager; +import com.azure.resourcemanager.computelimit.models.Feature; +import com.azure.resourcemanager.computelimit.models.FeatureState; +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 FeaturesListBySubscriptionLocationResourceMockTests { + @Test + public void testListBySubscriptionLocationResource() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"state\":\"Disabled\",\"provisioningState\":\"Failed\"},\"id\":\"ugnxkrxdqmi\",\"name\":\"tthzrvqd\",\"type\":\"abhjybi\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ComputeLimitManager manager = ComputeLimitManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.features().listBySubscriptionLocationResource("iotkftutqxl", com.azure.core.util.Context.NONE); + + Assertions.assertEquals(FeatureState.DISABLED, response.iterator().next().properties().state()); + } +} diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/GuestSubscriptionsCreateWithResponseMockTests.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/GuestSubscriptionsCreateWithResponseMockTests.java index 3f90db38c35f..2febaebc4b62 100644 --- a/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/GuestSubscriptionsCreateWithResponseMockTests.java +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/GuestSubscriptionsCreateWithResponseMockTests.java @@ -21,7 +21,7 @@ public final class GuestSubscriptionsCreateWithResponseMockTests { @Test public void testCreateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Succeeded\"},\"id\":\"ujitcjcz\",\"name\":\"zevndhkrwpdappds\",\"type\":\"dkvwrwjfe\"}"; + = "{\"properties\":{\"provisioningState\":\"Canceled\"},\"id\":\"sgfyccsnew\",\"name\":\"dwzjeiach\",\"type\":\"oosflnr\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,8 +31,8 @@ public void testCreateWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); GuestSubscription response = manager.guestSubscriptions() - .define("gls") - .withExistingLocation("biksq") + .define("km") + .withExistingLocation("aop") .withProperties(new GuestSubscriptionProperties()) .create(); diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/GuestSubscriptionsDeleteByResourceGroupWithResponseMockTests.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/GuestSubscriptionsDeleteByResourceGroupWithResponseMockTests.java index 65456dae126b..c680ffdd51ec 100644 --- a/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/GuestSubscriptionsDeleteByResourceGroupWithResponseMockTests.java +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/GuestSubscriptionsDeleteByResourceGroupWithResponseMockTests.java @@ -28,7 +28,7 @@ public void testDeleteWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.guestSubscriptions() - .deleteByResourceGroupWithResponse("v", "smjqulngsntnbyb", com.azure.core.util.Context.NONE); + .deleteByResourceGroupWithResponse("fizuckyf", "hr", com.azure.core.util.Context.NONE); } } diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/GuestSubscriptionsGetWithResponseMockTests.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/GuestSubscriptionsGetWithResponseMockTests.java index f4668d73b29e..486e11dc27c1 100644 --- a/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/GuestSubscriptionsGetWithResponseMockTests.java +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/GuestSubscriptionsGetWithResponseMockTests.java @@ -20,7 +20,7 @@ public final class GuestSubscriptionsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Canceled\"},\"id\":\"vtz\",\"name\":\"kufubljo\",\"type\":\"xqeofjaeqjhqjba\"}"; + = "{\"properties\":{\"provisioningState\":\"Canceled\"},\"id\":\"wzwbnguitn\",\"name\":\"uizga\",\"type\":\"x\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -30,7 +30,7 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); GuestSubscription response = manager.guestSubscriptions() - .getWithResponse("hungbwjzrnf", "gxg", com.azure.core.util.Context.NONE) + .getWithResponse("tbvpysszdnru", "qguhmuo", com.azure.core.util.Context.NONE) .getValue(); } diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/GuestSubscriptionsListBySubscriptionLocationResourceMockTests.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/GuestSubscriptionsListBySubscriptionLocationResourceMockTests.java index de3d4adfeda7..e02750783375 100644 --- a/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/GuestSubscriptionsListBySubscriptionLocationResourceMockTests.java +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/GuestSubscriptionsListBySubscriptionLocationResourceMockTests.java @@ -21,7 +21,7 @@ public final class GuestSubscriptionsListBySubscriptionLocationResourceMockTests @Test public void testListBySubscriptionLocationResource() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\"},\"id\":\"rljdouskcqv\",\"name\":\"ocrcjdk\",\"type\":\"tnhxbn\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\"},\"id\":\"uht\",\"name\":\"mwisdkfthwxmnt\",\"type\":\"i\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -30,8 +30,8 @@ public void testListBySubscriptionLocationResource() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response = manager.guestSubscriptions() - .listBySubscriptionLocationResource("zgcwrw", com.azure.core.util.Context.NONE); + PagedIterable response + = manager.guestSubscriptions().listBySubscriptionLocationResource("idf", com.azure.core.util.Context.NONE); } } diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/OperationsListMockTests.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/OperationsListMockTests.java index d733409d4d20..34e2b3e61502 100644 --- a/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/OperationsListMockTests.java +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/OperationsListMockTests.java @@ -21,7 +21,7 @@ public final class OperationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"name\":\"luwfzitonpeqfpjk\",\"isDataAction\":true,\"display\":{\"provider\":\"pdvhpfxxypin\",\"resource\":\"mayhuybbkpodepoo\",\"operation\":\"nuvamiheogna\",\"description\":\"zxtheotusivyevcc\"},\"origin\":\"user\",\"actionType\":\"Internal\"}]}"; + = "{\"value\":[{\"name\":\"fpsalgbqu\",\"isDataAction\":true,\"display\":{\"provider\":\"jgzjaoyfhrtx\",\"resource\":\"n\",\"operation\":\"kujysvlejuvfq\",\"description\":\"rlyxwjkcprbnw\"},\"origin\":\"system\",\"actionType\":\"Internal\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/SharedLimitsCreateWithResponseMockTests.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/SharedLimitsCreateWithResponseMockTests.java index 27f53c499d42..1546c854c706 100644 --- a/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/SharedLimitsCreateWithResponseMockTests.java +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/SharedLimitsCreateWithResponseMockTests.java @@ -21,7 +21,7 @@ public final class SharedLimitsCreateWithResponseMockTests { @Test public void testCreateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"resourceName\":{\"value\":\"yjgzjaoyfhrtxiln\",\"localizedValue\":\"kujysvlejuvfq\"},\"limit\":1135390068,\"unit\":\"yxwjkcp\",\"provisioningState\":\"Canceled\"},\"id\":\"b\",\"name\":\"gjvtbv\",\"type\":\"ysszdnrujqguh\"}"; + = "{\"properties\":{\"resourceName\":{\"value\":\"hd\",\"localizedValue\":\"i\"},\"limit\":996013729,\"unit\":\"jnxqbzvddntwn\",\"provisioningState\":\"Failed\"},\"id\":\"btwnpzaoqvuhrhcf\",\"name\":\"cyddglmjthjqk\",\"type\":\"pyeicxm\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,8 +31,8 @@ public void testCreateWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); SharedLimit response = manager.sharedLimits() - .define("modmglougpb") - .withExistingLocation("iqfouflmmnkz") + .define("gmaajrm") + .withExistingLocation("po") .withProperties(new SharedLimitProperties()) .create(); diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/SharedLimitsDeleteByResourceGroupWithResponseMockTests.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/SharedLimitsDeleteByResourceGroupWithResponseMockTests.java index edbb30d559e9..29387473d3d5 100644 --- a/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/SharedLimitsDeleteByResourceGroupWithResponseMockTests.java +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/SharedLimitsDeleteByResourceGroupWithResponseMockTests.java @@ -27,7 +27,8 @@ public void testDeleteWithResponse() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.sharedLimits().deleteByResourceGroupWithResponse("kjfkg", "awxklr", com.azure.core.util.Context.NONE); + manager.sharedLimits() + .deleteByResourceGroupWithResponse("gpbtoqcjmklj", "vbqid", com.azure.core.util.Context.NONE); } } diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/SharedLimitsGetWithResponseMockTests.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/SharedLimitsGetWithResponseMockTests.java index ede1d772a190..e61c231721de 100644 --- a/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/SharedLimitsGetWithResponseMockTests.java +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/SharedLimitsGetWithResponseMockTests.java @@ -20,7 +20,7 @@ public final class SharedLimitsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"resourceName\":{\"value\":\"rl\",\"localizedValue\":\"ugjzzdatqxhocdge\"},\"limit\":1293628182,\"unit\":\"phut\",\"provisioningState\":\"Succeeded\"},\"id\":\"vkaozwyiftyhxhur\",\"name\":\"k\",\"type\":\"tyxolniwpwc\"}"; + = "{\"properties\":{\"resourceName\":{\"value\":\"dkirsoodqxhcr\",\"localizedValue\":\"ohjtckw\"},\"limit\":1289285070,\"unit\":\"ifiyipjxsqwpgrj\",\"provisioningState\":\"Failed\"},\"id\":\"rcjxvsnbyxqabn\",\"name\":\"ocpcy\",\"type\":\"hurzafblj\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -29,8 +29,9 @@ public void testGetWithResponse() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - SharedLimit response - = manager.sharedLimits().getWithResponse("snhu", "je", com.azure.core.util.Context.NONE).getValue(); + SharedLimit response = manager.sharedLimits() + .getWithResponse("sfqpteehz", "vypyqrimzinpv", com.azure.core.util.Context.NONE) + .getValue(); } } diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/SharedLimitsListBySubscriptionLocationResourceMockTests.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/SharedLimitsListBySubscriptionLocationResourceMockTests.java index 961c1ca5c66a..db8c8ad75aac 100644 --- a/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/SharedLimitsListBySubscriptionLocationResourceMockTests.java +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/SharedLimitsListBySubscriptionLocationResourceMockTests.java @@ -21,7 +21,7 @@ public final class SharedLimitsListBySubscriptionLocationResourceMockTests { @Test public void testListBySubscriptionLocationResource() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"resourceName\":{\"value\":\"nddhsgcbacph\",\"localizedValue\":\"koty\"},\"limit\":757698897,\"unit\":\"ulzndlikwyqk\",\"provisioningState\":\"Succeeded\"},\"id\":\"bmadgak\",\"name\":\"qsrxybzqqed\",\"type\":\"ytb\"}]}"; + = "{\"value\":[{\"properties\":{\"resourceName\":{\"value\":\"bzhfepgzgqexz\",\"localizedValue\":\"c\"},\"limit\":149734817,\"unit\":\"aierhhb\",\"provisioningState\":\"Failed\"},\"id\":\"ummajtjaod\",\"name\":\"obnbdxkqpxokaj\",\"type\":\"onpimexgstxg\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -30,8 +30,8 @@ public void testListBySubscriptionLocationResource() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response - = manager.sharedLimits().listBySubscriptionLocationResource("plwckbas", com.azure.core.util.Context.NONE); + PagedIterable response = manager.sharedLimits() + .listBySubscriptionLocationResource("qajzyulpkudjkr", com.azure.core.util.Context.NONE); } } diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/VmFamiliesGetWithResponseMockTests.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/VmFamiliesGetWithResponseMockTests.java new file mode 100644 index 000000000000..58bb858a7dcc --- /dev/null +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/VmFamiliesGetWithResponseMockTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computelimit.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.computelimit.ComputeLimitManager; +import com.azure.resourcemanager.computelimit.models.VmFamily; +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 VmFamiliesGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"category\":\"koen\",\"provisioningState\":\"Failed\"},\"id\":\"nvudwtiukb\",\"name\":\"dng\",\"type\":\"pocipazyxoegu\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ComputeLimitManager manager = ComputeLimitManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + VmFamily response = manager.vmFamilies() + .getWithResponse("shxmzsbbzoggigrx", "burvjxxjnspy", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("koen", response.properties().category()); + } +} diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/VmFamiliesListBySubscriptionLocationResourceMockTests.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/VmFamiliesListBySubscriptionLocationResourceMockTests.java new file mode 100644 index 000000000000..de636fa6e183 --- /dev/null +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/VmFamiliesListBySubscriptionLocationResourceMockTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computelimit.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.computelimit.ComputeLimitManager; +import com.azure.resourcemanager.computelimit.models.VmFamily; +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 VmFamiliesListBySubscriptionLocationResourceMockTests { + @Test + public void testListBySubscriptionLocationResource() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"category\":\"bpizcdrqjsdpydn\",\"provisioningState\":\"Failed\"},\"id\":\"de\",\"name\":\"ejzicwifsjtt\",\"type\":\"zfbishcbkhaj\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ComputeLimitManager manager = ComputeLimitManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.vmFamilies() + .listBySubscriptionLocationResource("g", "npiucgygevqznty", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("bpizcdrqjsdpydn", response.iterator().next().properties().category()); + } +} diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/VmFamilyInnerTests.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/VmFamilyInnerTests.java new file mode 100644 index 000000000000..40c4111c5d8d --- /dev/null +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/VmFamilyInnerTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computelimit.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computelimit.fluent.models.VmFamilyInner; +import org.junit.jupiter.api.Assertions; + +public final class VmFamilyInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + VmFamilyInner model = BinaryData.fromString( + "{\"properties\":{\"category\":\"w\",\"provisioningState\":\"Succeeded\"},\"id\":\"ypl\",\"name\":\"ckbasyypndd\",\"type\":\"sgcbac\"}") + .toObject(VmFamilyInner.class); + Assertions.assertEquals("w", model.properties().category()); + } +} diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/VmFamilyListResultTests.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/VmFamilyListResultTests.java new file mode 100644 index 000000000000..80bf8a0155b4 --- /dev/null +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/VmFamilyListResultTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computelimit.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computelimit.implementation.models.VmFamilyListResult; +import org.junit.jupiter.api.Assertions; + +public final class VmFamilyListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + VmFamilyListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"category\":\"oulzndlikwyq\",\"provisioningState\":\"Canceled\"},\"id\":\"ibmadgakeqsrxy\",\"name\":\"zqqedq\",\"type\":\"tbciqfouflmm\"},{\"properties\":{\"category\":\"smodmgloug\",\"provisioningState\":\"Canceled\"},\"id\":\"tmut\",\"name\":\"uqktap\",\"type\":\"pwgcuertu\"},{\"properties\":{\"category\":\"o\",\"provisioningState\":\"Succeeded\"},\"id\":\"hbmdgbbjfdd\",\"name\":\"mbmbexppbh\",\"type\":\"q\"}],\"nextLink\":\"ol\"}") + .toObject(VmFamilyListResult.class); + Assertions.assertEquals("oulzndlikwyq", model.value().get(0).properties().category()); + Assertions.assertEquals("ol", model.nextLink()); + } +} diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/VmFamilyPropertiesTests.java b/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/VmFamilyPropertiesTests.java new file mode 100644 index 000000000000..0ae03b38c9b0 --- /dev/null +++ b/sdk/computelimit/azure-resourcemanager-computelimit/src/test/java/com/azure/resourcemanager/computelimit/generated/VmFamilyPropertiesTests.java @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.computelimit.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.computelimit.models.VmFamilyProperties; +import org.junit.jupiter.api.Assertions; + +public final class VmFamilyPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + VmFamilyProperties model = BinaryData.fromString("{\"category\":\"ejk\",\"provisioningState\":\"Failed\"}") + .toObject(VmFamilyProperties.class); + Assertions.assertEquals("ejk", model.category()); + } +} diff --git a/sdk/computelimit/azure-resourcemanager-computelimit/tsp-location.yaml b/sdk/computelimit/azure-resourcemanager-computelimit/tsp-location.yaml index 637345c8748a..09e55e68641c 100644 --- a/sdk/computelimit/azure-resourcemanager-computelimit/tsp-location.yaml +++ b/sdk/computelimit/azure-resourcemanager-computelimit/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/computelimit/resource-manager/Microsoft.ComputeLimit/ComputeLimit -commit: ea59de0de01a84fdea241f85e3cb518c0339c9ba +commit: fecd9f0cc1b1589c66295932e97f18226f51a28b repo: Azure/azure-rest-api-specs additionalDirectories: