From 256f2233130daa02d62aac787d4a5ea63e6227d0 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Mon, 1 Jun 2026 06:29:10 +0000 Subject: [PATCH] Configurations: 'specification/quantum/Microsoft.Quantum.Management/tspconfig.yaml', API Version: 2025-12-15-preview, SDK Release Type: beta, and CommitSHA: 'b9f84851bcc14f356b1719575b89e2c85143619f' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6376437 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- .../CHANGELOG.md | 204 +++- .../azure-resourcemanager-quantum/README.md | 12 +- .../azure-resourcemanager-quantum/SAMPLE.md | 160 +-- .../azure-resourcemanager-quantum/pom.xml | 9 +- .../quantum/AzureQuantumManager.java | 68 +- .../fluent/AzureQuantumManagementClient.java | 39 +- .../quantum/fluent/OfferingsClient.java | 5 +- .../quantum/fluent/OperationsClient.java | 12 +- .../quantum/fluent/SuiteOffersClient.java | 38 + .../fluent/WorkspaceOperationsClient.java | 33 +- .../quantum/fluent/WorkspacesClient.java | 89 +- .../CheckNameAvailabilityResultInner.java | 63 +- .../fluent/models/ListKeysResultInner.java | 55 +- .../quantum/fluent/models/OperationInner.java | 91 +- .../models/ProviderDescriptionInner.java | 41 +- .../fluent/models/QuantumSuiteOfferInner.java | 144 +++ .../fluent/models/QuantumWorkspaceInner.java | 34 +- .../quantum/fluent/models/package-info.java | 6 +- .../quantum/fluent/package-info.java | 6 +- .../AzureQuantumManagementClientBuilder.java | 28 +- .../AzureQuantumManagementClientImpl.java | 108 ++- .../CheckNameAvailabilityResultImpl.java | 5 +- .../implementation/ListKeysResultImpl.java | 2 +- .../implementation/OfferingsClientImpl.java | 172 ++-- .../quantum/implementation/OfferingsImpl.java | 6 +- .../quantum/implementation/OperationImpl.java | 12 +- .../implementation/OperationsClientImpl.java | 147 +-- .../implementation/OperationsImpl.java | 2 +- .../ProviderDescriptionImpl.java | 2 +- .../implementation/QuantumSuiteOfferImpl.java | 50 + .../implementation/QuantumWorkspaceImpl.java | 22 +- .../implementation/ResourceManagerUtils.java | 2 +- .../implementation/SuiteOffersClientImpl.java | 248 +++++ .../implementation/SuiteOffersImpl.java | 45 + .../WorkspaceOperationsClientImpl.java | 330 ++----- .../WorkspaceOperationsImpl.java | 43 +- .../implementation/WorkspacesClientImpl.java | 916 +++++++----------- .../implementation/WorkspacesImpl.java | 28 +- .../models/OfferingsListResult.java | 54 +- .../models/OperationListResult.java | 96 ++ .../models/QuantumSuiteOfferListResult.java | 96 ++ .../models/QuantumWorkspaceListResult.java | 96 ++ .../quantum/implementation/package-info.java | 6 +- .../quantum/models/ActionType.java | 46 + .../quantum/models/ApiKey.java | 27 +- .../quantum/models/ApiKeys.java | 10 +- .../CheckNameAvailabilityParameters.java | 24 +- .../models/CheckNameAvailabilityReason.java | 51 + .../models/CheckNameAvailabilityResult.java | 10 +- .../quantum/models/KeyType.java | 8 +- .../quantum/models/ListKeysResult.java | 2 +- .../ManagedOnBehalfOfConfiguration.java | 78 ++ .../models/ManagedServiceIdentity.java | 154 +++ .../models/ManagedServiceIdentityType.java | 62 ++ .../quantum/models/MoboBrokerResource.java | 75 ++ .../quantum/models/Offerings.java | 5 +- .../quantum/models/Operation.java | 26 +- .../quantum/models/OperationDisplay.java | 89 +- .../quantum/models/Operations.java | 12 +- .../quantum/models/OperationsList.java | 134 --- .../quantum/models/Origin.java | 57 ++ .../quantum/models/PricingDetail.java | 38 +- .../quantum/models/PricingDimension.java | 38 +- .../quantum/models/Provider.java | 28 +- .../quantum/models/ProviderDescription.java | 2 +- .../quantum/models/ProviderProperties.java | 100 +- .../quantum/models/ProviderPropertiesAad.java | 12 +- .../ProviderPropertiesManagedApplication.java | 12 +- .../quantum/models/ProvisioningStatus.java | 29 +- .../quantum/models/QuantumSuiteOffer.java | 55 ++ .../models/QuantumSuiteOfferProperties.java | 160 +++ .../quantum/models/QuantumWorkspace.java | 12 +- .../models/QuantumWorkspaceIdentity.java | 125 --- ...t.java => QuantumWorkspaceTagsUpdate.java} | 38 +- .../quantum/models/QuotaAllocations.java | 114 +++ .../quantum/models/QuotaDimension.java | 104 +- .../quantum/models/ResourceIdentityType.java | 51 - .../quantum/models/SkuDescription.java | 122 +-- .../quantum/models/Status.java | 14 +- .../quantum/models/SuiteOffers.java | 33 + .../quantum/models/TargetDescription.java | 101 +- .../quantum/models/UsableStatus.java | 8 +- .../quantum/models/UserAssignedIdentity.java | 89 ++ .../quantum/models/WorkspaceKind.java | 51 + .../quantum/models/WorkspaceListResult.java | 130 --- .../quantum/models/WorkspaceOperations.java | 33 +- .../models/WorkspaceResourceProperties.java | 66 +- .../quantum/models/Workspaces.java | 40 +- .../quantum/models/package-info.java | 6 +- .../resourcemanager/quantum/package-info.java | 6 +- .../src/main/java/module-info.java | 3 +- ...zure-resourcemanager-quantum_metadata.json | 1 + .../proxy-config.json | 2 +- .../azure-resourcemanager-quantum.properties | 1 + .../generated/OfferingsListSamples.java | 9 +- .../generated/OperationsListSamples.java | 9 +- .../generated/SuiteOffersListSamples.java | 22 + ...OperationCheckNameAvailabilitySamples.java | 30 - .../WorkspaceOperationListKeysSamples.java | 24 - ...rkspaceOperationRegenerateKeysSamples.java | 30 - .../WorkspacesCreateOrUpdateSamples.java | 30 +- .../generated/WorkspacesDeleteSamples.java | 9 +- .../WorkspacesGetByResourceGroupSamples.java | 10 +- .../WorkspacesListByResourceGroupSamples.java | 10 +- .../generated/WorkspacesListSamples.java | 10 +- .../WorkspacesUpdateTagsSamples.java | 9 +- .../CheckNameAvailabilityParametersTests.java | 14 +- ...CheckNameAvailabilityResultInnerTests.java | 19 +- .../ManagedOnBehalfOfConfigurationTests.java | 17 + .../ManagedServiceIdentityTests.java | 44 + .../generated/MoboBrokerResourceTests.java | 17 + .../generated/OfferingsListMockTests.java | 62 +- .../generated/OfferingsListResultTests.java | 225 +---- .../generated/OperationDisplayTests.java | 22 +- .../generated/OperationInnerTests.java | 29 +- .../generated/OperationListResultTests.java | 19 + .../generated/OperationsListMockTests.java | 15 +- .../generated/OperationsListTests.java | 47 - .../quantum/generated/PricingDetailTests.java | 16 +- .../generated/PricingDimensionTests.java | 18 +- .../ProviderDescriptionInnerTests.java | 281 +----- .../generated/ProviderPropertiesAadTests.java | 13 +- ...iderPropertiesManagedApplicationTests.java | 10 +- .../generated/ProviderPropertiesTests.java | 158 +-- .../quantum/generated/ProviderTests.java | 47 +- .../QuantumSuiteOfferInnerTests.java | 25 + .../QuantumSuiteOfferListResultTests.java | 26 + .../QuantumSuiteOfferPropertiesTests.java | 25 + .../QuantumWorkspaceIdentityTests.java | 27 - ...a => QuantumWorkspaceTagsUpdateTests.java} | 20 +- .../generated/QuotaAllocationsTests.java | 29 + .../generated/QuotaDimensionTests.java | 41 +- .../generated/SkuDescriptionTests.java | 82 +- .../generated/SuiteOffersListMockTests.java | 44 + .../generated/TargetDescriptionTests.java | 30 +- .../generated/UserAssignedIdentityTests.java | 22 + ...NameAvailabilityWithResponseMockTests.java | 42 - .../generated/WorkspacesDeleteMockTests.java | 33 - .../tsp-location.yaml | 4 + 139 files changed, 4024 insertions(+), 3820 deletions(-) create mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/SuiteOffersClient.java create mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/models/QuantumSuiteOfferInner.java create mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/QuantumSuiteOfferImpl.java create mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/SuiteOffersClientImpl.java create mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/SuiteOffersImpl.java rename sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/{ => implementation}/models/OfferingsListResult.java (64%) create mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/models/OperationListResult.java create mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/models/QuantumSuiteOfferListResult.java create mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/models/QuantumWorkspaceListResult.java create mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ActionType.java create mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/CheckNameAvailabilityReason.java create mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ManagedOnBehalfOfConfiguration.java create mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ManagedServiceIdentity.java create mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ManagedServiceIdentityType.java create mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/MoboBrokerResource.java delete mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/OperationsList.java create mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/Origin.java create mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/QuantumSuiteOffer.java create mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/QuantumSuiteOfferProperties.java delete mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/QuantumWorkspaceIdentity.java rename sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/{TagsObject.java => QuantumWorkspaceTagsUpdate.java} (62%) create mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/QuotaAllocations.java delete mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ResourceIdentityType.java create mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/SuiteOffers.java create mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/UserAssignedIdentity.java create mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/WorkspaceKind.java delete mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/WorkspaceListResult.java create mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/main/resources/META-INF/azure-resourcemanager-quantum_metadata.json create mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/main/resources/azure-resourcemanager-quantum.properties create mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/SuiteOffersListSamples.java delete mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/WorkspaceOperationCheckNameAvailabilitySamples.java delete mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/WorkspaceOperationListKeysSamples.java delete mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/WorkspaceOperationRegenerateKeysSamples.java create mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/ManagedOnBehalfOfConfigurationTests.java create mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/ManagedServiceIdentityTests.java create mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/MoboBrokerResourceTests.java create mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/OperationListResultTests.java delete mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/OperationsListTests.java create mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/QuantumSuiteOfferInnerTests.java create mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/QuantumSuiteOfferListResultTests.java create mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/QuantumSuiteOfferPropertiesTests.java delete mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/QuantumWorkspaceIdentityTests.java rename sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/{TagsObjectTests.java => QuantumWorkspaceTagsUpdateTests.java} (50%) create mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/QuotaAllocationsTests.java create mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/SuiteOffersListMockTests.java create mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/UserAssignedIdentityTests.java delete mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/WorkspaceOperationsCheckNameAvailabilityWithResponseMockTests.java delete mode 100644 sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/WorkspacesDeleteMockTests.java create mode 100644 sdk/quantum/azure-resourcemanager-quantum/tsp-location.yaml diff --git a/sdk/quantum/azure-resourcemanager-quantum/CHANGELOG.md b/sdk/quantum/azure-resourcemanager-quantum/CHANGELOG.md index eaff95a1eb1e..a813dc3db70b 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/CHANGELOG.md +++ b/sdk/quantum/azure-resourcemanager-quantum/CHANGELOG.md @@ -1,14 +1,210 @@ # Release History -## 1.0.0-beta.4 (Unreleased) +## 1.0.0-beta.4 (2026-06-01) -### Features Added +- Azure Resource Manager Azure Quantum client library for Java. This package contains Microsoft Azure SDK for Azure Quantum Management SDK. Microsoft.Quantum Resource Provider Management API. Package api-version 2025-12-15-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Breaking Changes -### Bugs Fixed +#### `models.OfferingsListResult` was removed + +#### `models.QuantumWorkspaceIdentity` was removed + +#### `models.WorkspaceListResult` was removed + +#### `models.TagsObject` was removed + +#### `models.ResourceIdentityType` was removed + +#### `models.OperationsList` was removed + +#### `models.CheckNameAvailabilityParameters` was modified + +* `validate()` was removed + +#### `models.ProviderPropertiesAad` was modified + +* `ProviderPropertiesAad()` was changed to private access +* `validate()` was removed + +#### `models.ApiKeys` was modified + +* `validate()` was removed + +#### `models.OperationDisplay` was modified + +* `OperationDisplay()` was changed to private access +* `withResource(java.lang.String)` was removed +* `withOperation(java.lang.String)` was removed +* `withDescription(java.lang.String)` was removed +* `withProvider(java.lang.String)` was removed +* `validate()` was removed + +#### `models.PricingDetail` was modified + +* `PricingDetail()` was changed to private access +* `validate()` was removed +* `withId(java.lang.String)` was removed +* `withValue(java.lang.String)` was removed + +#### `models.TargetDescription` was modified + +* `TargetDescription()` was changed to private access +* `withAcceptedDataFormats(java.util.List)` was removed +* `validate()` was removed +* `withDescription(java.lang.String)` was removed +* `withName(java.lang.String)` was removed +* `withId(java.lang.String)` was removed +* `withAcceptedContentEncodings(java.util.List)` was removed + +#### `models.PricingDimension` was modified + +* `PricingDimension()` was changed to private access +* `withId(java.lang.String)` was removed +* `validate()` was removed +* `withName(java.lang.String)` was removed + +#### `models.ProviderProperties` was modified + +* `ProviderProperties()` was changed to private access +* `withQuotaDimensions(java.util.List)` was removed +* `validate()` was removed +* `withManagedApplication(models.ProviderPropertiesManagedApplication)` was removed +* `withSkus(java.util.List)` was removed +* `withAad(models.ProviderPropertiesAad)` was removed +* `withPricingDimensions(java.util.List)` was removed +* `withTargets(java.util.List)` was removed + +#### `models.ApiKey` was modified + +* `ApiKey()` was changed to private access +* `withCreatedAt(java.time.OffsetDateTime)` was removed +* `validate()` was removed + +#### `models.QuantumWorkspace$Definition` was modified + +* `withIdentity(models.QuantumWorkspaceIdentity)` was removed + +#### `models.ProviderPropertiesManagedApplication` was modified + +* `ProviderPropertiesManagedApplication()` was changed to private access +* `validate()` was removed + +#### `models.Offerings` was modified + +* `list(java.lang.String,com.azure.core.util.Context)` was removed + +#### `models.Provider` was modified + +* `validate()` was removed + +#### `models.WorkspaceResourceProperties` was modified + +* `validate()` was removed + +#### `models.SkuDescription` was modified + +* `SkuDescription()` was changed to private access +* `withDescription(java.lang.String)` was removed +* `withName(java.lang.String)` was removed +* `validate()` was removed +* `withTargets(java.util.List)` was removed +* `withId(java.lang.String)` was removed +* `withAutoAdd(java.lang.Boolean)` was removed +* `withQuotaDimensions(java.util.List)` was removed +* `withRestrictedAccessUri(java.lang.String)` was removed +* `withVersion(java.lang.String)` was removed +* `withPricingDetails(java.util.List)` was removed + +#### `models.QuantumWorkspace` was modified + +* `models.QuantumWorkspaceIdentity identity()` -> `models.ManagedServiceIdentity identity()` + +#### `models.QuotaDimension` was modified + +* `QuotaDimension()` was changed to private access +* `validate()` was removed +* `withPeriod(java.lang.String)` was removed +* `withQuota(java.lang.Float)` was removed +* `withScope(java.lang.String)` was removed +* `withDescription(java.lang.String)` was removed +* `withUnit(java.lang.String)` was removed +* `withUnitPlural(java.lang.String)` was removed +* `withName(java.lang.String)` was removed +* `withId(java.lang.String)` was removed + +#### `models.CheckNameAvailabilityResult` was modified + +* `java.lang.String reason()` -> `models.CheckNameAvailabilityReason reason()` + +### Features Added + +* `models.Origin` was added + +* `models.ActionType` was added + +* `models.QuantumSuiteOfferProperties` was added + +* `models.ManagedOnBehalfOfConfiguration` was added + +* `models.SuiteOffers` was added + +* `models.ManagedServiceIdentity` was added + +* `models.MoboBrokerResource` was added + +* `models.QuotaAllocations` was added + +* `models.QuantumWorkspaceTagsUpdate` was added + +* `models.WorkspaceKind` was added + +* `models.UserAssignedIdentity` was added + +* `models.ManagedServiceIdentityType` was added + +* `models.CheckNameAvailabilityReason` was added + +* `models.QuantumSuiteOffer` was added + +#### `models.ProvisioningStatus` was modified + +* `CANCELED` was added + +#### `models.TargetDescription` was modified + +* `metadata()` was added +* `numQubits()` was added +* `targetProfile()` was added + +#### `AzureQuantumManager` was modified + +* `suiteOffers()` was added + +#### `models.QuantumWorkspace$Definition` was modified + +* `withIdentity(models.ManagedServiceIdentity)` was added + +#### `models.Offerings` was modified + +* `list(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added + +#### `models.Provider` was modified + +* `withQuotas(models.QuotaAllocations)` was added +* `quotas()` was added + +#### `models.WorkspaceResourceProperties` was modified + +* `workspaceKind()` was added +* `managedOnBehalfOfConfiguration()` was added +* `withWorkspaceKind(models.WorkspaceKind)` was added +* `managedStorageAccount()` was added + +#### `models.Operation` was modified -### Other Changes +* `origin()` was added +* `actionType()` was added ## 1.0.0-beta.3 (2024-12-03) diff --git a/sdk/quantum/azure-resourcemanager-quantum/README.md b/sdk/quantum/azure-resourcemanager-quantum/README.md index 2bead3ccc12a..4d6caf95ebfa 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/README.md +++ b/sdk/quantum/azure-resourcemanager-quantum/README.md @@ -1,8 +1,8 @@ -# Azure Resource Manager AzureQuantum client library for Java +# Azure Resource Manager Azure Quantum client library for Java -Azure Resource Manager AzureQuantum client library for Java. +Azure Resource Manager Azure Quantum client library for Java. -This package contains Microsoft Azure SDK for AzureQuantum Management SDK. Package tag package-2023-11-13-preview. 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 Azure Quantum Management SDK. Microsoft.Quantum Resource Provider Management API. Package api-version 2025-12-15-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -52,7 +52,7 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java -AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); @@ -60,7 +60,7 @@ AzureQuantumManager manager = AzureQuantumManager .authenticate(credential, profile); ``` -The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. See [Authentication][authenticate] for more options. @@ -100,5 +100,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ - - diff --git a/sdk/quantum/azure-resourcemanager-quantum/SAMPLE.md b/sdk/quantum/azure-resourcemanager-quantum/SAMPLE.md index b7d8b1204c0d..4ca1e4d29e43 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/SAMPLE.md +++ b/sdk/quantum/azure-resourcemanager-quantum/SAMPLE.md @@ -9,11 +9,9 @@ - [List](#operations_list) -## WorkspaceOperation +## SuiteOffers -- [CheckNameAvailability](#workspaceoperation_checknameavailability) -- [ListKeys](#workspaceoperation_listkeys) -- [RegenerateKeys](#workspaceoperation_regeneratekeys) +- [List](#suiteoffers_list) ## Workspaces @@ -31,16 +29,15 @@ */ public final class OfferingsListSamples { /* - * x-ms-original-file: - * specification/quantum/resource-manager/Microsoft.Quantum/preview/2023-11-13-preview/examples/offeringsList.json + * x-ms-original-file: 2025-12-15-preview/Offerings_List.json */ /** - * Sample code: OfferingsList. + * Sample code: Offerings_List. * * @param manager Entry point to AzureQuantumManager. */ public static void offeringsList(com.azure.resourcemanager.quantum.AzureQuantumManager manager) { - manager.offerings().list("westus2", com.azure.core.util.Context.NONE); + manager.offerings().list("westus2", null, com.azure.core.util.Context.NONE); } } ``` @@ -53,97 +50,36 @@ public final class OfferingsListSamples { */ public final class OperationsListSamples { /* - * x-ms-original-file: - * specification/quantum/resource-manager/Microsoft.Quantum/preview/2023-11-13-preview/examples/operations.json + * x-ms-original-file: 2025-12-15-preview/Operations_List.json */ /** - * Sample code: Operations. + * Sample code: Operations_List. * * @param manager Entry point to AzureQuantumManager. */ - public static void operations(com.azure.resourcemanager.quantum.AzureQuantumManager manager) { + public static void operationsList(com.azure.resourcemanager.quantum.AzureQuantumManager manager) { manager.operations().list(com.azure.core.util.Context.NONE); } } ``` -### WorkspaceOperation_CheckNameAvailability +### SuiteOffers_List ```java -import com.azure.resourcemanager.quantum.models.CheckNameAvailabilityParameters; - /** - * Samples for WorkspaceOperation CheckNameAvailability. + * Samples for SuiteOffers List. */ -public final class WorkspaceOperationCheckNameAvailabilitySamples { +public final class SuiteOffersListSamples { /* - * x-ms-original-file: specification/quantum/resource-manager/Microsoft.Quantum/preview/2023-11-13-preview/examples/ - * quantumWorkspacesCheckNameAvailability.json + * x-ms-original-file: 2025-12-15-preview/SuiteOffers_ListBySubscription.json */ /** - * Sample code: QuantumWorkspacesCheckNameAvailability. + * Sample code: SuiteOffers_ListBySubscription. * * @param manager Entry point to AzureQuantumManager. */ - public static void - quantumWorkspacesCheckNameAvailability(com.azure.resourcemanager.quantum.AzureQuantumManager manager) { - manager.workspaceOperations() - .checkNameAvailabilityWithResponse("westus2", - new CheckNameAvailabilityParameters().withName("sample-workspace-name") - .withType("Microsoft.Quantum/Workspaces"), - com.azure.core.util.Context.NONE); - } -} -``` - -### WorkspaceOperation_ListKeys - -```java -/** - * Samples for WorkspaceOperation ListKeys. - */ -public final class WorkspaceOperationListKeysSamples { - /* - * x-ms-original-file: - * specification/quantum/resource-manager/Microsoft.Quantum/preview/2023-11-13-preview/examples/listKeys.json - */ - /** - * Sample code: ListKeys. - * - * @param manager Entry point to AzureQuantumManager. - */ - public static void listKeys(com.azure.resourcemanager.quantum.AzureQuantumManager manager) { - manager.workspaceOperations() - .listKeysWithResponse("quantumResourcegroup", "quantumworkspace1", com.azure.core.util.Context.NONE); - } -} -``` - -### WorkspaceOperation_RegenerateKeys - -```java -import com.azure.resourcemanager.quantum.models.ApiKeys; -import com.azure.resourcemanager.quantum.models.KeyType; -import java.util.Arrays; - -/** - * Samples for WorkspaceOperation RegenerateKeys. - */ -public final class WorkspaceOperationRegenerateKeysSamples { - /* - * x-ms-original-file: - * specification/quantum/resource-manager/Microsoft.Quantum/preview/2023-11-13-preview/examples/regenerateKey.json - */ - /** - * Sample code: RegenerateKey. - * - * @param manager Entry point to AzureQuantumManager. - */ - public static void regenerateKey(com.azure.resourcemanager.quantum.AzureQuantumManager manager) { - manager.workspaceOperations() - .regenerateKeysWithResponse("quantumResourcegroup", "quantumworkspace1", - new ApiKeys().withKeys(Arrays.asList(KeyType.PRIMARY, KeyType.SECONDARY)), - com.azure.core.util.Context.NONE); + public static void suiteOffersListBySubscription(com.azure.resourcemanager.quantum.AzureQuantumManager manager) { + manager.suiteOffers().list(com.azure.core.util.Context.NONE); } } ``` @@ -152,6 +88,7 @@ public final class WorkspaceOperationRegenerateKeysSamples { ```java import com.azure.resourcemanager.quantum.models.Provider; +import com.azure.resourcemanager.quantum.models.QuotaAllocations; import com.azure.resourcemanager.quantum.models.WorkspaceResourceProperties; import java.util.Arrays; @@ -160,26 +97,31 @@ import java.util.Arrays; */ public final class WorkspacesCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/quantum/resource-manager/Microsoft.Quantum/preview/2023-11-13-preview/examples/quantumWorkspacesPut - * .json + * x-ms-original-file: 2025-12-15-preview/Workspaces_CreateOrUpdate.json */ /** - * Sample code: QuantumWorkspacesPut. + * Sample code: Workspaces_CreateOrUpdate. * * @param manager Entry point to AzureQuantumManager. */ - public static void quantumWorkspacesPut(com.azure.resourcemanager.quantum.AzureQuantumManager manager) { + public static void workspacesCreateOrUpdate(com.azure.resourcemanager.quantum.AzureQuantumManager manager) { manager.workspaces() .define("quantumworkspace1") .withRegion("West US") .withExistingResourceGroup("quantumResourcegroup") - .withProperties(new WorkspaceResourceProperties() - .withProviders(Arrays.asList(new Provider().withProviderId("Honeywell").withProviderSku("Basic"), - new Provider().withProviderId("IonQ").withProviderSku("Basic"), - new Provider().withProviderId("OneQBit").withProviderSku("Basic"))) - .withStorageAccount( - "/subscriptions/1C4B2828-7D49-494F-933D-061373BE28C2/resourceGroups/quantumResourcegroup/providers/Microsoft.Storage/storageAccounts/testStorageAccount")) + .withProperties( + new WorkspaceResourceProperties() + .withProviders( + Arrays.asList(new Provider().withProviderId("Honeywell").withProviderSku("Basic"), + new Provider().withProviderId("IonQ").withProviderSku("Basic"), + new Provider().withProviderId("OneQBit").withProviderSku("Basic"), + new Provider().withProviderId("suiteProvider") + .withProviderSku("Basic") + .withQuotas(new QuotaAllocations() + .withStandardMinutesLifetime(500) + .withHighMinutesLifetime(50)))) + .withStorageAccount( + "/subscriptions/1C4B2828-7D49-494F-933D-061373BE28C2/resourceGroups/quantumResourcegroup/providers/Microsoft.Storage/storageAccounts/testStorageAccount")) .create(); } } @@ -193,15 +135,14 @@ public final class WorkspacesCreateOrUpdateSamples { */ public final class WorkspacesDeleteSamples { /* - * x-ms-original-file: specification/quantum/resource-manager/Microsoft.Quantum/preview/2023-11-13-preview/examples/ - * quantumWorkspacesDelete.json + * x-ms-original-file: 2025-12-15-preview/Workspaces_Delete.json */ /** - * Sample code: QuantumWorkspacesDelete. + * Sample code: Workspaces_Delete. * * @param manager Entry point to AzureQuantumManager. */ - public static void quantumWorkspacesDelete(com.azure.resourcemanager.quantum.AzureQuantumManager manager) { + public static void workspacesDelete(com.azure.resourcemanager.quantum.AzureQuantumManager manager) { manager.workspaces().delete("quantumResourcegroup", "quantumworkspace1", com.azure.core.util.Context.NONE); } } @@ -215,16 +156,14 @@ public final class WorkspacesDeleteSamples { */ public final class WorkspacesGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/quantum/resource-manager/Microsoft.Quantum/preview/2023-11-13-preview/examples/quantumWorkspacesGet - * .json + * x-ms-original-file: 2025-12-15-preview/Workspaces_Get.json */ /** - * Sample code: QuantumWorkspacesGet. + * Sample code: Workspaces_Get. * * @param manager Entry point to AzureQuantumManager. */ - public static void quantumWorkspacesGet(com.azure.resourcemanager.quantum.AzureQuantumManager manager) { + public static void workspacesGet(com.azure.resourcemanager.quantum.AzureQuantumManager manager) { manager.workspaces() .getByResourceGroupWithResponse("quantumResourcegroup", "quantumworkspace1", com.azure.core.util.Context.NONE); @@ -240,16 +179,14 @@ public final class WorkspacesGetByResourceGroupSamples { */ public final class WorkspacesListSamples { /* - * x-ms-original-file: specification/quantum/resource-manager/Microsoft.Quantum/preview/2023-11-13-preview/examples/ - * quantumWorkspacesListSubscription.json + * x-ms-original-file: 2025-12-15-preview/Workspaces_ListBySubscription.json */ /** - * Sample code: QuantumWorkspacesListBySubscription. + * Sample code: Workspaces_ListBySubscription. * * @param manager Entry point to AzureQuantumManager. */ - public static void - quantumWorkspacesListBySubscription(com.azure.resourcemanager.quantum.AzureQuantumManager manager) { + public static void workspacesListBySubscription(com.azure.resourcemanager.quantum.AzureQuantumManager manager) { manager.workspaces().list(com.azure.core.util.Context.NONE); } } @@ -263,16 +200,14 @@ public final class WorkspacesListSamples { */ public final class WorkspacesListByResourceGroupSamples { /* - * x-ms-original-file: specification/quantum/resource-manager/Microsoft.Quantum/preview/2023-11-13-preview/examples/ - * quantumWorkspacesListResourceGroup.json + * x-ms-original-file: 2025-12-15-preview/Workspaces_ListByResourceGroup.json */ /** - * Sample code: QuantumWorkspacesListByResourceGroup. + * Sample code: Workspaces_ListByResourceGroup. * * @param manager Entry point to AzureQuantumManager. */ - public static void - quantumWorkspacesListByResourceGroup(com.azure.resourcemanager.quantum.AzureQuantumManager manager) { + public static void workspacesListByResourceGroup(com.azure.resourcemanager.quantum.AzureQuantumManager manager) { manager.workspaces().listByResourceGroup("quantumResourcegroup", com.azure.core.util.Context.NONE); } } @@ -290,15 +225,14 @@ import java.util.Map; */ public final class WorkspacesUpdateTagsSamples { /* - * x-ms-original-file: specification/quantum/resource-manager/Microsoft.Quantum/preview/2023-11-13-preview/examples/ - * quantumWorkspacesPatch.json + * x-ms-original-file: 2025-12-15-preview/Workspaces_UpdateTags.json */ /** - * Sample code: QuantumWorkspacesPatchTags. + * Sample code: Workspaces_UpdateTags. * * @param manager Entry point to AzureQuantumManager. */ - public static void quantumWorkspacesPatchTags(com.azure.resourcemanager.quantum.AzureQuantumManager manager) { + public static void workspacesUpdateTags(com.azure.resourcemanager.quantum.AzureQuantumManager manager) { QuantumWorkspace resource = manager.workspaces() .getByResourceGroupWithResponse("quantumResourcegroup", "quantumworkspace1", com.azure.core.util.Context.NONE) diff --git a/sdk/quantum/azure-resourcemanager-quantum/pom.xml b/sdk/quantum/azure-resourcemanager-quantum/pom.xml index 49fa19bb5b6d..99c66d8cb2b9 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/pom.xml +++ b/sdk/quantum/azure-resourcemanager-quantum/pom.xml @@ -1,9 +1,9 @@ - + 4.0.0 com.azure @@ -17,8 +17,8 @@ 1.0.0-beta.4 jar - Microsoft Azure SDK for AzureQuantum Management - This package contains Microsoft Azure SDK for AzureQuantum Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2023-11-13-preview. + Microsoft Azure SDK for Azure Quantum Management + This package contains Microsoft Azure SDK for Azure Quantum Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Microsoft.Quantum Resource Provider Management API. Package api-version 2025-12-15-preview. https://github.com/Azure/azure-sdk-for-java @@ -46,7 +46,6 @@ 0 0 true - false diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/AzureQuantumManager.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/AzureQuantumManager.java index f57d1d71b55e..7dafb59838dc 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/AzureQuantumManager.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/AzureQuantumManager.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum; @@ -22,33 +22,40 @@ import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.quantum.fluent.AzureQuantumManagementClient; import com.azure.resourcemanager.quantum.implementation.AzureQuantumManagementClientBuilder; import com.azure.resourcemanager.quantum.implementation.OfferingsImpl; import com.azure.resourcemanager.quantum.implementation.OperationsImpl; +import com.azure.resourcemanager.quantum.implementation.SuiteOffersImpl; import com.azure.resourcemanager.quantum.implementation.WorkspaceOperationsImpl; import com.azure.resourcemanager.quantum.implementation.WorkspacesImpl; import com.azure.resourcemanager.quantum.models.Offerings; import com.azure.resourcemanager.quantum.models.Operations; +import com.azure.resourcemanager.quantum.models.SuiteOffers; import com.azure.resourcemanager.quantum.models.WorkspaceOperations; import com.azure.resourcemanager.quantum.models.Workspaces; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; /** * Entry point to AzureQuantumManager. + * Microsoft.Quantum Resource Provider Management API. */ public final class AzureQuantumManager { + private Operations operations; + private Workspaces workspaces; - private Offerings offerings; + private SuiteOffers suiteOffers; - private Operations operations; + private Offerings offerings; private WorkspaceOperations workspaceOperations; @@ -65,11 +72,11 @@ private AzureQuantumManager(HttpPipeline httpPipeline, AzureProfile profile, Dur } /** - * Creates an instance of AzureQuantum service API entry point. + * Creates an instance of Azure Quantum service API entry point. * * @param credential the credential to use. * @param profile the Azure profile for client. - * @return the AzureQuantum service API instance. + * @return the Azure Quantum service API instance. */ public static AzureQuantumManager authenticate(TokenCredential credential, AzureProfile profile) { Objects.requireNonNull(credential, "'credential' cannot be null."); @@ -78,11 +85,11 @@ public static AzureQuantumManager authenticate(TokenCredential credential, Azure } /** - * Creates an instance of AzureQuantum service API entry point. + * Creates an instance of Azure Quantum service API entry point. * * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. * @param profile the Azure profile for client. - * @return the AzureQuantum service API instance. + * @return the Azure Quantum service API instance. */ public static AzureQuantumManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); @@ -104,6 +111,9 @@ public static Configurable configure() { */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-quantum.properties"); private HttpClient httpClient; private HttpLogOptions httpLogOptions; @@ -201,22 +211,24 @@ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { } /** - * Creates an instance of AzureQuantum service API entry point. + * Creates an instance of Azure Quantum service API entry point. * * @param credential the credential to use. * @param profile the Azure profile for client. - * @return the AzureQuantum service API instance. + * @return the Azure Quantum service API instance. */ public AzureQuantumManager authenticate(TokenCredential credential, AzureProfile profile) { Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + StringBuilder userAgentBuilder = new StringBuilder(); userAgentBuilder.append("azsdk-java") .append("-") .append("com.azure.resourcemanager.quantum") .append("/") - .append("1.0.0-beta.3"); + .append(clientVersion); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -262,6 +274,18 @@ public AzureQuantumManager authenticate(TokenCredential credential, AzureProfile } } + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + /** * Gets the resource collection API of Workspaces. It manages QuantumWorkspace. * @@ -275,27 +299,27 @@ public Workspaces workspaces() { } /** - * Gets the resource collection API of Offerings. + * Gets the resource collection API of SuiteOffers. * - * @return Resource collection API of Offerings. + * @return Resource collection API of SuiteOffers. */ - public Offerings offerings() { - if (this.offerings == null) { - this.offerings = new OfferingsImpl(clientObject.getOfferings(), this); + public SuiteOffers suiteOffers() { + if (this.suiteOffers == null) { + this.suiteOffers = new SuiteOffersImpl(clientObject.getSuiteOffers(), this); } - return offerings; + return suiteOffers; } /** - * Gets the resource collection API of Operations. + * Gets the resource collection API of Offerings. * - * @return Resource collection API of Operations. + * @return Resource collection API of Offerings. */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(clientObject.getOperations(), this); + public Offerings offerings() { + if (this.offerings == null) { + this.offerings = new OfferingsImpl(clientObject.getOfferings(), this); } - return operations; + return offerings; } /** diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/AzureQuantumManagementClient.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/AzureQuantumManagementClient.java index 5abc8e88d148..bf32310cafdd 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/AzureQuantumManagementClient.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/AzureQuantumManagementClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.fluent; @@ -12,26 +12,26 @@ */ public interface AzureQuantumManagementClient { /** - * Gets The ID of the target subscription. The value must be an UUID. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ String getEndpoint(); /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ String getApiVersion(); + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + /** * Gets The HTTP pipeline to send requests through. * @@ -46,6 +46,13 @@ public interface AzureQuantumManagementClient { */ Duration getDefaultPollInterval(); + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + /** * Gets the WorkspacesClient object to access its operations. * @@ -54,18 +61,18 @@ public interface AzureQuantumManagementClient { WorkspacesClient getWorkspaces(); /** - * Gets the OfferingsClient object to access its operations. + * Gets the SuiteOffersClient object to access its operations. * - * @return the OfferingsClient object. + * @return the SuiteOffersClient object. */ - OfferingsClient getOfferings(); + SuiteOffersClient getSuiteOffers(); /** - * Gets the OperationsClient object to access its operations. + * Gets the OfferingsClient object to access its operations. * - * @return the OperationsClient object. + * @return the OfferingsClient object. */ - OperationsClient getOperations(); + OfferingsClient getOfferings(); /** * Gets the WorkspaceOperationsClient object to access its operations. diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/OfferingsClient.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/OfferingsClient.java index 8fa8eebb1bba..73f760a9f320 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/OfferingsClient.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/OfferingsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.fluent; @@ -30,6 +30,7 @@ public interface OfferingsClient { * Returns the list of all provider offerings available for the given location. * * @param locationName Location. + * @param filter The filter to apply to the operation. Example: '$filter=kind eq 'v1'. * @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. @@ -37,5 +38,5 @@ public interface OfferingsClient { * @return the response of a list Providers operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String locationName, Context context); + PagedIterable list(String locationName, String filter, Context context); } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/OperationsClient.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/OperationsClient.java index 8cf0abb9ba60..349a6cf21085 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/OperationsClient.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/OperationsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.fluent; @@ -15,23 +15,25 @@ */ public interface OperationsClient { /** - * Returns list of operations. + * List the operations for the provider. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lists the operations available as paginated response with {@link PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); /** - * Returns list of operations. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lists the operations available as paginated response with {@link PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/SuiteOffersClient.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/SuiteOffersClient.java new file mode 100644 index 000000000000..9edfc1334057 --- /dev/null +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/SuiteOffersClient.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quantum.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.quantum.fluent.models.QuantumSuiteOfferInner; + +/** + * An instance of this class provides access to all the operations defined in SuiteOffersClient. + */ +public interface SuiteOffersClient { + /** + * Returns the SuiteOffer resource associated with the given name. + * + * @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 QuantumSuiteOffer list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Returns the SuiteOffer resource associated with the given name. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a QuantumSuiteOffer list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/WorkspaceOperationsClient.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/WorkspaceOperationsClient.java index de541b77db5a..578a441238a5 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/WorkspaceOperationsClient.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/WorkspaceOperationsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.fluent; @@ -18,33 +18,32 @@ */ public interface WorkspaceOperationsClient { /** - * Check the availability of the resource name. + * Check the availability of the resource name for the given location. * - * @param locationName Location. - * @param checkNameAvailabilityParameters The name and type of the resource. + * @param location The name of the Azure region. + * @param body The CheckAvailability request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of check name availability along with {@link Response}. + * @return the check availability result along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response checkNameAvailabilityWithResponse(String locationName, - CheckNameAvailabilityParameters checkNameAvailabilityParameters, Context context); + Response checkNameAvailabilityWithResponse(String location, + CheckNameAvailabilityParameters body, Context context); /** - * Check the availability of the resource name. + * Check the availability of the resource name for the given location. * - * @param locationName Location. - * @param checkNameAvailabilityParameters The name and type of the resource. + * @param location The name of the Azure region. + * @param body The CheckAvailability request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of check name availability. + * @return the check availability result. */ @ServiceMethod(returns = ReturnType.SINGLE) - CheckNameAvailabilityResultInner checkNameAvailability(String locationName, - CheckNameAvailabilityParameters checkNameAvailabilityParameters); + CheckNameAvailabilityResultInner checkNameAvailability(String location, CheckNameAvailabilityParameters body); /** * Get the keys to use with the Quantum APIs. A key is used to authenticate and authorize access to the Quantum REST @@ -81,7 +80,7 @@ CheckNameAvailabilityResultInner checkNameAvailability(String locationName, * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the quantum workspace resource. - * @param keySpecification Which key to regenerate: primary or secondary. + * @param body Which key to regenerate: primary or secondary. * @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. @@ -89,7 +88,7 @@ CheckNameAvailabilityResultInner checkNameAvailability(String locationName, * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response regenerateKeysWithResponse(String resourceGroupName, String workspaceName, ApiKeys keySpecification, + Response regenerateKeysWithResponse(String resourceGroupName, String workspaceName, ApiKeys body, Context context); /** @@ -98,11 +97,11 @@ Response regenerateKeysWithResponse(String resourceGroupName, String works * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the quantum workspace resource. - * @param keySpecification Which key to regenerate: primary or secondary. + * @param body Which key to regenerate: primary or secondary. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void regenerateKeys(String resourceGroupName, String workspaceName, ApiKeys keySpecification); + void regenerateKeys(String resourceGroupName, String workspaceName, ApiKeys body); } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/WorkspacesClient.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/WorkspacesClient.java index 0327e407ff0a..91311c941634 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/WorkspacesClient.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/WorkspacesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.fluent; @@ -12,7 +12,7 @@ import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.quantum.fluent.models.QuantumWorkspaceInner; -import com.azure.resourcemanager.quantum.models.TagsObject; +import com.azure.resourcemanager.quantum.models.QuantumWorkspaceTagsUpdate; /** * An instance of this class provides access to all the operations defined in WorkspacesClient. @@ -27,7 +27,7 @@ public interface WorkspacesClient { * @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 resource proxy definition object for quantum workspace along with {@link Response}. + * @return the resource proxy definition object for Quantum Workspace along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByResourceGroupWithResponse(String resourceGroupName, String workspaceName, @@ -41,102 +41,103 @@ Response getByResourceGroupWithResponse(String resourceGr * @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 resource proxy definition object for quantum workspace. + * @return the resource proxy definition object for Quantum Workspace. */ @ServiceMethod(returns = ReturnType.SINGLE) QuantumWorkspaceInner getByResourceGroup(String resourceGroupName, String workspaceName); /** - * Creates or updates a workspace resource. + * Creates or updates a Workspace resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the quantum workspace resource. - * @param quantumWorkspace Workspace details. + * @param resource Workspace details. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the resource proxy definition object for quantum workspace. + * @return the {@link SyncPoller} for polling of the resource proxy definition object for Quantum Workspace. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, QuantumWorkspaceInner> beginCreateOrUpdate(String resourceGroupName, - String workspaceName, QuantumWorkspaceInner quantumWorkspace); + String workspaceName, QuantumWorkspaceInner resource); /** - * Creates or updates a workspace resource. + * Creates or updates a Workspace resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the quantum workspace resource. - * @param quantumWorkspace Workspace details. + * @param resource Workspace details. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the resource proxy definition object for quantum workspace. + * @return the {@link SyncPoller} for polling of the resource proxy definition object for Quantum Workspace. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, QuantumWorkspaceInner> beginCreateOrUpdate(String resourceGroupName, - String workspaceName, QuantumWorkspaceInner quantumWorkspace, Context context); + String workspaceName, QuantumWorkspaceInner resource, Context context); /** - * Creates or updates a workspace resource. + * Creates or updates a Workspace resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the quantum workspace resource. - * @param quantumWorkspace Workspace details. + * @param resource Workspace details. * @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 resource proxy definition object for quantum workspace. + * @return the resource proxy definition object for Quantum Workspace. */ @ServiceMethod(returns = ReturnType.SINGLE) QuantumWorkspaceInner createOrUpdate(String resourceGroupName, String workspaceName, - QuantumWorkspaceInner quantumWorkspace); + QuantumWorkspaceInner resource); /** - * Creates or updates a workspace resource. + * Creates or updates a Workspace resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the quantum workspace resource. - * @param quantumWorkspace Workspace details. + * @param resource Workspace details. * @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 resource proxy definition object for quantum workspace. + * @return the resource proxy definition object for Quantum Workspace. */ @ServiceMethod(returns = ReturnType.SINGLE) - QuantumWorkspaceInner createOrUpdate(String resourceGroupName, String workspaceName, - QuantumWorkspaceInner quantumWorkspace, Context context); + QuantumWorkspaceInner createOrUpdate(String resourceGroupName, String workspaceName, QuantumWorkspaceInner resource, + Context context); /** - * Updates an existing workspace's tags. + * Updates an existing Workspace's tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the quantum workspace resource. - * @param workspaceTags Parameters supplied to update tags. + * @param properties Parameters supplied to update tags. * @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 resource proxy definition object for quantum workspace along with {@link Response}. + * @return the resource proxy definition object for Quantum Workspace along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response updateTagsWithResponse(String resourceGroupName, String workspaceName, - TagsObject workspaceTags, Context context); + QuantumWorkspaceTagsUpdate properties, Context context); /** - * Updates an existing workspace's tags. + * Updates an existing Workspace's tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the quantum workspace resource. - * @param workspaceTags Parameters supplied to update tags. + * @param properties Parameters supplied to update tags. * @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 resource proxy definition object for quantum workspace. + * @return the resource proxy definition object for Quantum Workspace. */ @ServiceMethod(returns = ReturnType.SINGLE) - QuantumWorkspaceInner updateTags(String resourceGroupName, String workspaceName, TagsObject workspaceTags); + QuantumWorkspaceInner updateTags(String resourceGroupName, String workspaceName, + QuantumWorkspaceTagsUpdate properties); /** * Deletes a Workspace resource. @@ -191,49 +192,49 @@ Response updateTagsWithResponse(String resourceGroupName, void delete(String resourceGroupName, String workspaceName, Context context); /** - * Gets the list of Workspaces within a Subscription. + * Gets the list of Workspaces within a resource group. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Workspaces within a Subscription as paginated response with {@link PagedIterable}. + * @return the list of Workspaces within a resource group as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Gets the list of Workspaces within a Subscription. + * Gets the list of Workspaces within a resource group. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Workspaces within a Subscription as paginated response with {@link PagedIterable}. + * @return the list of Workspaces within a resource group as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Gets the list of Workspaces within a resource group. + * Gets the list of Workspaces within a Subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Workspaces within a resource group as paginated response with {@link PagedIterable}. + * @return the list of Workspaces within a Subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); + PagedIterable list(); /** - * Gets the list of Workspaces within a resource group. + * Gets the list of Workspaces within a Subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Workspaces within a resource group as paginated response with {@link PagedIterable}. + * @return the list of Workspaces within a Subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + PagedIterable list(Context context); } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/models/CheckNameAvailabilityResultInner.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/models/CheckNameAvailabilityResultInner.java index 0105862d92f3..cf70cb790200 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/models/CheckNameAvailabilityResultInner.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/models/CheckNameAvailabilityResultInner.java @@ -1,44 +1,45 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.quantum.models.CheckNameAvailabilityReason; import java.io.IOException; /** - * Result of check name availability. + * The check availability result. */ -@Fluent +@Immutable public final class CheckNameAvailabilityResultInner implements JsonSerializable { /* - * Indicator of availability of the Quantum Workspace resource name. + * Indicates if the resource name is available. */ private Boolean nameAvailable; /* - * The reason of unavailability. + * The reason why the given name is not available. */ - private String reason; + private CheckNameAvailabilityReason reason; /* - * The detailed info regarding the reason associated with the Namespace. + * Detailed reason why the given name is not available. */ private String message; /** * Creates an instance of CheckNameAvailabilityResultInner class. */ - public CheckNameAvailabilityResultInner() { + private CheckNameAvailabilityResultInner() { } /** - * Get the nameAvailable property: Indicator of availability of the Quantum Workspace resource name. + * Get the nameAvailable property: Indicates if the resource name is available. * * @return the nameAvailable value. */ @@ -47,38 +48,16 @@ public Boolean nameAvailable() { } /** - * Set the nameAvailable property: Indicator of availability of the Quantum Workspace resource name. - * - * @param nameAvailable the nameAvailable value to set. - * @return the CheckNameAvailabilityResultInner object itself. - */ - public CheckNameAvailabilityResultInner withNameAvailable(Boolean nameAvailable) { - this.nameAvailable = nameAvailable; - return this; - } - - /** - * Get the reason property: The reason of unavailability. + * Get the reason property: The reason why the given name is not available. * * @return the reason value. */ - public String reason() { + public CheckNameAvailabilityReason reason() { return this.reason; } /** - * Set the reason property: The reason of unavailability. - * - * @param reason the reason value to set. - * @return the CheckNameAvailabilityResultInner object itself. - */ - public CheckNameAvailabilityResultInner withReason(String reason) { - this.reason = reason; - return this; - } - - /** - * Get the message property: The detailed info regarding the reason associated with the Namespace. + * Get the message property: Detailed reason why the given name is not available. * * @return the message value. */ @@ -86,14 +65,6 @@ public String message() { return this.message; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ @@ -101,7 +72,8 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeBooleanField("nameAvailable", this.nameAvailable); - jsonWriter.writeStringField("reason", this.reason); + jsonWriter.writeStringField("reason", this.reason == null ? null : this.reason.toString()); + jsonWriter.writeStringField("message", this.message); return jsonWriter.writeEndObject(); } @@ -125,7 +97,8 @@ public static CheckNameAvailabilityResultInner fromJson(JsonReader jsonReader) t deserializedCheckNameAvailabilityResultInner.nameAvailable = reader.getNullable(JsonReader::getBoolean); } else if ("reason".equals(fieldName)) { - deserializedCheckNameAvailabilityResultInner.reason = reader.getString(); + deserializedCheckNameAvailabilityResultInner.reason + = CheckNameAvailabilityReason.fromString(reader.getString()); } else if ("message".equals(fieldName)) { deserializedCheckNameAvailabilityResultInner.message = reader.getString(); } else { diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/models/ListKeysResultInner.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/models/ListKeysResultInner.java index 1020582ef47a..d39842083830 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/models/ListKeysResultInner.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/models/ListKeysResultInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * Result of list Api keys and connection strings. */ -@Fluent +@Immutable public final class ListKeysResultInner implements JsonSerializable { /* * Indicator of enablement of the Quantum workspace Api keys. @@ -45,7 +45,7 @@ public final class ListKeysResultInner implements JsonSerializable { /* - * Name of the operation + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" */ private String name; /* - * Indicates whether the operation is a data action + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure + * Resource Manager/control-plane operations. */ private Boolean isDataAction; /* - * Properties of the operation + * Localized display information for this particular operation. */ private OperationDisplay display; + /* + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + * value is "user,system" + */ + private Origin origin; + + /* + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ + private ActionType actionType; + /** * Creates an instance of OperationInner class. */ - public OperationInner() { + private OperationInner() { } /** - * Get the name property: Name of the operation. + * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". * * @return the name value. */ @@ -48,18 +66,8 @@ public String name() { } /** - * Set the name property: Name of the operation. - * - * @param name the name value to set. - * @return the OperationInner object itself. - */ - public OperationInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the isDataAction property: Indicates whether the operation is a data action. + * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for Azure Resource Manager/control-plane operations. * * @return the isDataAction value. */ @@ -68,18 +76,7 @@ public Boolean isDataAction() { } /** - * Set the isDataAction property: Indicates whether the operation is a data action. - * - * @param isDataAction the isDataAction value to set. - * @return the OperationInner object itself. - */ - public OperationInner withIsDataAction(Boolean isDataAction) { - this.isDataAction = isDataAction; - return this; - } - - /** - * Get the display property: Properties of the operation. + * Get the display property: Localized display information for this particular operation. * * @return the display value. */ @@ -88,25 +85,23 @@ public OperationDisplay display() { } /** - * Set the display property: Properties of the operation. + * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". * - * @param display the display value to set. - * @return the OperationInner object itself. + * @return the origin value. */ - public OperationInner withDisplay(OperationDisplay display) { - this.display = display; - return this; + public Origin origin() { + return this.origin; } /** - * Validates the instance. + * Get the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the actionType value. */ - public void validate() { - if (display() != null) { - display().validate(); - } + public ActionType actionType() { + return this.actionType; } /** @@ -115,8 +110,6 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeBooleanField("isDataAction", this.isDataAction); jsonWriter.writeJsonField("display", this.display); return jsonWriter.writeEndObject(); } @@ -142,6 +135,10 @@ public static OperationInner fromJson(JsonReader jsonReader) throws IOException deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean); } else if ("display".equals(fieldName)) { deserializedOperationInner.display = OperationDisplay.fromJson(reader); + } else if ("origin".equals(fieldName)) { + deserializedOperationInner.origin = Origin.fromString(reader.getString()); + } else if ("actionType".equals(fieldName)) { + deserializedOperationInner.actionType = ActionType.fromString(reader.getString()); } else { reader.skipChildren(); } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/models/ProviderDescriptionInner.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/models/ProviderDescriptionInner.java index b0b821801d85..9be4b2c161f9 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/models/ProviderDescriptionInner.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/models/ProviderDescriptionInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * Information about an offering. A provider offering is an entity that offers Targets to run Azure Quantum Jobs. */ -@Fluent +@Immutable public final class ProviderDescriptionInner implements JsonSerializable { /* * Unique provider's id. @@ -35,7 +35,7 @@ public final class ProviderDescriptionInner implements JsonSerializable { + QuantumSuiteOfferInner deserializedQuantumSuiteOfferInner = new QuantumSuiteOfferInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedQuantumSuiteOfferInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedQuantumSuiteOfferInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedQuantumSuiteOfferInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedQuantumSuiteOfferInner.properties = QuantumSuiteOfferProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedQuantumSuiteOfferInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedQuantumSuiteOfferInner; + }); + } +} diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/models/QuantumWorkspaceInner.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/models/QuantumWorkspaceInner.java index a824db2cd592..85d91a47b927 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/models/QuantumWorkspaceInner.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/models/QuantumWorkspaceInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.fluent.models; @@ -10,13 +10,13 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.quantum.models.QuantumWorkspaceIdentity; +import com.azure.resourcemanager.quantum.models.ManagedServiceIdentity; import com.azure.resourcemanager.quantum.models.WorkspaceResourceProperties; import java.io.IOException; import java.util.Map; /** - * The resource proxy definition object for quantum workspace. + * The resource proxy definition object for Quantum Workspace. */ @Fluent public final class QuantumWorkspaceInner extends Resource { @@ -26,9 +26,9 @@ public final class QuantumWorkspaceInner extends Resource { private WorkspaceResourceProperties properties; /* - * Managed Identity information. + * The managed service identities assigned to this resource. */ - private QuantumWorkspaceIdentity identity; + private ManagedServiceIdentity identity; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -77,21 +77,21 @@ public QuantumWorkspaceInner withProperties(WorkspaceResourceProperties properti } /** - * Get the identity property: Managed Identity information. + * Get the identity property: The managed service identities assigned to this resource. * * @return the identity value. */ - public QuantumWorkspaceIdentity identity() { + public ManagedServiceIdentity identity() { return this.identity; } /** - * Set the identity property: Managed Identity information. + * Set the identity property: The managed service identities assigned to this resource. * * @param identity the identity value to set. * @return the QuantumWorkspaceInner object itself. */ - public QuantumWorkspaceInner withIdentity(QuantumWorkspaceIdentity identity) { + public QuantumWorkspaceInner withIdentity(ManagedServiceIdentity identity) { this.identity = identity; return this; } @@ -153,20 +153,6 @@ public QuantumWorkspaceInner withTags(Map tags) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - if (identity() != null) { - identity().validate(); - } - } - /** * {@inheritDoc} */ @@ -210,7 +196,7 @@ public static QuantumWorkspaceInner fromJson(JsonReader jsonReader) throws IOExc } else if ("properties".equals(fieldName)) { deserializedQuantumWorkspaceInner.properties = WorkspaceResourceProperties.fromJson(reader); } else if ("identity".equals(fieldName)) { - deserializedQuantumWorkspaceInner.identity = QuantumWorkspaceIdentity.fromJson(reader); + deserializedQuantumWorkspaceInner.identity = ManagedServiceIdentity.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedQuantumWorkspaceInner.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/models/package-info.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/models/package-info.java index 97e1040ffdbe..b77b5f85766e 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/models/package-info.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/models/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the inner data models for AzureQuantumManagementClient. - * null. + * Package containing the inner data models for AzureQuantum. + * Microsoft.Quantum Resource Provider Management API. */ package com.azure.resourcemanager.quantum.fluent.models; diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/package-info.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/package-info.java index 3ce074a39d8d..88951029cf48 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/package-info.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/fluent/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the service clients for AzureQuantumManagementClient. - * null. + * Package containing the service clients for AzureQuantum. + * Microsoft.Quantum Resource Provider Management API. */ package com.azure.resourcemanager.quantum.fluent; diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/AzureQuantumManagementClientBuilder.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/AzureQuantumManagementClientBuilder.java index 5281414e6ca7..546b7f5a4883 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/AzureQuantumManagementClientBuilder.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/AzureQuantumManagementClientBuilder.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.implementation; @@ -20,34 +20,34 @@ @ServiceClientBuilder(serviceClients = { AzureQuantumManagementClientImpl.class }) public final class AzureQuantumManagementClientBuilder { /* - * The ID of the target subscription. The value must be an UUID. + * Service host */ - private String subscriptionId; + private String endpoint; /** - * Sets The ID of the target subscription. The value must be an UUID. + * Sets Service host. * - * @param subscriptionId the subscriptionId value. + * @param endpoint the endpoint value. * @return the AzureQuantumManagementClientBuilder. */ - public AzureQuantumManagementClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; + public AzureQuantumManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; return this; } /* - * server parameter + * The ID of the target subscription. The value must be an UUID. */ - private String endpoint; + private String subscriptionId; /** - * Sets server parameter. + * Sets The ID of the target subscription. The value must be an UUID. * - * @param endpoint the endpoint value. + * @param subscriptionId the subscriptionId value. * @return the AzureQuantumManagementClientBuilder. */ - public AzureQuantumManagementClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; + public AzureQuantumManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; return this; } @@ -132,7 +132,7 @@ public AzureQuantumManagementClientImpl buildClient() { ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); AzureQuantumManagementClientImpl client = new AzureQuantumManagementClientImpl(localPipeline, - localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + localSerializerAdapter, localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); return client; } } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/AzureQuantumManagementClientImpl.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/AzureQuantumManagementClientImpl.java index bd158a993303..273280ee1433 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/AzureQuantumManagementClientImpl.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/AzureQuantumManagementClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.implementation; @@ -15,17 +15,21 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; import com.azure.core.management.polling.PollerFactory; +import com.azure.core.management.polling.SyncPollerFactory; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; import com.azure.core.util.polling.LongRunningOperationStatus; import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.quantum.fluent.AzureQuantumManagementClient; import com.azure.resourcemanager.quantum.fluent.OfferingsClient; import com.azure.resourcemanager.quantum.fluent.OperationsClient; +import com.azure.resourcemanager.quantum.fluent.SuiteOffersClient; import com.azure.resourcemanager.quantum.fluent.WorkspaceOperationsClient; import com.azure.resourcemanager.quantum.fluent.WorkspacesClient; import java.io.IOException; @@ -43,26 +47,12 @@ @ServiceClient(builder = AzureQuantumManagementClientBuilder.class) public final class AzureQuantumManagementClientImpl implements AzureQuantumManagementClient { /** - * The ID of the target subscription. The value must be an UUID. - */ - private final String subscriptionId; - - /** - * Gets The ID of the target subscription. The value must be an UUID. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** - * server parameter. + * Service host. */ private final String endpoint; /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -71,12 +61,12 @@ public String getEndpoint() { } /** - * Api Version. + * Version parameter. */ private final String apiVersion; /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ @@ -84,6 +74,20 @@ public String getApiVersion() { return this.apiVersion; } + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + /** * The HTTP pipeline to send requests through. */ @@ -126,6 +130,20 @@ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } + /** + * The OperationsClient object to access its operations. + */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + /** * The WorkspacesClient object to access its operations. */ @@ -141,31 +159,31 @@ public WorkspacesClient getWorkspaces() { } /** - * The OfferingsClient object to access its operations. + * The SuiteOffersClient object to access its operations. */ - private final OfferingsClient offerings; + private final SuiteOffersClient suiteOffers; /** - * Gets the OfferingsClient object to access its operations. + * Gets the SuiteOffersClient object to access its operations. * - * @return the OfferingsClient object. + * @return the SuiteOffersClient object. */ - public OfferingsClient getOfferings() { - return this.offerings; + public SuiteOffersClient getSuiteOffers() { + return this.suiteOffers; } /** - * The OperationsClient object to access its operations. + * The OfferingsClient object to access its operations. */ - private final OperationsClient operations; + private final OfferingsClient offerings; /** - * Gets the OperationsClient object to access its operations. + * Gets the OfferingsClient object to access its operations. * - * @return the OperationsClient object. + * @return the OfferingsClient object. */ - public OperationsClient getOperations() { - return this.operations; + public OfferingsClient getOfferings() { + return this.offerings; } /** @@ -189,20 +207,21 @@ public WorkspaceOperationsClient getWorkspaceOperations() { * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. + * @param endpoint Service host. * @param subscriptionId The ID of the target subscription. The value must be an UUID. - * @param endpoint server parameter. */ AzureQuantumManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { + Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2023-11-13-preview"; + this.subscriptionId = subscriptionId; + this.apiVersion = "2025-12-15-preview"; + this.operations = new OperationsClientImpl(this); this.workspaces = new WorkspacesClientImpl(this); + this.suiteOffers = new SuiteOffersClientImpl(this); this.offerings = new OfferingsClientImpl(this); - this.operations = new OperationsClientImpl(this); this.workspaceOperations = new WorkspaceOperationsClientImpl(this); } @@ -243,6 +262,23 @@ public PollerFlux, U> getLroResult(Mono type of poll result. + * @param type of final result. + * @return SyncPoller for poll result and final result. + */ + public SyncPoller, U> getLroResult(Response activationResponse, + Type pollResultType, Type finalResultType, Context context) { + return SyncPollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, () -> activationResponse, context); + } + /** * Gets the final result, or an error, based on last async poll response. * diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/CheckNameAvailabilityResultImpl.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/CheckNameAvailabilityResultImpl.java index be6ba9505006..1ec0e1592529 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/CheckNameAvailabilityResultImpl.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/CheckNameAvailabilityResultImpl.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.implementation; import com.azure.resourcemanager.quantum.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.quantum.models.CheckNameAvailabilityReason; import com.azure.resourcemanager.quantum.models.CheckNameAvailabilityResult; public final class CheckNameAvailabilityResultImpl implements CheckNameAvailabilityResult { @@ -22,7 +23,7 @@ public Boolean nameAvailable() { return this.innerModel().nameAvailable(); } - public String reason() { + public CheckNameAvailabilityReason reason() { return this.innerModel().reason(); } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/ListKeysResultImpl.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/ListKeysResultImpl.java index f93c3102ad12..b834f7557722 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/ListKeysResultImpl.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/ListKeysResultImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.implementation; diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/OfferingsClientImpl.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/OfferingsClientImpl.java index 047094c3e451..0b8fa000dcba 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/OfferingsClientImpl.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/OfferingsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.quantum.fluent.OfferingsClient; import com.azure.resourcemanager.quantum.fluent.models.ProviderDescriptionInner; -import com.azure.resourcemanager.quantum.models.OfferingsListResult; +import com.azure.resourcemanager.quantum.implementation.models.OfferingsListResult; import reactor.core.publisher.Mono; /** @@ -59,29 +59,47 @@ public final class OfferingsClientImpl implements OfferingsClient { * The interface defining all the services for AzureQuantumManagementClientOfferings to be used by the proxy service * to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "AzureQuantumManageme") + @Host("{endpoint}") + @ServiceInterface(name = "AzureQuantumManagementClientOfferings") public interface OfferingsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Quantum/locations/{locationName}/offerings") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @PathParam("locationName") String locationName, @HeaderParam("Accept") String accept, Context context); + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("locationName") String locationName, @QueryParam("filter") String filter, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Quantum/locations/{locationName}/offerings") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("locationName") String locationName, @QueryParam("filter") String filter, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Returns the list of all provider offerings available for the given location. * * @param locationName Location. + * @param filter The filter to apply to the operation. Example: '$filter=kind eq 'v1'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -89,22 +107,11 @@ Mono> listNext(@PathParam(value = "nextLink", enco * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String locationName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } + private Mono> listSinglePageAsync(String locationName, String filter) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), locationName, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), locationName, 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())); @@ -114,33 +121,16 @@ private Mono> listSinglePageAsync(String * Returns the list of all provider offerings available for the given location. * * @param locationName Location. - * @param context The context to associate with this operation. + * @param filter The filter to apply to the operation. Example: '$filter=kind eq 'v1'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list Providers operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a list Providers operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String locationName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), locationName, - accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String locationName, String filter) { + return new PagedFlux<>(() -> listSinglePageAsync(locationName, filter), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -154,23 +144,49 @@ private Mono> listSinglePageAsync(String */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String locationName) { - return new PagedFlux<>(() -> listSinglePageAsync(locationName), nextLink -> listNextSinglePageAsync(nextLink)); + final String filter = null; + return new PagedFlux<>(() -> listSinglePageAsync(locationName, filter), + nextLink -> listNextSinglePageAsync(nextLink)); } /** * Returns the list of all provider offerings available for the given location. * * @param locationName Location. + * @param filter The filter to apply to the operation. Example: '$filter=kind eq 'v1'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 list Providers operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String locationName, String filter) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), locationName, filter, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Returns the list of all provider offerings available for the given location. + * + * @param locationName Location. + * @param filter The filter to apply to the operation. Example: '$filter=kind eq 'v1'. * @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 list Providers operation as paginated response with {@link PagedFlux}. + * @return the response of a list Providers operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String locationName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(locationName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String locationName, String filter, + Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), locationName, filter, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -184,13 +200,16 @@ private PagedFlux listAsync(String locationName, Conte */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String locationName) { - return new PagedIterable<>(listAsync(locationName)); + final String filter = null; + return new PagedIterable<>(() -> listSinglePage(locationName, filter), + nextLink -> listNextSinglePage(nextLink)); } /** * Returns the list of all provider offerings available for the given location. * * @param locationName Location. + * @param filter The filter to apply to the operation. Example: '$filter=kind eq 'v1'. * @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. @@ -198,8 +217,9 @@ public PagedIterable list(String locationName) { * @return the response of a list Providers operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String locationName, Context context) { - return new PagedIterable<>(listAsync(locationName, context)); + public PagedIterable list(String locationName, String filter, Context context) { + return new PagedIterable<>(() -> listSinglePage(locationName, filter, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -214,13 +234,6 @@ public PagedIterable list(String locationName, Context */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), @@ -228,6 +241,24 @@ private Mono> listNextSinglePageAsync(St .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 list Providers operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -236,22 +267,13 @@ private Mono> listNextSinglePageAsync(St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list Providers operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a list Providers operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/OfferingsImpl.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/OfferingsImpl.java index 5e84df36d44c..3a8bd11c1a3c 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/OfferingsImpl.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/OfferingsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.implementation; @@ -30,8 +30,8 @@ public PagedIterable list(String locationName) { return ResourceManagerUtils.mapPage(inner, inner1 -> new ProviderDescriptionImpl(inner1, this.manager())); } - public PagedIterable list(String locationName, Context context) { - PagedIterable inner = this.serviceClient().list(locationName, context); + public PagedIterable list(String locationName, String filter, Context context) { + PagedIterable inner = this.serviceClient().list(locationName, filter, context); return ResourceManagerUtils.mapPage(inner, inner1 -> new ProviderDescriptionImpl(inner1, this.manager())); } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/OperationImpl.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/OperationImpl.java index ad698e0f569b..e348f956c189 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/OperationImpl.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/OperationImpl.java @@ -1,12 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.implementation; import com.azure.resourcemanager.quantum.fluent.models.OperationInner; +import com.azure.resourcemanager.quantum.models.ActionType; import com.azure.resourcemanager.quantum.models.Operation; import com.azure.resourcemanager.quantum.models.OperationDisplay; +import com.azure.resourcemanager.quantum.models.Origin; public final class OperationImpl implements Operation { private OperationInner innerObject; @@ -30,6 +32,14 @@ public OperationDisplay display() { return this.innerModel().display(); } + public Origin origin() { + return this.innerModel().origin(); + } + + public ActionType actionType() { + return this.innerModel().actionType(); + } + public OperationInner innerModel() { return this.innerObject; } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/OperationsClientImpl.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/OperationsClientImpl.java index 1a794655f0eb..52309d5f3b17 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/OperationsClientImpl.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/OperationsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.quantum.fluent.OperationsClient; import com.azure.resourcemanager.quantum.fluent.models.OperationInner; -import com.azure.resourcemanager.quantum.models.OperationsList; +import com.azure.resourcemanager.quantum.implementation.models.OperationListResult; import reactor.core.publisher.Mono; /** @@ -59,37 +59,48 @@ public final class OperationsClientImpl implements OperationsClient { * The interface defining all the services for AzureQuantumManagementClientOperations to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "AzureQuantumManageme") + @Host("{endpoint}") + @ServiceInterface(name = "AzureQuantumManagementClientOperations") public interface OperationsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Quantum/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Quantum/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Returns list of operations. + * List the operations for the provider. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lists the operations available along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( @@ -100,78 +111,78 @@ private Mono> listSinglePageAsync() { } /** - * Returns list of operations. + * List the operations for the provider. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lists the operations available along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Returns list of operations. + * List the operations for the provider. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lists the operations available as paginated response with {@link PagedFlux}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Returns list of operations. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lists the operations available as paginated response with {@link PagedFlux}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Returns list of operations. + * List the operations for the provider. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lists the operations available as paginated response with {@link PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { - return new PagedIterable<>(listAsync()); + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); } /** - * Returns list of operations. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lists the operations available as paginated response with {@link PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -181,17 +192,11 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lists the operations available along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), @@ -199,6 +204,24 @@ private Mono> listNextSinglePageAsync(String nextL .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -207,21 +230,13 @@ private Mono> listNextSinglePageAsync(String nextL * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lists the operations available along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/OperationsImpl.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/OperationsImpl.java index ec0cc3e55617..a0552ad4cf0e 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/OperationsImpl.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/OperationsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.implementation; diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/ProviderDescriptionImpl.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/ProviderDescriptionImpl.java index 51527e0b96c6..1a07a45b1931 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/ProviderDescriptionImpl.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/ProviderDescriptionImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.implementation; diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/QuantumSuiteOfferImpl.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/QuantumSuiteOfferImpl.java new file mode 100644 index 000000000000..fd2b21047112 --- /dev/null +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/QuantumSuiteOfferImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quantum.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.quantum.fluent.models.QuantumSuiteOfferInner; +import com.azure.resourcemanager.quantum.models.QuantumSuiteOffer; +import com.azure.resourcemanager.quantum.models.QuantumSuiteOfferProperties; + +public final class QuantumSuiteOfferImpl implements QuantumSuiteOffer { + private QuantumSuiteOfferInner innerObject; + + private final com.azure.resourcemanager.quantum.AzureQuantumManager serviceManager; + + QuantumSuiteOfferImpl(QuantumSuiteOfferInner innerObject, + com.azure.resourcemanager.quantum.AzureQuantumManager 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 QuantumSuiteOfferProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public QuantumSuiteOfferInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.quantum.AzureQuantumManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/QuantumWorkspaceImpl.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/QuantumWorkspaceImpl.java index 4d4ea89d8b17..1fe30cc97fd2 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/QuantumWorkspaceImpl.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/QuantumWorkspaceImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.implementation; @@ -8,9 +8,9 @@ import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.quantum.fluent.models.QuantumWorkspaceInner; +import com.azure.resourcemanager.quantum.models.ManagedServiceIdentity; import com.azure.resourcemanager.quantum.models.QuantumWorkspace; -import com.azure.resourcemanager.quantum.models.QuantumWorkspaceIdentity; -import com.azure.resourcemanager.quantum.models.TagsObject; +import com.azure.resourcemanager.quantum.models.QuantumWorkspaceTagsUpdate; import com.azure.resourcemanager.quantum.models.WorkspaceResourceProperties; import java.util.Collections; import java.util.Map; @@ -50,7 +50,7 @@ public WorkspaceResourceProperties properties() { return this.innerModel().properties(); } - public QuantumWorkspaceIdentity identity() { + public ManagedServiceIdentity identity() { return this.innerModel().identity(); } @@ -82,7 +82,7 @@ private com.azure.resourcemanager.quantum.AzureQuantumManager manager() { private String workspaceName; - private TagsObject updateWorkspaceTags; + private QuantumWorkspaceTagsUpdate updateProperties; public QuantumWorkspaceImpl withExistingResourceGroup(String resourceGroupName) { this.resourceGroupName = resourceGroupName; @@ -110,14 +110,14 @@ public QuantumWorkspace create(Context context) { } public QuantumWorkspaceImpl update() { - this.updateWorkspaceTags = new TagsObject(); + this.updateProperties = new QuantumWorkspaceTagsUpdate(); return this; } public QuantumWorkspace apply() { this.innerObject = serviceManager.serviceClient() .getWorkspaces() - .updateTagsWithResponse(resourceGroupName, workspaceName, updateWorkspaceTags, Context.NONE) + .updateTagsWithResponse(resourceGroupName, workspaceName, updateProperties, Context.NONE) .getValue(); return this; } @@ -125,7 +125,7 @@ public QuantumWorkspace apply() { public QuantumWorkspace apply(Context context) { this.innerObject = serviceManager.serviceClient() .getWorkspaces() - .updateTagsWithResponse(resourceGroupName, workspaceName, updateWorkspaceTags, context) + .updateTagsWithResponse(resourceGroupName, workspaceName, updateProperties, context) .getValue(); return this; } @@ -169,7 +169,7 @@ public QuantumWorkspaceImpl withTags(Map tags) { this.innerModel().withTags(tags); return this; } else { - this.updateWorkspaceTags.withTags(tags); + this.updateProperties.withTags(tags); return this; } } @@ -179,12 +179,12 @@ public QuantumWorkspaceImpl withProperties(WorkspaceResourceProperties propertie return this; } - public QuantumWorkspaceImpl withIdentity(QuantumWorkspaceIdentity identity) { + public QuantumWorkspaceImpl withIdentity(ManagedServiceIdentity identity) { this.innerModel().withIdentity(identity); return this; } private boolean isInCreateMode() { - return this.innerModel().id() == null; + return this.innerModel() == null || this.innerModel().id() == null; } } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/ResourceManagerUtils.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/ResourceManagerUtils.java index 6e54f67d9e08..cec318778566 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/ResourceManagerUtils.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/ResourceManagerUtils.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.implementation; diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/SuiteOffersClientImpl.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/SuiteOffersClientImpl.java new file mode 100644 index 000000000000..0f6a60642f6e --- /dev/null +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/SuiteOffersClientImpl.java @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quantum.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.quantum.fluent.SuiteOffersClient; +import com.azure.resourcemanager.quantum.fluent.models.QuantumSuiteOfferInner; +import com.azure.resourcemanager.quantum.implementation.models.QuantumSuiteOfferListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SuiteOffersClient. + */ +public final class SuiteOffersClientImpl implements SuiteOffersClient { + /** + * The proxy service used to perform REST calls. + */ + private final SuiteOffersService service; + + /** + * The service client containing this operation class. + */ + private final AzureQuantumManagementClientImpl client; + + /** + * Initializes an instance of SuiteOffersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SuiteOffersClientImpl(AzureQuantumManagementClientImpl client) { + this.service + = RestProxy.create(SuiteOffersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureQuantumManagementClientSuiteOffers to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "AzureQuantumManagementClientSuiteOffers") + public interface SuiteOffersService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Quantum/suiteOffers") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Quantum/suiteOffers") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @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 listBySubscriptionNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Returns the SuiteOffer resource associated with the given name. + * + * @throws ManagementException 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 QuantumSuiteOffer list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns the SuiteOffer resource associated with the given name. + * + * @throws ManagementException 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 QuantumSuiteOffer list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Returns the SuiteOffer resource associated with the given name. + * + * @throws ManagementException 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 QuantumSuiteOffer list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Returns the SuiteOffer resource associated with the given name. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a QuantumSuiteOffer list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Returns the SuiteOffer resource associated with the given name. + * + * @throws ManagementException 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 QuantumSuiteOffer list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listBySubscriptionNextSinglePage(nextLink)); + } + + /** + * Returns the SuiteOffer resource associated with the given name. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a QuantumSuiteOffer list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), + nextLink -> listBySubscriptionNextSinglePage(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 QuantumSuiteOffer list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(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 QuantumSuiteOffer list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(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 QuantumSuiteOffer list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(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/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/SuiteOffersImpl.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/SuiteOffersImpl.java new file mode 100644 index 000000000000..b802705ca7ec --- /dev/null +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/SuiteOffersImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quantum.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.quantum.fluent.SuiteOffersClient; +import com.azure.resourcemanager.quantum.fluent.models.QuantumSuiteOfferInner; +import com.azure.resourcemanager.quantum.models.QuantumSuiteOffer; +import com.azure.resourcemanager.quantum.models.SuiteOffers; + +public final class SuiteOffersImpl implements SuiteOffers { + private static final ClientLogger LOGGER = new ClientLogger(SuiteOffersImpl.class); + + private final SuiteOffersClient innerClient; + + private final com.azure.resourcemanager.quantum.AzureQuantumManager serviceManager; + + public SuiteOffersImpl(SuiteOffersClient innerClient, + com.azure.resourcemanager.quantum.AzureQuantumManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new QuantumSuiteOfferImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new QuantumSuiteOfferImpl(inner1, this.manager())); + } + + private SuiteOffersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.quantum.AzureQuantumManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/WorkspaceOperationsClientImpl.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/WorkspaceOperationsClientImpl.java index f3844e12ba27..d485022e95ff 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/WorkspaceOperationsClientImpl.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/WorkspaceOperationsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.implementation; @@ -58,163 +58,138 @@ public final class WorkspaceOperationsClientImpl implements WorkspaceOperationsC * The interface defining all the services for AzureQuantumManagementClientWorkspaceOperations to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "AzureQuantumManageme") + @Host("{endpoint}") + @ServiceInterface(name = "AzureQuantumManagementClientWorkspaceOperations") public interface WorkspaceOperationsService { + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Quantum/locations/{location}/checkNameAvailability") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") CheckNameAvailabilityParameters body, + Context context); + + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Quantum/locations/{location}/checkNameAvailability") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response checkNameAvailabilitySync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") CheckNameAvailabilityParameters body, + Context context); + @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Quantum/locations/{locationName}/checkNameAvailability") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/listKeys") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkNameAvailability(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @PathParam("locationName") String locationName, - @BodyParam("application/json") CheckNameAvailabilityParameters checkNameAvailabilityParameters, + Mono> listKeys(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/listKeys") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listKeys(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + Response listKeysSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/regenerateKey") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> regenerateKeys(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") ApiKeys body, + Context context); + + @Headers({ "Accept: application/json;q=0.9" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/regenerateKey") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> regenerateKeys(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + Response regenerateKeysSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, - @BodyParam("application/json") ApiKeys keySpecification, @HeaderParam("Accept") String accept, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") ApiKeys body, Context context); } /** - * Check the availability of the resource name. + * Check the availability of the resource name for the given location. * - * @param locationName Location. - * @param checkNameAvailabilityParameters The name and type of the resource. + * @param location The name of the Azure region. + * @param body The CheckAvailability request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of check name availability along with {@link Response} on successful completion of {@link Mono}. + * @return the check availability result along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkNameAvailabilityWithResponseAsync(String locationName, - CheckNameAvailabilityParameters checkNameAvailabilityParameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - if (checkNameAvailabilityParameters == null) { - return Mono.error(new IllegalArgumentException( - "Parameter checkNameAvailabilityParameters is required and cannot be null.")); - } else { - checkNameAvailabilityParameters.validate(); - } + private Mono> checkNameAvailabilityWithResponseAsync(String location, + CheckNameAvailabilityParameters body) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext( - context -> service.checkNameAvailability(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), locationName, checkNameAvailabilityParameters, accept, context)) + context -> service.checkNameAvailability(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, contentType, accept, body, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Check the availability of the resource name. + * Check the availability of the resource name for the given location. * - * @param locationName Location. - * @param checkNameAvailabilityParameters The name and type of the resource. - * @param context The context to associate with this operation. + * @param location The name of the Azure region. + * @param body The CheckAvailability request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of check name availability along with {@link Response} on successful completion of {@link Mono}. + * @return the check availability result on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkNameAvailabilityWithResponseAsync(String locationName, - CheckNameAvailabilityParameters checkNameAvailabilityParameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - if (checkNameAvailabilityParameters == null) { - return Mono.error(new IllegalArgumentException( - "Parameter checkNameAvailabilityParameters is required and cannot be null.")); - } else { - checkNameAvailabilityParameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.checkNameAvailability(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), locationName, checkNameAvailabilityParameters, accept, context); + private Mono checkNameAvailabilityAsync(String location, + CheckNameAvailabilityParameters body) { + return checkNameAvailabilityWithResponseAsync(location, body).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Check the availability of the resource name. + * Check the availability of the resource name for the given location. * - * @param locationName Location. - * @param checkNameAvailabilityParameters The name and type of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of check name availability on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono checkNameAvailabilityAsync(String locationName, - CheckNameAvailabilityParameters checkNameAvailabilityParameters) { - return checkNameAvailabilityWithResponseAsync(locationName, checkNameAvailabilityParameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Check the availability of the resource name. - * - * @param locationName Location. - * @param checkNameAvailabilityParameters The name and type of the resource. + * @param location The name of the Azure region. + * @param body The CheckAvailability request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of check name availability along with {@link Response}. + * @return the check availability result along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkNameAvailabilityWithResponse(String locationName, - CheckNameAvailabilityParameters checkNameAvailabilityParameters, Context context) { - return checkNameAvailabilityWithResponseAsync(locationName, checkNameAvailabilityParameters, context).block(); + public Response checkNameAvailabilityWithResponse(String location, + CheckNameAvailabilityParameters body, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.checkNameAvailabilitySync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, contentType, accept, body, context); } /** - * Check the availability of the resource name. + * Check the availability of the resource name for the given location. * - * @param locationName Location. - * @param checkNameAvailabilityParameters The name and type of the resource. + * @param location The name of the Azure region. + * @param body The CheckAvailability request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of check name availability. + * @return the check availability result. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CheckNameAvailabilityResultInner checkNameAvailability(String locationName, - CheckNameAvailabilityParameters checkNameAvailabilityParameters) { - return checkNameAvailabilityWithResponse(locationName, checkNameAvailabilityParameters, Context.NONE) - .getValue(); + public CheckNameAvailabilityResultInner checkNameAvailability(String location, + CheckNameAvailabilityParameters body) { + return checkNameAvailabilityWithResponse(location, body, Context.NONE).getValue(); } /** @@ -232,65 +207,13 @@ public CheckNameAvailabilityResultInner checkNameAvailability(String locationNam @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listKeysWithResponseAsync(String resourceGroupName, String workspaceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), resourceGroupName, workspaceName, accept, context)) + .withContext(context -> service.listKeys(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Get the keys to use with the Quantum APIs. A key is used to authenticate and authorize access to the Quantum REST - * APIs. Only one key is needed at a time; two are given to provide seamless key regeneration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the quantum workspace resource. - * @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 keys to use with the Quantum APIs along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listKeysWithResponseAsync(String resourceGroupName, - String workspaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), - resourceGroupName, workspaceName, accept, context); - } - /** * Get the keys to use with the Quantum APIs. A key is used to authenticate and authorize access to the Quantum REST * APIs. Only one key is needed at a time; two are given to provide seamless key regeneration. @@ -323,7 +246,9 @@ private Mono listKeysAsync(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) public Response listKeysWithResponse(String resourceGroupName, String workspaceName, Context context) { - return listKeysWithResponseAsync(resourceGroupName, workspaceName, context).block(); + final String accept = "application/json"; + return service.listKeysSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context); } /** @@ -348,7 +273,7 @@ public ListKeysResultInner listKeys(String resourceGroupName, String workspaceNa * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the quantum workspace resource. - * @param keySpecification Which key to regenerate: primary or secondary. + * @param body Which key to regenerate: primary or secondary. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -356,32 +281,11 @@ public ListKeysResultInner listKeys(String resourceGroupName, String workspaceNa */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> regenerateKeysWithResponseAsync(String resourceGroupName, String workspaceName, - ApiKeys keySpecification) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (keySpecification == null) { - return Mono - .error(new IllegalArgumentException("Parameter keySpecification is required and cannot be null.")); - } else { - keySpecification.validate(); - } - final String accept = "application/json"; + ApiKeys body) { + final String contentType = "application/json"; return FluxUtil - .withContext(context -> service.regenerateKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), resourceGroupName, workspaceName, keySpecification, accept, context)) + .withContext(context -> service.regenerateKeys(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, contentType, body, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -391,59 +295,15 @@ private Mono> regenerateKeysWithResponseAsync(String resourceGrou * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the quantum workspace resource. - * @param keySpecification Which key to regenerate: primary or secondary. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> regenerateKeysWithResponseAsync(String resourceGroupName, String workspaceName, - ApiKeys keySpecification, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (keySpecification == null) { - return Mono - .error(new IllegalArgumentException("Parameter keySpecification is required and cannot be null.")); - } else { - keySpecification.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.regenerateKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), resourceGroupName, workspaceName, keySpecification, accept, context); - } - - /** - * Regenerate either the primary or secondary key for use with the Quantum APIs. The old key will stop working - * immediately. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the quantum workspace resource. - * @param keySpecification Which key to regenerate: primary or secondary. + * @param body Which key to regenerate: primary or secondary. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono regenerateKeysAsync(String resourceGroupName, String workspaceName, ApiKeys keySpecification) { - return regenerateKeysWithResponseAsync(resourceGroupName, workspaceName, keySpecification) - .flatMap(ignored -> Mono.empty()); + private Mono regenerateKeysAsync(String resourceGroupName, String workspaceName, ApiKeys body) { + return regenerateKeysWithResponseAsync(resourceGroupName, workspaceName, body).flatMap(ignored -> Mono.empty()); } /** @@ -452,7 +312,7 @@ private Mono regenerateKeysAsync(String resourceGroupName, String workspac * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the quantum workspace resource. - * @param keySpecification Which key to regenerate: primary or secondary. + * @param body Which key to regenerate: primary or secondary. * @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. @@ -460,9 +320,11 @@ private Mono regenerateKeysAsync(String resourceGroupName, String workspac * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response regenerateKeysWithResponse(String resourceGroupName, String workspaceName, - ApiKeys keySpecification, Context context) { - return regenerateKeysWithResponseAsync(resourceGroupName, workspaceName, keySpecification, context).block(); + public Response regenerateKeysWithResponse(String resourceGroupName, String workspaceName, ApiKeys body, + Context context) { + final String contentType = "application/json"; + return service.regenerateKeysSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, contentType, body, context); } /** @@ -471,13 +333,13 @@ public Response regenerateKeysWithResponse(String resourceGroupName, Strin * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the quantum workspace resource. - * @param keySpecification Which key to regenerate: primary or secondary. + * @param body Which key to regenerate: primary or secondary. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void regenerateKeys(String resourceGroupName, String workspaceName, ApiKeys keySpecification) { - regenerateKeysWithResponse(resourceGroupName, workspaceName, keySpecification, Context.NONE); + public void regenerateKeys(String resourceGroupName, String workspaceName, ApiKeys body) { + regenerateKeysWithResponse(resourceGroupName, workspaceName, body, Context.NONE); } } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/WorkspaceOperationsImpl.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/WorkspaceOperationsImpl.java index 24dc0319e5d8..4c5668df0834 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/WorkspaceOperationsImpl.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/WorkspaceOperationsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.implementation; @@ -30,22 +30,16 @@ public WorkspaceOperationsImpl(WorkspaceOperationsClient innerClient, this.serviceManager = serviceManager; } - public Response checkNameAvailabilityWithResponse(String locationName, - CheckNameAvailabilityParameters checkNameAvailabilityParameters, Context context) { - Response inner = this.serviceClient() - .checkNameAvailabilityWithResponse(locationName, checkNameAvailabilityParameters, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CheckNameAvailabilityResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } + public Response checkNameAvailabilityWithResponse(String location, + CheckNameAvailabilityParameters body, Context context) { + Response inner + = this.serviceClient().checkNameAvailabilityWithResponse(location, body, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CheckNameAvailabilityResultImpl(inner.getValue(), this.manager())); } - public CheckNameAvailabilityResult checkNameAvailability(String locationName, - CheckNameAvailabilityParameters checkNameAvailabilityParameters) { - CheckNameAvailabilityResultInner inner - = this.serviceClient().checkNameAvailability(locationName, checkNameAvailabilityParameters); + public CheckNameAvailabilityResult checkNameAvailability(String location, CheckNameAvailabilityParameters body) { + CheckNameAvailabilityResultInner inner = this.serviceClient().checkNameAvailability(location, body); if (inner != null) { return new CheckNameAvailabilityResultImpl(inner, this.manager()); } else { @@ -57,12 +51,8 @@ public Response listKeysWithResponse(String resourceGroupName, S Context context) { Response inner = this.serviceClient().listKeysWithResponse(resourceGroupName, workspaceName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ListKeysResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ListKeysResultImpl(inner.getValue(), this.manager())); } public ListKeysResult listKeys(String resourceGroupName, String workspaceName) { @@ -74,14 +64,13 @@ public ListKeysResult listKeys(String resourceGroupName, String workspaceName) { } } - public Response regenerateKeysWithResponse(String resourceGroupName, String workspaceName, - ApiKeys keySpecification, Context context) { - return this.serviceClient() - .regenerateKeysWithResponse(resourceGroupName, workspaceName, keySpecification, context); + public Response regenerateKeysWithResponse(String resourceGroupName, String workspaceName, ApiKeys body, + Context context) { + return this.serviceClient().regenerateKeysWithResponse(resourceGroupName, workspaceName, body, context); } - public void regenerateKeys(String resourceGroupName, String workspaceName, ApiKeys keySpecification) { - this.serviceClient().regenerateKeys(resourceGroupName, workspaceName, keySpecification); + public void regenerateKeys(String resourceGroupName, String workspaceName, ApiKeys body) { + this.serviceClient().regenerateKeys(resourceGroupName, workspaceName, body); } private WorkspaceOperationsClient serviceClient() { diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/WorkspacesClientImpl.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/WorkspacesClientImpl.java index d0ea9971516a..462be8db0419 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/WorkspacesClientImpl.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/WorkspacesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.implementation; @@ -28,14 +28,15 @@ 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.quantum.fluent.WorkspacesClient; import com.azure.resourcemanager.quantum.fluent.models.QuantumWorkspaceInner; -import com.azure.resourcemanager.quantum.models.TagsObject; -import com.azure.resourcemanager.quantum.models.WorkspaceListResult; +import com.azure.resourcemanager.quantum.implementation.models.QuantumWorkspaceListResult; +import com.azure.resourcemanager.quantum.models.QuantumWorkspaceTagsUpdate; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -69,77 +70,145 @@ public final class WorkspacesClientImpl implements WorkspacesClient { * The interface defining all the services for AzureQuantumManagementClientWorkspaces to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "AzureQuantumManageme") + @Host("{endpoint}") + @ServiceInterface(name = "AzureQuantumManagementClientWorkspaces") public interface WorkspacesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @PathParam("workspaceName") String workspaceName, + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") QuantumWorkspaceInner resource, Context context); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @PathParam("workspaceName") String workspaceName, - @BodyParam("application/json") QuantumWorkspaceInner quantumWorkspace, @HeaderParam("Accept") String accept, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") QuantumWorkspaceInner resource, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") QuantumWorkspaceTagsUpdate properties, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateTagsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") QuantumWorkspaceTagsUpdate properties, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateTags(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @PathParam("workspaceName") String workspaceName, - @BodyParam("application/json") TagsObject workspaceTags, @HeaderParam("Accept") String accept, + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}") - @ExpectedResponses({ 200, 202, 204 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @PathParam("workspaceName") String workspaceName, + Response listByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Quantum/workspaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Quantum/workspaces") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces") + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Response listBySubscriptionNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } @@ -151,31 +220,16 @@ Mono> listByResourceGroupNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource proxy definition object for quantum workspace along with {@link Response} on successful + * @return the resource proxy definition object for Quantum Workspace along with {@link Response} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String workspaceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, - this.client.getApiVersion(), this.client.getSubscriptionId(), workspaceName, accept, context)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -184,46 +238,10 @@ private Mono> getByResourceGroupWithResponseAsyn * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the quantum workspace resource. - * @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 resource proxy definition object for quantum workspace along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String workspaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), - this.client.getSubscriptionId(), workspaceName, accept, context); - } - - /** - * Returns the Workspace resource associated with the given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the quantum workspace resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource proxy definition object for quantum workspace on successful completion of {@link Mono}. + * @return the resource proxy definition object for Quantum Workspace on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, String workspaceName) { @@ -240,12 +258,14 @@ private Mono getByResourceGroupAsync(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource proxy definition object for quantum workspace along with {@link Response}. + * @return the resource proxy definition object for Quantum Workspace along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse(String resourceGroupName, String workspaceName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, workspaceName, context).block(); + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context); } /** @@ -256,7 +276,7 @@ public Response getByResourceGroupWithResponse(String res * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource proxy definition object for quantum workspace. + * @return the resource proxy definition object for Quantum Workspace. */ @ServiceMethod(returns = ReturnType.SINGLE) public QuantumWorkspaceInner getByResourceGroup(String resourceGroupName, String workspaceName) { @@ -264,378 +284,263 @@ public QuantumWorkspaceInner getByResourceGroup(String resourceGroupName, String } /** - * Creates or updates a workspace resource. + * Creates or updates a Workspace resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the quantum workspace resource. - * @param quantumWorkspace Workspace details. + * @param resource Workspace details. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource proxy definition object for quantum workspace along with {@link Response} on successful + * @return the resource proxy definition object for Quantum Workspace along with {@link Response} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String workspaceName, QuantumWorkspaceInner quantumWorkspace) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (quantumWorkspace == null) { - return Mono - .error(new IllegalArgumentException("Parameter quantumWorkspace is required and cannot be null.")); - } else { - quantumWorkspace.validate(); - } + String workspaceName, QuantumWorkspaceInner resource) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, - this.client.getApiVersion(), this.client.getSubscriptionId(), workspaceName, quantumWorkspace, accept, + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, contentType, accept, resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates or updates a workspace resource. + * Creates or updates a Workspace resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the quantum workspace resource. - * @param quantumWorkspace Workspace details. - * @param context The context to associate with this operation. + * @param resource Workspace details. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource proxy definition object for quantum workspace along with {@link Response} on successful - * completion of {@link Mono}. + * @return the resource proxy definition object for Quantum Workspace along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String workspaceName, QuantumWorkspaceInner quantumWorkspace, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (quantumWorkspace == null) { - return Mono - .error(new IllegalArgumentException("Parameter quantumWorkspace is required and cannot be null.")); - } else { - quantumWorkspace.validate(); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + QuantumWorkspaceInner resource) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), - this.client.getSubscriptionId(), workspaceName, quantumWorkspace, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, contentType, accept, resource, + Context.NONE); } /** - * Creates or updates a workspace resource. + * Creates or updates a Workspace resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the quantum workspace resource. - * @param quantumWorkspace Workspace details. + * @param resource Workspace details. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of the resource proxy definition object for quantum workspace. + * @return the resource proxy definition object for Quantum Workspace along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, QuantumWorkspaceInner> beginCreateOrUpdateAsync( - String resourceGroupName, String workspaceName, QuantumWorkspaceInner quantumWorkspace) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, quantumWorkspace); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), QuantumWorkspaceInner.class, QuantumWorkspaceInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + QuantumWorkspaceInner resource, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, contentType, accept, resource, context); } /** - * Creates or updates a workspace resource. + * Creates or updates a Workspace resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the quantum workspace resource. - * @param quantumWorkspace Workspace details. - * @param context The context to associate with this operation. + * @param resource Workspace details. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of the resource proxy definition object for quantum workspace. + * @return the {@link PollerFlux} for polling of the resource proxy definition object for Quantum Workspace. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, QuantumWorkspaceInner> beginCreateOrUpdateAsync( - String resourceGroupName, String workspaceName, QuantumWorkspaceInner quantumWorkspace, Context context) { - context = this.client.mergeContext(context); + private PollerFlux, QuantumWorkspaceInner> + beginCreateOrUpdateAsync(String resourceGroupName, String workspaceName, QuantumWorkspaceInner resource) { Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, quantumWorkspace, context); + = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, resource); return this.client.getLroResult(mono, - this.client.getHttpPipeline(), QuantumWorkspaceInner.class, QuantumWorkspaceInner.class, context); + this.client.getHttpPipeline(), QuantumWorkspaceInner.class, QuantumWorkspaceInner.class, + this.client.getContext()); } /** - * Creates or updates a workspace resource. + * Creates or updates a Workspace resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the quantum workspace resource. - * @param quantumWorkspace Workspace details. + * @param resource Workspace details. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the resource proxy definition object for quantum workspace. + * @return the {@link SyncPoller} for polling of the resource proxy definition object for Quantum Workspace. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, QuantumWorkspaceInner> - beginCreateOrUpdate(String resourceGroupName, String workspaceName, QuantumWorkspaceInner quantumWorkspace) { - return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, quantumWorkspace).getSyncPoller(); + beginCreateOrUpdate(String resourceGroupName, String workspaceName, QuantumWorkspaceInner resource) { + Response response = createOrUpdateWithResponse(resourceGroupName, workspaceName, resource); + return this.client.getLroResult(response, + QuantumWorkspaceInner.class, QuantumWorkspaceInner.class, Context.NONE); } /** - * Creates or updates a workspace resource. + * Creates or updates a Workspace resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the quantum workspace resource. - * @param quantumWorkspace Workspace details. + * @param resource Workspace details. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the resource proxy definition object for quantum workspace. + * @return the {@link SyncPoller} for polling of the resource proxy definition object for Quantum Workspace. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, QuantumWorkspaceInner> beginCreateOrUpdate( - String resourceGroupName, String workspaceName, QuantumWorkspaceInner quantumWorkspace, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, quantumWorkspace, context) - .getSyncPoller(); + String resourceGroupName, String workspaceName, QuantumWorkspaceInner resource, Context context) { + Response response = createOrUpdateWithResponse(resourceGroupName, workspaceName, resource, context); + return this.client.getLroResult(response, + QuantumWorkspaceInner.class, QuantumWorkspaceInner.class, context); } /** - * Creates or updates a workspace resource. + * Creates or updates a Workspace resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the quantum workspace resource. - * @param quantumWorkspace Workspace details. + * @param resource Workspace details. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource proxy definition object for quantum workspace on successful completion of {@link Mono}. + * @return the resource proxy definition object for Quantum Workspace on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, - QuantumWorkspaceInner quantumWorkspace) { - return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, quantumWorkspace).last() + QuantumWorkspaceInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, resource).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Creates or updates a workspace resource. + * Creates or updates a Workspace resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the quantum workspace resource. - * @param quantumWorkspace Workspace details. - * @param context The context to associate with this operation. + * @param resource Workspace details. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource proxy definition object for quantum workspace on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, - QuantumWorkspaceInner quantumWorkspace, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, quantumWorkspace, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a workspace resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the quantum workspace resource. - * @param quantumWorkspace Workspace details. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource proxy definition object for quantum workspace. + * @return the resource proxy definition object for Quantum Workspace. */ @ServiceMethod(returns = ReturnType.SINGLE) public QuantumWorkspaceInner createOrUpdate(String resourceGroupName, String workspaceName, - QuantumWorkspaceInner quantumWorkspace) { - return createOrUpdateAsync(resourceGroupName, workspaceName, quantumWorkspace).block(); + QuantumWorkspaceInner resource) { + return beginCreateOrUpdate(resourceGroupName, workspaceName, resource).getFinalResult(); } /** - * Creates or updates a workspace resource. + * Creates or updates a Workspace resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the quantum workspace resource. - * @param quantumWorkspace Workspace details. + * @param resource Workspace details. * @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 resource proxy definition object for quantum workspace. + * @return the resource proxy definition object for Quantum Workspace. */ @ServiceMethod(returns = ReturnType.SINGLE) public QuantumWorkspaceInner createOrUpdate(String resourceGroupName, String workspaceName, - QuantumWorkspaceInner quantumWorkspace, Context context) { - return createOrUpdateAsync(resourceGroupName, workspaceName, quantumWorkspace, context).block(); + QuantumWorkspaceInner resource, Context context) { + return beginCreateOrUpdate(resourceGroupName, workspaceName, resource, context).getFinalResult(); } /** - * Updates an existing workspace's tags. + * Updates an existing Workspace's tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the quantum workspace resource. - * @param workspaceTags Parameters supplied to update tags. + * @param properties Parameters supplied to update tags. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource proxy definition object for quantum workspace along with {@link Response} on successful + * @return the resource proxy definition object for Quantum Workspace along with {@link Response} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateTagsWithResponseAsync(String resourceGroupName, - String workspaceName, TagsObject workspaceTags) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (workspaceTags == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceTags is required and cannot be null.")); - } else { - workspaceTags.validate(); - } + String workspaceName, QuantumWorkspaceTagsUpdate properties) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.updateTags(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), - this.client.getSubscriptionId(), workspaceName, workspaceTags, accept, context)) + .withContext(context -> service.updateTags(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, contentType, accept, properties, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Updates an existing workspace's tags. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the quantum workspace resource. - * @param workspaceTags Parameters supplied to update tags. - * @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 resource proxy definition object for quantum workspace along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateTagsWithResponseAsync(String resourceGroupName, - String workspaceName, TagsObject workspaceTags, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (workspaceTags == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceTags is required and cannot be null.")); - } else { - workspaceTags.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.updateTags(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), - this.client.getSubscriptionId(), workspaceName, workspaceTags, accept, context); - } - - /** - * Updates an existing workspace's tags. + * Updates an existing Workspace's tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the quantum workspace resource. - * @param workspaceTags Parameters supplied to update tags. + * @param properties Parameters supplied to update tags. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource proxy definition object for quantum workspace on successful completion of {@link Mono}. + * @return the resource proxy definition object for Quantum Workspace on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateTagsAsync(String resourceGroupName, String workspaceName, - TagsObject workspaceTags) { - return updateTagsWithResponseAsync(resourceGroupName, workspaceName, workspaceTags) + QuantumWorkspaceTagsUpdate properties) { + return updateTagsWithResponseAsync(resourceGroupName, workspaceName, properties) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Updates an existing workspace's tags. + * Updates an existing Workspace's tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the quantum workspace resource. - * @param workspaceTags Parameters supplied to update tags. + * @param properties Parameters supplied to update tags. * @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 resource proxy definition object for quantum workspace along with {@link Response}. + * @return the resource proxy definition object for Quantum Workspace along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateTagsWithResponse(String resourceGroupName, String workspaceName, - TagsObject workspaceTags, Context context) { - return updateTagsWithResponseAsync(resourceGroupName, workspaceName, workspaceTags, context).block(); + QuantumWorkspaceTagsUpdate properties, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateTagsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, contentType, accept, properties, + context); } /** - * Updates an existing workspace's tags. + * Updates an existing Workspace's tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the quantum workspace resource. - * @param workspaceTags Parameters supplied to update tags. + * @param properties Parameters supplied to update tags. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource proxy definition object for quantum workspace. + * @return the resource proxy definition object for Quantum Workspace. */ @ServiceMethod(returns = ReturnType.SINGLE) - public QuantumWorkspaceInner updateTags(String resourceGroupName, String workspaceName, TagsObject workspaceTags) { - return updateTagsWithResponse(resourceGroupName, workspaceName, workspaceTags, Context.NONE).getValue(); + public QuantumWorkspaceInner updateTags(String resourceGroupName, String workspaceName, + QuantumWorkspaceTagsUpdate properties) { + return updateTagsWithResponse(resourceGroupName, workspaceName, properties, Context.NONE).getValue(); } /** @@ -650,25 +555,9 @@ public QuantumWorkspaceInner updateTags(String resourceGroupName, String workspa */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, - this.client.getApiVersion(), this.client.getSubscriptionId(), workspaceName, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -677,34 +566,15 @@ private Mono>> deleteWithResponseAsync(String resource * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the quantum workspace resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), - this.client.getSubscriptionId(), workspaceName, accept, context); + private Response deleteWithResponse(String resourceGroupName, String workspaceName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, Context.NONE); } /** @@ -712,16 +582,16 @@ private Mono>> deleteWithResponseAsync(String resource * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the quantum workspace resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, workspaceName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String workspaceName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, context); } /** @@ -729,19 +599,16 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the quantum workspace resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, workspaceName, context); + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, workspaceName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -756,7 +623,8 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName) { - return this.beginDeleteAsync(resourceGroupName, workspaceName).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, workspaceName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -773,7 +641,8 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, Context context) { - return this.beginDeleteAsync(resourceGroupName, workspaceName, context).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, workspaceName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -791,23 +660,6 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName) { return beginDeleteAsync(resourceGroupName, workspaceName).last().flatMap(this.client::getLroFinalResultOrError); } - /** - * Deletes a Workspace resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the quantum workspace resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String workspaceName, Context context) { - return beginDeleteAsync(resourceGroupName, workspaceName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Deletes a Workspace resource. * @@ -819,7 +671,7 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, C */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String workspaceName) { - deleteAsync(resourceGroupName, workspaceName).block(); + beginDelete(resourceGroupName, workspaceName).getFinalResult(); } /** @@ -834,245 +686,205 @@ public void delete(String resourceGroupName, String workspaceName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String workspaceName, Context context) { - deleteAsync(resourceGroupName, workspaceName, context).block(); + beginDelete(resourceGroupName, workspaceName, context).getFinalResult(); } /** - * Gets the list of Workspaces within a Subscription. + * Gets the list of Workspaces within a resource group. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Workspaces within a Subscription along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the list of Workspaces within a resource group along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets the list of Workspaces within a Subscription. + * Gets the list of Workspaces within a resource group. * - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Workspaces within a Subscription along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the list of Workspaces within a resource group as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** - * Gets the list of Workspaces within a Subscription. + * Gets the list of Workspaces within a resource group. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Workspaces within a Subscription as paginated response with {@link PagedFlux}. + * @return the list of Workspaces within a resource group along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Gets the list of Workspaces within a Subscription. + * Gets the list of Workspaces within a resource group. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Workspaces within a Subscription as paginated response with {@link PagedFlux}. + * @return the list of Workspaces within a resource group along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, + Context context) { + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Gets the list of Workspaces within a Subscription. + * Gets the list of Workspaces within a resource group. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Workspaces within a Subscription as paginated response with {@link PagedIterable}. + * @return the list of Workspaces within a resource group as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); } /** - * Gets the list of Workspaces within a Subscription. + * Gets the list of Workspaces within a resource group. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Workspaces within a Subscription as paginated response with {@link PagedIterable}. + * @return the list of Workspaces within a resource group as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); } /** - * Gets the list of Workspaces within a resource group. + * Gets the list of Workspaces within a Subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Workspaces within a resource group along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the list of Workspaces within a Subscription along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + private Mono> listSinglePageAsync() { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), resourceGroupName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets the list of Workspaces within a resource group. + * Gets the list of Workspaces within a Subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Workspaces within a resource group along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the list of Workspaces within a Subscription as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** - * Gets the list of Workspaces within a resource group. + * Gets the list of Workspaces within a Subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Workspaces within a resource group as paginated response with {@link PagedFlux}. + * @return the list of Workspaces within a Subscription along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Gets the list of Workspaces within a resource group. + * Gets the list of Workspaces within a Subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Workspaces within a resource group as paginated response with {@link PagedFlux}. + * @return the list of Workspaces within a Subscription along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Gets the list of Workspaces within a resource group. + * Gets the list of Workspaces within a Subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Workspaces within a resource group as paginated response with {@link PagedIterable}. + * @return the list of Workspaces within a Subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listBySubscriptionNextSinglePage(nextLink)); } /** - * Gets the list of Workspaces within a resource group. + * Gets the list of Workspaces within a Subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Workspaces within a resource group as paginated response with {@link PagedIterable}. + * @return the list of Workspaces within a Subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), + nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); } /** @@ -1082,27 +894,38 @@ public PagedIterable listByResourceGroup(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list Workspaces operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the list of Workspaces within a resource group along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + context -> service.listByResourceGroupNext(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 list of Workspaces within a resource group along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(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. * @@ -1111,24 +934,15 @@ private Mono> listBySubscriptionNextSingleP * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list Workspaces operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the list of Workspaces within a resource group along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1138,27 +952,38 @@ private Mono> listBySubscriptionNextSingleP * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list Workspaces operation along with {@link PagedResponse} on successful completion of + * @return the list of Workspaces within a Subscription along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + context -> service.listBySubscriptionNext(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 list of Workspaces within a Subscription along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(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. * @@ -1167,23 +992,14 @@ private Mono> listByResourceGroupNextSingle * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list Workspaces operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the list of Workspaces within a Subscription along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listBySubscriptionNextSync(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/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/WorkspacesImpl.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/WorkspacesImpl.java index dbc1e5027543..11a57fd23eae 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/WorkspacesImpl.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/WorkspacesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.implementation; @@ -31,12 +31,8 @@ public Response getByResourceGroupWithResponse(String resource Context context) { Response inner = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, workspaceName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new QuantumWorkspaceImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new QuantumWorkspaceImpl(inner.getValue(), this.manager())); } public QuantumWorkspace getByResourceGroup(String resourceGroupName, String workspaceName) { @@ -56,24 +52,24 @@ public void delete(String resourceGroupName, String workspaceName, Context conte this.serviceClient().delete(resourceGroupName, workspaceName, context); } - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); return ResourceManagerUtils.mapPage(inner, inner1 -> new QuantumWorkspaceImpl(inner1, this.manager())); } - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); return ResourceManagerUtils.mapPage(inner, inner1 -> new QuantumWorkspaceImpl(inner1, this.manager())); } - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); return ResourceManagerUtils.mapPage(inner, inner1 -> new QuantumWorkspaceImpl(inner1, this.manager())); } - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner - = this.serviceClient().listByResourceGroup(resourceGroupName, context); + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); return ResourceManagerUtils.mapPage(inner, inner1 -> new QuantumWorkspaceImpl(inner1, this.manager())); } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/OfferingsListResult.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/models/OfferingsListResult.java similarity index 64% rename from sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/OfferingsListResult.java rename to sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/models/OfferingsListResult.java index 7c3c62d9fb81..dd48dcb9a229 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/OfferingsListResult.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/models/OfferingsListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.quantum.models; +package com.azure.resourcemanager.quantum.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,26 +16,26 @@ /** * The response of a list Providers operation. */ -@Fluent +@Immutable public final class OfferingsListResult implements JsonSerializable { /* - * Result of a list Providers operation. + * The ProviderDescription items on this page */ private List value; /* - * Link to the next set of results. Not empty if Value contains incomplete list of Providers. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of OfferingsListResult class. */ - public OfferingsListResult() { + private OfferingsListResult() { } /** - * Get the value property: Result of a list Providers operation. + * Get the value property: The ProviderDescription items on this page. * * @return the value value. */ @@ -44,19 +44,7 @@ public List value() { } /** - * Set the value property: Result of a list Providers operation. - * - * @param value the value value to set. - * @return the OfferingsListResult object itself. - */ - public OfferingsListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of - * Providers. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -64,29 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of - * Providers. - * - * @param nextLink the nextLink value to set. - * @return the OfferingsListResult object itself. - */ - public OfferingsListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -104,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of OfferingsListResult 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 OfferingsListResult. */ public static OfferingsListResult fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/models/OperationListResult.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/models/OperationListResult.java new file mode 100644 index 000000000000..26ef78c39783 --- /dev/null +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/models/OperationListResult.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quantum.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.quantum.fluent.models.OperationInner; +import java.io.IOException; +import java.util.List; + +/** + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. + */ +@Immutable +public final class OperationListResult implements JsonSerializable { + /* + * The Operation items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of OperationListResult class. + */ + private OperationListResult() { + } + + /** + * Get the value property: The Operation items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OperationListResult. + */ + public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationListResult deserializedOperationListResult = new OperationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1)); + deserializedOperationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOperationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationListResult; + }); + } +} diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/models/QuantumSuiteOfferListResult.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/models/QuantumSuiteOfferListResult.java new file mode 100644 index 000000000000..0b034213a21a --- /dev/null +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/models/QuantumSuiteOfferListResult.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quantum.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.quantum.fluent.models.QuantumSuiteOfferInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a QuantumSuiteOffer list operation. + */ +@Immutable +public final class QuantumSuiteOfferListResult implements JsonSerializable { + /* + * The QuantumSuiteOffer items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of QuantumSuiteOfferListResult class. + */ + private QuantumSuiteOfferListResult() { + } + + /** + * Get the value property: The QuantumSuiteOffer 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 QuantumSuiteOfferListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QuantumSuiteOfferListResult 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 QuantumSuiteOfferListResult. + */ + public static QuantumSuiteOfferListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QuantumSuiteOfferListResult deserializedQuantumSuiteOfferListResult = new QuantumSuiteOfferListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> QuantumSuiteOfferInner.fromJson(reader1)); + deserializedQuantumSuiteOfferListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedQuantumSuiteOfferListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedQuantumSuiteOfferListResult; + }); + } +} diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/models/QuantumWorkspaceListResult.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/models/QuantumWorkspaceListResult.java new file mode 100644 index 000000000000..a835db4d7de9 --- /dev/null +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/models/QuantumWorkspaceListResult.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quantum.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.quantum.fluent.models.QuantumWorkspaceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a QuantumWorkspace list operation. + */ +@Immutable +public final class QuantumWorkspaceListResult implements JsonSerializable { + /* + * The QuantumWorkspace items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of QuantumWorkspaceListResult class. + */ + private QuantumWorkspaceListResult() { + } + + /** + * Get the value property: The QuantumWorkspace 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 QuantumWorkspaceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QuantumWorkspaceListResult 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 QuantumWorkspaceListResult. + */ + public static QuantumWorkspaceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QuantumWorkspaceListResult deserializedQuantumWorkspaceListResult = new QuantumWorkspaceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> QuantumWorkspaceInner.fromJson(reader1)); + deserializedQuantumWorkspaceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedQuantumWorkspaceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedQuantumWorkspaceListResult; + }); + } +} diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/package-info.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/package-info.java index da03b6a59a56..48986060c3d6 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/package-info.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/implementation/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the implementations for AzureQuantumManagementClient. - * null. + * Package containing the implementations for AzureQuantum. + * Microsoft.Quantum Resource Provider Management API. */ package com.azure.resourcemanager.quantum.implementation; diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ActionType.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ActionType.java new file mode 100644 index 000000000000..ba60d0405742 --- /dev/null +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ActionType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quantum.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ +public final class ActionType extends ExpandableStringEnum { + /** + * Actions are for internal-only APIs. + */ + public static final ActionType INTERNAL = fromString("Internal"); + + /** + * Creates a new instance of ActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionType() { + } + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** + * Gets known ActionType values. + * + * @return known ActionType values. + */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ApiKey.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ApiKey.java index f13d30cb80b7..905eab4ede56 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ApiKey.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ApiKey.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,7 +17,7 @@ /** * Azure quantum workspace Api key details. */ -@Fluent +@Immutable public final class ApiKey implements JsonSerializable { /* * The creation time of the api key. @@ -32,7 +32,7 @@ public final class ApiKey implements JsonSerializable { /** * Creates an instance of ApiKey class. */ - public ApiKey() { + private ApiKey() { } /** @@ -44,17 +44,6 @@ public OffsetDateTime createdAt() { return this.createdAt; } - /** - * Set the createdAt property: The creation time of the api key. - * - * @param createdAt the createdAt value to set. - * @return the ApiKey object itself. - */ - public ApiKey withCreatedAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - return this; - } - /** * Get the key property: The Api key. * @@ -64,14 +53,6 @@ public String key() { return this.key; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ApiKeys.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ApiKeys.java index 5a474390657b..4d253885f0be 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ApiKeys.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ApiKeys.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.models; @@ -48,14 +48,6 @@ public ApiKeys withKeys(List keys) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/CheckNameAvailabilityParameters.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/CheckNameAvailabilityParameters.java index 8e25e6545276..575375ffe3bb 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/CheckNameAvailabilityParameters.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/CheckNameAvailabilityParameters.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.models; @@ -12,17 +12,17 @@ import java.io.IOException; /** - * Details of check name availability request body. + * The check availability request body. */ @Fluent public final class CheckNameAvailabilityParameters implements JsonSerializable { /* - * Name for checking availability. + * The name of the resource for which availability needs to be checked. */ private String name; /* - * The resource type of Quantum Workspace. + * The resource type. */ private String type; @@ -33,7 +33,7 @@ public CheckNameAvailabilityParameters() { } /** - * Get the name property: Name for checking availability. + * Get the name property: The name of the resource for which availability needs to be checked. * * @return the name value. */ @@ -42,7 +42,7 @@ public String name() { } /** - * Set the name property: Name for checking availability. + * Set the name property: The name of the resource for which availability needs to be checked. * * @param name the name value to set. * @return the CheckNameAvailabilityParameters object itself. @@ -53,7 +53,7 @@ public CheckNameAvailabilityParameters withName(String name) { } /** - * Get the type property: The resource type of Quantum Workspace. + * Get the type property: The resource type. * * @return the type value. */ @@ -62,7 +62,7 @@ public String type() { } /** - * Set the type property: The resource type of Quantum Workspace. + * Set the type property: The resource type. * * @param type the type value to set. * @return the CheckNameAvailabilityParameters object itself. @@ -72,14 +72,6 @@ public CheckNameAvailabilityParameters withType(String type) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/CheckNameAvailabilityReason.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/CheckNameAvailabilityReason.java new file mode 100644 index 000000000000..fb212d2217cd --- /dev/null +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/CheckNameAvailabilityReason.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.quantum.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Possible reasons for a name not being available. + */ +public final class CheckNameAvailabilityReason extends ExpandableStringEnum { + /** + * Name is invalid. + */ + public static final CheckNameAvailabilityReason INVALID = fromString("Invalid"); + + /** + * Name already exists. + */ + public static final CheckNameAvailabilityReason ALREADY_EXISTS = fromString("AlreadyExists"); + + /** + * Creates a new instance of CheckNameAvailabilityReason value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CheckNameAvailabilityReason() { + } + + /** + * Creates or finds a CheckNameAvailabilityReason from its string representation. + * + * @param name a name to look for. + * @return the corresponding CheckNameAvailabilityReason. + */ + public static CheckNameAvailabilityReason fromString(String name) { + return fromString(name, CheckNameAvailabilityReason.class); + } + + /** + * Gets known CheckNameAvailabilityReason values. + * + * @return known CheckNameAvailabilityReason values. + */ + public static Collection values() { + return values(CheckNameAvailabilityReason.class); + } +} diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/CheckNameAvailabilityResult.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/CheckNameAvailabilityResult.java index c75f5fd2fa56..b756d5c291c4 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/CheckNameAvailabilityResult.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/CheckNameAvailabilityResult.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.models; @@ -11,21 +11,21 @@ */ public interface CheckNameAvailabilityResult { /** - * Gets the nameAvailable property: Indicator of availability of the Quantum Workspace resource name. + * Gets the nameAvailable property: Indicates if the resource name is available. * * @return the nameAvailable value. */ Boolean nameAvailable(); /** - * Gets the reason property: The reason of unavailability. + * Gets the reason property: The reason why the given name is not available. * * @return the reason value. */ - String reason(); + CheckNameAvailabilityReason reason(); /** - * Gets the message property: The detailed info regarding the reason associated with the Namespace. + * Gets the message property: Detailed reason why the given name is not available. * * @return the message value. */ diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/KeyType.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/KeyType.java index 56fb16b9b0f2..761b14a21395 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/KeyType.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/KeyType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.models; @@ -8,16 +8,16 @@ import java.util.Collection; /** - * Defines values for KeyType. + * The API key type. */ public final class KeyType extends ExpandableStringEnum { /** - * Static value Primary for KeyType. + * The primary API key. */ public static final KeyType PRIMARY = fromString("Primary"); /** - * Static value Secondary for KeyType. + * The secondary API key. */ public static final KeyType SECONDARY = fromString("Secondary"); diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ListKeysResult.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ListKeysResult.java index a1cf8cc247dd..c3c9f8666a8d 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ListKeysResult.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ListKeysResult.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.models; diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ManagedOnBehalfOfConfiguration.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ManagedOnBehalfOfConfiguration.java new file mode 100644 index 000000000000..35c42d4022f9 --- /dev/null +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ManagedOnBehalfOfConfiguration.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quantum.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Managed-On-Behalf-Of configuration properties. This configuration exists for the resources where a resource provider + * manages those resources on behalf of the resource owner. + */ +@Immutable +public final class ManagedOnBehalfOfConfiguration implements JsonSerializable { + /* + * Managed-On-Behalf-Of broker resources + */ + private List moboBrokerResources; + + /** + * Creates an instance of ManagedOnBehalfOfConfiguration class. + */ + private ManagedOnBehalfOfConfiguration() { + } + + /** + * Get the moboBrokerResources property: Managed-On-Behalf-Of broker resources. + * + * @return the moboBrokerResources value. + */ + public List moboBrokerResources() { + return this.moboBrokerResources; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedOnBehalfOfConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedOnBehalfOfConfiguration 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 ManagedOnBehalfOfConfiguration. + */ + public static ManagedOnBehalfOfConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedOnBehalfOfConfiguration deserializedManagedOnBehalfOfConfiguration + = new ManagedOnBehalfOfConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("moboBrokerResources".equals(fieldName)) { + List moboBrokerResources + = reader.readArray(reader1 -> MoboBrokerResource.fromJson(reader1)); + deserializedManagedOnBehalfOfConfiguration.moboBrokerResources = moboBrokerResources; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedOnBehalfOfConfiguration; + }); + } +} diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ManagedServiceIdentity.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ManagedServiceIdentity.java new file mode 100644 index 000000000000..e7be51339d07 --- /dev/null +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ManagedServiceIdentity.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quantum.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Managed service identity (system assigned and/or user assigned identities). + */ +@Fluent +public final class ManagedServiceIdentity implements JsonSerializable { + /* + * The service principal ID of the system assigned identity. This property will only be provided for a system + * assigned identity. + */ + private String principalId; + + /* + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned + * identity. + */ + private String tenantId; + + /* + * The type of managed identity assigned to this resource. + */ + private ManagedServiceIdentityType type; + + /* + * The identities assigned to this resource by the user. + */ + private Map userAssignedIdentities; + + /** + * Creates an instance of ManagedServiceIdentity class. + */ + public ManagedServiceIdentity() { + } + + /** + * Get the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for + * a system assigned identity. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type property: The type of managed identity assigned to this resource. + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.type; + } + + /** + * Set the type property: The type of managed identity assigned to this resource. + * + * @param type the type value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withType(ManagedServiceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The identities assigned to this resource by the user. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The identities assigned to this resource by the user. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedServiceIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedServiceIdentity 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 ManagedServiceIdentity. + */ + public static ManagedServiceIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedServiceIdentity deserializedManagedServiceIdentity = new ManagedServiceIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedManagedServiceIdentity.type = ManagedServiceIdentityType.fromString(reader.getString()); + } else if ("principalId".equals(fieldName)) { + deserializedManagedServiceIdentity.principalId = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedManagedServiceIdentity.tenantId = reader.getString(); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1)); + deserializedManagedServiceIdentity.userAssignedIdentities = userAssignedIdentities; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedServiceIdentity; + }); + } +} diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ManagedServiceIdentityType.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ManagedServiceIdentityType.java new file mode 100644 index 000000000000..856c9d01ee6b --- /dev/null +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ManagedServiceIdentityType.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quantum.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ +public final class ManagedServiceIdentityType extends ExpandableStringEnum { + /** + * No managed identity. + */ + public static final ManagedServiceIdentityType NONE = fromString("None"); + + /** + * System assigned managed identity. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** + * User assigned managed identity. + */ + public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** + * System and user assigned managed identity. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED + = fromString("SystemAssigned,UserAssigned"); + + /** + * Creates a new instance of ManagedServiceIdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedServiceIdentityType() { + } + + /** + * Creates or finds a ManagedServiceIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedServiceIdentityType. + */ + public static ManagedServiceIdentityType fromString(String name) { + return fromString(name, ManagedServiceIdentityType.class); + } + + /** + * Gets known ManagedServiceIdentityType values. + * + * @return known ManagedServiceIdentityType values. + */ + public static Collection values() { + return values(ManagedServiceIdentityType.class); + } +} diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/MoboBrokerResource.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/MoboBrokerResource.java new file mode 100644 index 000000000000..ead3c37b4c62 --- /dev/null +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/MoboBrokerResource.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quantum.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; + +/** + * Managed-On-Behalf-Of broker resource. This resource is created by the Resource Provider to manage some resources on + * behalf of the user. + */ +@Immutable +public final class MoboBrokerResource implements JsonSerializable { + /* + * Resource identifier of a Managed-On-Behalf-Of broker resource + */ + private String id; + + /** + * Creates an instance of MoboBrokerResource class. + */ + private MoboBrokerResource() { + } + + /** + * Get the id property: Resource identifier of a Managed-On-Behalf-Of broker resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MoboBrokerResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MoboBrokerResource 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 MoboBrokerResource. + */ + public static MoboBrokerResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MoboBrokerResource deserializedMoboBrokerResource = new MoboBrokerResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMoboBrokerResource.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMoboBrokerResource; + }); + } +} diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/Offerings.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/Offerings.java index 218051dd3898..9c2833d652e6 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/Offerings.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/Offerings.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.models; @@ -26,11 +26,12 @@ public interface Offerings { * Returns the list of all provider offerings available for the given location. * * @param locationName Location. + * @param filter The filter to apply to the operation. Example: '$filter=kind eq 'v1'. * @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 list Providers operation as paginated response with {@link PagedIterable}. */ - PagedIterable list(String locationName, Context context); + PagedIterable list(String locationName, String filter, Context context); } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/Operation.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/Operation.java index 71c941240c5e..15589c5a3055 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/Operation.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/Operation.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.models; @@ -11,26 +11,44 @@ */ public interface Operation { /** - * Gets the name property: Name of the operation. + * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". * * @return the name value. */ String name(); /** - * Gets the isDataAction property: Indicates whether the operation is a data action. + * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for Azure Resource Manager/control-plane operations. * * @return the isDataAction value. */ Boolean isDataAction(); /** - * Gets the display property: Properties of the operation. + * Gets the display property: Localized display information for this particular operation. * * @return the display value. */ OperationDisplay display(); + /** + * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + Origin origin(); + + /** + * Gets the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. + * + * @return the actionType value. + */ + ActionType actionType(); + /** * Gets the inner com.azure.resourcemanager.quantum.fluent.models.OperationInner object. * diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/OperationDisplay.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/OperationDisplay.java index d653e38d5a69..b4769cce135f 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/OperationDisplay.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/OperationDisplay.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -12,38 +12,42 @@ import java.io.IOException; /** - * Properties of the operation. + * Localized display information for an operation. */ -@Fluent +@Immutable public final class OperationDisplay implements JsonSerializable { /* - * Provider name + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or + * "Microsoft Compute". */ private String provider; /* - * Resource name + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or + * "Job Schedule Collections". */ private String resource; /* - * Operation name + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". */ private String operation; /* - * Description of the operation + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. */ private String description; /** * Creates an instance of OperationDisplay class. */ - public OperationDisplay() { + private OperationDisplay() { } /** - * Get the provider property: Provider name. + * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring + * Insights" or "Microsoft Compute". * * @return the provider value. */ @@ -52,18 +56,8 @@ public String provider() { } /** - * Set the provider property: Provider name. - * - * @param provider the provider value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withProvider(String provider) { - this.provider = provider; - return this; - } - - /** - * Get the resource property: Resource name. + * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. + * "Virtual Machines" or "Job Schedule Collections". * * @return the resource value. */ @@ -72,18 +66,8 @@ public String resource() { } /** - * Set the resource property: Resource name. - * - * @param resource the resource value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withResource(String resource) { - this.resource = resource; - return this; - } - - /** - * Get the operation property: Operation name. + * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". * * @return the operation value. */ @@ -92,18 +76,8 @@ public String operation() { } /** - * Set the operation property: Operation name. - * - * @param operation the operation value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withOperation(String operation) { - this.operation = operation; - return this; - } - - /** - * Get the description property: Description of the operation. + * Get the description property: The short, localized friendly description of the operation; suitable for tool tips + * and detailed views. * * @return the description value. */ @@ -111,35 +85,12 @@ public String description() { return this.description; } - /** - * Set the description property: Description of the operation. - * - * @param description the description value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withDescription(String description) { - this.description = description; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("provider", this.provider); - jsonWriter.writeStringField("resource", this.resource); - jsonWriter.writeStringField("operation", this.operation); - jsonWriter.writeStringField("description", this.description); return jsonWriter.writeEndObject(); } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/Operations.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/Operations.java index 5996d174c860..8c3efc582f28 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/Operations.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/Operations.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.models; @@ -12,22 +12,24 @@ */ public interface Operations { /** - * Returns list of operations. + * List the operations for the provider. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lists the operations available as paginated response with {@link PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ PagedIterable list(); /** - * Returns list of operations. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lists the operations available as paginated response with {@link PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ PagedIterable list(Context context); } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/OperationsList.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/OperationsList.java deleted file mode 100644 index 959fd9fde12b..000000000000 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/OperationsList.java +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.quantum.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.quantum.fluent.models.OperationInner; -import java.io.IOException; -import java.util.List; - -/** - * Lists the operations available. - */ -@Fluent -public final class OperationsList implements JsonSerializable { - /* - * Url to follow for getting next page of operations. - */ - private String nextLink; - - /* - * Array of operations - */ - private List value; - - /** - * Creates an instance of OperationsList class. - */ - public OperationsList() { - } - - /** - * Get the nextLink property: Url to follow for getting next page of operations. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: Url to follow for getting next page of operations. - * - * @param nextLink the nextLink value to set. - * @return the OperationsList object itself. - */ - public OperationsList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Get the value property: Array of operations. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Array of operations. - * - * @param value the value value to set. - * @return the OperationsList object itself. - */ - public OperationsList withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property value in model OperationsList")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(OperationsList.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationsList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationsList 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 OperationsList. - */ - public static OperationsList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationsList deserializedOperationsList = new OperationsList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1)); - deserializedOperationsList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedOperationsList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationsList; - }); - } -} diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/Origin.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/Origin.java new file mode 100644 index 000000000000..28515509e4d0 --- /dev/null +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/Origin.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quantum.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value + * is "user,system". + */ +public final class Origin extends ExpandableStringEnum { + /** + * Indicates the operation is initiated by a user. + */ + public static final Origin USER = fromString("user"); + + /** + * Indicates the operation is initiated by a system. + */ + public static final Origin SYSTEM = fromString("system"); + + /** + * Indicates the operation is initiated by a user or system. + */ + public static final Origin USER_SYSTEM = fromString("user,system"); + + /** + * Creates a new instance of Origin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Origin() { + } + + /** + * Creates or finds a Origin from its string representation. + * + * @param name a name to look for. + * @return the corresponding Origin. + */ + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** + * Gets known Origin values. + * + * @return known Origin values. + */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/PricingDetail.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/PricingDetail.java index 1e46bd99c35d..8d3839ec9474 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/PricingDetail.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/PricingDetail.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Detailed pricing information for an sku. */ -@Fluent +@Immutable public final class PricingDetail implements JsonSerializable { /* * Unique id for this pricing information. @@ -29,7 +29,7 @@ public final class PricingDetail implements JsonSerializable { /** * Creates an instance of PricingDetail class. */ - public PricingDetail() { + private PricingDetail() { } /** @@ -41,17 +41,6 @@ public String id() { return this.id; } - /** - * Set the id property: Unique id for this pricing information. - * - * @param id the id value to set. - * @return the PricingDetail object itself. - */ - public PricingDetail withId(String id) { - this.id = id; - return this; - } - /** * Get the value property: The unit cost of this sku. * @@ -61,25 +50,6 @@ public String value() { return this.value; } - /** - * Set the value property: The unit cost of this sku. - * - * @param value the value value to set. - * @return the PricingDetail object itself. - */ - public PricingDetail withValue(String value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/PricingDimension.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/PricingDimension.java index 87dfea2aa35f..d5e06f6a2a28 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/PricingDimension.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/PricingDimension.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Information about pricing dimension. */ -@Fluent +@Immutable public final class PricingDimension implements JsonSerializable { /* * Unique id of this pricing dimension. @@ -29,7 +29,7 @@ public final class PricingDimension implements JsonSerializable { */ private String resourceUsageId; + /* + * Quota allocations associated with this provider. Available only for special providers. + */ + private QuotaAllocations quotas; + /** * Creates an instance of Provider class. */ @@ -173,11 +178,23 @@ public Provider withResourceUsageId(String resourceUsageId) { } /** - * Validates the instance. + * Get the quotas property: Quota allocations associated with this provider. Available only for special providers. + * + * @return the quotas value. + */ + public QuotaAllocations quotas() { + return this.quotas; + } + + /** + * Set the quotas property: Quota allocations associated with this provider. Available only for special providers. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @param quotas the quotas value to set. + * @return the Provider object itself. */ - public void validate() { + public Provider withQuotas(QuotaAllocations quotas) { + this.quotas = quotas; + return this; } /** @@ -193,6 +210,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("provisioningState", this.provisioningState == null ? null : this.provisioningState.toString()); jsonWriter.writeStringField("resourceUsageId", this.resourceUsageId); + jsonWriter.writeJsonField("quotas", this.quotas); return jsonWriter.writeEndObject(); } @@ -223,6 +241,8 @@ public static Provider fromJson(JsonReader jsonReader) throws IOException { deserializedProvider.provisioningState = Status.fromString(reader.getString()); } else if ("resourceUsageId".equals(fieldName)) { deserializedProvider.resourceUsageId = reader.getString(); + } else if ("quotas".equals(fieldName)) { + deserializedProvider.quotas = QuotaAllocations.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ProviderDescription.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ProviderDescription.java index a4e4415595b0..4cb5d69b1cbe 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ProviderDescription.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ProviderDescription.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.models; diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ProviderProperties.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ProviderProperties.java index 47addda0e38c..fd4d87dba85b 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ProviderProperties.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ProviderProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * Provider properties. */ -@Fluent +@Immutable public final class ProviderProperties implements JsonSerializable { /* * A description about this provider. @@ -70,7 +70,7 @@ public final class ProviderProperties implements JsonSerializable targets() { return this.targets; } - /** - * Set the targets property: The list of targets available from this provider. - * - * @param targets the targets value to set. - * @return the ProviderProperties object itself. - */ - public ProviderProperties withTargets(List targets) { - this.targets = targets; - return this; - } - /** * Get the skus property: The list of skus available from this provider. * @@ -178,17 +145,6 @@ public List skus() { return this.skus; } - /** - * Set the skus property: The list of skus available from this provider. - * - * @param skus the skus value to set. - * @return the ProviderProperties object itself. - */ - public ProviderProperties withSkus(List skus) { - this.skus = skus; - return this; - } - /** * Get the quotaDimensions property: The list of quota dimensions from the provider. * @@ -198,17 +154,6 @@ public List quotaDimensions() { return this.quotaDimensions; } - /** - * Set the quotaDimensions property: The list of quota dimensions from the provider. - * - * @param quotaDimensions the quotaDimensions value to set. - * @return the ProviderProperties object itself. - */ - public ProviderProperties withQuotaDimensions(List quotaDimensions) { - this.quotaDimensions = quotaDimensions; - return this; - } - /** * Get the pricingDimensions property: The list of pricing dimensions from the provider. * @@ -218,43 +163,6 @@ public List pricingDimensions() { return this.pricingDimensions; } - /** - * Set the pricingDimensions property: The list of pricing dimensions from the provider. - * - * @param pricingDimensions the pricingDimensions value to set. - * @return the ProviderProperties object itself. - */ - public ProviderProperties withPricingDimensions(List pricingDimensions) { - this.pricingDimensions = pricingDimensions; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (aad() != null) { - aad().validate(); - } - if (managedApplication() != null) { - managedApplication().validate(); - } - if (targets() != null) { - targets().forEach(e -> e.validate()); - } - if (skus() != null) { - skus().forEach(e -> e.validate()); - } - if (quotaDimensions() != null) { - quotaDimensions().forEach(e -> e.validate()); - } - if (pricingDimensions() != null) { - pricingDimensions().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ProviderPropertiesAad.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ProviderPropertiesAad.java index 0a40dd3de58d..d0ea8ab079df 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ProviderPropertiesAad.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ProviderPropertiesAad.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.models; @@ -29,7 +29,7 @@ public final class ProviderPropertiesAad implements JsonSerializable { /** - * Static value Succeeded for ProvisioningStatus. + * The Workspace provisioning is succeeded. */ public static final ProvisioningStatus SUCCEEDED = fromString("Succeeded"); /** - * Static value ProviderLaunching for ProvisioningStatus. + * The Workspace provisioning failed. + */ + public static final ProvisioningStatus FAILED = fromString("Failed"); + + /** + * Resource creation was canceled. + */ + public static final ProvisioningStatus CANCELED = fromString("Canceled"); + + /** + * The Workspace is currently starting to provision a provider. */ public static final ProvisioningStatus PROVIDER_LAUNCHING = fromString("ProviderLaunching"); /** - * Static value ProviderUpdating for ProvisioningStatus. + * The Workspace is currently updating a provider. */ public static final ProvisioningStatus PROVIDER_UPDATING = fromString("ProviderUpdating"); /** - * Static value ProviderDeleting for ProvisioningStatus. + * The Workspace is currently deleting a provider. */ public static final ProvisioningStatus PROVIDER_DELETING = fromString("ProviderDeleting"); /** - * Static value ProviderProvisioning for ProvisioningStatus. + * The Workspace is currently provisioning a provider. */ public static final ProvisioningStatus PROVIDER_PROVISIONING = fromString("ProviderProvisioning"); - /** - * Static value Failed for ProvisioningStatus. - */ - public static final ProvisioningStatus FAILED = fromString("Failed"); - /** * Creates a new instance of ProvisioningStatus value. * diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/QuantumSuiteOffer.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/QuantumSuiteOffer.java new file mode 100644 index 000000000000..951116208698 --- /dev/null +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/QuantumSuiteOffer.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.quantum.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.quantum.fluent.models.QuantumSuiteOfferInner; + +/** + * An immutable client-side representation of QuantumSuiteOffer. + */ +public interface QuantumSuiteOffer { + /** + * 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. + */ + QuantumSuiteOfferProperties 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.quantum.fluent.models.QuantumSuiteOfferInner object. + * + * @return the inner object. + */ + QuantumSuiteOfferInner innerModel(); +} diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/QuantumSuiteOfferProperties.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/QuantumSuiteOfferProperties.java new file mode 100644 index 000000000000..63ee619ca213 --- /dev/null +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/QuantumSuiteOfferProperties.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quantum.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 Quantum Suite Offer. + */ +@Immutable +public final class QuantumSuiteOfferProperties implements JsonSerializable { + /* + * The provider ID of the offer. + */ + private String providerId; + + /* + * The provider name of the offer. + */ + private String providerName; + + /* + * The name of the company that is providing this offer. + */ + private String companyName; + + /* + * The location where this offer is available. + */ + private String location; + + /* + * Description of the offer. + */ + private String description; + + /* + * Quota allocations associated with this offer. + */ + private QuotaAllocations quotas; + + /** + * Creates an instance of QuantumSuiteOfferProperties class. + */ + private QuantumSuiteOfferProperties() { + } + + /** + * Get the providerId property: The provider ID of the offer. + * + * @return the providerId value. + */ + public String providerId() { + return this.providerId; + } + + /** + * Get the providerName property: The provider name of the offer. + * + * @return the providerName value. + */ + public String providerName() { + return this.providerName; + } + + /** + * Get the companyName property: The name of the company that is providing this offer. + * + * @return the companyName value. + */ + public String companyName() { + return this.companyName; + } + + /** + * Get the location property: The location where this offer is available. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the description property: Description of the offer. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the quotas property: Quota allocations associated with this offer. + * + * @return the quotas value. + */ + public QuotaAllocations quotas() { + return this.quotas; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("providerId", this.providerId); + jsonWriter.writeStringField("providerName", this.providerName); + jsonWriter.writeStringField("companyName", this.companyName); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeJsonField("quotas", this.quotas); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QuantumSuiteOfferProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QuantumSuiteOfferProperties 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 QuantumSuiteOfferProperties. + */ + public static QuantumSuiteOfferProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QuantumSuiteOfferProperties deserializedQuantumSuiteOfferProperties = new QuantumSuiteOfferProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("providerId".equals(fieldName)) { + deserializedQuantumSuiteOfferProperties.providerId = reader.getString(); + } else if ("providerName".equals(fieldName)) { + deserializedQuantumSuiteOfferProperties.providerName = reader.getString(); + } else if ("companyName".equals(fieldName)) { + deserializedQuantumSuiteOfferProperties.companyName = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedQuantumSuiteOfferProperties.location = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedQuantumSuiteOfferProperties.description = reader.getString(); + } else if ("quotas".equals(fieldName)) { + deserializedQuantumSuiteOfferProperties.quotas = QuotaAllocations.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedQuantumSuiteOfferProperties; + }); + } +} diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/QuantumWorkspace.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/QuantumWorkspace.java index a4290f6fbab5..df1666ea336d 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/QuantumWorkspace.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/QuantumWorkspace.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.models; @@ -57,11 +57,11 @@ public interface QuantumWorkspace { WorkspaceResourceProperties properties(); /** - * Gets the identity property: Managed Identity information. + * Gets the identity property: The managed service identities assigned to this resource. * * @return the identity value. */ - QuantumWorkspaceIdentity identity(); + ManagedServiceIdentity identity(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -203,12 +203,12 @@ interface WithProperties { */ interface WithIdentity { /** - * Specifies the identity property: Managed Identity information.. + * Specifies the identity property: The managed service identities assigned to this resource.. * - * @param identity Managed Identity information. + * @param identity The managed service identities assigned to this resource. * @return the next definition stage. */ - WithCreate withIdentity(QuantumWorkspaceIdentity identity); + WithCreate withIdentity(ManagedServiceIdentity identity); } } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/QuantumWorkspaceIdentity.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/QuantumWorkspaceIdentity.java deleted file mode 100644 index fd517ea5e10a..000000000000 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/QuantumWorkspaceIdentity.java +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.quantum.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Managed Identity information. - */ -@Fluent -public final class QuantumWorkspaceIdentity implements JsonSerializable { - /* - * The principal ID of resource identity. - */ - private String principalId; - - /* - * The tenant ID of resource. - */ - private String tenantId; - - /* - * The identity type. - */ - private ResourceIdentityType type; - - /** - * Creates an instance of QuantumWorkspaceIdentity class. - */ - public QuantumWorkspaceIdentity() { - } - - /** - * Get the principalId property: The principal ID of resource identity. - * - * @return the principalId value. - */ - public String principalId() { - return this.principalId; - } - - /** - * Get the tenantId property: The tenant ID of resource. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * Get the type property: The identity type. - * - * @return the type value. - */ - public ResourceIdentityType type() { - return this.type; - } - - /** - * Set the type property: The identity type. - * - * @param type the type value to set. - * @return the QuantumWorkspaceIdentity object itself. - */ - public QuantumWorkspaceIdentity withType(ResourceIdentityType type) { - this.type = type; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of QuantumWorkspaceIdentity from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of QuantumWorkspaceIdentity 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 QuantumWorkspaceIdentity. - */ - public static QuantumWorkspaceIdentity fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - QuantumWorkspaceIdentity deserializedQuantumWorkspaceIdentity = new QuantumWorkspaceIdentity(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("principalId".equals(fieldName)) { - deserializedQuantumWorkspaceIdentity.principalId = reader.getString(); - } else if ("tenantId".equals(fieldName)) { - deserializedQuantumWorkspaceIdentity.tenantId = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedQuantumWorkspaceIdentity.type = ResourceIdentityType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedQuantumWorkspaceIdentity; - }); - } -} diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/TagsObject.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/QuantumWorkspaceTagsUpdate.java similarity index 62% rename from sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/TagsObject.java rename to sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/QuantumWorkspaceTagsUpdate.java index fb2c444707c2..946350512ace 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/TagsObject.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/QuantumWorkspaceTagsUpdate.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.models; @@ -13,19 +13,19 @@ import java.util.Map; /** - * Tags object for patch operations. + * The type used for updating tags in QuantumWorkspace resources. */ @Fluent -public final class TagsObject implements JsonSerializable { +public final class QuantumWorkspaceTagsUpdate implements JsonSerializable { /* * Resource tags. */ private Map tags; /** - * Creates an instance of TagsObject class. + * Creates an instance of QuantumWorkspaceTagsUpdate class. */ - public TagsObject() { + public QuantumWorkspaceTagsUpdate() { } /** @@ -41,21 +41,13 @@ public Map tags() { * Set the tags property: Resource tags. * * @param tags the tags value to set. - * @return the TagsObject object itself. + * @return the QuantumWorkspaceTagsUpdate object itself. */ - public TagsObject withTags(Map tags) { + public QuantumWorkspaceTagsUpdate withTags(Map tags) { this.tags = tags; return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ @@ -67,29 +59,29 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of TagsObject from the JsonReader. + * Reads an instance of QuantumWorkspaceTagsUpdate from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of TagsObject 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 TagsObject. + * @return An instance of QuantumWorkspaceTagsUpdate 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 QuantumWorkspaceTagsUpdate. */ - public static TagsObject fromJson(JsonReader jsonReader) throws IOException { + public static QuantumWorkspaceTagsUpdate fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - TagsObject deserializedTagsObject = new TagsObject(); + QuantumWorkspaceTagsUpdate deserializedQuantumWorkspaceTagsUpdate = new QuantumWorkspaceTagsUpdate(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedTagsObject.tags = tags; + deserializedQuantumWorkspaceTagsUpdate.tags = tags; } else { reader.skipChildren(); } } - return deserializedTagsObject; + return deserializedQuantumWorkspaceTagsUpdate; }); } } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/QuotaAllocations.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/QuotaAllocations.java new file mode 100644 index 000000000000..7362086a2f13 --- /dev/null +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/QuotaAllocations.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quantum.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Quota allocations with each field representing different quota type. + */ +@Fluent +public final class QuotaAllocations implements JsonSerializable { + /* + * Lifetime limit for standard priority jobs execution in minutes. + */ + private int standardMinutesLifetime; + + /* + * Lifetime limit for high priority jobs execution in minutes. + */ + private Integer highMinutesLifetime; + + /** + * Creates an instance of QuotaAllocations class. + */ + public QuotaAllocations() { + } + + /** + * Get the standardMinutesLifetime property: Lifetime limit for standard priority jobs execution in minutes. + * + * @return the standardMinutesLifetime value. + */ + public int standardMinutesLifetime() { + return this.standardMinutesLifetime; + } + + /** + * Set the standardMinutesLifetime property: Lifetime limit for standard priority jobs execution in minutes. + * + * @param standardMinutesLifetime the standardMinutesLifetime value to set. + * @return the QuotaAllocations object itself. + */ + public QuotaAllocations withStandardMinutesLifetime(int standardMinutesLifetime) { + this.standardMinutesLifetime = standardMinutesLifetime; + return this; + } + + /** + * Get the highMinutesLifetime property: Lifetime limit for high priority jobs execution in minutes. + * + * @return the highMinutesLifetime value. + */ + public Integer highMinutesLifetime() { + return this.highMinutesLifetime; + } + + /** + * Set the highMinutesLifetime property: Lifetime limit for high priority jobs execution in minutes. + * + * @param highMinutesLifetime the highMinutesLifetime value to set. + * @return the QuotaAllocations object itself. + */ + public QuotaAllocations withHighMinutesLifetime(Integer highMinutesLifetime) { + this.highMinutesLifetime = highMinutesLifetime; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("standardMinutesLifetime", this.standardMinutesLifetime); + jsonWriter.writeNumberField("highMinutesLifetime", this.highMinutesLifetime); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QuotaAllocations from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QuotaAllocations 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 QuotaAllocations. + */ + public static QuotaAllocations fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QuotaAllocations deserializedQuotaAllocations = new QuotaAllocations(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("standardMinutesLifetime".equals(fieldName)) { + deserializedQuotaAllocations.standardMinutesLifetime = reader.getInt(); + } else if ("highMinutesLifetime".equals(fieldName)) { + deserializedQuotaAllocations.highMinutesLifetime = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedQuotaAllocations; + }); + } +} diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/QuotaDimension.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/QuotaDimension.java index dce8f2ceaed2..84cef5e9a859 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/QuotaDimension.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/QuotaDimension.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Information about a specific quota dimension. */ -@Fluent +@Immutable public final class QuotaDimension implements JsonSerializable { /* * Unique id of this dimension. @@ -59,7 +59,7 @@ public final class QuotaDimension implements JsonSerializable { /** * Creates an instance of QuotaDimension class. */ - public QuotaDimension() { + private QuotaDimension() { } /** @@ -71,17 +71,6 @@ public String id() { return this.id; } - /** - * Set the id property: Unique id of this dimension. - * - * @param id the id value to set. - * @return the QuotaDimension object itself. - */ - public QuotaDimension withId(String id) { - this.id = id; - return this; - } - /** * Get the scope property: The scope of this quota dimension. * @@ -91,17 +80,6 @@ public String scope() { return this.scope; } - /** - * Set the scope property: The scope of this quota dimension. - * - * @param scope the scope value to set. - * @return the QuotaDimension object itself. - */ - public QuotaDimension withScope(String scope) { - this.scope = scope; - return this; - } - /** * Get the period property: The reset period of this quota dimension. * @@ -111,17 +89,6 @@ public String period() { return this.period; } - /** - * Set the period property: The reset period of this quota dimension. - * - * @param period the period value to set. - * @return the QuotaDimension object itself. - */ - public QuotaDimension withPeriod(String period) { - this.period = period; - return this; - } - /** * Get the quota property: The max limit of this dimension. * @@ -131,17 +98,6 @@ public Float quota() { return this.quota; } - /** - * Set the quota property: The max limit of this dimension. - * - * @param quota the quota value to set. - * @return the QuotaDimension object itself. - */ - public QuotaDimension withQuota(Float quota) { - this.quota = quota; - return this; - } - /** * Get the name property: The display name of this quota dimension. * @@ -151,17 +107,6 @@ public String name() { return this.name; } - /** - * Set the name property: The display name of this quota dimension. - * - * @param name the name value to set. - * @return the QuotaDimension object itself. - */ - public QuotaDimension withName(String name) { - this.name = name; - return this; - } - /** * Get the description property: A description about this quota dimension. * @@ -171,17 +116,6 @@ public String description() { return this.description; } - /** - * Set the description property: A description about this quota dimension. - * - * @param description the description value to set. - * @return the QuotaDimension object itself. - */ - public QuotaDimension withDescription(String description) { - this.description = description; - return this; - } - /** * Get the unit property: The standard unit of measurement used for this quota dimension. * @@ -191,17 +125,6 @@ public String unit() { return this.unit; } - /** - * Set the unit property: The standard unit of measurement used for this quota dimension. - * - * @param unit the unit value to set. - * @return the QuotaDimension object itself. - */ - public QuotaDimension withUnit(String unit) { - this.unit = unit; - return this; - } - /** * Get the unitPlural property: The standard unit of measurement used for this quota dimension in plural form. * @@ -211,25 +134,6 @@ public String unitPlural() { return this.unitPlural; } - /** - * Set the unitPlural property: The standard unit of measurement used for this quota dimension in plural form. - * - * @param unitPlural the unitPlural value to set. - * @return the QuotaDimension object itself. - */ - public QuotaDimension withUnitPlural(String unitPlural) { - this.unitPlural = unitPlural; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ResourceIdentityType.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ResourceIdentityType.java deleted file mode 100644 index b9ae2c0828ca..000000000000 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/ResourceIdentityType.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.quantum.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The identity type. - */ -public final class ResourceIdentityType extends ExpandableStringEnum { - /** - * Static value SystemAssigned for ResourceIdentityType. - */ - public static final ResourceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); - - /** - * Static value None for ResourceIdentityType. - */ - public static final ResourceIdentityType NONE = fromString("None"); - - /** - * Creates a new instance of ResourceIdentityType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ResourceIdentityType() { - } - - /** - * Creates or finds a ResourceIdentityType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ResourceIdentityType. - */ - public static ResourceIdentityType fromString(String name) { - return fromString(name, ResourceIdentityType.class); - } - - /** - * Gets known ResourceIdentityType values. - * - * @return known ResourceIdentityType values. - */ - public static Collection values() { - return values(ResourceIdentityType.class); - } -} diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/SkuDescription.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/SkuDescription.java index 5507d40f64ee..1da4d751d3e4 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/SkuDescription.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/SkuDescription.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * Information about a specific sku. */ -@Fluent +@Immutable public final class SkuDescription implements JsonSerializable { /* * Unique sku id. @@ -65,7 +65,7 @@ public final class SkuDescription implements JsonSerializable { /** * Creates an instance of SkuDescription class. */ - public SkuDescription() { + private SkuDescription() { } /** @@ -77,17 +77,6 @@ public String id() { return this.id; } - /** - * Set the id property: Unique sku id. - * - * @param id the id value to set. - * @return the SkuDescription object itself. - */ - public SkuDescription withId(String id) { - this.id = id; - return this; - } - /** * Get the name property: Display name of this sku. * @@ -97,17 +86,6 @@ public String name() { return this.name; } - /** - * Set the name property: Display name of this sku. - * - * @param name the name value to set. - * @return the SkuDescription object itself. - */ - public SkuDescription withName(String name) { - this.name = name; - return this; - } - /** * Get the version property: Display name of this sku. * @@ -117,17 +95,6 @@ public String version() { return this.version; } - /** - * Set the version property: Display name of this sku. - * - * @param version the version value to set. - * @return the SkuDescription object itself. - */ - public SkuDescription withVersion(String version) { - this.version = version; - return this; - } - /** * Get the description property: Description about this sku. * @@ -137,17 +104,6 @@ public String description() { return this.description; } - /** - * Set the description property: Description about this sku. - * - * @param description the description value to set. - * @return the SkuDescription object itself. - */ - public SkuDescription withDescription(String description) { - this.description = description; - return this; - } - /** * Get the restrictedAccessUri property: Uri to subscribe to the restricted access sku. * @@ -157,17 +113,6 @@ public String restrictedAccessUri() { return this.restrictedAccessUri; } - /** - * Set the restrictedAccessUri property: Uri to subscribe to the restricted access sku. - * - * @param restrictedAccessUri the restrictedAccessUri value to set. - * @return the SkuDescription object itself. - */ - public SkuDescription withRestrictedAccessUri(String restrictedAccessUri) { - this.restrictedAccessUri = restrictedAccessUri; - return this; - } - /** * Get the autoAdd property: Flag to indicate whether the sku should be automatically added during workspace * creation. @@ -178,18 +123,6 @@ public Boolean autoAdd() { return this.autoAdd; } - /** - * Set the autoAdd property: Flag to indicate whether the sku should be automatically added during workspace - * creation. - * - * @param autoAdd the autoAdd value to set. - * @return the SkuDescription object itself. - */ - public SkuDescription withAutoAdd(Boolean autoAdd) { - this.autoAdd = autoAdd; - return this; - } - /** * Get the targets property: The list of targets available for this sku. * @@ -199,17 +132,6 @@ public List targets() { return this.targets; } - /** - * Set the targets property: The list of targets available for this sku. - * - * @param targets the targets value to set. - * @return the SkuDescription object itself. - */ - public SkuDescription withTargets(List targets) { - this.targets = targets; - return this; - } - /** * Get the quotaDimensions property: The list of quota dimensions for this sku. * @@ -219,17 +141,6 @@ public List quotaDimensions() { return this.quotaDimensions; } - /** - * Set the quotaDimensions property: The list of quota dimensions for this sku. - * - * @param quotaDimensions the quotaDimensions value to set. - * @return the SkuDescription object itself. - */ - public SkuDescription withQuotaDimensions(List quotaDimensions) { - this.quotaDimensions = quotaDimensions; - return this; - } - /** * Get the pricingDetails property: The list of pricing details for the sku. * @@ -239,31 +150,6 @@ public List pricingDetails() { return this.pricingDetails; } - /** - * Set the pricingDetails property: The list of pricing details for the sku. - * - * @param pricingDetails the pricingDetails value to set. - * @return the SkuDescription object itself. - */ - public SkuDescription withPricingDetails(List pricingDetails) { - this.pricingDetails = pricingDetails; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (quotaDimensions() != null) { - quotaDimensions().forEach(e -> e.validate()); - } - if (pricingDetails() != null) { - pricingDetails().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/Status.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/Status.java index ae27badd0f45..8770c91d757c 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/Status.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/Status.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.models; @@ -12,32 +12,32 @@ */ public final class Status extends ExpandableStringEnum { /** - * Static value Succeeded for Status. + * The provider is successfully provisioned. */ public static final Status SUCCEEDED = fromString("Succeeded"); /** - * Static value Launching for Status. + * The provider is starting provisioning. */ public static final Status LAUNCHING = fromString("Launching"); /** - * Static value Updating for Status. + * The provider is updating. */ public static final Status UPDATING = fromString("Updating"); /** - * Static value Deleting for Status. + * The provider is deleting. */ public static final Status DELETING = fromString("Deleting"); /** - * Static value Deleted for Status. + * The provider is deleted. */ public static final Status DELETED = fromString("Deleted"); /** - * Static value Failed for Status. + * The provider is failed. */ public static final Status FAILED = fromString("Failed"); diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/SuiteOffers.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/SuiteOffers.java new file mode 100644 index 000000000000..e8d55e33cc1d --- /dev/null +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/SuiteOffers.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quantum.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of SuiteOffers. + */ +public interface SuiteOffers { + /** + * Returns the SuiteOffer resource associated with the given name. + * + * @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 QuantumSuiteOffer list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Returns the SuiteOffer resource associated with the given name. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a QuantumSuiteOffer list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/TargetDescription.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/TargetDescription.java index 8465429254ed..e1bcd1a7c23c 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/TargetDescription.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/TargetDescription.java @@ -1,21 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.BinaryData; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; import java.util.List; +import java.util.Map; /** * Information about a Target. A target is the component that can process a specific type of Job. */ -@Fluent +@Immutable public final class TargetDescription implements JsonSerializable { /* * Unique target id. @@ -42,10 +44,25 @@ public final class TargetDescription implements JsonSerializable acceptedContentEncodings; + /* + * The qubit number + */ + private Integer numQubits; + + /* + * Target QIR profile + */ + private String targetProfile; + + /* + * The metadata of this target. + */ + private Map metadata; + /** * Creates an instance of TargetDescription class. */ - public TargetDescription() { + private TargetDescription() { } /** @@ -57,17 +74,6 @@ public String id() { return this.id; } - /** - * Set the id property: Unique target id. - * - * @param id the id value to set. - * @return the TargetDescription object itself. - */ - public TargetDescription withId(String id) { - this.id = id; - return this; - } - /** * Get the name property: Display name of this target. * @@ -77,17 +83,6 @@ public String name() { return this.name; } - /** - * Set the name property: Display name of this target. - * - * @param name the name value to set. - * @return the TargetDescription object itself. - */ - public TargetDescription withName(String name) { - this.name = name; - return this; - } - /** * Get the description property: A description about this target. * @@ -97,17 +92,6 @@ public String description() { return this.description; } - /** - * Set the description property: A description about this target. - * - * @param description the description value to set. - * @return the TargetDescription object itself. - */ - public TargetDescription withDescription(String description) { - this.description = description; - return this; - } - /** * Get the acceptedDataFormats property: List of data formats accepted by this target. * @@ -118,42 +102,39 @@ public List acceptedDataFormats() { } /** - * Set the acceptedDataFormats property: List of data formats accepted by this target. + * Get the acceptedContentEncodings property: List of content encodings accepted by this target. * - * @param acceptedDataFormats the acceptedDataFormats value to set. - * @return the TargetDescription object itself. + * @return the acceptedContentEncodings value. */ - public TargetDescription withAcceptedDataFormats(List acceptedDataFormats) { - this.acceptedDataFormats = acceptedDataFormats; - return this; + public List acceptedContentEncodings() { + return this.acceptedContentEncodings; } /** - * Get the acceptedContentEncodings property: List of content encodings accepted by this target. + * Get the numQubits property: The qubit number. * - * @return the acceptedContentEncodings value. + * @return the numQubits value. */ - public List acceptedContentEncodings() { - return this.acceptedContentEncodings; + public Integer numQubits() { + return this.numQubits; } /** - * Set the acceptedContentEncodings property: List of content encodings accepted by this target. + * Get the targetProfile property: Target QIR profile. * - * @param acceptedContentEncodings the acceptedContentEncodings value to set. - * @return the TargetDescription object itself. + * @return the targetProfile value. */ - public TargetDescription withAcceptedContentEncodings(List acceptedContentEncodings) { - this.acceptedContentEncodings = acceptedContentEncodings; - return this; + public String targetProfile() { + return this.targetProfile; } /** - * Validates the instance. + * Get the metadata property: The metadata of this target. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the metadata value. */ - public void validate() { + public Map metadata() { + return this.metadata; } /** @@ -199,6 +180,14 @@ public static TargetDescription fromJson(JsonReader jsonReader) throws IOExcepti } else if ("acceptedContentEncodings".equals(fieldName)) { List acceptedContentEncodings = reader.readArray(reader1 -> reader1.getString()); deserializedTargetDescription.acceptedContentEncodings = acceptedContentEncodings; + } else if ("numQubits".equals(fieldName)) { + deserializedTargetDescription.numQubits = reader.getNullable(JsonReader::getInt); + } else if ("targetProfile".equals(fieldName)) { + deserializedTargetDescription.targetProfile = reader.getString(); + } else if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1 + .getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped()))); + deserializedTargetDescription.metadata = metadata; } else { reader.skipChildren(); } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/UsableStatus.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/UsableStatus.java index 56efca078669..b8385f46dcdb 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/UsableStatus.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/UsableStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.models; @@ -12,17 +12,17 @@ */ public final class UsableStatus extends ExpandableStringEnum { /** - * Static value Yes for UsableStatus. + * The workspace is usable and can accept jobs. */ public static final UsableStatus YES = fromString("Yes"); /** - * Static value No for UsableStatus. + * The workspace is not usable and cannot accept jobs. */ public static final UsableStatus NO = fromString("No"); /** - * Static value Partial for UsableStatus. + * The workspace is partially usable. */ public static final UsableStatus PARTIAL = fromString("Partial"); diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/UserAssignedIdentity.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/UserAssignedIdentity.java new file mode 100644 index 000000000000..2b72272cf738 --- /dev/null +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/UserAssignedIdentity.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quantum.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; + +/** + * User assigned identity properties. + */ +@Immutable +public final class UserAssignedIdentity implements JsonSerializable { + /* + * The principal ID of the assigned identity. + */ + private String principalId; + + /* + * The client ID of the assigned identity. + */ + private String clientId; + + /** + * Creates an instance of UserAssignedIdentity class. + */ + public UserAssignedIdentity() { + } + + /** + * Get the principalId property: The principal ID of the assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client ID of the assigned identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserAssignedIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserAssignedIdentity 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 UserAssignedIdentity. + */ + public static UserAssignedIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserAssignedIdentity deserializedUserAssignedIdentity = new UserAssignedIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalId".equals(fieldName)) { + deserializedUserAssignedIdentity.principalId = reader.getString(); + } else if ("clientId".equals(fieldName)) { + deserializedUserAssignedIdentity.clientId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUserAssignedIdentity; + }); + } +} diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/WorkspaceKind.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/WorkspaceKind.java new file mode 100644 index 000000000000..7f6689a62e0b --- /dev/null +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/WorkspaceKind.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.quantum.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The workspace type. + */ +public final class WorkspaceKind extends ExpandableStringEnum { + /** + * The workspace is a general-purpose workspace. + */ + public static final WorkspaceKind V1 = fromString("V1"); + + /** + * The workspace is a V2 workspace. + */ + public static final WorkspaceKind V2 = fromString("V2"); + + /** + * Creates a new instance of WorkspaceKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WorkspaceKind() { + } + + /** + * Creates or finds a WorkspaceKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding WorkspaceKind. + */ + public static WorkspaceKind fromString(String name) { + return fromString(name, WorkspaceKind.class); + } + + /** + * Gets known WorkspaceKind values. + * + * @return known WorkspaceKind values. + */ + public static Collection values() { + return values(WorkspaceKind.class); + } +} diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/WorkspaceListResult.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/WorkspaceListResult.java deleted file mode 100644 index 4398148343ba..000000000000 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/WorkspaceListResult.java +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.quantum.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.quantum.fluent.models.QuantumWorkspaceInner; -import java.io.IOException; -import java.util.List; - -/** - * The response of a list Workspaces operation. - */ -@Fluent -public final class WorkspaceListResult implements JsonSerializable { - /* - * Result of a list Workspaces operation. - */ - private List value; - - /* - * Link to the next set of results. Not empty if Value contains incomplete list of Workspaces. - */ - private String nextLink; - - /** - * Creates an instance of WorkspaceListResult class. - */ - public WorkspaceListResult() { - } - - /** - * Get the value property: Result of a list Workspaces operation. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Result of a list Workspaces operation. - * - * @param value the value value to set. - * @return the WorkspaceListResult object itself. - */ - public WorkspaceListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of - * Workspaces. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of - * Workspaces. - * - * @param nextLink the nextLink value to set. - * @return the WorkspaceListResult object itself. - */ - public WorkspaceListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of WorkspaceListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of WorkspaceListResult 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 WorkspaceListResult. - */ - public static WorkspaceListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - WorkspaceListResult deserializedWorkspaceListResult = new WorkspaceListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> QuantumWorkspaceInner.fromJson(reader1)); - deserializedWorkspaceListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedWorkspaceListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedWorkspaceListResult; - }); - } -} diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/WorkspaceOperations.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/WorkspaceOperations.java index 3acd9829b53c..57fc6a9324db 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/WorkspaceOperations.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/WorkspaceOperations.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.models; @@ -12,31 +12,30 @@ */ public interface WorkspaceOperations { /** - * Check the availability of the resource name. + * Check the availability of the resource name for the given location. * - * @param locationName Location. - * @param checkNameAvailabilityParameters The name and type of the resource. + * @param location The name of the Azure region. + * @param body The CheckAvailability request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of check name availability along with {@link Response}. + * @return the check availability result along with {@link Response}. */ - Response checkNameAvailabilityWithResponse(String locationName, - CheckNameAvailabilityParameters checkNameAvailabilityParameters, Context context); + Response checkNameAvailabilityWithResponse(String location, + CheckNameAvailabilityParameters body, Context context); /** - * Check the availability of the resource name. + * Check the availability of the resource name for the given location. * - * @param locationName Location. - * @param checkNameAvailabilityParameters The name and type of the resource. + * @param location The name of the Azure region. + * @param body The CheckAvailability request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of check name availability. + * @return the check availability result. */ - CheckNameAvailabilityResult checkNameAvailability(String locationName, - CheckNameAvailabilityParameters checkNameAvailabilityParameters); + CheckNameAvailabilityResult checkNameAvailability(String location, CheckNameAvailabilityParameters body); /** * Get the keys to use with the Quantum APIs. A key is used to authenticate and authorize access to the Quantum REST @@ -71,14 +70,14 @@ CheckNameAvailabilityResult checkNameAvailability(String locationName, * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the quantum workspace resource. - * @param keySpecification Which key to regenerate: primary or secondary. + * @param body Which key to regenerate: primary or secondary. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ - Response regenerateKeysWithResponse(String resourceGroupName, String workspaceName, ApiKeys keySpecification, + Response regenerateKeysWithResponse(String resourceGroupName, String workspaceName, ApiKeys body, Context context); /** @@ -87,10 +86,10 @@ Response regenerateKeysWithResponse(String resourceGroupName, String works * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the quantum workspace resource. - * @param keySpecification Which key to regenerate: primary or secondary. + * @param body Which key to regenerate: primary or secondary. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void regenerateKeys(String resourceGroupName, String workspaceName, ApiKeys keySpecification); + void regenerateKeys(String resourceGroupName, String workspaceName, ApiKeys body); } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/WorkspaceResourceProperties.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/WorkspaceResourceProperties.java index 37d074b66532..1d1ab42831cd 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/WorkspaceResourceProperties.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/WorkspaceResourceProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.models; @@ -37,6 +37,11 @@ public final class WorkspaceResourceProperties implements JsonSerializable e.validate()); - } + public String managedStorageAccount() { + return this.managedStorageAccount; } /** @@ -159,6 +202,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("providers", this.providers, (writer, element) -> writer.writeJson(element)); jsonWriter.writeStringField("storageAccount", this.storageAccount); + jsonWriter.writeStringField("workspaceKind", this.workspaceKind == null ? null : this.workspaceKind.toString()); jsonWriter.writeBooleanField("apiKeyEnabled", this.apiKeyEnabled); return jsonWriter.writeEndObject(); } @@ -188,10 +232,18 @@ public static WorkspaceResourceProperties fromJson(JsonReader jsonReader) throws = ProvisioningStatus.fromString(reader.getString()); } else if ("storageAccount".equals(fieldName)) { deserializedWorkspaceResourceProperties.storageAccount = reader.getString(); + } else if ("workspaceKind".equals(fieldName)) { + deserializedWorkspaceResourceProperties.workspaceKind + = WorkspaceKind.fromString(reader.getString()); } else if ("endpointUri".equals(fieldName)) { deserializedWorkspaceResourceProperties.endpointUri = reader.getString(); } else if ("apiKeyEnabled".equals(fieldName)) { deserializedWorkspaceResourceProperties.apiKeyEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("managedOnBehalfOfConfiguration".equals(fieldName)) { + deserializedWorkspaceResourceProperties.managedOnBehalfOfConfiguration + = ManagedOnBehalfOfConfiguration.fromJson(reader); + } else if ("managedStorageAccount".equals(fieldName)) { + deserializedWorkspaceResourceProperties.managedStorageAccount = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/Workspaces.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/Workspaces.java index d36eded90648..0bcfd377dca7 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/Workspaces.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/Workspaces.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.models; @@ -21,7 +21,7 @@ public interface Workspaces { * @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 resource proxy definition object for quantum workspace along with {@link Response}. + * @return the resource proxy definition object for Quantum Workspace along with {@link Response}. */ Response getByResourceGroupWithResponse(String resourceGroupName, String workspaceName, Context context); @@ -34,7 +34,7 @@ Response getByResourceGroupWithResponse(String resourceGroupNa * @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 resource proxy definition object for quantum workspace. + * @return the resource proxy definition object for Quantum Workspace. */ QuantumWorkspace getByResourceGroup(String resourceGroupName, String workspaceName); @@ -62,47 +62,47 @@ Response getByResourceGroupWithResponse(String resourceGroupNa void delete(String resourceGroupName, String workspaceName, Context context); /** - * Gets the list of Workspaces within a Subscription. + * Gets the list of Workspaces within a resource group. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Workspaces within a Subscription as paginated response with {@link PagedIterable}. + * @return the list of Workspaces within a resource group as paginated response with {@link PagedIterable}. */ - PagedIterable list(); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Gets the list of Workspaces within a Subscription. + * Gets the list of Workspaces within a resource group. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Workspaces within a Subscription as paginated response with {@link PagedIterable}. + * @return the list of Workspaces within a resource group as paginated response with {@link PagedIterable}. */ - PagedIterable list(Context context); + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Gets the list of Workspaces within a resource group. + * Gets the list of Workspaces within a Subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Workspaces within a resource group as paginated response with {@link PagedIterable}. + * @return the list of Workspaces within a Subscription as paginated response with {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String resourceGroupName); + PagedIterable list(); /** - * Gets the list of Workspaces within a resource group. + * Gets the list of Workspaces within a Subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Workspaces within a resource group as paginated response with {@link PagedIterable}. + * @return the list of Workspaces within a Subscription as paginated response with {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + PagedIterable list(Context context); /** * Returns the Workspace resource associated with the given name. @@ -111,7 +111,7 @@ Response getByResourceGroupWithResponse(String resourceGroupNa * @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 resource proxy definition object for quantum workspace along with {@link Response}. + * @return the resource proxy definition object for Quantum Workspace along with {@link Response}. */ QuantumWorkspace getById(String id); @@ -123,7 +123,7 @@ Response getByResourceGroupWithResponse(String resourceGroupNa * @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 resource proxy definition object for quantum workspace along with {@link Response}. + * @return the resource proxy definition object for Quantum Workspace along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/package-info.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/package-info.java index bb29f3eb81af..bd96fcdabca6 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/package-info.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/models/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the data models for AzureQuantumManagementClient. - * null. + * Package containing the data models for AzureQuantum. + * Microsoft.Quantum Resource Provider Management API. */ package com.azure.resourcemanager.quantum.models; diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/package-info.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/package-info.java index 55c6aa3a1ae8..e123ee664804 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/package-info.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/com/azure/resourcemanager/quantum/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the classes for AzureQuantumManagementClient. - * null. + * Package containing the classes for AzureQuantum. + * Microsoft.Quantum Resource Provider Management API. */ package com.azure.resourcemanager.quantum; diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/module-info.java b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/module-info.java index d73e16058225..fea31642e748 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/java/module-info.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/java/module-info.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. module com.azure.resourcemanager.quantum { requires transitive com.azure.core.management; @@ -12,4 +12,5 @@ opens com.azure.resourcemanager.quantum.fluent.models to com.azure.core; opens com.azure.resourcemanager.quantum.models to com.azure.core; + opens com.azure.resourcemanager.quantum.implementation.models to com.azure.core; } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/resources/META-INF/azure-resourcemanager-quantum_metadata.json b/sdk/quantum/azure-resourcemanager-quantum/src/main/resources/META-INF/azure-resourcemanager-quantum_metadata.json new file mode 100644 index 000000000000..6dcfc5c63b7e --- /dev/null +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/resources/META-INF/azure-resourcemanager-quantum_metadata.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersions":{"Microsoft.Quantum":"2025-12-15-preview"},"crossLanguagePackageId":"Microsoft.Quantum","crossLanguageVersion":"764cb79959fa","crossLanguageDefinitions":{"com.azure.resourcemanager.quantum.fluent.AzureQuantumManagementClient":"Microsoft.Quantum","com.azure.resourcemanager.quantum.fluent.OfferingsClient":"Microsoft.Quantum.Offerings","com.azure.resourcemanager.quantum.fluent.OfferingsClient.list":"Microsoft.Quantum.Offerings.list","com.azure.resourcemanager.quantum.fluent.OperationsClient":"Microsoft.Quantum.Operations","com.azure.resourcemanager.quantum.fluent.OperationsClient.list":"Azure.ResourceManager.Operations.list","com.azure.resourcemanager.quantum.fluent.SuiteOffersClient":"Microsoft.Quantum.SuiteOffers","com.azure.resourcemanager.quantum.fluent.SuiteOffersClient.list":"Microsoft.Quantum.SuiteOffers.listBySubscription","com.azure.resourcemanager.quantum.fluent.WorkspaceOperationsClient":"Microsoft.Quantum","com.azure.resourcemanager.quantum.fluent.WorkspaceOperationsClient.checkNameAvailability":"Microsoft.Quantum.Workspaces.checkNameAvailability","com.azure.resourcemanager.quantum.fluent.WorkspaceOperationsClient.checkNameAvailabilityWithResponse":"Microsoft.Quantum.Workspaces.checkNameAvailability","com.azure.resourcemanager.quantum.fluent.WorkspaceOperationsClient.listKeys":"Microsoft.Quantum.Workspaces.listKeys","com.azure.resourcemanager.quantum.fluent.WorkspaceOperationsClient.listKeysWithResponse":"Microsoft.Quantum.Workspaces.listKeys","com.azure.resourcemanager.quantum.fluent.WorkspaceOperationsClient.regenerateKeys":"Microsoft.Quantum.Workspaces.regenerateKeys","com.azure.resourcemanager.quantum.fluent.WorkspaceOperationsClient.regenerateKeysWithResponse":"Microsoft.Quantum.Workspaces.regenerateKeys","com.azure.resourcemanager.quantum.fluent.WorkspacesClient":"Microsoft.Quantum.Workspaces","com.azure.resourcemanager.quantum.fluent.WorkspacesClient.beginCreateOrUpdate":"Microsoft.Quantum.Workspaces.createOrUpdate","com.azure.resourcemanager.quantum.fluent.WorkspacesClient.beginDelete":"Microsoft.Quantum.Workspaces.delete","com.azure.resourcemanager.quantum.fluent.WorkspacesClient.createOrUpdate":"Microsoft.Quantum.Workspaces.createOrUpdate","com.azure.resourcemanager.quantum.fluent.WorkspacesClient.delete":"Microsoft.Quantum.Workspaces.delete","com.azure.resourcemanager.quantum.fluent.WorkspacesClient.getByResourceGroup":"Microsoft.Quantum.Workspaces.get","com.azure.resourcemanager.quantum.fluent.WorkspacesClient.getByResourceGroupWithResponse":"Microsoft.Quantum.Workspaces.get","com.azure.resourcemanager.quantum.fluent.WorkspacesClient.list":"Microsoft.Quantum.Workspaces.listBySubscription","com.azure.resourcemanager.quantum.fluent.WorkspacesClient.listByResourceGroup":"Microsoft.Quantum.Workspaces.listByResourceGroup","com.azure.resourcemanager.quantum.fluent.WorkspacesClient.updateTags":"Microsoft.Quantum.Workspaces.updateTags","com.azure.resourcemanager.quantum.fluent.WorkspacesClient.updateTagsWithResponse":"Microsoft.Quantum.Workspaces.updateTags","com.azure.resourcemanager.quantum.fluent.models.CheckNameAvailabilityResultInner":"Azure.ResourceManager.CommonTypes.CheckNameAvailabilityResponse","com.azure.resourcemanager.quantum.fluent.models.ListKeysResultInner":"Microsoft.Quantum.ListKeysResult","com.azure.resourcemanager.quantum.fluent.models.OperationInner":"Azure.ResourceManager.CommonTypes.Operation","com.azure.resourcemanager.quantum.fluent.models.ProviderDescriptionInner":"Microsoft.Quantum.ProviderDescription","com.azure.resourcemanager.quantum.fluent.models.QuantumSuiteOfferInner":"Microsoft.Quantum.QuantumSuiteOffer","com.azure.resourcemanager.quantum.fluent.models.QuantumWorkspaceInner":"Microsoft.Quantum.QuantumWorkspace","com.azure.resourcemanager.quantum.implementation.AzureQuantumManagementClientBuilder":"Microsoft.Quantum","com.azure.resourcemanager.quantum.implementation.models.OfferingsListResult":"Microsoft.Quantum.OfferingsListResult","com.azure.resourcemanager.quantum.implementation.models.OperationListResult":"Azure.ResourceManager.CommonTypes.OperationListResult","com.azure.resourcemanager.quantum.implementation.models.QuantumSuiteOfferListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.quantum.implementation.models.QuantumWorkspaceListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.quantum.models.ActionType":"Azure.ResourceManager.CommonTypes.ActionType","com.azure.resourcemanager.quantum.models.ApiKey":"Microsoft.Quantum.ApiKey","com.azure.resourcemanager.quantum.models.ApiKeys":"Microsoft.Quantum.ApiKeys","com.azure.resourcemanager.quantum.models.CheckNameAvailabilityParameters":"Azure.ResourceManager.CommonTypes.CheckNameAvailabilityRequest","com.azure.resourcemanager.quantum.models.CheckNameAvailabilityReason":"Azure.ResourceManager.CommonTypes.CheckNameAvailabilityReason","com.azure.resourcemanager.quantum.models.KeyType":"Microsoft.Quantum.KeyType","com.azure.resourcemanager.quantum.models.ManagedOnBehalfOfConfiguration":"Azure.ResourceManager.CommonTypes.ManagedOnBehalfOfConfiguration","com.azure.resourcemanager.quantum.models.ManagedServiceIdentity":"Azure.ResourceManager.CommonTypes.ManagedServiceIdentity","com.azure.resourcemanager.quantum.models.ManagedServiceIdentityType":"Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType","com.azure.resourcemanager.quantum.models.MoboBrokerResource":"Azure.ResourceManager.CommonTypes.MoboBrokerResource","com.azure.resourcemanager.quantum.models.OperationDisplay":"Azure.ResourceManager.CommonTypes.OperationDisplay","com.azure.resourcemanager.quantum.models.Origin":"Azure.ResourceManager.CommonTypes.Origin","com.azure.resourcemanager.quantum.models.PricingDetail":"Microsoft.Quantum.PricingDetail","com.azure.resourcemanager.quantum.models.PricingDimension":"Microsoft.Quantum.PricingDimension","com.azure.resourcemanager.quantum.models.Provider":"Microsoft.Quantum.Provider","com.azure.resourcemanager.quantum.models.ProviderProperties":"Microsoft.Quantum.ProviderProperties","com.azure.resourcemanager.quantum.models.ProviderPropertiesAad":"Microsoft.Quantum.ProviderPropertiesAad","com.azure.resourcemanager.quantum.models.ProviderPropertiesManagedApplication":"Microsoft.Quantum.ProviderPropertiesManagedApplication","com.azure.resourcemanager.quantum.models.ProvisioningStatus":"Microsoft.Quantum.WorkspaceProvisioningStatus","com.azure.resourcemanager.quantum.models.QuantumSuiteOfferProperties":"Microsoft.Quantum.QuantumSuiteOfferProperties","com.azure.resourcemanager.quantum.models.QuantumWorkspaceTagsUpdate":"Azure.ResourceManager.Foundations.TagsUpdateModel","com.azure.resourcemanager.quantum.models.QuotaAllocations":"Microsoft.Quantum.QuotaAllocations","com.azure.resourcemanager.quantum.models.QuotaDimension":"Microsoft.Quantum.QuotaDimension","com.azure.resourcemanager.quantum.models.SkuDescription":"Microsoft.Quantum.SkuDescription","com.azure.resourcemanager.quantum.models.Status":"Microsoft.Quantum.ProviderStatus","com.azure.resourcemanager.quantum.models.TargetDescription":"Microsoft.Quantum.TargetDescription","com.azure.resourcemanager.quantum.models.UsableStatus":"Microsoft.Quantum.UsableStatus","com.azure.resourcemanager.quantum.models.UserAssignedIdentity":"Azure.ResourceManager.CommonTypes.UserAssignedIdentity","com.azure.resourcemanager.quantum.models.WorkspaceKind":"Microsoft.Quantum.WorkspaceKind","com.azure.resourcemanager.quantum.models.WorkspaceResourceProperties":"Microsoft.Quantum.WorkspaceResourceProperties"},"generatedFiles":["src/main/java/com/azure/resourcemanager/quantum/AzureQuantumManager.java","src/main/java/com/azure/resourcemanager/quantum/fluent/AzureQuantumManagementClient.java","src/main/java/com/azure/resourcemanager/quantum/fluent/OfferingsClient.java","src/main/java/com/azure/resourcemanager/quantum/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/quantum/fluent/SuiteOffersClient.java","src/main/java/com/azure/resourcemanager/quantum/fluent/WorkspaceOperationsClient.java","src/main/java/com/azure/resourcemanager/quantum/fluent/WorkspacesClient.java","src/main/java/com/azure/resourcemanager/quantum/fluent/models/CheckNameAvailabilityResultInner.java","src/main/java/com/azure/resourcemanager/quantum/fluent/models/ListKeysResultInner.java","src/main/java/com/azure/resourcemanager/quantum/fluent/models/OperationInner.java","src/main/java/com/azure/resourcemanager/quantum/fluent/models/ProviderDescriptionInner.java","src/main/java/com/azure/resourcemanager/quantum/fluent/models/QuantumSuiteOfferInner.java","src/main/java/com/azure/resourcemanager/quantum/fluent/models/QuantumWorkspaceInner.java","src/main/java/com/azure/resourcemanager/quantum/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/quantum/fluent/package-info.java","src/main/java/com/azure/resourcemanager/quantum/implementation/AzureQuantumManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/quantum/implementation/AzureQuantumManagementClientImpl.java","src/main/java/com/azure/resourcemanager/quantum/implementation/CheckNameAvailabilityResultImpl.java","src/main/java/com/azure/resourcemanager/quantum/implementation/ListKeysResultImpl.java","src/main/java/com/azure/resourcemanager/quantum/implementation/OfferingsClientImpl.java","src/main/java/com/azure/resourcemanager/quantum/implementation/OfferingsImpl.java","src/main/java/com/azure/resourcemanager/quantum/implementation/OperationImpl.java","src/main/java/com/azure/resourcemanager/quantum/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/quantum/implementation/OperationsImpl.java","src/main/java/com/azure/resourcemanager/quantum/implementation/ProviderDescriptionImpl.java","src/main/java/com/azure/resourcemanager/quantum/implementation/QuantumSuiteOfferImpl.java","src/main/java/com/azure/resourcemanager/quantum/implementation/QuantumWorkspaceImpl.java","src/main/java/com/azure/resourcemanager/quantum/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/quantum/implementation/SuiteOffersClientImpl.java","src/main/java/com/azure/resourcemanager/quantum/implementation/SuiteOffersImpl.java","src/main/java/com/azure/resourcemanager/quantum/implementation/WorkspaceOperationsClientImpl.java","src/main/java/com/azure/resourcemanager/quantum/implementation/WorkspaceOperationsImpl.java","src/main/java/com/azure/resourcemanager/quantum/implementation/WorkspacesClientImpl.java","src/main/java/com/azure/resourcemanager/quantum/implementation/WorkspacesImpl.java","src/main/java/com/azure/resourcemanager/quantum/implementation/models/OfferingsListResult.java","src/main/java/com/azure/resourcemanager/quantum/implementation/models/OperationListResult.java","src/main/java/com/azure/resourcemanager/quantum/implementation/models/QuantumSuiteOfferListResult.java","src/main/java/com/azure/resourcemanager/quantum/implementation/models/QuantumWorkspaceListResult.java","src/main/java/com/azure/resourcemanager/quantum/implementation/package-info.java","src/main/java/com/azure/resourcemanager/quantum/models/ActionType.java","src/main/java/com/azure/resourcemanager/quantum/models/ApiKey.java","src/main/java/com/azure/resourcemanager/quantum/models/ApiKeys.java","src/main/java/com/azure/resourcemanager/quantum/models/CheckNameAvailabilityParameters.java","src/main/java/com/azure/resourcemanager/quantum/models/CheckNameAvailabilityReason.java","src/main/java/com/azure/resourcemanager/quantum/models/CheckNameAvailabilityResult.java","src/main/java/com/azure/resourcemanager/quantum/models/KeyType.java","src/main/java/com/azure/resourcemanager/quantum/models/ListKeysResult.java","src/main/java/com/azure/resourcemanager/quantum/models/ManagedOnBehalfOfConfiguration.java","src/main/java/com/azure/resourcemanager/quantum/models/ManagedServiceIdentity.java","src/main/java/com/azure/resourcemanager/quantum/models/ManagedServiceIdentityType.java","src/main/java/com/azure/resourcemanager/quantum/models/MoboBrokerResource.java","src/main/java/com/azure/resourcemanager/quantum/models/Offerings.java","src/main/java/com/azure/resourcemanager/quantum/models/Operation.java","src/main/java/com/azure/resourcemanager/quantum/models/OperationDisplay.java","src/main/java/com/azure/resourcemanager/quantum/models/Operations.java","src/main/java/com/azure/resourcemanager/quantum/models/Origin.java","src/main/java/com/azure/resourcemanager/quantum/models/PricingDetail.java","src/main/java/com/azure/resourcemanager/quantum/models/PricingDimension.java","src/main/java/com/azure/resourcemanager/quantum/models/Provider.java","src/main/java/com/azure/resourcemanager/quantum/models/ProviderDescription.java","src/main/java/com/azure/resourcemanager/quantum/models/ProviderProperties.java","src/main/java/com/azure/resourcemanager/quantum/models/ProviderPropertiesAad.java","src/main/java/com/azure/resourcemanager/quantum/models/ProviderPropertiesManagedApplication.java","src/main/java/com/azure/resourcemanager/quantum/models/ProvisioningStatus.java","src/main/java/com/azure/resourcemanager/quantum/models/QuantumSuiteOffer.java","src/main/java/com/azure/resourcemanager/quantum/models/QuantumSuiteOfferProperties.java","src/main/java/com/azure/resourcemanager/quantum/models/QuantumWorkspace.java","src/main/java/com/azure/resourcemanager/quantum/models/QuantumWorkspaceTagsUpdate.java","src/main/java/com/azure/resourcemanager/quantum/models/QuotaAllocations.java","src/main/java/com/azure/resourcemanager/quantum/models/QuotaDimension.java","src/main/java/com/azure/resourcemanager/quantum/models/SkuDescription.java","src/main/java/com/azure/resourcemanager/quantum/models/Status.java","src/main/java/com/azure/resourcemanager/quantum/models/SuiteOffers.java","src/main/java/com/azure/resourcemanager/quantum/models/TargetDescription.java","src/main/java/com/azure/resourcemanager/quantum/models/UsableStatus.java","src/main/java/com/azure/resourcemanager/quantum/models/UserAssignedIdentity.java","src/main/java/com/azure/resourcemanager/quantum/models/WorkspaceKind.java","src/main/java/com/azure/resourcemanager/quantum/models/WorkspaceOperations.java","src/main/java/com/azure/resourcemanager/quantum/models/WorkspaceResourceProperties.java","src/main/java/com/azure/resourcemanager/quantum/models/Workspaces.java","src/main/java/com/azure/resourcemanager/quantum/models/package-info.java","src/main/java/com/azure/resourcemanager/quantum/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-quantum/proxy-config.json b/sdk/quantum/azure-resourcemanager-quantum/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-quantum/proxy-config.json index cf8dc1af1df9..91811c256621 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-quantum/proxy-config.json +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-quantum/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.quantum.implementation.OfferingsClientImpl$OfferingsService"],["com.azure.resourcemanager.quantum.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.quantum.implementation.WorkspaceOperationsClientImpl$WorkspaceOperationsService"],["com.azure.resourcemanager.quantum.implementation.WorkspacesClientImpl$WorkspacesService"]] \ No newline at end of file +[["com.azure.resourcemanager.quantum.implementation.OfferingsClientImpl$OfferingsService"],["com.azure.resourcemanager.quantum.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.quantum.implementation.SuiteOffersClientImpl$SuiteOffersService"],["com.azure.resourcemanager.quantum.implementation.WorkspaceOperationsClientImpl$WorkspaceOperationsService"],["com.azure.resourcemanager.quantum.implementation.WorkspacesClientImpl$WorkspacesService"]] \ No newline at end of file diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/main/resources/azure-resourcemanager-quantum.properties b/sdk/quantum/azure-resourcemanager-quantum/src/main/resources/azure-resourcemanager-quantum.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/quantum/azure-resourcemanager-quantum/src/main/resources/azure-resourcemanager-quantum.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/OfferingsListSamples.java b/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/OfferingsListSamples.java index 6e8f743dfbda..9b0e084d7bc5 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/OfferingsListSamples.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/OfferingsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.generated; @@ -9,15 +9,14 @@ */ public final class OfferingsListSamples { /* - * x-ms-original-file: - * specification/quantum/resource-manager/Microsoft.Quantum/preview/2023-11-13-preview/examples/offeringsList.json + * x-ms-original-file: 2025-12-15-preview/Offerings_List.json */ /** - * Sample code: OfferingsList. + * Sample code: Offerings_List. * * @param manager Entry point to AzureQuantumManager. */ public static void offeringsList(com.azure.resourcemanager.quantum.AzureQuantumManager manager) { - manager.offerings().list("westus2", com.azure.core.util.Context.NONE); + manager.offerings().list("westus2", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/OperationsListSamples.java b/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/OperationsListSamples.java index d25909608e0a..77b23f060f49 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/OperationsListSamples.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/OperationsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.generated; @@ -9,15 +9,14 @@ */ public final class OperationsListSamples { /* - * x-ms-original-file: - * specification/quantum/resource-manager/Microsoft.Quantum/preview/2023-11-13-preview/examples/operations.json + * x-ms-original-file: 2025-12-15-preview/Operations_List.json */ /** - * Sample code: Operations. + * Sample code: Operations_List. * * @param manager Entry point to AzureQuantumManager. */ - public static void operations(com.azure.resourcemanager.quantum.AzureQuantumManager manager) { + public static void operationsList(com.azure.resourcemanager.quantum.AzureQuantumManager manager) { manager.operations().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/SuiteOffersListSamples.java b/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/SuiteOffersListSamples.java new file mode 100644 index 000000000000..de588ee116fe --- /dev/null +++ b/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/SuiteOffersListSamples.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.quantum.generated; + +/** + * Samples for SuiteOffers List. + */ +public final class SuiteOffersListSamples { + /* + * x-ms-original-file: 2025-12-15-preview/SuiteOffers_ListBySubscription.json + */ + /** + * Sample code: SuiteOffers_ListBySubscription. + * + * @param manager Entry point to AzureQuantumManager. + */ + public static void suiteOffersListBySubscription(com.azure.resourcemanager.quantum.AzureQuantumManager manager) { + manager.suiteOffers().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/WorkspaceOperationCheckNameAvailabilitySamples.java b/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/WorkspaceOperationCheckNameAvailabilitySamples.java deleted file mode 100644 index f0db9a24af69..000000000000 --- a/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/WorkspaceOperationCheckNameAvailabilitySamples.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.quantum.generated; - -import com.azure.resourcemanager.quantum.models.CheckNameAvailabilityParameters; - -/** - * Samples for WorkspaceOperation CheckNameAvailability. - */ -public final class WorkspaceOperationCheckNameAvailabilitySamples { - /* - * x-ms-original-file: specification/quantum/resource-manager/Microsoft.Quantum/preview/2023-11-13-preview/examples/ - * quantumWorkspacesCheckNameAvailability.json - */ - /** - * Sample code: QuantumWorkspacesCheckNameAvailability. - * - * @param manager Entry point to AzureQuantumManager. - */ - public static void - quantumWorkspacesCheckNameAvailability(com.azure.resourcemanager.quantum.AzureQuantumManager manager) { - manager.workspaceOperations() - .checkNameAvailabilityWithResponse("westus2", - new CheckNameAvailabilityParameters().withName("sample-workspace-name") - .withType("Microsoft.Quantum/Workspaces"), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/WorkspaceOperationListKeysSamples.java b/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/WorkspaceOperationListKeysSamples.java deleted file mode 100644 index 639f2708f6ba..000000000000 --- a/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/WorkspaceOperationListKeysSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.quantum.generated; - -/** - * Samples for WorkspaceOperation ListKeys. - */ -public final class WorkspaceOperationListKeysSamples { - /* - * x-ms-original-file: - * specification/quantum/resource-manager/Microsoft.Quantum/preview/2023-11-13-preview/examples/listKeys.json - */ - /** - * Sample code: ListKeys. - * - * @param manager Entry point to AzureQuantumManager. - */ - public static void listKeys(com.azure.resourcemanager.quantum.AzureQuantumManager manager) { - manager.workspaceOperations() - .listKeysWithResponse("quantumResourcegroup", "quantumworkspace1", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/WorkspaceOperationRegenerateKeysSamples.java b/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/WorkspaceOperationRegenerateKeysSamples.java deleted file mode 100644 index 9c9aa348468c..000000000000 --- a/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/WorkspaceOperationRegenerateKeysSamples.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.quantum.generated; - -import com.azure.resourcemanager.quantum.models.ApiKeys; -import com.azure.resourcemanager.quantum.models.KeyType; -import java.util.Arrays; - -/** - * Samples for WorkspaceOperation RegenerateKeys. - */ -public final class WorkspaceOperationRegenerateKeysSamples { - /* - * x-ms-original-file: - * specification/quantum/resource-manager/Microsoft.Quantum/preview/2023-11-13-preview/examples/regenerateKey.json - */ - /** - * Sample code: RegenerateKey. - * - * @param manager Entry point to AzureQuantumManager. - */ - public static void regenerateKey(com.azure.resourcemanager.quantum.AzureQuantumManager manager) { - manager.workspaceOperations() - .regenerateKeysWithResponse("quantumResourcegroup", "quantumworkspace1", - new ApiKeys().withKeys(Arrays.asList(KeyType.PRIMARY, KeyType.SECONDARY)), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/WorkspacesCreateOrUpdateSamples.java b/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/WorkspacesCreateOrUpdateSamples.java index f5128363c563..5db44d8e853f 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/WorkspacesCreateOrUpdateSamples.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/WorkspacesCreateOrUpdateSamples.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.generated; import com.azure.resourcemanager.quantum.models.Provider; +import com.azure.resourcemanager.quantum.models.QuotaAllocations; import com.azure.resourcemanager.quantum.models.WorkspaceResourceProperties; import java.util.Arrays; @@ -13,26 +14,31 @@ */ public final class WorkspacesCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/quantum/resource-manager/Microsoft.Quantum/preview/2023-11-13-preview/examples/quantumWorkspacesPut - * .json + * x-ms-original-file: 2025-12-15-preview/Workspaces_CreateOrUpdate.json */ /** - * Sample code: QuantumWorkspacesPut. + * Sample code: Workspaces_CreateOrUpdate. * * @param manager Entry point to AzureQuantumManager. */ - public static void quantumWorkspacesPut(com.azure.resourcemanager.quantum.AzureQuantumManager manager) { + public static void workspacesCreateOrUpdate(com.azure.resourcemanager.quantum.AzureQuantumManager manager) { manager.workspaces() .define("quantumworkspace1") .withRegion("West US") .withExistingResourceGroup("quantumResourcegroup") - .withProperties(new WorkspaceResourceProperties() - .withProviders(Arrays.asList(new Provider().withProviderId("Honeywell").withProviderSku("Basic"), - new Provider().withProviderId("IonQ").withProviderSku("Basic"), - new Provider().withProviderId("OneQBit").withProviderSku("Basic"))) - .withStorageAccount( - "/subscriptions/1C4B2828-7D49-494F-933D-061373BE28C2/resourceGroups/quantumResourcegroup/providers/Microsoft.Storage/storageAccounts/testStorageAccount")) + .withProperties( + new WorkspaceResourceProperties() + .withProviders( + Arrays.asList(new Provider().withProviderId("Honeywell").withProviderSku("Basic"), + new Provider().withProviderId("IonQ").withProviderSku("Basic"), + new Provider().withProviderId("OneQBit").withProviderSku("Basic"), + new Provider().withProviderId("suiteProvider") + .withProviderSku("Basic") + .withQuotas(new QuotaAllocations() + .withStandardMinutesLifetime(500) + .withHighMinutesLifetime(50)))) + .withStorageAccount( + "/subscriptions/1C4B2828-7D49-494F-933D-061373BE28C2/resourceGroups/quantumResourcegroup/providers/Microsoft.Storage/storageAccounts/testStorageAccount")) .create(); } } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/WorkspacesDeleteSamples.java b/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/WorkspacesDeleteSamples.java index 269930594804..9cce650b954a 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/WorkspacesDeleteSamples.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/WorkspacesDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.generated; @@ -9,15 +9,14 @@ */ public final class WorkspacesDeleteSamples { /* - * x-ms-original-file: specification/quantum/resource-manager/Microsoft.Quantum/preview/2023-11-13-preview/examples/ - * quantumWorkspacesDelete.json + * x-ms-original-file: 2025-12-15-preview/Workspaces_Delete.json */ /** - * Sample code: QuantumWorkspacesDelete. + * Sample code: Workspaces_Delete. * * @param manager Entry point to AzureQuantumManager. */ - public static void quantumWorkspacesDelete(com.azure.resourcemanager.quantum.AzureQuantumManager manager) { + public static void workspacesDelete(com.azure.resourcemanager.quantum.AzureQuantumManager manager) { manager.workspaces().delete("quantumResourcegroup", "quantumworkspace1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/WorkspacesGetByResourceGroupSamples.java b/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/WorkspacesGetByResourceGroupSamples.java index b219188e7dd4..1047d4ac3132 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/WorkspacesGetByResourceGroupSamples.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/WorkspacesGetByResourceGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.generated; @@ -9,16 +9,14 @@ */ public final class WorkspacesGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/quantum/resource-manager/Microsoft.Quantum/preview/2023-11-13-preview/examples/quantumWorkspacesGet - * .json + * x-ms-original-file: 2025-12-15-preview/Workspaces_Get.json */ /** - * Sample code: QuantumWorkspacesGet. + * Sample code: Workspaces_Get. * * @param manager Entry point to AzureQuantumManager. */ - public static void quantumWorkspacesGet(com.azure.resourcemanager.quantum.AzureQuantumManager manager) { + public static void workspacesGet(com.azure.resourcemanager.quantum.AzureQuantumManager manager) { manager.workspaces() .getByResourceGroupWithResponse("quantumResourcegroup", "quantumworkspace1", com.azure.core.util.Context.NONE); diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/WorkspacesListByResourceGroupSamples.java b/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/WorkspacesListByResourceGroupSamples.java index dac33d4a44fe..87e0b36b21b8 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/WorkspacesListByResourceGroupSamples.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/WorkspacesListByResourceGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.generated; @@ -9,16 +9,14 @@ */ public final class WorkspacesListByResourceGroupSamples { /* - * x-ms-original-file: specification/quantum/resource-manager/Microsoft.Quantum/preview/2023-11-13-preview/examples/ - * quantumWorkspacesListResourceGroup.json + * x-ms-original-file: 2025-12-15-preview/Workspaces_ListByResourceGroup.json */ /** - * Sample code: QuantumWorkspacesListByResourceGroup. + * Sample code: Workspaces_ListByResourceGroup. * * @param manager Entry point to AzureQuantumManager. */ - public static void - quantumWorkspacesListByResourceGroup(com.azure.resourcemanager.quantum.AzureQuantumManager manager) { + public static void workspacesListByResourceGroup(com.azure.resourcemanager.quantum.AzureQuantumManager manager) { manager.workspaces().listByResourceGroup("quantumResourcegroup", com.azure.core.util.Context.NONE); } } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/WorkspacesListSamples.java b/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/WorkspacesListSamples.java index 7edde7c5bd46..d265be2b723a 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/WorkspacesListSamples.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/WorkspacesListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.generated; @@ -9,16 +9,14 @@ */ public final class WorkspacesListSamples { /* - * x-ms-original-file: specification/quantum/resource-manager/Microsoft.Quantum/preview/2023-11-13-preview/examples/ - * quantumWorkspacesListSubscription.json + * x-ms-original-file: 2025-12-15-preview/Workspaces_ListBySubscription.json */ /** - * Sample code: QuantumWorkspacesListBySubscription. + * Sample code: Workspaces_ListBySubscription. * * @param manager Entry point to AzureQuantumManager. */ - public static void - quantumWorkspacesListBySubscription(com.azure.resourcemanager.quantum.AzureQuantumManager manager) { + public static void workspacesListBySubscription(com.azure.resourcemanager.quantum.AzureQuantumManager manager) { manager.workspaces().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/WorkspacesUpdateTagsSamples.java b/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/WorkspacesUpdateTagsSamples.java index 8e661a320962..18a3f657323e 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/WorkspacesUpdateTagsSamples.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/samples/java/com/azure/resourcemanager/quantum/generated/WorkspacesUpdateTagsSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.generated; @@ -13,15 +13,14 @@ */ public final class WorkspacesUpdateTagsSamples { /* - * x-ms-original-file: specification/quantum/resource-manager/Microsoft.Quantum/preview/2023-11-13-preview/examples/ - * quantumWorkspacesPatch.json + * x-ms-original-file: 2025-12-15-preview/Workspaces_UpdateTags.json */ /** - * Sample code: QuantumWorkspacesPatchTags. + * Sample code: Workspaces_UpdateTags. * * @param manager Entry point to AzureQuantumManager. */ - public static void quantumWorkspacesPatchTags(com.azure.resourcemanager.quantum.AzureQuantumManager manager) { + public static void workspacesUpdateTags(com.azure.resourcemanager.quantum.AzureQuantumManager manager) { QuantumWorkspace resource = manager.workspaces() .getByResourceGroupWithResponse("quantumResourcegroup", "quantumworkspace1", com.azure.core.util.Context.NONE) diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/CheckNameAvailabilityParametersTests.java b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/CheckNameAvailabilityParametersTests.java index bc892bb03b5a..701c4a0e2d59 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/CheckNameAvailabilityParametersTests.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/CheckNameAvailabilityParametersTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.generated; @@ -12,18 +12,18 @@ public final class CheckNameAvailabilityParametersTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CheckNameAvailabilityParameters model - = BinaryData.fromString("{\"name\":\"bttdumorppxe\",\"type\":\"nzbtbhj\"}") + = BinaryData.fromString("{\"name\":\"kszzcmrvexztv\",\"type\":\"qgsfraoyzkoow\"}") .toObject(CheckNameAvailabilityParameters.class); - Assertions.assertEquals("bttdumorppxe", model.name()); - Assertions.assertEquals("nzbtbhj", model.type()); + Assertions.assertEquals("kszzcmrvexztv", model.name()); + Assertions.assertEquals("qgsfraoyzkoow", model.type()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { CheckNameAvailabilityParameters model - = new CheckNameAvailabilityParameters().withName("bttdumorppxe").withType("nzbtbhj"); + = new CheckNameAvailabilityParameters().withName("kszzcmrvexztv").withType("qgsfraoyzkoow"); model = BinaryData.fromObject(model).toObject(CheckNameAvailabilityParameters.class); - Assertions.assertEquals("bttdumorppxe", model.name()); - Assertions.assertEquals("nzbtbhj", model.type()); + Assertions.assertEquals("kszzcmrvexztv", model.name()); + Assertions.assertEquals("qgsfraoyzkoow", model.type()); } } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/CheckNameAvailabilityResultInnerTests.java b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/CheckNameAvailabilityResultInnerTests.java index 57978289100b..8427d6d5539d 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/CheckNameAvailabilityResultInnerTests.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/CheckNameAvailabilityResultInnerTests.java @@ -1,29 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.quantum.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.quantum.models.CheckNameAvailabilityReason; import org.junit.jupiter.api.Assertions; public final class CheckNameAvailabilityResultInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CheckNameAvailabilityResultInner model = BinaryData - .fromString("{\"nameAvailable\":false,\"reason\":\"fgohdneuelfphs\",\"message\":\"htozfikdow\"}") + .fromString("{\"nameAvailable\":true,\"reason\":\"AlreadyExists\",\"message\":\"xawqaldsyuuxim\"}") .toObject(CheckNameAvailabilityResultInner.class); - Assertions.assertEquals(false, model.nameAvailable()); - Assertions.assertEquals("fgohdneuelfphs", model.reason()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CheckNameAvailabilityResultInner model - = new CheckNameAvailabilityResultInner().withNameAvailable(false).withReason("fgohdneuelfphs"); - model = BinaryData.fromObject(model).toObject(CheckNameAvailabilityResultInner.class); - Assertions.assertEquals(false, model.nameAvailable()); - Assertions.assertEquals("fgohdneuelfphs", model.reason()); + Assertions.assertTrue(model.nameAvailable()); + Assertions.assertEquals(CheckNameAvailabilityReason.ALREADY_EXISTS, model.reason()); + Assertions.assertEquals("xawqaldsyuuxim", model.message()); } } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/ManagedOnBehalfOfConfigurationTests.java b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/ManagedOnBehalfOfConfigurationTests.java new file mode 100644 index 000000000000..b862a1887e85 --- /dev/null +++ b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/ManagedOnBehalfOfConfigurationTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quantum.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.quantum.models.ManagedOnBehalfOfConfiguration; + +public final class ManagedOnBehalfOfConfigurationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedOnBehalfOfConfiguration model = BinaryData.fromString( + "{\"moboBrokerResources\":[{\"id\":\"tmrldhugjzzdatq\"},{\"id\":\"oc\"},{\"id\":\"eablg\"},{\"id\":\"uticndvkaozwyif\"}]}") + .toObject(ManagedOnBehalfOfConfiguration.class); + } +} diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/ManagedServiceIdentityTests.java b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/ManagedServiceIdentityTests.java new file mode 100644 index 000000000000..0e0567826734 --- /dev/null +++ b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/ManagedServiceIdentityTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quantum.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.quantum.models.ManagedServiceIdentity; +import com.azure.resourcemanager.quantum.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.quantum.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class ManagedServiceIdentityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedServiceIdentity model = BinaryData.fromString( + "{\"principalId\":\"okftyxolniwpwcuk\",\"tenantId\":\"kgiawxklryplwck\",\"type\":\"None\",\"userAssignedIdentities\":{\"gfgibm\":{\"principalId\":\"pnddhsgcbacphejk\",\"clientId\":\"ynqgoulzndlikwyq\"},\"ouf\":{\"principalId\":\"gakeqsr\",\"clientId\":\"bzqqedqytbciq\"},\"mutduqktaps\":{\"principalId\":\"mnkzsmod\",\"clientId\":\"lougpbkw\"},\"bbjfddgmbmbexp\":{\"principalId\":\"gcue\",\"clientId\":\"umkdosvqwhbmd\"}}}") + .toObject(ManagedServiceIdentity.class); + Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedServiceIdentity model = new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf("gfgibm", new UserAssignedIdentity(), "ouf", new UserAssignedIdentity(), + "mutduqktaps", new UserAssignedIdentity(), "bbjfddgmbmbexp", new UserAssignedIdentity())); + model = BinaryData.fromObject(model).toObject(ManagedServiceIdentity.class); + Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.type()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/MoboBrokerResourceTests.java b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/MoboBrokerResourceTests.java new file mode 100644 index 000000000000..ab5d5c398e1f --- /dev/null +++ b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/MoboBrokerResourceTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quantum.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.quantum.models.MoboBrokerResource; +import org.junit.jupiter.api.Assertions; + +public final class MoboBrokerResourceTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MoboBrokerResource model = BinaryData.fromString("{\"id\":\"hxh\"}").toObject(MoboBrokerResource.class); + Assertions.assertEquals("hxh", model.id()); + } +} diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/OfferingsListMockTests.java b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/OfferingsListMockTests.java index 0331f65d8e19..13a420cdd2e3 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/OfferingsListMockTests.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/OfferingsListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.quantum.AzureQuantumManager; import com.azure.resourcemanager.quantum.models.ProviderDescription; @@ -22,44 +22,46 @@ public final class OfferingsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"id\":\"bnnhadoocrkvcik\",\"name\":\"vpa\",\"properties\":{\"description\":\"x\",\"providerType\":\"u\",\"company\":\"ik\",\"defaultEndpoint\":\"ggxkallatmelwuip\",\"aad\":{\"applicationId\":\"jzkzi\",\"tenantId\":\"vvcnayr\"},\"managedApplication\":{\"publisherId\":\"nxxmueedndrdv\",\"offerId\":\"kwqqtchealmf\"},\"targets\":[{\"id\":\"aygdvwvgpioh\",\"name\":\"xrtfudxep\",\"description\":\"yqagvrvm\",\"acceptedDataFormats\":[\"ukghimdblxgw\"],\"acceptedContentEncodings\":[\"njhf\",\"xw\",\"szkkfoqre\",\"fkzikfj\"]}],\"skus\":[{\"id\":\"a\",\"name\":\"xwczelpcire\",\"version\":\"feaenwab\",\"description\":\"tkl\",\"restrictedAccessUri\":\"xbjhwuaanozjosph\",\"autoAdd\":false,\"targets\":[\"jrvxaglrv\",\"mjwosytx\"],\"quotaDimensions\":[{},{},{},{}],\"pricingDetails\":[{},{}]}],\"quotaDimensions\":[{\"id\":\"tq\",\"scope\":\"iekkezz\",\"period\":\"hlyfjhdgqgg\",\"quota\":29.760027,\"name\":\"nyga\",\"description\":\"idb\",\"unit\":\"atpxl\",\"unitPlural\":\"xcyjmoadsuvarmy\"},{\"id\":\"mjsjqb\",\"scope\":\"hyxxrwlycoduhpk\",\"period\":\"gymare\",\"quota\":23.266273,\"name\":\"xqugjhkycubedd\",\"description\":\"sofwqmzqalkrmnji\",\"unit\":\"xacqqudfnbyx\",\"unitPlural\":\"aabjyvayffimrz\"},{\"id\":\"uzqogsexnevf\",\"scope\":\"wnwmewzs\",\"period\":\"ceuzsoibjudpfr\",\"quota\":98.30812,\"name\":\"hzv\",\"description\":\"tdwkqbrq\",\"unit\":\"paxh\",\"unitPlural\":\"iilivpdtiirqtd\"},{\"id\":\"axoruzfgsquy\",\"scope\":\"rxxle\",\"period\":\"ramxjezwlwnw\",\"quota\":41.191147,\"name\":\"cvydypatdoo\",\"description\":\"jkniodko\",\"unit\":\"bw\",\"unitPlural\":\"jhemms\"}],\"pricingDimensions\":[{\"id\":\"c\",\"name\":\"dtjinfw\"},{\"id\":\"fltkacjv\",\"name\":\"kdlfoa\"}]}}]}"; + = "{\"value\":[{\"id\":\"feo\",\"name\":\"rqwky\",\"properties\":{\"description\":\"bopgxedkowepbqp\",\"providerType\":\"fkbw\",\"company\":\"snjvcdwxlpqekftn\",\"defaultEndpoint\":\"tjsyin\",\"aad\":{\"applicationId\":\"qatmtdhtmdvy\",\"tenantId\":\"ikdgszywkbir\"},\"managedApplication\":{\"publisherId\":\"zh\",\"offerId\":\"kj\"},\"targets\":[{\"id\":\"qqaatjinrvgou\",\"name\":\"fiibfggjioolvr\",\"description\":\"kvtkkg\",\"acceptedDataFormats\":[\"wjygvjayvblmhvk\",\"uhbxvvy\"],\"acceptedContentEncodings\":[\"opbyrqufegxu\"],\"numQubits\":950135360,\"targetProfile\":\"bnhlmc\",\"metadata\":{\"itvgbmhrixkwm\":\"\\\"datadn\\\"\"}},{\"id\":\"jejveg\",\"name\":\"bpnaixexccbdre\",\"description\":\"hcexdrrvqa\",\"acceptedDataFormats\":[\"ghtpw\",\"jnhyjsvf\",\"cxzbfvoowvr\"],\"acceptedContentEncodings\":[\"gjqppy\"],\"numQubits\":768184156,\"targetProfile\":\"on\",\"metadata\":{\"ekrrjr\":\"\\\"datahgfipnsxkmcw\\\"\",\"jglikkxwslolb\":\"\\\"dataafxtsgum\\\"\",\"elfk\":\"\\\"datapvuzlmv\\\"\"}}],\"skus\":[{\"id\":\"crpw\",\"name\":\"eznoig\",\"version\":\"njwmwkpnbsazejj\",\"description\":\"kagfhsxtt\",\"restrictedAccessUri\":\"gzxnfaazpxdtnk\",\"autoAdd\":true,\"targets\":[\"jlwuenvrkp\"],\"quotaDimensions\":[{},{},{},{}],\"pricingDetails\":[{},{}]},{\"id\":\"rebqaaysjk\",\"name\":\"qtnqtt\",\"version\":\"lwfffi\",\"description\":\"pjpqqmtedltmmji\",\"restrictedAccessUri\":\"eozphv\",\"autoAdd\":true,\"targets\":[\"ncyg\",\"p\",\"vipmdscwxqupevzh\"],\"quotaDimensions\":[{},{},{}],\"pricingDetails\":[{},{}]},{\"id\":\"hojujbypelmcuv\",\"name\":\"xbjxyfwnylrcools\",\"version\":\"p\",\"description\":\"w\",\"restrictedAccessUri\":\"bnujrywvtylbf\",\"autoAdd\":true,\"targets\":[\"doiwi\"],\"quotaDimensions\":[{},{},{},{}],\"pricingDetails\":[{}]},{\"id\":\"ubxcbihw\",\"name\":\"nfdn\",\"version\":\"jchrdgoihxumw\",\"description\":\"ond\",\"restrictedAccessUri\":\"luudfdlwggytsb\",\"autoAdd\":true,\"targets\":[\"tgseinqfiufxqkn\",\"irgne\"],\"quotaDimensions\":[{},{},{},{}],\"pricingDetails\":[{},{},{},{}]}],\"quotaDimensions\":[{\"id\":\"iffcdmqnrojlpijn\",\"scope\":\"xfrdd\",\"period\":\"ratiz\",\"quota\":52.32599,\"name\":\"asxifto\",\"description\":\"yzhftwesgogczh\",\"unit\":\"nxkrlgnyhmossxkk\",\"unitPlural\":\"h\"},{\"id\":\"gh\",\"scope\":\"bdhqxvcxgf\",\"period\":\"dsofbshrns\",\"quota\":30.974007,\"name\":\"wdvzyy\",\"description\":\"cnunvjsr\",\"unit\":\"f\",\"unitPlural\":\"nopqgikyzirtx\"}],\"pricingDimensions\":[{\"id\":\"zejntps\",\"name\":\"gioilqu\"},{\"id\":\"ydxtqm\",\"name\":\"ox\"},{\"id\":\"ggufhyaomtb\",\"name\":\"havgrvk\"}]}}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AzureQuantumManager manager = AzureQuantumManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response = manager.offerings().list("jlt", com.azure.core.util.Context.NONE); + PagedIterable response + = manager.offerings().list("qxqvpsvuoymgc", "elvezrypq", com.azure.core.util.Context.NONE); - Assertions.assertEquals("bnnhadoocrkvcik", response.iterator().next().id()); - Assertions.assertEquals("aygdvwvgpioh", response.iterator().next().properties().targets().get(0).id()); - Assertions.assertEquals("xrtfudxep", response.iterator().next().properties().targets().get(0).name()); - Assertions.assertEquals("yqagvrvm", response.iterator().next().properties().targets().get(0).description()); - Assertions.assertEquals("ukghimdblxgw", + Assertions.assertEquals("feo", response.iterator().next().id()); + Assertions.assertEquals("qqaatjinrvgou", response.iterator().next().properties().targets().get(0).id()); + Assertions.assertEquals("fiibfggjioolvr", response.iterator().next().properties().targets().get(0).name()); + Assertions.assertEquals("kvtkkg", response.iterator().next().properties().targets().get(0).description()); + Assertions.assertEquals("wjygvjayvblmhvk", response.iterator().next().properties().targets().get(0).acceptedDataFormats().get(0)); - Assertions.assertEquals("njhf", + Assertions.assertEquals("opbyrqufegxu", response.iterator().next().properties().targets().get(0).acceptedContentEncodings().get(0)); - Assertions.assertEquals("a", response.iterator().next().properties().skus().get(0).id()); - Assertions.assertEquals("xwczelpcire", response.iterator().next().properties().skus().get(0).name()); - Assertions.assertEquals("feaenwab", response.iterator().next().properties().skus().get(0).version()); - Assertions.assertEquals("tkl", response.iterator().next().properties().skus().get(0).description()); - Assertions.assertEquals("xbjhwuaanozjosph", + Assertions.assertEquals("crpw", response.iterator().next().properties().skus().get(0).id()); + Assertions.assertEquals("eznoig", response.iterator().next().properties().skus().get(0).name()); + Assertions.assertEquals("njwmwkpnbsazejj", response.iterator().next().properties().skus().get(0).version()); + Assertions.assertEquals("kagfhsxtt", response.iterator().next().properties().skus().get(0).description()); + Assertions.assertEquals("gzxnfaazpxdtnk", response.iterator().next().properties().skus().get(0).restrictedAccessUri()); - Assertions.assertEquals(false, response.iterator().next().properties().skus().get(0).autoAdd()); - Assertions.assertEquals("jrvxaglrv", response.iterator().next().properties().skus().get(0).targets().get(0)); - Assertions.assertEquals("tq", response.iterator().next().properties().quotaDimensions().get(0).id()); - Assertions.assertEquals("iekkezz", response.iterator().next().properties().quotaDimensions().get(0).scope()); - Assertions.assertEquals("hlyfjhdgqgg", - response.iterator().next().properties().quotaDimensions().get(0).period()); - Assertions.assertEquals(29.760027F, response.iterator().next().properties().quotaDimensions().get(0).quota()); - Assertions.assertEquals("nyga", response.iterator().next().properties().quotaDimensions().get(0).name()); - Assertions.assertEquals("idb", response.iterator().next().properties().quotaDimensions().get(0).description()); - Assertions.assertEquals("atpxl", response.iterator().next().properties().quotaDimensions().get(0).unit()); - Assertions.assertEquals("xcyjmoadsuvarmy", - response.iterator().next().properties().quotaDimensions().get(0).unitPlural()); - Assertions.assertEquals("c", response.iterator().next().properties().pricingDimensions().get(0).id()); - Assertions.assertEquals("dtjinfw", response.iterator().next().properties().pricingDimensions().get(0).name()); + Assertions.assertTrue(response.iterator().next().properties().skus().get(0).autoAdd()); + Assertions.assertEquals("jlwuenvrkp", response.iterator().next().properties().skus().get(0).targets().get(0)); + Assertions.assertEquals("iffcdmqnrojlpijn", + response.iterator().next().properties().quotaDimensions().get(0).id()); + Assertions.assertEquals("xfrdd", response.iterator().next().properties().quotaDimensions().get(0).scope()); + Assertions.assertEquals("ratiz", response.iterator().next().properties().quotaDimensions().get(0).period()); + Assertions.assertEquals(52.32599F, response.iterator().next().properties().quotaDimensions().get(0).quota()); + Assertions.assertEquals("asxifto", response.iterator().next().properties().quotaDimensions().get(0).name()); + Assertions.assertEquals("yzhftwesgogczh", + response.iterator().next().properties().quotaDimensions().get(0).description()); + Assertions.assertEquals("nxkrlgnyhmossxkk", + response.iterator().next().properties().quotaDimensions().get(0).unit()); + Assertions.assertEquals("h", response.iterator().next().properties().quotaDimensions().get(0).unitPlural()); + Assertions.assertEquals("zejntps", response.iterator().next().properties().pricingDimensions().get(0).id()); + Assertions.assertEquals("gioilqu", response.iterator().next().properties().pricingDimensions().get(0).name()); } } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/OfferingsListResultTests.java b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/OfferingsListResultTests.java index 7facc15f7b92..21d3511b5810 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/OfferingsListResultTests.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/OfferingsListResultTests.java @@ -1,213 +1,46 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quantum.fluent.models.ProviderDescriptionInner; -import com.azure.resourcemanager.quantum.models.OfferingsListResult; -import com.azure.resourcemanager.quantum.models.PricingDetail; -import com.azure.resourcemanager.quantum.models.PricingDimension; -import com.azure.resourcemanager.quantum.models.ProviderProperties; -import com.azure.resourcemanager.quantum.models.ProviderPropertiesAad; -import com.azure.resourcemanager.quantum.models.ProviderPropertiesManagedApplication; -import com.azure.resourcemanager.quantum.models.QuotaDimension; -import com.azure.resourcemanager.quantum.models.SkuDescription; -import com.azure.resourcemanager.quantum.models.TargetDescription; -import java.util.Arrays; +import com.azure.resourcemanager.quantum.implementation.models.OfferingsListResult; import org.junit.jupiter.api.Assertions; public final class OfferingsListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OfferingsListResult model = BinaryData.fromString( - "{\"value\":[{\"id\":\"huxinpmqnj\",\"name\":\"wixjsprozvcp\",\"properties\":{\"description\":\"gjvw\",\"providerType\":\"datscmd\",\"company\":\"jhulsuuvmkjo\",\"defaultEndpoint\":\"rwfndiod\",\"aad\":{\"applicationId\":\"lwejdpv\",\"tenantId\":\"yoqpsoaccta\"},\"managedApplication\":{\"publisherId\":\"ljlahbcryf\",\"offerId\":\"fdosyg\"},\"targets\":[{\"id\":\"ojakhmsbzjhcrze\",\"name\":\"phlxa\",\"description\":\"thqt\",\"acceptedDataFormats\":[\"jbp\",\"zfsinzgvf\",\"jrwzox\"],\"acceptedContentEncodings\":[\"felluwfzitonpe\",\"fpjkjlxofp\"]},{\"id\":\"hpf\",\"name\":\"ypininm\",\"description\":\"huyb\",\"acceptedDataFormats\":[\"odepoogin\",\"vamih\"],\"acceptedContentEncodings\":[\"narxzxtheotus\",\"vyevcciqi\",\"nhungbw\"]},{\"id\":\"rnfygxgispem\",\"name\":\"zfkufubljofx\",\"description\":\"ofjaeqjhqjb\",\"acceptedDataFormats\":[\"msmjqulngsntn\"],\"acceptedContentEncodings\":[\"kzgcwrwcl\",\"xwrljdouskcqvkoc\",\"cjdkwtnhxbnjbi\"]},{\"id\":\"qrglssainqpjwn\",\"name\":\"ljfmppee\",\"description\":\"mgxsab\",\"acceptedDataFormats\":[\"duuji\",\"c\",\"czdzev\",\"dhkrwpdappdsbdk\"],\"acceptedContentEncodings\":[\"wjfeusnhutjel\",\"mrldhu\"]}],\"skus\":[{\"id\":\"datqxhocdgeabl\",\"name\":\"huticndvkao\",\"version\":\"yiftyhxhuro\",\"description\":\"tyxolniwpwc\",\"restrictedAccessUri\":\"jfkgiawxk\",\"autoAdd\":false,\"targets\":[\"wckbasyypnd\",\"hsgcbacphejkot\",\"nqgoulzndli\",\"wyqkgfgibm\"],\"quotaDimensions\":[{},{}],\"pricingDetails\":[{},{},{},{}]}],\"quotaDimensions\":[{\"id\":\"rxybz\",\"scope\":\"e\",\"period\":\"ytb\",\"quota\":19.418764,\"name\":\"ouf\",\"description\":\"mnkzsmod\",\"unit\":\"lougpbkw\",\"unitPlural\":\"utduqktapspwgcu\"},{\"id\":\"tumkdosvqwhbm\",\"scope\":\"bbjfddgmbmbexp\",\"period\":\"htqqrolfp\",\"quota\":1.6021609,\"name\":\"lgbquxig\",\"description\":\"jgzjaoyfhrtx\",\"unit\":\"n\",\"unitPlural\":\"kujysvlejuvfq\"},{\"id\":\"rlyxwjkcprbnw\",\"scope\":\"gjvtbv\",\"period\":\"sszdnru\",\"quota\":66.73355,\"name\":\"hmuouqfprwzwbn\",\"description\":\"itnwuizgazxufi\",\"unit\":\"ckyfih\",\"unitPlural\":\"idf\"}],\"pricingDimensions\":[{\"id\":\"zuhtymwisdkfthwx\",\"name\":\"t\"},{\"id\":\"waopvkmijcmmxd\",\"name\":\"fufsrpymzi\"},{\"id\":\"sezcxtb\",\"name\":\"gfycc\"}]}},{\"id\":\"ewmdw\",\"name\":\"eiachboosflnr\",\"properties\":{\"description\":\"qpteeh\",\"providerType\":\"vypyqrimzinpv\",\"company\":\"jdkirsoodqx\",\"defaultEndpoint\":\"rmnohj\",\"aad\":{\"applicationId\":\"whdsoifiyip\",\"tenantId\":\"sqwpgrjb\"},\"managedApplication\":{\"publisherId\":\"rcjxvsnbyxqabn\",\"offerId\":\"cpc\"},\"targets\":[{\"id\":\"rzafbljjgpbtoqcj\",\"name\":\"ljavbqid\",\"description\":\"ajzyul\",\"acceptedDataFormats\":[\"dj\"],\"acceptedContentEncodings\":[\"khbzhfepgzg\",\"e\"]},{\"id\":\"locx\",\"name\":\"paierh\",\"description\":\"csglum\",\"acceptedDataFormats\":[\"tjaodxobnb\",\"xkqpxo\",\"ajionpimexgstxg\",\"po\"],\"acceptedContentEncodings\":[\"aajrm\",\"djwzrlov\",\"clwhijcoejctbz\",\"qsqsy\"]},{\"id\":\"kbfkg\",\"name\":\"dkexxppofm\",\"description\":\"x\",\"acceptedDataFormats\":[\"pg\"],\"acceptedContentEncodings\":[\"ocjjxhvpmouexh\"]}],\"skus\":[{\"id\":\"bqe\",\"name\":\"nxqbzvddn\",\"version\":\"ndei\",\"description\":\"twnpzaoqvuhrhcf\",\"restrictedAccessUri\":\"yd\",\"autoAdd\":false,\"targets\":[\"t\",\"jqkwpyeicx\",\"qciwqvhkhixuigdt\"],\"quotaDimensions\":[{}],\"pricingDetails\":[{},{},{},{}]},{\"id\":\"og\",\"name\":\"e\",\"version\":\"a\",\"description\":\"uhrzayvvt\",\"restrictedAccessUri\":\"vdfgiotk\",\"autoAdd\":false,\"targets\":[\"xlngx\",\"efgugnxk\"],\"quotaDimensions\":[{},{}],\"pricingDetails\":[{}]},{\"id\":\"dt\",\"name\":\"zrvqdr\",\"version\":\"hjybigehoqfbo\",\"description\":\"kanyktzlcuiywg\",\"restrictedAccessUri\":\"wgndrvynhzgpp\",\"autoAdd\":true,\"targets\":[\"nc\",\"cpecfvmmcoofs\",\"lzevgbmqjqab\",\"y\"],\"quotaDimensions\":[{},{},{},{}],\"pricingDetails\":[{},{},{},{}]}],\"quotaDimensions\":[{\"id\":\"uvcc\",\"scope\":\"nfnbacfionlebxe\",\"period\":\"gtzxdpn\",\"quota\":19.734276,\"name\":\"wxrjfeallnwsub\",\"description\":\"njampm\",\"unit\":\"nzscxa\",\"unitPlural\":\"ooch\"}],\"pricingDimensions\":[{\"id\":\"qvpkvlrxnjeaseip\",\"name\":\"oflokey\"}]}}],\"nextLink\":\"enjbdlwtgrhp\"}") + "{\"value\":[{\"id\":\"xmqci\",\"name\":\"vhkhixu\",\"properties\":{\"description\":\"topbobjogh\",\"providerType\":\"w\",\"company\":\"m\",\"defaultEndpoint\":\"hrzayvvtpgvdf\",\"aad\":{\"applicationId\":\"tkftutqxlngx\",\"tenantId\":\"fgugnxkrxdqmid\"},\"managedApplication\":{\"publisherId\":\"zrvqdr\",\"offerId\":\"hjybigehoqfbo\"},\"targets\":[{\"id\":\"nyktzlcuiy\",\"name\":\"qyw\",\"description\":\"drvyn\",\"acceptedDataFormats\":[\"pphrcgynco\",\"pec\",\"vmmcoofs\"],\"acceptedContentEncodings\":[\"evgbmqjq\",\"bcypmi\"],\"numQubits\":61418624,\"targetProfile\":\"zuvccfwnfnbacfio\",\"metadata\":{\"bqqwxrj\":\"\\\"databxetqgtzxdpn\\\"\",\"mpmngnzscxaqwoo\":\"\\\"dataeallnwsubisnj\\\"\",\"njeaseipheofloke\":\"\\\"datahcbonqvpkvlr\\\"\"}},{\"id\":\"ienjbdlwtgr\",\"name\":\"djpjumasxazjpq\",\"description\":\"gual\",\"acceptedDataFormats\":[\"xhejjzzvdud\",\"wdslfhotwmcy\",\"pwlbjnpg\"],\"acceptedContentEncodings\":[\"tadehxnltyfsopp\",\"suesnzw\",\"ej\",\"avo\"],\"numQubits\":669466066,\"targetProfile\":\"mohctb\",\"metadata\":{\"w\":\"\\\"datadwxdndnv\\\"\",\"lazjdyggdtjixhbk\":\"\\\"dataujjugwdkcglh\\\"\",\"fwhybcibvy\":\"\\\"dataofqweykhmenevfye\\\"\",\"ynnaam\":\"\\\"datadcsi\\\"\"}},{\"id\":\"ctehfiqscjey\",\"name\":\"hezrkgq\",\"description\":\"jrefovgmkqsle\",\"acceptedDataFormats\":[\"xyqj\",\"k\",\"attpngjcrcczsq\",\"jh\"],\"acceptedContentEncodings\":[\"ajvnysounqe\"],\"numQubits\":904416760,\"targetProfile\":\"ae\",\"metadata\":{\"ltrpmopj\":\"\\\"datahy\\\"\",\"u\":\"\\\"datacma\\\"\",\"aodsfcpkv\":\"\\\"datakthfui\\\"\",\"uaxbezyiuokkt\":\"\\\"dataodpuozmyzydag\\\"\"}},{\"id\":\"rdxwzywqsm\",\"name\":\"ureximoryocfs\",\"description\":\"s\",\"acceptedDataFormats\":[\"dystkiiuxhqyud\",\"o\",\"rq\",\"b\"],\"acceptedContentEncodings\":[\"zvyifqrvkdvj\",\"llr\"],\"numQubits\":31465947,\"targetProfile\":\"f\",\"metadata\":{\"wiqzbqjvsovmyo\":\"\\\"datakpnpulexxbczwtr\\\"\"}}],\"skus\":[{\"id\":\"pkwlhz\",\"name\":\"bpxjmfl\",\"version\":\"vnchrkcci\",\"description\":\"zjuqkhrsaj\",\"restrictedAccessUri\":\"ku\",\"autoAdd\":false,\"targets\":[\"ghsauuimjmvxied\"],\"quotaDimensions\":[{},{}],\"pricingDetails\":[{},{},{}]},{\"id\":\"jrrfbyaosve\",\"name\":\"sonpclhocohs\",\"version\":\"ev\",\"description\":\"ggzfbu\",\"restrictedAccessUri\":\"mvfaxkffeiith\",\"autoAdd\":false,\"targets\":[\"yvshxmz\"],\"quotaDimensions\":[{},{},{}],\"pricingDetails\":[{},{},{}]},{\"id\":\"gigr\",\"name\":\"burvjxxjnspy\",\"version\":\"tko\",\"description\":\"kouknvudwtiu\",\"restrictedAccessUri\":\"ldngkpoci\",\"autoAdd\":false,\"targets\":[\"o\",\"gukgjnpiucgygevq\",\"ntypmrbpizcdrqj\",\"dpydn\"],\"quotaDimensions\":[{},{}],\"pricingDetails\":[{}]},{\"id\":\"oejzi\",\"name\":\"ifsjttgzfbishcb\",\"version\":\"ajdeyeamdphaga\",\"description\":\"buxwgip\",\"restrictedAccessUri\":\"onowk\",\"autoAdd\":true,\"targets\":[\"nkixzbinj\",\"pu\",\"tmryw\",\"uzoqft\"],\"quotaDimensions\":[{},{},{},{}],\"pricingDetails\":[{},{},{}]}],\"quotaDimensions\":[{\"id\":\"qvyxlwhzlsicoho\",\"scope\":\"nwvlryavwhheunmm\",\"period\":\"gyxzk\",\"quota\":62.142975,\"name\":\"uko\",\"description\":\"yaxuconuqszfkb\",\"unit\":\"pewr\",\"unitPlural\":\"mwvvjektcxsenhw\"},{\"id\":\"s\",\"scope\":\"rzpwvlqdqgbiq\",\"period\":\"ihkaetcktvfc\",\"quota\":62.413876,\"name\":\"nkymuctqhjfbebrj\",\"description\":\"erfuwuttt\",\"unit\":\"vjrbirphxepcyvah\",\"unitPlural\":\"ljkyqxjvuuj\"}],\"pricingDimensions\":[{\"id\":\"ok\",\"name\":\"ljyoxgvcltb\"},{\"id\":\"ncghkje\",\"name\":\"zhbijhtxfv\"}]}}],\"nextLink\":\"bfs\"}") .toObject(OfferingsListResult.class); - Assertions.assertEquals("huxinpmqnj", model.value().get(0).id()); - Assertions.assertEquals("ojakhmsbzjhcrze", model.value().get(0).properties().targets().get(0).id()); - Assertions.assertEquals("phlxa", model.value().get(0).properties().targets().get(0).name()); - Assertions.assertEquals("thqt", model.value().get(0).properties().targets().get(0).description()); - Assertions.assertEquals("jbp", model.value().get(0).properties().targets().get(0).acceptedDataFormats().get(0)); - Assertions.assertEquals("felluwfzitonpe", + Assertions.assertEquals("xmqci", model.value().get(0).id()); + Assertions.assertEquals("nyktzlcuiy", model.value().get(0).properties().targets().get(0).id()); + Assertions.assertEquals("qyw", model.value().get(0).properties().targets().get(0).name()); + Assertions.assertEquals("drvyn", model.value().get(0).properties().targets().get(0).description()); + Assertions.assertEquals("pphrcgynco", + model.value().get(0).properties().targets().get(0).acceptedDataFormats().get(0)); + Assertions.assertEquals("evgbmqjq", model.value().get(0).properties().targets().get(0).acceptedContentEncodings().get(0)); - Assertions.assertEquals("datqxhocdgeabl", model.value().get(0).properties().skus().get(0).id()); - Assertions.assertEquals("huticndvkao", model.value().get(0).properties().skus().get(0).name()); - Assertions.assertEquals("yiftyhxhuro", model.value().get(0).properties().skus().get(0).version()); - Assertions.assertEquals("tyxolniwpwc", model.value().get(0).properties().skus().get(0).description()); - Assertions.assertEquals("jfkgiawxk", model.value().get(0).properties().skus().get(0).restrictedAccessUri()); - Assertions.assertEquals(false, model.value().get(0).properties().skus().get(0).autoAdd()); - Assertions.assertEquals("wckbasyypnd", model.value().get(0).properties().skus().get(0).targets().get(0)); - Assertions.assertEquals("rxybz", model.value().get(0).properties().quotaDimensions().get(0).id()); - Assertions.assertEquals("e", model.value().get(0).properties().quotaDimensions().get(0).scope()); - Assertions.assertEquals("ytb", model.value().get(0).properties().quotaDimensions().get(0).period()); - Assertions.assertEquals(19.418764F, model.value().get(0).properties().quotaDimensions().get(0).quota()); - Assertions.assertEquals("ouf", model.value().get(0).properties().quotaDimensions().get(0).name()); - Assertions.assertEquals("mnkzsmod", model.value().get(0).properties().quotaDimensions().get(0).description()); - Assertions.assertEquals("lougpbkw", model.value().get(0).properties().quotaDimensions().get(0).unit()); - Assertions.assertEquals("utduqktapspwgcu", + Assertions.assertEquals("pkwlhz", model.value().get(0).properties().skus().get(0).id()); + Assertions.assertEquals("bpxjmfl", model.value().get(0).properties().skus().get(0).name()); + Assertions.assertEquals("vnchrkcci", model.value().get(0).properties().skus().get(0).version()); + Assertions.assertEquals("zjuqkhrsaj", model.value().get(0).properties().skus().get(0).description()); + Assertions.assertEquals("ku", model.value().get(0).properties().skus().get(0).restrictedAccessUri()); + Assertions.assertFalse(model.value().get(0).properties().skus().get(0).autoAdd()); + Assertions.assertEquals("ghsauuimjmvxied", model.value().get(0).properties().skus().get(0).targets().get(0)); + Assertions.assertEquals("qvyxlwhzlsicoho", model.value().get(0).properties().quotaDimensions().get(0).id()); + Assertions.assertEquals("nwvlryavwhheunmm", model.value().get(0).properties().quotaDimensions().get(0).scope()); + Assertions.assertEquals("gyxzk", model.value().get(0).properties().quotaDimensions().get(0).period()); + Assertions.assertEquals(62.142975F, model.value().get(0).properties().quotaDimensions().get(0).quota()); + Assertions.assertEquals("uko", model.value().get(0).properties().quotaDimensions().get(0).name()); + Assertions.assertEquals("yaxuconuqszfkb", + model.value().get(0).properties().quotaDimensions().get(0).description()); + Assertions.assertEquals("pewr", model.value().get(0).properties().quotaDimensions().get(0).unit()); + Assertions.assertEquals("mwvvjektcxsenhw", model.value().get(0).properties().quotaDimensions().get(0).unitPlural()); - Assertions.assertEquals("zuhtymwisdkfthwx", model.value().get(0).properties().pricingDimensions().get(0).id()); - Assertions.assertEquals("t", model.value().get(0).properties().pricingDimensions().get(0).name()); - Assertions.assertEquals("enjbdlwtgrhp", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OfferingsListResult model - = new OfferingsListResult().withValue(Arrays.asList( - new ProviderDescriptionInner().withId("huxinpmqnj") - .withProperties(new ProviderProperties().withAad(new ProviderPropertiesAad()) - .withManagedApplication(new ProviderPropertiesManagedApplication()) - .withTargets(Arrays.asList( - new TargetDescription().withId("ojakhmsbzjhcrze") - .withName("phlxa") - .withDescription("thqt") - .withAcceptedDataFormats(Arrays.asList("jbp", "zfsinzgvf", "jrwzox")) - .withAcceptedContentEncodings(Arrays.asList("felluwfzitonpe", "fpjkjlxofp")), - new TargetDescription().withId("hpf") - .withName("ypininm") - .withDescription("huyb") - .withAcceptedDataFormats(Arrays.asList("odepoogin", "vamih")) - .withAcceptedContentEncodings(Arrays.asList("narxzxtheotus", "vyevcciqi", "nhungbw")), - new TargetDescription().withId("rnfygxgispem") - .withName("zfkufubljofx") - .withDescription("ofjaeqjhqjb") - .withAcceptedDataFormats(Arrays.asList("msmjqulngsntn")) - .withAcceptedContentEncodings( - Arrays.asList("kzgcwrwcl", "xwrljdouskcqvkoc", "cjdkwtnhxbnjbi")), - new TargetDescription().withId("qrglssainqpjwn") - .withName("ljfmppee") - .withDescription("mgxsab") - .withAcceptedDataFormats(Arrays.asList("duuji", "c", "czdzev", "dhkrwpdappdsbdk")) - .withAcceptedContentEncodings(Arrays.asList("wjfeusnhutjel", "mrldhu")))) - .withSkus(Arrays.asList(new SkuDescription().withId("datqxhocdgeabl") - .withName("huticndvkao") - .withVersion("yiftyhxhuro") - .withDescription("tyxolniwpwc") - .withRestrictedAccessUri("jfkgiawxk") - .withAutoAdd(false) - .withTargets(Arrays.asList("wckbasyypnd", "hsgcbacphejkot", "nqgoulzndli", "wyqkgfgibm")) - .withQuotaDimensions(Arrays.asList(new QuotaDimension(), new QuotaDimension())) - .withPricingDetails(Arrays.asList(new PricingDetail(), new PricingDetail(), - new PricingDetail(), new PricingDetail())))) - .withQuotaDimensions(Arrays.asList( - new QuotaDimension().withId("rxybz") - .withScope("e") - .withPeriod("ytb") - .withQuota(19.418764F) - .withName("ouf") - .withDescription("mnkzsmod") - .withUnit("lougpbkw") - .withUnitPlural("utduqktapspwgcu"), - new QuotaDimension().withId("tumkdosvqwhbm") - .withScope("bbjfddgmbmbexp") - .withPeriod("htqqrolfp") - .withQuota(1.6021609F) - .withName("lgbquxig") - .withDescription("jgzjaoyfhrtx") - .withUnit("n") - .withUnitPlural("kujysvlejuvfq"), - new QuotaDimension().withId("rlyxwjkcprbnw") - .withScope("gjvtbv") - .withPeriod("sszdnru") - .withQuota(66.73355F) - .withName("hmuouqfprwzwbn") - .withDescription("itnwuizgazxufi") - .withUnit("ckyfih") - .withUnitPlural("idf"))) - .withPricingDimensions( - Arrays.asList(new PricingDimension().withId("zuhtymwisdkfthwx").withName("t"), - new PricingDimension().withId("waopvkmijcmmxd").withName("fufsrpymzi"), - new PricingDimension().withId("sezcxtb").withName("gfycc")))), - new ProviderDescriptionInner().withId("ewmdw") - .withProperties(new ProviderProperties().withAad(new ProviderPropertiesAad()) - .withManagedApplication(new ProviderPropertiesManagedApplication()) - .withTargets(Arrays.asList( - new TargetDescription().withId("rzafbljjgpbtoqcj") - .withName("ljavbqid") - .withDescription("ajzyul") - .withAcceptedDataFormats(Arrays.asList("dj")) - .withAcceptedContentEncodings(Arrays.asList("khbzhfepgzg", "e")), - new TargetDescription().withId("locx") - .withName("paierh") - .withDescription("csglum") - .withAcceptedDataFormats(Arrays.asList("tjaodxobnb", "xkqpxo", "ajionpimexgstxg", "po")) - .withAcceptedContentEncodings( - Arrays.asList("aajrm", "djwzrlov", "clwhijcoejctbz", "qsqsy")), - new TargetDescription().withId("kbfkg") - .withName("dkexxppofm") - .withDescription("x") - .withAcceptedDataFormats(Arrays.asList("pg")) - .withAcceptedContentEncodings(Arrays.asList("ocjjxhvpmouexh")))) - .withSkus(Arrays.asList( - new SkuDescription().withId("bqe") - .withName("nxqbzvddn") - .withVersion("ndei") - .withDescription("twnpzaoqvuhrhcf") - .withRestrictedAccessUri("yd") - .withAutoAdd(false) - .withTargets(Arrays.asList("t", "jqkwpyeicx", "qciwqvhkhixuigdt")) - .withQuotaDimensions(Arrays.asList(new QuotaDimension())) - .withPricingDetails(Arrays.asList(new PricingDetail(), new PricingDetail(), - new PricingDetail(), new PricingDetail())), - new SkuDescription().withId("og") - .withName("e") - .withVersion("a") - .withDescription("uhrzayvvt") - .withRestrictedAccessUri("vdfgiotk") - .withAutoAdd(false) - .withTargets(Arrays.asList("xlngx", "efgugnxk")) - .withQuotaDimensions(Arrays.asList(new QuotaDimension(), new QuotaDimension())) - .withPricingDetails(Arrays.asList(new PricingDetail())), - new SkuDescription().withId("dt") - .withName("zrvqdr") - .withVersion("hjybigehoqfbo") - .withDescription("kanyktzlcuiywg") - .withRestrictedAccessUri("wgndrvynhzgpp") - .withAutoAdd(true) - .withTargets(Arrays.asList("nc", "cpecfvmmcoofs", "lzevgbmqjqab", "y")) - .withQuotaDimensions(Arrays.asList(new QuotaDimension(), new QuotaDimension(), - new QuotaDimension(), new QuotaDimension())) - .withPricingDetails(Arrays.asList(new PricingDetail(), new PricingDetail(), - new PricingDetail(), new PricingDetail())))) - .withQuotaDimensions(Arrays.asList(new QuotaDimension().withId("uvcc") - .withScope("nfnbacfionlebxe") - .withPeriod("gtzxdpn") - .withQuota(19.734276F) - .withName("wxrjfeallnwsub") - .withDescription("njampm") - .withUnit("nzscxa") - .withUnitPlural("ooch"))) - .withPricingDimensions( - Arrays.asList(new PricingDimension().withId("qvpkvlrxnjeaseip").withName("oflokey")))))) - .withNextLink("enjbdlwtgrhp"); - model = BinaryData.fromObject(model).toObject(OfferingsListResult.class); - Assertions.assertEquals("huxinpmqnj", model.value().get(0).id()); - Assertions.assertEquals("ojakhmsbzjhcrze", model.value().get(0).properties().targets().get(0).id()); - Assertions.assertEquals("phlxa", model.value().get(0).properties().targets().get(0).name()); - Assertions.assertEquals("thqt", model.value().get(0).properties().targets().get(0).description()); - Assertions.assertEquals("jbp", model.value().get(0).properties().targets().get(0).acceptedDataFormats().get(0)); - Assertions.assertEquals("felluwfzitonpe", - model.value().get(0).properties().targets().get(0).acceptedContentEncodings().get(0)); - Assertions.assertEquals("datqxhocdgeabl", model.value().get(0).properties().skus().get(0).id()); - Assertions.assertEquals("huticndvkao", model.value().get(0).properties().skus().get(0).name()); - Assertions.assertEquals("yiftyhxhuro", model.value().get(0).properties().skus().get(0).version()); - Assertions.assertEquals("tyxolniwpwc", model.value().get(0).properties().skus().get(0).description()); - Assertions.assertEquals("jfkgiawxk", model.value().get(0).properties().skus().get(0).restrictedAccessUri()); - Assertions.assertEquals(false, model.value().get(0).properties().skus().get(0).autoAdd()); - Assertions.assertEquals("wckbasyypnd", model.value().get(0).properties().skus().get(0).targets().get(0)); - Assertions.assertEquals("rxybz", model.value().get(0).properties().quotaDimensions().get(0).id()); - Assertions.assertEquals("e", model.value().get(0).properties().quotaDimensions().get(0).scope()); - Assertions.assertEquals("ytb", model.value().get(0).properties().quotaDimensions().get(0).period()); - Assertions.assertEquals(19.418764F, model.value().get(0).properties().quotaDimensions().get(0).quota()); - Assertions.assertEquals("ouf", model.value().get(0).properties().quotaDimensions().get(0).name()); - Assertions.assertEquals("mnkzsmod", model.value().get(0).properties().quotaDimensions().get(0).description()); - Assertions.assertEquals("lougpbkw", model.value().get(0).properties().quotaDimensions().get(0).unit()); - Assertions.assertEquals("utduqktapspwgcu", - model.value().get(0).properties().quotaDimensions().get(0).unitPlural()); - Assertions.assertEquals("zuhtymwisdkfthwx", model.value().get(0).properties().pricingDimensions().get(0).id()); - Assertions.assertEquals("t", model.value().get(0).properties().pricingDimensions().get(0).name()); - Assertions.assertEquals("enjbdlwtgrhp", model.nextLink()); + Assertions.assertEquals("ok", model.value().get(0).properties().pricingDimensions().get(0).id()); + Assertions.assertEquals("ljyoxgvcltb", model.value().get(0).properties().pricingDimensions().get(0).name()); + Assertions.assertEquals("bfs", model.nextLink()); } } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/OperationDisplayTests.java b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/OperationDisplayTests.java index 08d8e6d2b9ac..dcd45e6aa75c 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/OperationDisplayTests.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/OperationDisplayTests.java @@ -1,35 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.quantum.models.OperationDisplay; -import org.junit.jupiter.api.Assertions; public final class OperationDisplayTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationDisplay model = BinaryData.fromString( - "{\"provider\":\"eotg\",\"resource\":\"l\",\"operation\":\"muwlauwzizxbm\",\"description\":\"cjefuzmu\"}") + "{\"provider\":\"cdm\",\"resource\":\"rcryuanzwuxzdxta\",\"operation\":\"lhmwhfpmrqobm\",\"description\":\"kknryrtihf\"}") .toObject(OperationDisplay.class); - Assertions.assertEquals("eotg", model.provider()); - Assertions.assertEquals("l", model.resource()); - Assertions.assertEquals("muwlauwzizxbm", model.operation()); - Assertions.assertEquals("cjefuzmu", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay().withProvider("eotg") - .withResource("l") - .withOperation("muwlauwzizxbm") - .withDescription("cjefuzmu"); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - Assertions.assertEquals("eotg", model.provider()); - Assertions.assertEquals("l", model.resource()); - Assertions.assertEquals("muwlauwzizxbm", model.operation()); - Assertions.assertEquals("cjefuzmu", model.description()); } } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/OperationInnerTests.java b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/OperationInnerTests.java index 4b39cd39d5f7..7af8517151c0 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/OperationInnerTests.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/OperationInnerTests.java @@ -1,42 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.quantum.fluent.models.OperationInner; -import com.azure.resourcemanager.quantum.models.OperationDisplay; -import org.junit.jupiter.api.Assertions; public final class OperationInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationInner model = BinaryData.fromString( - "{\"name\":\"bqdxbx\",\"isDataAction\":true,\"display\":{\"provider\":\"gqxndlkzgxhuripl\",\"resource\":\"odxun\",\"operation\":\"ebxmubyynt\",\"description\":\"rbqtkoie\"}}") + "{\"name\":\"nygj\",\"isDataAction\":true,\"display\":{\"provider\":\"eqsrdeupewnwreit\",\"resource\":\"yflusarhmofc\",\"operation\":\"smy\",\"description\":\"kdtmlxhekuk\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") .toObject(OperationInner.class); - Assertions.assertEquals("bqdxbx", model.name()); - Assertions.assertEquals(true, model.isDataAction()); - Assertions.assertEquals("gqxndlkzgxhuripl", model.display().provider()); - Assertions.assertEquals("odxun", model.display().resource()); - Assertions.assertEquals("ebxmubyynt", model.display().operation()); - Assertions.assertEquals("rbqtkoie", model.display().description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withName("bqdxbx") - .withIsDataAction(true) - .withDisplay(new OperationDisplay().withProvider("gqxndlkzgxhuripl") - .withResource("odxun") - .withOperation("ebxmubyynt") - .withDescription("rbqtkoie")); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - Assertions.assertEquals("bqdxbx", model.name()); - Assertions.assertEquals(true, model.isDataAction()); - Assertions.assertEquals("gqxndlkzgxhuripl", model.display().provider()); - Assertions.assertEquals("odxun", model.display().resource()); - Assertions.assertEquals("ebxmubyynt", model.display().operation()); - Assertions.assertEquals("rbqtkoie", model.display().description()); } } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/OperationListResultTests.java b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/OperationListResultTests.java new file mode 100644 index 000000000000..c868ea50830b --- /dev/null +++ b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/OperationListResultTests.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.quantum.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.quantum.implementation.models.OperationListResult; +import org.junit.jupiter.api.Assertions; + +public final class OperationListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationListResult model = BinaryData.fromString( + "{\"value\":[{\"name\":\"hq\",\"isDataAction\":true,\"display\":{\"provider\":\"pybczmehmtzopb\",\"resource\":\"h\",\"operation\":\"pidgsybbejhphoyc\",\"description\":\"xaobhdxbmtqioqjz\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"fpownoizhwlr\",\"isDataAction\":false,\"display\":{\"provider\":\"oqijgkdmbpaz\",\"resource\":\"bc\",\"operation\":\"pdznrbtcqqjnqgl\",\"description\":\"gnufoooj\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"esaagdfm\",\"isDataAction\":true,\"display\":{\"provider\":\"j\",\"resource\":\"ifkwmrvktsizntoc\",\"operation\":\"a\",\"description\":\"ajpsquc\"},\"origin\":\"system\",\"actionType\":\"Internal\"}],\"nextLink\":\"kfo\"}") + .toObject(OperationListResult.class); + Assertions.assertEquals("kfo", model.nextLink()); + } +} diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/OperationsListMockTests.java b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/OperationsListMockTests.java index 1204fb8874f3..d5bb3b4905a0 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/OperationsListMockTests.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/OperationsListMockTests.java @@ -1,20 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.quantum.AzureQuantumManager; import com.azure.resourcemanager.quantum.models.Operation; 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; @@ -22,22 +21,16 @@ public final class OperationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"name\":\"gkfpaga\",\"isDataAction\":true,\"display\":{\"provider\":\"pqblylsyxkqjnsj\",\"resource\":\"vti\",\"operation\":\"xsdszuempsb\",\"description\":\"f\"}}]}"; + = "{\"value\":[{\"name\":\"m\",\"isDataAction\":true,\"display\":{\"provider\":\"snfdsdoakgtdl\",\"resource\":\"kzevdlhewpusds\",\"operation\":\"wvogvbbejdc\",\"description\":\"qqmoaku\"},\"origin\":\"system\",\"actionType\":\"Internal\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); AzureQuantumManager manager = AzureQuantumManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - Assertions.assertEquals("gkfpaga", response.iterator().next().name()); - Assertions.assertEquals(true, response.iterator().next().isDataAction()); - Assertions.assertEquals("pqblylsyxkqjnsj", response.iterator().next().display().provider()); - Assertions.assertEquals("vti", response.iterator().next().display().resource()); - Assertions.assertEquals("xsdszuempsb", response.iterator().next().display().operation()); - Assertions.assertEquals("f", response.iterator().next().display().description()); } } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/OperationsListTests.java b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/OperationsListTests.java deleted file mode 100644 index b89cb50a6d76..000000000000 --- a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/OperationsListTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.quantum.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quantum.fluent.models.OperationInner; -import com.azure.resourcemanager.quantum.models.OperationDisplay; -import com.azure.resourcemanager.quantum.models.OperationsList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class OperationsListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationsList model = BinaryData.fromString( - "{\"nextLink\":\"gaokonzmnsikv\",\"value\":[{\"name\":\"ze\",\"isDataAction\":true,\"display\":{\"provider\":\"tfz\",\"resource\":\"hhvh\",\"operation\":\"r\",\"description\":\"dkwobdagx\"}}]}") - .toObject(OperationsList.class); - Assertions.assertEquals("gaokonzmnsikv", model.nextLink()); - Assertions.assertEquals("ze", model.value().get(0).name()); - Assertions.assertEquals(true, model.value().get(0).isDataAction()); - Assertions.assertEquals("tfz", model.value().get(0).display().provider()); - Assertions.assertEquals("hhvh", model.value().get(0).display().resource()); - Assertions.assertEquals("r", model.value().get(0).display().operation()); - Assertions.assertEquals("dkwobdagx", model.value().get(0).display().description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationsList model = new OperationsList().withNextLink("gaokonzmnsikv") - .withValue(Arrays.asList(new OperationInner().withName("ze") - .withIsDataAction(true) - .withDisplay(new OperationDisplay().withProvider("tfz") - .withResource("hhvh") - .withOperation("r") - .withDescription("dkwobdagx")))); - model = BinaryData.fromObject(model).toObject(OperationsList.class); - Assertions.assertEquals("gaokonzmnsikv", model.nextLink()); - Assertions.assertEquals("ze", model.value().get(0).name()); - Assertions.assertEquals(true, model.value().get(0).isDataAction()); - Assertions.assertEquals("tfz", model.value().get(0).display().provider()); - Assertions.assertEquals("hhvh", model.value().get(0).display().resource()); - Assertions.assertEquals("r", model.value().get(0).display().operation()); - Assertions.assertEquals("dkwobdagx", model.value().get(0).display().description()); - } -} diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/PricingDetailTests.java b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/PricingDetailTests.java index f661174e0f5f..9b1d1cdf1345 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/PricingDetailTests.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/PricingDetailTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.generated; @@ -12,16 +12,8 @@ public final class PricingDetailTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PricingDetail model - = BinaryData.fromString("{\"id\":\"wab\",\"value\":\"tshhszhedp\"}").toObject(PricingDetail.class); - Assertions.assertEquals("wab", model.id()); - Assertions.assertEquals("tshhszhedp", model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PricingDetail model = new PricingDetail().withId("wab").withValue("tshhszhedp"); - model = BinaryData.fromObject(model).toObject(PricingDetail.class); - Assertions.assertEquals("wab", model.id()); - Assertions.assertEquals("tshhszhedp", model.value()); + = BinaryData.fromString("{\"id\":\"ufoxc\",\"value\":\"opidoamciodh\"}").toObject(PricingDetail.class); + Assertions.assertEquals("ufoxc", model.id()); + Assertions.assertEquals("opidoamciodh", model.value()); } } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/PricingDimensionTests.java b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/PricingDimensionTests.java index f52f4fd6c08f..e3c5d1caee19 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/PricingDimensionTests.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/PricingDimensionTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.generated; @@ -11,17 +11,9 @@ public final class PricingDimensionTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - PricingDimension model = BinaryData.fromString("{\"id\":\"wiwubm\",\"name\":\"besldnkwwtppjflc\"}") - .toObject(PricingDimension.class); - Assertions.assertEquals("wiwubm", model.id()); - Assertions.assertEquals("besldnkwwtppjflc", model.name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PricingDimension model = new PricingDimension().withId("wiwubm").withName("besldnkwwtppjflc"); - model = BinaryData.fromObject(model).toObject(PricingDimension.class); - Assertions.assertEquals("wiwubm", model.id()); - Assertions.assertEquals("besldnkwwtppjflc", model.name()); + PricingDimension model + = BinaryData.fromString("{\"id\":\"azxkhnzbonlwnto\",\"name\":\"okdwb\"}").toObject(PricingDimension.class); + Assertions.assertEquals("azxkhnzbonlwnto", model.id()); + Assertions.assertEquals("okdwb", model.name()); } } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/ProviderDescriptionInnerTests.java b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/ProviderDescriptionInnerTests.java index 16477f211726..f7f316be4442 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/ProviderDescriptionInnerTests.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/ProviderDescriptionInnerTests.java @@ -1,261 +1,52 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.quantum.fluent.models.ProviderDescriptionInner; -import com.azure.resourcemanager.quantum.models.PricingDetail; -import com.azure.resourcemanager.quantum.models.PricingDimension; -import com.azure.resourcemanager.quantum.models.ProviderProperties; -import com.azure.resourcemanager.quantum.models.ProviderPropertiesAad; -import com.azure.resourcemanager.quantum.models.ProviderPropertiesManagedApplication; -import com.azure.resourcemanager.quantum.models.QuotaDimension; -import com.azure.resourcemanager.quantum.models.SkuDescription; -import com.azure.resourcemanager.quantum.models.TargetDescription; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class ProviderDescriptionInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ProviderDescriptionInner model = BinaryData.fromString( - "{\"id\":\"pj\",\"name\":\"asxazjpqyegualhb\",\"properties\":{\"description\":\"e\",\"providerType\":\"zzvdudgwds\",\"company\":\"hotwmcynpwlbjnp\",\"defaultEndpoint\":\"cftadeh\",\"aad\":{\"applicationId\":\"tyfsoppusuesn\",\"tenantId\":\"dejbavo\"},\"managedApplication\":{\"publisherId\":\"dmoh\",\"offerId\":\"bqvudwxdndn\"},\"targets\":[{\"id\":\"ujjugwdkcglh\",\"name\":\"azjdyggd\",\"description\":\"ixhbkuofqweykhm\",\"acceptedDataFormats\":[\"vfyexfw\",\"ybcibvyvdcsit\",\"nnaamdectehfiqsc\",\"eypvhezrkg\"],\"acceptedContentEncodings\":[\"jrefovgmkqsle\"]}],\"skus\":[{\"id\":\"yqjpkcatt\",\"name\":\"gjcrcczsqpjhvm\",\"version\":\"jvnysounqe\",\"description\":\"noae\",\"restrictedAccessUri\":\"fhyhltrpmopjmcma\",\"autoAdd\":false,\"targets\":[\"hfuiuaodsfc\",\"kvxod\",\"uozmyzydagfua\",\"bezy\"],\"quotaDimensions\":[{\"id\":\"ktwh\",\"scope\":\"xw\",\"period\":\"wqsmbsur\",\"quota\":85.49606,\"name\":\"o\",\"description\":\"ocfs\",\"unit\":\"s\",\"unitPlural\":\"ddystkiiuxhqy\"},{\"id\":\"xorrqnb\",\"scope\":\"czvyifq\",\"period\":\"kdvjsll\",\"quota\":80.76506,\"name\":\"d\",\"description\":\"atkpnp\",\"unit\":\"exxbczwtr\",\"unitPlural\":\"iqzbq\"},{\"id\":\"sovmyokacspkwl\",\"scope\":\"dobpxjmflbvvn\",\"period\":\"rkcciwwzjuqk\",\"quota\":7.702547,\"name\":\"jiwkuofoskghsau\",\"description\":\"mjmvxieduugidyjr\",\"unit\":\"byao\",\"unitPlural\":\"e\"}],\"pricingDetails\":[{\"id\":\"npc\",\"value\":\"ocohslkevleg\"},{\"id\":\"fbuhfmvfaxkffe\",\"value\":\"th\"},{\"id\":\"m\",\"value\":\"yvshxmz\"}]},{\"id\":\"bzoggigrx\",\"name\":\"ur\",\"version\":\"xxjnspydptk\",\"description\":\"nkoukn\",\"restrictedAccessUri\":\"dwtiukbldngkp\",\"autoAdd\":true,\"targets\":[\"z\",\"xoegukgjnpiucgy\",\"evqzntypmrbp\"],\"quotaDimensions\":[{\"id\":\"r\",\"scope\":\"sdpydnfyhxdeoejz\",\"period\":\"w\",\"quota\":67.792435,\"name\":\"ttgzfbis\",\"description\":\"bkh\",\"unit\":\"deyeamdphagalpbu\",\"unitPlural\":\"gipwhonowkg\"}],\"pricingDetails\":[{\"id\":\"nkixzbinj\",\"value\":\"uttmrywnuzoqft\"},{\"id\":\"qzrnkcqvyxlwhz\",\"value\":\"icohoqqnwvl\"},{\"id\":\"avwhheunm\",\"value\":\"hgyxzkonoc\"}]},{\"id\":\"oklyaxuconuq\",\"name\":\"fkbey\",\"version\":\"wrmjmwvvjektc\",\"description\":\"enhwlrs\",\"restrictedAccessUri\":\"rzpwvlqdqgbiq\",\"autoAdd\":true,\"targets\":[\"aetcktvfcivfs\"],\"quotaDimensions\":[{\"id\":\"uctqhjfbe\",\"scope\":\"jcxerfuwu\",\"period\":\"txfvjrbirph\",\"quota\":84.526054,\"name\":\"yva\",\"description\":\"nljky\",\"unit\":\"j\",\"unitPlural\":\"ujqgidok\"},{\"id\":\"ljyoxgvcltb\",\"scope\":\"ncghkje\",\"period\":\"zhbijhtxfv\",\"quota\":15.551442,\"name\":\"smx\",\"description\":\"hmpvecx\",\"unit\":\"debfqkkrbmpukgri\",\"unitPlural\":\"lzlfbxzpuz\"},{\"id\":\"ispnqzahmgkbrp\",\"scope\":\"dhibnuq\",\"period\":\"pikad\",\"quota\":14.613795,\"name\":\"qagnbuyn\",\"description\":\"jggmebfsiarbu\",\"unit\":\"cvpnazzmhjrunmpx\",\"unitPlural\":\"dbhrbnlankxm\"},{\"id\":\"k\",\"scope\":\"henbtkcxywnytn\",\"period\":\"yn\",\"quota\":52.88253,\"name\":\"ybyxc\",\"description\":\"clha\",\"unit\":\"dbabp\",\"unitPlural\":\"wrqlfktsthsuco\"}],\"pricingDetails\":[{\"id\":\"yazttbtwwrqpue\",\"value\":\"kzywbiex\"},{\"id\":\"eyueaxibxujwb\",\"value\":\"walm\"},{\"id\":\"yoxa\",\"value\":\"dkzjancuxrh\"},{\"id\":\"bavxbniwdjswzt\",\"value\":\"bpg\"}]},{\"id\":\"ytxhp\",\"name\":\"bzpfzab\",\"version\":\"cuh\",\"description\":\"tcty\",\"restrictedAccessUri\":\"klbb\",\"autoAdd\":true,\"targets\":[\"zbhvgyuguosv\",\"kfssxqukkf\",\"l\"],\"quotaDimensions\":[{\"id\":\"xnkjzkdesl\",\"scope\":\"lopwiyig\",\"period\":\"pkdwzbai\",\"quota\":69.34189,\"name\":\"a\",\"description\":\"nyqupedeojnabck\",\"unit\":\"mtxpsiebtfh\",\"unitPlural\":\"esap\"},{\"id\":\"rdqmhjjdhtldwkyz\",\"scope\":\"utknc\",\"period\":\"cwsvlxotog\",\"quota\":71.378235,\"name\":\"pqsxvnmicy\",\"description\":\"ceoveilovno\",\"unit\":\"fj\",\"unitPlural\":\"njbkcnxdhbttkph\"},{\"id\":\"pnvjtoqnermclf\",\"scope\":\"phoxus\",\"period\":\"pabgyeps\",\"quota\":95.976326,\"name\":\"zq\",\"description\":\"xywpmueefjzwfqkq\",\"unit\":\"ids\",\"unitPlural\":\"onobglaocqx\"},{\"id\":\"cmgyud\",\"scope\":\"tlmoyrx\",\"period\":\"fudwpznt\",\"quota\":32.9984,\"name\":\"hl\",\"description\":\"jbhckfrlhr\",\"unit\":\"bkyvp\",\"unitPlural\":\"anuzbpzkafkuw\"}],\"pricingDetails\":[{\"id\":\"wbme\",\"value\":\"seyvj\"}]}],\"quotaDimensions\":[{\"id\":\"slhs\",\"scope\":\"deemao\",\"period\":\"xagkvtmelmqkrh\",\"quota\":25.794971,\"name\":\"juahaquhcdhmdual\",\"description\":\"xqpvfadmw\",\"unit\":\"crgvxpvgom\",\"unitPlural\":\"fmisg\"}],\"pricingDimensions\":[{\"id\":\"beldawkzbaliourq\",\"name\":\"kauhashsfwxo\"},{\"id\":\"w\",\"name\":\"cugicjoox\"}]}}") + "{\"id\":\"nehmpvecx\",\"name\":\"debfqkkrbmpukgri\",\"properties\":{\"description\":\"zlfbxzpuzycispnq\",\"providerType\":\"hmgkbrpyy\",\"company\":\"ibnuqqkpik\",\"defaultEndpoint\":\"rgvtqag\",\"aad\":{\"applicationId\":\"ynhijggme\",\"tenantId\":\"siarbutrcvpn\"},\"managedApplication\":{\"publisherId\":\"mhjrunmpxttdbhr\",\"offerId\":\"l\"},\"targets\":[{\"id\":\"myskpbhenbtkcxy\",\"name\":\"y\",\"description\":\"rsyn\",\"acceptedDataFormats\":[\"dybyxczfclhaa\",\"dbabp\",\"lwrq\"],\"acceptedContentEncodings\":[\"tsthsucocm\",\"yyazttbt\",\"wrqpue\",\"ckzywbiexzfeyue\"],\"numQubits\":537783371,\"targetProfile\":\"xujwbhqwalmuzyo\",\"metadata\":{\"d\":\"\\\"datapdkzjancuxr\\\"\",\"dbpgnxytxhp\":\"\\\"databavxbniwdjswzt\\\"\"}}],\"skus\":[{\"id\":\"pfza\",\"name\":\"lcuhxwtctyqiklb\",\"version\":\"vplwzbhv\",\"description\":\"u\",\"restrictedAccessUri\":\"osvmk\",\"autoAdd\":false,\"targets\":[\"ukkfplgmgs\",\"nkjzkdeslpvlop\"],\"quotaDimensions\":[{\"id\":\"ghxpkdw\",\"scope\":\"aiuebbaumnyqu\",\"period\":\"deoj\",\"quota\":67.37568,\"name\":\"khsmtxpsiebt\",\"description\":\"vpesapskrdqmhjjd\",\"unit\":\"ldwkyzxuutkn\",\"unitPlural\":\"scwsv\"},{\"id\":\"otogtwrupqs\",\"scope\":\"nmic\",\"period\":\"vce\",\"quota\":13.49774,\"name\":\"lo\",\"description\":\"oty\",\"unit\":\"fcnj\",\"unitPlural\":\"cn\"}],\"pricingDetails\":[{\"id\":\"ttkphywpnvjtoqne\",\"value\":\"clfp\"},{\"id\":\"hoxus\",\"value\":\"pabgyeps\"},{\"id\":\"tazqugxywpmueefj\",\"value\":\"fqkquj\"}]},{\"id\":\"suyonobglaocq\",\"name\":\"ccm\",\"version\":\"udxytlmoyrx\",\"description\":\"fudwpznt\",\"restrictedAccessUri\":\"dzhlrq\",\"autoAdd\":true,\"targets\":[\"frlh\",\"xsbkyvpyca\",\"uzbpzkafku\"],\"quotaDimensions\":[{\"id\":\"nwbmeh\",\"scope\":\"eyvjusrtslhspkde\",\"period\":\"aofmxagkvtme\",\"quota\":65.92134,\"name\":\"rhahvljuahaquhcd\",\"description\":\"duala\",\"unit\":\"qpv\",\"unitPlural\":\"dmwsrcrgvxpvgomz\"},{\"id\":\"misgwbnb\",\"scope\":\"ldawkzbaliourqha\",\"period\":\"uhashsfwx\",\"quota\":32.73186,\"name\":\"z\",\"description\":\"ugicjooxdjebw\",\"unit\":\"cwwfvovbvme\",\"unitPlural\":\"civyhzceuo\"}],\"pricingDetails\":[{\"id\":\"wjue\",\"value\":\"twm\"},{\"id\":\"ytdxwit\",\"value\":\"rjaw\"},{\"id\":\"wgxhn\",\"value\":\"kxfbkpycgklwndn\"}]}],\"quotaDimensions\":[{\"id\":\"uwhvylwzbtdhxujz\",\"scope\":\"mpowuwpr\",\"period\":\"lve\",\"quota\":23.059952,\"name\":\"pjmkhfxobbc\",\"description\":\"s\",\"unit\":\"jriplrbpbewtghf\",\"unitPlural\":\"lcgwxzvlvqh\"},{\"id\":\"begibtnmxiebwwa\",\"scope\":\"ayqcgw\",\"period\":\"zjuzgwyz\",\"quota\":22.303885,\"name\":\"ongmtsa\",\"description\":\"cbpwxqpsrknft\",\"unit\":\"vriuhprwmdyvx\",\"unitPlural\":\"ayriwwroyqbexrm\"},{\"id\":\"ibycno\",\"scope\":\"knme\",\"period\":\"sgzvahapjyzhpv\",\"quota\":87.25675,\"name\":\"j\",\"description\":\"xdjzlmwlxk\",\"unit\":\"gfhzovawjvzunlut\",\"unitPlural\":\"n\"},{\"id\":\"nxipeil\",\"scope\":\"zuaejxd\",\"period\":\"tskzbbtdzumveek\",\"quota\":41.73995,\"name\":\"zuhkfpbsjyof\",\"description\":\"luu\",\"unit\":\"ttouwaboekqvkel\",\"unitPlural\":\"mvb\"}],\"pricingDimensions\":[{\"id\":\"sflhhca\",\"name\":\"n\"},{\"id\":\"xisxyawjoyaqcsl\",\"name\":\"pkii\"},{\"id\":\"yexz\",\"name\":\"lixhnrztfol\"},{\"id\":\"nxknalaulp\",\"name\":\"gdtpnapnyiro\"}]}}") .toObject(ProviderDescriptionInner.class); - Assertions.assertEquals("pj", model.id()); - Assertions.assertEquals("ujjugwdkcglh", model.properties().targets().get(0).id()); - Assertions.assertEquals("azjdyggd", model.properties().targets().get(0).name()); - Assertions.assertEquals("ixhbkuofqweykhm", model.properties().targets().get(0).description()); - Assertions.assertEquals("vfyexfw", model.properties().targets().get(0).acceptedDataFormats().get(0)); - Assertions.assertEquals("jrefovgmkqsle", model.properties().targets().get(0).acceptedContentEncodings().get(0)); - Assertions.assertEquals("yqjpkcatt", model.properties().skus().get(0).id()); - Assertions.assertEquals("gjcrcczsqpjhvm", model.properties().skus().get(0).name()); - Assertions.assertEquals("jvnysounqe", model.properties().skus().get(0).version()); - Assertions.assertEquals("noae", model.properties().skus().get(0).description()); - Assertions.assertEquals("fhyhltrpmopjmcma", model.properties().skus().get(0).restrictedAccessUri()); - Assertions.assertEquals(false, model.properties().skus().get(0).autoAdd()); - Assertions.assertEquals("hfuiuaodsfc", model.properties().skus().get(0).targets().get(0)); - Assertions.assertEquals("ktwh", model.properties().skus().get(0).quotaDimensions().get(0).id()); - Assertions.assertEquals("xw", model.properties().skus().get(0).quotaDimensions().get(0).scope()); - Assertions.assertEquals("wqsmbsur", model.properties().skus().get(0).quotaDimensions().get(0).period()); - Assertions.assertEquals(85.49606F, model.properties().skus().get(0).quotaDimensions().get(0).quota()); - Assertions.assertEquals("o", model.properties().skus().get(0).quotaDimensions().get(0).name()); - Assertions.assertEquals("ocfs", model.properties().skus().get(0).quotaDimensions().get(0).description()); - Assertions.assertEquals("s", model.properties().skus().get(0).quotaDimensions().get(0).unit()); - Assertions.assertEquals("ddystkiiuxhqy", - model.properties().skus().get(0).quotaDimensions().get(0).unitPlural()); - Assertions.assertEquals("npc", model.properties().skus().get(0).pricingDetails().get(0).id()); - Assertions.assertEquals("ocohslkevleg", model.properties().skus().get(0).pricingDetails().get(0).value()); - Assertions.assertEquals("slhs", model.properties().quotaDimensions().get(0).id()); - Assertions.assertEquals("deemao", model.properties().quotaDimensions().get(0).scope()); - Assertions.assertEquals("xagkvtmelmqkrh", model.properties().quotaDimensions().get(0).period()); - Assertions.assertEquals(25.794971F, model.properties().quotaDimensions().get(0).quota()); - Assertions.assertEquals("juahaquhcdhmdual", model.properties().quotaDimensions().get(0).name()); - Assertions.assertEquals("xqpvfadmw", model.properties().quotaDimensions().get(0).description()); - Assertions.assertEquals("crgvxpvgom", model.properties().quotaDimensions().get(0).unit()); - Assertions.assertEquals("fmisg", model.properties().quotaDimensions().get(0).unitPlural()); - Assertions.assertEquals("beldawkzbaliourq", model.properties().pricingDimensions().get(0).id()); - Assertions.assertEquals("kauhashsfwxo", model.properties().pricingDimensions().get(0).name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProviderDescriptionInner model = new ProviderDescriptionInner().withId("pj") - .withProperties(new ProviderProperties().withAad(new ProviderPropertiesAad()) - .withManagedApplication(new ProviderPropertiesManagedApplication()) - .withTargets(Arrays.asList(new TargetDescription().withId("ujjugwdkcglh") - .withName("azjdyggd") - .withDescription("ixhbkuofqweykhm") - .withAcceptedDataFormats( - Arrays.asList("vfyexfw", "ybcibvyvdcsit", "nnaamdectehfiqsc", "eypvhezrkg")) - .withAcceptedContentEncodings(Arrays.asList("jrefovgmkqsle")))) - .withSkus(Arrays.asList( - new SkuDescription().withId("yqjpkcatt") - .withName("gjcrcczsqpjhvm") - .withVersion("jvnysounqe") - .withDescription("noae") - .withRestrictedAccessUri("fhyhltrpmopjmcma") - .withAutoAdd(false) - .withTargets(Arrays.asList("hfuiuaodsfc", "kvxod", "uozmyzydagfua", "bezy")) - .withQuotaDimensions(Arrays.asList( - new QuotaDimension().withId("ktwh") - .withScope("xw") - .withPeriod("wqsmbsur") - .withQuota(85.49606F) - .withName("o") - .withDescription("ocfs") - .withUnit("s") - .withUnitPlural("ddystkiiuxhqy"), - new QuotaDimension().withId("xorrqnb") - .withScope("czvyifq") - .withPeriod("kdvjsll") - .withQuota(80.76506F) - .withName("d") - .withDescription("atkpnp") - .withUnit("exxbczwtr") - .withUnitPlural("iqzbq"), - new QuotaDimension().withId("sovmyokacspkwl") - .withScope("dobpxjmflbvvn") - .withPeriod("rkcciwwzjuqk") - .withQuota(7.702547F) - .withName("jiwkuofoskghsau") - .withDescription("mjmvxieduugidyjr") - .withUnit("byao") - .withUnitPlural("e"))) - .withPricingDetails(Arrays.asList(new PricingDetail().withId("npc").withValue("ocohslkevleg"), - new PricingDetail().withId("fbuhfmvfaxkffe").withValue("th"), - new PricingDetail().withId("m").withValue("yvshxmz"))), - new SkuDescription().withId("bzoggigrx") - .withName("ur") - .withVersion("xxjnspydptk") - .withDescription("nkoukn") - .withRestrictedAccessUri("dwtiukbldngkp") - .withAutoAdd(true) - .withTargets(Arrays.asList("z", "xoegukgjnpiucgy", "evqzntypmrbp")) - .withQuotaDimensions(Arrays.asList(new QuotaDimension().withId("r") - .withScope("sdpydnfyhxdeoejz") - .withPeriod("w") - .withQuota(67.792435F) - .withName("ttgzfbis") - .withDescription("bkh") - .withUnit("deyeamdphagalpbu") - .withUnitPlural("gipwhonowkg"))) - .withPricingDetails( - Arrays.asList(new PricingDetail().withId("nkixzbinj").withValue("uttmrywnuzoqft"), - new PricingDetail().withId("qzrnkcqvyxlwhz").withValue("icohoqqnwvl"), - new PricingDetail().withId("avwhheunm").withValue("hgyxzkonoc"))), - new SkuDescription().withId("oklyaxuconuq") - .withName("fkbey") - .withVersion("wrmjmwvvjektc") - .withDescription("enhwlrs") - .withRestrictedAccessUri("rzpwvlqdqgbiq") - .withAutoAdd(true) - .withTargets(Arrays.asList("aetcktvfcivfs")) - .withQuotaDimensions(Arrays.asList( - new QuotaDimension().withId("uctqhjfbe") - .withScope("jcxerfuwu") - .withPeriod("txfvjrbirph") - .withQuota(84.526054F) - .withName("yva") - .withDescription("nljky") - .withUnit("j") - .withUnitPlural("ujqgidok"), - new QuotaDimension().withId("ljyoxgvcltb") - .withScope("ncghkje") - .withPeriod("zhbijhtxfv") - .withQuota(15.551442F) - .withName("smx") - .withDescription("hmpvecx") - .withUnit("debfqkkrbmpukgri") - .withUnitPlural("lzlfbxzpuz"), - new QuotaDimension().withId("ispnqzahmgkbrp") - .withScope("dhibnuq") - .withPeriod("pikad") - .withQuota(14.613795F) - .withName("qagnbuyn") - .withDescription("jggmebfsiarbu") - .withUnit("cvpnazzmhjrunmpx") - .withUnitPlural("dbhrbnlankxm"), - new QuotaDimension().withId("k") - .withScope("henbtkcxywnytn") - .withPeriod("yn") - .withQuota(52.88253F) - .withName("ybyxc") - .withDescription("clha") - .withUnit("dbabp") - .withUnitPlural("wrqlfktsthsuco"))) - .withPricingDetails( - Arrays.asList(new PricingDetail().withId("yazttbtwwrqpue").withValue("kzywbiex"), - new PricingDetail().withId("eyueaxibxujwb").withValue("walm"), - new PricingDetail().withId("yoxa").withValue("dkzjancuxrh"), - new PricingDetail().withId("bavxbniwdjswzt").withValue("bpg"))), - new SkuDescription().withId("ytxhp") - .withName("bzpfzab") - .withVersion("cuh") - .withDescription("tcty") - .withRestrictedAccessUri("klbb") - .withAutoAdd(true) - .withTargets(Arrays.asList("zbhvgyuguosv", "kfssxqukkf", "l")) - .withQuotaDimensions(Arrays.asList( - new QuotaDimension().withId("xnkjzkdesl") - .withScope("lopwiyig") - .withPeriod("pkdwzbai") - .withQuota(69.34189F) - .withName("a") - .withDescription("nyqupedeojnabck") - .withUnit("mtxpsiebtfh") - .withUnitPlural("esap"), - new QuotaDimension().withId("rdqmhjjdhtldwkyz") - .withScope("utknc") - .withPeriod("cwsvlxotog") - .withQuota(71.378235F) - .withName("pqsxvnmicy") - .withDescription("ceoveilovno") - .withUnit("fj") - .withUnitPlural("njbkcnxdhbttkph"), - new QuotaDimension().withId("pnvjtoqnermclf") - .withScope("phoxus") - .withPeriod("pabgyeps") - .withQuota(95.976326F) - .withName("zq") - .withDescription("xywpmueefjzwfqkq") - .withUnit("ids") - .withUnitPlural("onobglaocqx"), - new QuotaDimension().withId("cmgyud") - .withScope("tlmoyrx") - .withPeriod("fudwpznt") - .withQuota(32.9984F) - .withName("hl") - .withDescription("jbhckfrlhr") - .withUnit("bkyvp") - .withUnitPlural("anuzbpzkafkuw"))) - .withPricingDetails(Arrays.asList(new PricingDetail().withId("wbme").withValue("seyvj"))))) - .withQuotaDimensions(Arrays.asList(new QuotaDimension().withId("slhs") - .withScope("deemao") - .withPeriod("xagkvtmelmqkrh") - .withQuota(25.794971F) - .withName("juahaquhcdhmdual") - .withDescription("xqpvfadmw") - .withUnit("crgvxpvgom") - .withUnitPlural("fmisg"))) - .withPricingDimensions( - Arrays.asList(new PricingDimension().withId("beldawkzbaliourq").withName("kauhashsfwxo"), - new PricingDimension().withId("w").withName("cugicjoox")))); - model = BinaryData.fromObject(model).toObject(ProviderDescriptionInner.class); - Assertions.assertEquals("pj", model.id()); - Assertions.assertEquals("ujjugwdkcglh", model.properties().targets().get(0).id()); - Assertions.assertEquals("azjdyggd", model.properties().targets().get(0).name()); - Assertions.assertEquals("ixhbkuofqweykhm", model.properties().targets().get(0).description()); - Assertions.assertEquals("vfyexfw", model.properties().targets().get(0).acceptedDataFormats().get(0)); - Assertions.assertEquals("jrefovgmkqsle", model.properties().targets().get(0).acceptedContentEncodings().get(0)); - Assertions.assertEquals("yqjpkcatt", model.properties().skus().get(0).id()); - Assertions.assertEquals("gjcrcczsqpjhvm", model.properties().skus().get(0).name()); - Assertions.assertEquals("jvnysounqe", model.properties().skus().get(0).version()); - Assertions.assertEquals("noae", model.properties().skus().get(0).description()); - Assertions.assertEquals("fhyhltrpmopjmcma", model.properties().skus().get(0).restrictedAccessUri()); - Assertions.assertEquals(false, model.properties().skus().get(0).autoAdd()); - Assertions.assertEquals("hfuiuaodsfc", model.properties().skus().get(0).targets().get(0)); - Assertions.assertEquals("ktwh", model.properties().skus().get(0).quotaDimensions().get(0).id()); - Assertions.assertEquals("xw", model.properties().skus().get(0).quotaDimensions().get(0).scope()); - Assertions.assertEquals("wqsmbsur", model.properties().skus().get(0).quotaDimensions().get(0).period()); - Assertions.assertEquals(85.49606F, model.properties().skus().get(0).quotaDimensions().get(0).quota()); - Assertions.assertEquals("o", model.properties().skus().get(0).quotaDimensions().get(0).name()); - Assertions.assertEquals("ocfs", model.properties().skus().get(0).quotaDimensions().get(0).description()); - Assertions.assertEquals("s", model.properties().skus().get(0).quotaDimensions().get(0).unit()); - Assertions.assertEquals("ddystkiiuxhqy", - model.properties().skus().get(0).quotaDimensions().get(0).unitPlural()); - Assertions.assertEquals("npc", model.properties().skus().get(0).pricingDetails().get(0).id()); - Assertions.assertEquals("ocohslkevleg", model.properties().skus().get(0).pricingDetails().get(0).value()); - Assertions.assertEquals("slhs", model.properties().quotaDimensions().get(0).id()); - Assertions.assertEquals("deemao", model.properties().quotaDimensions().get(0).scope()); - Assertions.assertEquals("xagkvtmelmqkrh", model.properties().quotaDimensions().get(0).period()); - Assertions.assertEquals(25.794971F, model.properties().quotaDimensions().get(0).quota()); - Assertions.assertEquals("juahaquhcdhmdual", model.properties().quotaDimensions().get(0).name()); - Assertions.assertEquals("xqpvfadmw", model.properties().quotaDimensions().get(0).description()); - Assertions.assertEquals("crgvxpvgom", model.properties().quotaDimensions().get(0).unit()); - Assertions.assertEquals("fmisg", model.properties().quotaDimensions().get(0).unitPlural()); - Assertions.assertEquals("beldawkzbaliourq", model.properties().pricingDimensions().get(0).id()); - Assertions.assertEquals("kauhashsfwxo", model.properties().pricingDimensions().get(0).name()); + Assertions.assertEquals("nehmpvecx", model.id()); + Assertions.assertEquals("myskpbhenbtkcxy", model.properties().targets().get(0).id()); + Assertions.assertEquals("y", model.properties().targets().get(0).name()); + Assertions.assertEquals("rsyn", model.properties().targets().get(0).description()); + Assertions.assertEquals("dybyxczfclhaa", model.properties().targets().get(0).acceptedDataFormats().get(0)); + Assertions.assertEquals("tsthsucocm", model.properties().targets().get(0).acceptedContentEncodings().get(0)); + Assertions.assertEquals("pfza", model.properties().skus().get(0).id()); + Assertions.assertEquals("lcuhxwtctyqiklb", model.properties().skus().get(0).name()); + Assertions.assertEquals("vplwzbhv", model.properties().skus().get(0).version()); + Assertions.assertEquals("u", model.properties().skus().get(0).description()); + Assertions.assertEquals("osvmk", model.properties().skus().get(0).restrictedAccessUri()); + Assertions.assertFalse(model.properties().skus().get(0).autoAdd()); + Assertions.assertEquals("ukkfplgmgs", model.properties().skus().get(0).targets().get(0)); + Assertions.assertEquals("ghxpkdw", model.properties().skus().get(0).quotaDimensions().get(0).id()); + Assertions.assertEquals("aiuebbaumnyqu", model.properties().skus().get(0).quotaDimensions().get(0).scope()); + Assertions.assertEquals("deoj", model.properties().skus().get(0).quotaDimensions().get(0).period()); + Assertions.assertEquals(67.37568F, model.properties().skus().get(0).quotaDimensions().get(0).quota()); + Assertions.assertEquals("khsmtxpsiebt", model.properties().skus().get(0).quotaDimensions().get(0).name()); + Assertions.assertEquals("vpesapskrdqmhjjd", + model.properties().skus().get(0).quotaDimensions().get(0).description()); + Assertions.assertEquals("ldwkyzxuutkn", model.properties().skus().get(0).quotaDimensions().get(0).unit()); + Assertions.assertEquals("scwsv", model.properties().skus().get(0).quotaDimensions().get(0).unitPlural()); + Assertions.assertEquals("ttkphywpnvjtoqne", model.properties().skus().get(0).pricingDetails().get(0).id()); + Assertions.assertEquals("clfp", model.properties().skus().get(0).pricingDetails().get(0).value()); + Assertions.assertEquals("uwhvylwzbtdhxujz", model.properties().quotaDimensions().get(0).id()); + Assertions.assertEquals("mpowuwpr", model.properties().quotaDimensions().get(0).scope()); + Assertions.assertEquals("lve", model.properties().quotaDimensions().get(0).period()); + Assertions.assertEquals(23.059952F, model.properties().quotaDimensions().get(0).quota()); + Assertions.assertEquals("pjmkhfxobbc", model.properties().quotaDimensions().get(0).name()); + Assertions.assertEquals("s", model.properties().quotaDimensions().get(0).description()); + Assertions.assertEquals("jriplrbpbewtghf", model.properties().quotaDimensions().get(0).unit()); + Assertions.assertEquals("lcgwxzvlvqh", model.properties().quotaDimensions().get(0).unitPlural()); + Assertions.assertEquals("sflhhca", model.properties().pricingDimensions().get(0).id()); + Assertions.assertEquals("n", model.properties().pricingDimensions().get(0).name()); } } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/ProviderPropertiesAadTests.java b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/ProviderPropertiesAadTests.java index e4c662264c05..fae32aac875d 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/ProviderPropertiesAadTests.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/ProviderPropertiesAadTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.generated; @@ -10,13 +10,8 @@ public final class ProviderPropertiesAadTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ProviderPropertiesAad model = BinaryData.fromString("{\"applicationId\":\"z\",\"tenantId\":\"hzxct\"}") - .toObject(ProviderPropertiesAad.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProviderPropertiesAad model = new ProviderPropertiesAad(); - model = BinaryData.fromObject(model).toObject(ProviderPropertiesAad.class); + ProviderPropertiesAad model + = BinaryData.fromString("{\"applicationId\":\"enwabfatk\",\"tenantId\":\"dxbjhwuaanozj\"}") + .toObject(ProviderPropertiesAad.class); } } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/ProviderPropertiesManagedApplicationTests.java b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/ProviderPropertiesManagedApplicationTests.java index 1c3626843b44..464a8df5ec5b 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/ProviderPropertiesManagedApplicationTests.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/ProviderPropertiesManagedApplicationTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.generated; @@ -11,13 +11,7 @@ public final class ProviderPropertiesManagedApplicationTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ProviderPropertiesManagedApplication model - = BinaryData.fromString("{\"publisherId\":\"gbkdmoizpos\",\"offerId\":\"grcfb\"}") + = BinaryData.fromString("{\"publisherId\":\"ph\",\"offerId\":\"ulpjr\"}") .toObject(ProviderPropertiesManagedApplication.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProviderPropertiesManagedApplication model = new ProviderPropertiesManagedApplication(); - model = BinaryData.fromObject(model).toObject(ProviderPropertiesManagedApplication.class); - } } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/ProviderPropertiesTests.java b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/ProviderPropertiesTests.java index f935419841ed..88decf8f823b 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/ProviderPropertiesTests.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/ProviderPropertiesTests.java @@ -1,140 +1,50 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quantum.models.PricingDetail; -import com.azure.resourcemanager.quantum.models.PricingDimension; import com.azure.resourcemanager.quantum.models.ProviderProperties; -import com.azure.resourcemanager.quantum.models.ProviderPropertiesAad; -import com.azure.resourcemanager.quantum.models.ProviderPropertiesManagedApplication; -import com.azure.resourcemanager.quantum.models.QuotaDimension; -import com.azure.resourcemanager.quantum.models.SkuDescription; -import com.azure.resourcemanager.quantum.models.TargetDescription; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class ProviderPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ProviderProperties model = BinaryData.fromString( - "{\"description\":\"ebwpucwwfvo\",\"providerType\":\"vmeueci\",\"company\":\"hzceuojgjrwjue\",\"defaultEndpoint\":\"twm\",\"aad\":{\"applicationId\":\"tdx\",\"tenantId\":\"txnrjaw\"},\"managedApplication\":{\"publisherId\":\"gxhnisk\",\"offerId\":\"bkpyc\"},\"targets\":[{\"id\":\"ndnhj\",\"name\":\"uwhvylwzbtdhxujz\",\"description\":\"mpowuwpr\",\"acceptedDataFormats\":[\"veual\"],\"acceptedContentEncodings\":[\"mkh\"]}],\"skus\":[{\"id\":\"bcswsrt\",\"name\":\"iplrbpbewtghfgb\",\"version\":\"gw\",\"description\":\"vlvqhjkbegi\",\"restrictedAccessUri\":\"nmxiebwwaloayqc\",\"autoAdd\":false,\"targets\":[\"j\",\"zg\"],\"quotaDimensions\":[{\"id\":\"htxongmtsavjc\",\"scope\":\"wxqpsrknftguvri\",\"period\":\"prwmdyvxqt\",\"quota\":42.644672,\"name\":\"ww\",\"description\":\"yqbexrmcqibycno\",\"unit\":\"knme\",\"unitPlural\":\"sgzvahapjyzhpv\"}],\"pricingDetails\":[{\"id\":\"j\",\"value\":\"xdjzlmwlxk\"},{\"id\":\"gfhzovawjvzunlut\",\"value\":\"n\"},{\"id\":\"nxipeil\",\"value\":\"zuaejxd\"},{\"id\":\"tskzbbtdzumveek\",\"value\":\"wozuhkf\"}]}],\"quotaDimensions\":[{\"id\":\"yofd\",\"scope\":\"uusdttouwa\",\"period\":\"ekqvkeln\",\"quota\":63.19878,\"name\":\"xwyjsflhhc\",\"description\":\"lnjixisxya\",\"unit\":\"oyaqcslyjpkiid\",\"unitPlural\":\"exznelixhnr\"},{\"id\":\"folhbnxknal\",\"scope\":\"lp\",\"period\":\"gdtpnapnyiro\",\"quota\":27.694834,\"name\":\"igvpgylg\",\"description\":\"itxmedjvcslynqww\",\"unit\":\"wzz\",\"unitPlural\":\"gktrmgucnapkte\"}],\"pricingDimensions\":[{\"id\":\"wptfdy\",\"name\":\"fqbuaceopzf\"},{\"id\":\"hhuao\",\"name\":\"pcqeqx\"}]}") + "{\"description\":\"hpigv\",\"providerType\":\"ylgqgitxmedjvcsl\",\"company\":\"qwwncw\",\"defaultEndpoint\":\"hxg\",\"aad\":{\"applicationId\":\"mgucna\",\"tenantId\":\"t\"},\"managedApplication\":{\"publisherId\":\"llwptfdy\",\"offerId\":\"fqbuaceopzf\"},\"targets\":[{\"id\":\"uaopppcqeq\",\"name\":\"lzdahzxctobgbkdm\",\"description\":\"zpostmgrcfbu\",\"acceptedDataFormats\":[\"fqjhhkxbpvjymj\",\"xxjyngudivkrtsw\",\"xqzvszjfa\"],\"acceptedContentEncodings\":[\"fdxxivetvtcqaqtd\"],\"numQubits\":608754752,\"targetProfile\":\"bxvwv\",\"metadata\":{\"obl\":\"\\\"datalqbhsf\\\"\"}},{\"id\":\"k\",\"name\":\"mpew\",\"description\":\"fbkrvrnsvs\",\"acceptedDataFormats\":[\"ohxcrsbfova\",\"rruvwbhsq\"],\"acceptedContentEncodings\":[\"bcgjbirxbp\",\"bsrfbj\",\"dtws\"],\"numQubits\":22179172,\"targetProfile\":\"tpvjzbexilzznfqq\",\"metadata\":{\"ujmkcjhwqy\":\"\\\"datapmqtaru\\\"\",\"naenqpehindo\":\"\\\"datajrybnwjewgdrjer\\\"\"}}],\"skus\":[{\"id\":\"fthnzdn\",\"name\":\"l\",\"version\":\"ayqigynduhav\",\"description\":\"lkthu\",\"restrictedAccessUri\":\"qolbgyc\",\"autoAdd\":true,\"targets\":[\"tgccymvaolpss\"],\"quotaDimensions\":[{\"id\":\"mmdnbbglzps\",\"scope\":\"ydmcwyhzdxssa\",\"period\":\"zmnvdfznudaod\",\"quota\":16.816956,\"name\":\"ncblylpst\",\"description\":\"hh\",\"unit\":\"rzdzucerscdnt\",\"unitPlural\":\"vfiwjmygtdss\"},{\"id\":\"wtmwerio\",\"scope\":\"pyqs\",\"period\":\"wab\",\"quota\":57.78845,\"name\":\"hhszh\",\"description\":\"plvwiwubmwmbes\",\"unit\":\"nkww\",\"unitPlural\":\"pjflcxogao\"},{\"id\":\"nzmnsikvm\",\"scope\":\"ze\",\"period\":\"kdltfzxmhhvhg\",\"quota\":55.672485,\"name\":\"dkwobdagx\",\"description\":\"bqdxbx\",\"unit\":\"kbogqxndlkzgx\",\"unitPlural\":\"ripl\"},{\"id\":\"odxun\",\"scope\":\"ebxmubyynt\",\"period\":\"rbqtkoie\",\"quota\":24.519556,\"name\":\"tgqr\",\"description\":\"tmuwlauwzi\",\"unit\":\"bm\",\"unitPlural\":\"cjefuzmu\"}],\"pricingDetails\":[{\"id\":\"tdum\",\"value\":\"p\"},{\"id\":\"ebmnzbtbhjpglk\",\"value\":\"ohdneuel\"},{\"id\":\"hsd\",\"value\":\"t\"}]},{\"id\":\"fikdowwqu\",\"name\":\"xzxcl\",\"version\":\"thhqzonosggbh\",\"description\":\"hfwdsjnkaljutiis\",\"restrictedAccessUri\":\"cffgdkzzewk\",\"autoAdd\":true,\"targets\":[\"railvpnppfuf\",\"rwdmhdlxyjrxsa\"],\"quotaDimensions\":[{\"id\":\"nihgwqapnedg\",\"scope\":\"cvkcvqvpkeqdcv\",\"period\":\"hvoodsotbobzd\",\"quota\":26.7008,\"name\":\"wvnhdldwmgx\",\"description\":\"rslpmutwuoeg\",\"unit\":\"khjwn\",\"unitPlural\":\"qsluicp\"},{\"id\":\"gk\",\"scope\":\"lvmbmpaxmodfvuef\",\"period\":\"sbpfvmwyhr\",\"quota\":28.787529,\"name\":\"ft\",\"description\":\"kcpwiy\",\"unit\":\"qtmnubexkpzk\",\"unitPlural\":\"ondjmq\"}],\"pricingDetails\":[{\"id\":\"pomgkopkwhojvp\",\"value\":\"qgxy\"},{\"id\":\"ocmbqfqvmkcxoza\",\"value\":\"helxprglya\"},{\"id\":\"dckcbc\",\"value\":\"jrjxgciqibrhosx\"},{\"id\":\"qrhzoymibmrqyib\",\"value\":\"wfluszdt\"}]},{\"id\":\"rkwofyyvoqa\",\"name\":\"iexpbtgiwbwo\",\"version\":\"washr\",\"description\":\"tkcnqxwb\",\"restrictedAccessUri\":\"kulpiujwaasi\",\"autoAdd\":false,\"targets\":[\"byuqerpqlp\"],\"quotaDimensions\":[{\"id\":\"iuqgbdbutauv\",\"scope\":\"tkuwhhmhykojo\",\"period\":\"fnndl\",\"quota\":67.95136,\"name\":\"koymkcd\",\"description\":\"bpkkpwdre\",\"unit\":\"ovvqfovljxywsu\",\"unitPlural\":\"yrs\"},{\"id\":\"sytgadgvraea\",\"scope\":\"e\",\"period\":\"zar\",\"quota\":93.18957,\"name\":\"uu\",\"description\":\"fqka\",\"unit\":\"wiipfpub\",\"unitPlural\":\"bwwift\"},{\"id\":\"qkvpuvksgplsakn\",\"scope\":\"fsynljphuop\",\"period\":\"dlqiyntorzih\",\"quota\":39.111107,\"name\":\"jswsrmslyz\",\"description\":\"zbchckqqzqioxiy\",\"unit\":\"iizynkedyatrwyh\",\"unitPlural\":\"ibzyhwitsmyp\"},{\"id\":\"npcdpumnzgm\",\"scope\":\"nmabik\",\"period\":\"orgjhxbldt\",\"quota\":45.90471,\"name\":\"lkdmtncvokotllxd\",\"description\":\"gsyocogj\",\"unit\":\"dtbnnha\",\"unitPlural\":\"ocrkvcikh\"}],\"pricingDetails\":[{\"id\":\"mqg\",\"value\":\"queziky\"}]}],\"quotaDimensions\":[{\"id\":\"kallatmel\",\"scope\":\"ipicc\",\"period\":\"kzivgvvcnayrh\",\"quota\":78.620316,\"name\":\"xmueed\",\"description\":\"rdvstkwqqtch\",\"unit\":\"lmfmtdaay\",\"unitPlural\":\"v\"}],\"pricingDimensions\":[{\"id\":\"iohgwxrtfud\",\"name\":\"pxgy\"},{\"id\":\"gvr\",\"name\":\"npkukghimdblx\"},{\"id\":\"imfnjhfjx\",\"name\":\"szkkfoqre\"},{\"id\":\"kzikfjawneaivxwc\",\"name\":\"lpcirelsf\"}]}") .toObject(ProviderProperties.class); - Assertions.assertEquals("ndnhj", model.targets().get(0).id()); - Assertions.assertEquals("uwhvylwzbtdhxujz", model.targets().get(0).name()); - Assertions.assertEquals("mpowuwpr", model.targets().get(0).description()); - Assertions.assertEquals("veual", model.targets().get(0).acceptedDataFormats().get(0)); - Assertions.assertEquals("mkh", model.targets().get(0).acceptedContentEncodings().get(0)); - Assertions.assertEquals("bcswsrt", model.skus().get(0).id()); - Assertions.assertEquals("iplrbpbewtghfgb", model.skus().get(0).name()); - Assertions.assertEquals("gw", model.skus().get(0).version()); - Assertions.assertEquals("vlvqhjkbegi", model.skus().get(0).description()); - Assertions.assertEquals("nmxiebwwaloayqc", model.skus().get(0).restrictedAccessUri()); - Assertions.assertEquals(false, model.skus().get(0).autoAdd()); - Assertions.assertEquals("j", model.skus().get(0).targets().get(0)); - Assertions.assertEquals("htxongmtsavjc", model.skus().get(0).quotaDimensions().get(0).id()); - Assertions.assertEquals("wxqpsrknftguvri", model.skus().get(0).quotaDimensions().get(0).scope()); - Assertions.assertEquals("prwmdyvxqt", model.skus().get(0).quotaDimensions().get(0).period()); - Assertions.assertEquals(42.644672F, model.skus().get(0).quotaDimensions().get(0).quota()); - Assertions.assertEquals("ww", model.skus().get(0).quotaDimensions().get(0).name()); - Assertions.assertEquals("yqbexrmcqibycno", model.skus().get(0).quotaDimensions().get(0).description()); - Assertions.assertEquals("knme", model.skus().get(0).quotaDimensions().get(0).unit()); - Assertions.assertEquals("sgzvahapjyzhpv", model.skus().get(0).quotaDimensions().get(0).unitPlural()); - Assertions.assertEquals("j", model.skus().get(0).pricingDetails().get(0).id()); - Assertions.assertEquals("xdjzlmwlxk", model.skus().get(0).pricingDetails().get(0).value()); - Assertions.assertEquals("yofd", model.quotaDimensions().get(0).id()); - Assertions.assertEquals("uusdttouwa", model.quotaDimensions().get(0).scope()); - Assertions.assertEquals("ekqvkeln", model.quotaDimensions().get(0).period()); - Assertions.assertEquals(63.19878F, model.quotaDimensions().get(0).quota()); - Assertions.assertEquals("xwyjsflhhc", model.quotaDimensions().get(0).name()); - Assertions.assertEquals("lnjixisxya", model.quotaDimensions().get(0).description()); - Assertions.assertEquals("oyaqcslyjpkiid", model.quotaDimensions().get(0).unit()); - Assertions.assertEquals("exznelixhnr", model.quotaDimensions().get(0).unitPlural()); - Assertions.assertEquals("wptfdy", model.pricingDimensions().get(0).id()); - Assertions.assertEquals("fqbuaceopzf", model.pricingDimensions().get(0).name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProviderProperties model = new ProviderProperties().withAad(new ProviderPropertiesAad()) - .withManagedApplication(new ProviderPropertiesManagedApplication()) - .withTargets(Arrays.asList(new TargetDescription().withId("ndnhj") - .withName("uwhvylwzbtdhxujz") - .withDescription("mpowuwpr") - .withAcceptedDataFormats(Arrays.asList("veual")) - .withAcceptedContentEncodings(Arrays.asList("mkh")))) - .withSkus(Arrays.asList(new SkuDescription().withId("bcswsrt") - .withName("iplrbpbewtghfgb") - .withVersion("gw") - .withDescription("vlvqhjkbegi") - .withRestrictedAccessUri("nmxiebwwaloayqc") - .withAutoAdd(false) - .withTargets(Arrays.asList("j", "zg")) - .withQuotaDimensions(Arrays.asList(new QuotaDimension().withId("htxongmtsavjc") - .withScope("wxqpsrknftguvri") - .withPeriod("prwmdyvxqt") - .withQuota(42.644672F) - .withName("ww") - .withDescription("yqbexrmcqibycno") - .withUnit("knme") - .withUnitPlural("sgzvahapjyzhpv"))) - .withPricingDetails(Arrays.asList(new PricingDetail().withId("j").withValue("xdjzlmwlxk"), - new PricingDetail().withId("gfhzovawjvzunlut").withValue("n"), - new PricingDetail().withId("nxipeil").withValue("zuaejxd"), - new PricingDetail().withId("tskzbbtdzumveek").withValue("wozuhkf"))))) - .withQuotaDimensions(Arrays.asList( - new QuotaDimension().withId("yofd") - .withScope("uusdttouwa") - .withPeriod("ekqvkeln") - .withQuota(63.19878F) - .withName("xwyjsflhhc") - .withDescription("lnjixisxya") - .withUnit("oyaqcslyjpkiid") - .withUnitPlural("exznelixhnr"), - new QuotaDimension().withId("folhbnxknal") - .withScope("lp") - .withPeriod("gdtpnapnyiro") - .withQuota(27.694834F) - .withName("igvpgylg") - .withDescription("itxmedjvcslynqww") - .withUnit("wzz") - .withUnitPlural("gktrmgucnapkte"))) - .withPricingDimensions(Arrays.asList(new PricingDimension().withId("wptfdy").withName("fqbuaceopzf"), - new PricingDimension().withId("hhuao").withName("pcqeqx"))); - model = BinaryData.fromObject(model).toObject(ProviderProperties.class); - Assertions.assertEquals("ndnhj", model.targets().get(0).id()); - Assertions.assertEquals("uwhvylwzbtdhxujz", model.targets().get(0).name()); - Assertions.assertEquals("mpowuwpr", model.targets().get(0).description()); - Assertions.assertEquals("veual", model.targets().get(0).acceptedDataFormats().get(0)); - Assertions.assertEquals("mkh", model.targets().get(0).acceptedContentEncodings().get(0)); - Assertions.assertEquals("bcswsrt", model.skus().get(0).id()); - Assertions.assertEquals("iplrbpbewtghfgb", model.skus().get(0).name()); - Assertions.assertEquals("gw", model.skus().get(0).version()); - Assertions.assertEquals("vlvqhjkbegi", model.skus().get(0).description()); - Assertions.assertEquals("nmxiebwwaloayqc", model.skus().get(0).restrictedAccessUri()); - Assertions.assertEquals(false, model.skus().get(0).autoAdd()); - Assertions.assertEquals("j", model.skus().get(0).targets().get(0)); - Assertions.assertEquals("htxongmtsavjc", model.skus().get(0).quotaDimensions().get(0).id()); - Assertions.assertEquals("wxqpsrknftguvri", model.skus().get(0).quotaDimensions().get(0).scope()); - Assertions.assertEquals("prwmdyvxqt", model.skus().get(0).quotaDimensions().get(0).period()); - Assertions.assertEquals(42.644672F, model.skus().get(0).quotaDimensions().get(0).quota()); - Assertions.assertEquals("ww", model.skus().get(0).quotaDimensions().get(0).name()); - Assertions.assertEquals("yqbexrmcqibycno", model.skus().get(0).quotaDimensions().get(0).description()); - Assertions.assertEquals("knme", model.skus().get(0).quotaDimensions().get(0).unit()); - Assertions.assertEquals("sgzvahapjyzhpv", model.skus().get(0).quotaDimensions().get(0).unitPlural()); - Assertions.assertEquals("j", model.skus().get(0).pricingDetails().get(0).id()); - Assertions.assertEquals("xdjzlmwlxk", model.skus().get(0).pricingDetails().get(0).value()); - Assertions.assertEquals("yofd", model.quotaDimensions().get(0).id()); - Assertions.assertEquals("uusdttouwa", model.quotaDimensions().get(0).scope()); - Assertions.assertEquals("ekqvkeln", model.quotaDimensions().get(0).period()); - Assertions.assertEquals(63.19878F, model.quotaDimensions().get(0).quota()); - Assertions.assertEquals("xwyjsflhhc", model.quotaDimensions().get(0).name()); - Assertions.assertEquals("lnjixisxya", model.quotaDimensions().get(0).description()); - Assertions.assertEquals("oyaqcslyjpkiid", model.quotaDimensions().get(0).unit()); - Assertions.assertEquals("exznelixhnr", model.quotaDimensions().get(0).unitPlural()); - Assertions.assertEquals("wptfdy", model.pricingDimensions().get(0).id()); - Assertions.assertEquals("fqbuaceopzf", model.pricingDimensions().get(0).name()); + Assertions.assertEquals("uaopppcqeq", model.targets().get(0).id()); + Assertions.assertEquals("lzdahzxctobgbkdm", model.targets().get(0).name()); + Assertions.assertEquals("zpostmgrcfbu", model.targets().get(0).description()); + Assertions.assertEquals("fqjhhkxbpvjymj", model.targets().get(0).acceptedDataFormats().get(0)); + Assertions.assertEquals("fdxxivetvtcqaqtd", model.targets().get(0).acceptedContentEncodings().get(0)); + Assertions.assertEquals("fthnzdn", model.skus().get(0).id()); + Assertions.assertEquals("l", model.skus().get(0).name()); + Assertions.assertEquals("ayqigynduhav", model.skus().get(0).version()); + Assertions.assertEquals("lkthu", model.skus().get(0).description()); + Assertions.assertEquals("qolbgyc", model.skus().get(0).restrictedAccessUri()); + Assertions.assertTrue(model.skus().get(0).autoAdd()); + Assertions.assertEquals("tgccymvaolpss", model.skus().get(0).targets().get(0)); + Assertions.assertEquals("mmdnbbglzps", model.skus().get(0).quotaDimensions().get(0).id()); + Assertions.assertEquals("ydmcwyhzdxssa", model.skus().get(0).quotaDimensions().get(0).scope()); + Assertions.assertEquals("zmnvdfznudaod", model.skus().get(0).quotaDimensions().get(0).period()); + Assertions.assertEquals(16.816956F, model.skus().get(0).quotaDimensions().get(0).quota()); + Assertions.assertEquals("ncblylpst", model.skus().get(0).quotaDimensions().get(0).name()); + Assertions.assertEquals("hh", model.skus().get(0).quotaDimensions().get(0).description()); + Assertions.assertEquals("rzdzucerscdnt", model.skus().get(0).quotaDimensions().get(0).unit()); + Assertions.assertEquals("vfiwjmygtdss", model.skus().get(0).quotaDimensions().get(0).unitPlural()); + Assertions.assertEquals("tdum", model.skus().get(0).pricingDetails().get(0).id()); + Assertions.assertEquals("p", model.skus().get(0).pricingDetails().get(0).value()); + Assertions.assertEquals("kallatmel", model.quotaDimensions().get(0).id()); + Assertions.assertEquals("ipicc", model.quotaDimensions().get(0).scope()); + Assertions.assertEquals("kzivgvvcnayrh", model.quotaDimensions().get(0).period()); + Assertions.assertEquals(78.620316F, model.quotaDimensions().get(0).quota()); + Assertions.assertEquals("xmueed", model.quotaDimensions().get(0).name()); + Assertions.assertEquals("rdvstkwqqtch", model.quotaDimensions().get(0).description()); + Assertions.assertEquals("lmfmtdaay", model.quotaDimensions().get(0).unit()); + Assertions.assertEquals("v", model.quotaDimensions().get(0).unitPlural()); + Assertions.assertEquals("iohgwxrtfud", model.pricingDimensions().get(0).id()); + Assertions.assertEquals("pxgy", model.pricingDimensions().get(0).name()); } } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/ProviderTests.java b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/ProviderTests.java index e7ffc7e37d42..28eb31371ddb 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/ProviderTests.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/ProviderTests.java @@ -1,11 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.quantum.models.Provider; +import com.azure.resourcemanager.quantum.models.QuotaAllocations; import com.azure.resourcemanager.quantum.models.Status; import org.junit.jupiter.api.Assertions; @@ -13,30 +14,36 @@ public final class ProviderTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { Provider model = BinaryData.fromString( - "{\"providerId\":\"mofcq\",\"providerSku\":\"my\",\"instanceUri\":\"kdtmlxhekuk\",\"applicationName\":\"txukcdmp\",\"provisioningState\":\"Failed\",\"resourceUsageId\":\"y\"}") + "{\"providerId\":\"ppeebvmgxsab\",\"providerSku\":\"qduujitcjczdz\",\"instanceUri\":\"ndhkrw\",\"applicationName\":\"appd\",\"provisioningState\":\"Deleting\",\"resourceUsageId\":\"vwrwj\",\"quotas\":{\"standardMinutesLifetime\":2141844336,\"highMinutesLifetime\":1882901501}}") .toObject(Provider.class); - Assertions.assertEquals("mofcq", model.providerId()); - Assertions.assertEquals("my", model.providerSku()); - Assertions.assertEquals("kdtmlxhekuk", model.instanceUri()); - Assertions.assertEquals("txukcdmp", model.applicationName()); - Assertions.assertEquals(Status.FAILED, model.provisioningState()); - Assertions.assertEquals("y", model.resourceUsageId()); + Assertions.assertEquals("ppeebvmgxsab", model.providerId()); + Assertions.assertEquals("qduujitcjczdz", model.providerSku()); + Assertions.assertEquals("ndhkrw", model.instanceUri()); + Assertions.assertEquals("appd", model.applicationName()); + Assertions.assertEquals(Status.DELETING, model.provisioningState()); + Assertions.assertEquals("vwrwj", model.resourceUsageId()); + Assertions.assertEquals(2141844336, model.quotas().standardMinutesLifetime()); + Assertions.assertEquals(1882901501, model.quotas().highMinutesLifetime()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Provider model = new Provider().withProviderId("mofcq") - .withProviderSku("my") - .withInstanceUri("kdtmlxhekuk") - .withApplicationName("txukcdmp") - .withProvisioningState(Status.FAILED) - .withResourceUsageId("y"); + Provider model = new Provider().withProviderId("ppeebvmgxsab") + .withProviderSku("qduujitcjczdz") + .withInstanceUri("ndhkrw") + .withApplicationName("appd") + .withProvisioningState(Status.DELETING) + .withResourceUsageId("vwrwj") + .withQuotas( + new QuotaAllocations().withStandardMinutesLifetime(2141844336).withHighMinutesLifetime(1882901501)); model = BinaryData.fromObject(model).toObject(Provider.class); - Assertions.assertEquals("mofcq", model.providerId()); - Assertions.assertEquals("my", model.providerSku()); - Assertions.assertEquals("kdtmlxhekuk", model.instanceUri()); - Assertions.assertEquals("txukcdmp", model.applicationName()); - Assertions.assertEquals(Status.FAILED, model.provisioningState()); - Assertions.assertEquals("y", model.resourceUsageId()); + Assertions.assertEquals("ppeebvmgxsab", model.providerId()); + Assertions.assertEquals("qduujitcjczdz", model.providerSku()); + Assertions.assertEquals("ndhkrw", model.instanceUri()); + Assertions.assertEquals("appd", model.applicationName()); + Assertions.assertEquals(Status.DELETING, model.provisioningState()); + Assertions.assertEquals("vwrwj", model.resourceUsageId()); + Assertions.assertEquals(2141844336, model.quotas().standardMinutesLifetime()); + Assertions.assertEquals(1882901501, model.quotas().highMinutesLifetime()); } } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/QuantumSuiteOfferInnerTests.java b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/QuantumSuiteOfferInnerTests.java new file mode 100644 index 000000000000..a4fbadbff561 --- /dev/null +++ b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/QuantumSuiteOfferInnerTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quantum.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.quantum.fluent.models.QuantumSuiteOfferInner; +import org.junit.jupiter.api.Assertions; + +public final class QuantumSuiteOfferInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + QuantumSuiteOfferInner model = BinaryData.fromString( + "{\"properties\":{\"providerId\":\"ovmclwhijcoejct\",\"providerName\":\"zaqsqsycbkbfk\",\"companyName\":\"ukdkexxppofmxa\",\"location\":\"c\",\"description\":\"jpgd\",\"quotas\":{\"standardMinutesLifetime\":1410609059,\"highMinutesLifetime\":1992126973}},\"id\":\"xhvpmoue\",\"name\":\"hd\",\"type\":\"xibqeojnx\"}") + .toObject(QuantumSuiteOfferInner.class); + Assertions.assertEquals("ovmclwhijcoejct", model.properties().providerId()); + Assertions.assertEquals("zaqsqsycbkbfk", model.properties().providerName()); + Assertions.assertEquals("ukdkexxppofmxa", model.properties().companyName()); + Assertions.assertEquals("c", model.properties().location()); + Assertions.assertEquals("jpgd", model.properties().description()); + Assertions.assertEquals(1410609059, model.properties().quotas().standardMinutesLifetime()); + Assertions.assertEquals(1992126973, model.properties().quotas().highMinutesLifetime()); + } +} diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/QuantumSuiteOfferListResultTests.java b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/QuantumSuiteOfferListResultTests.java new file mode 100644 index 000000000000..e2184f9c1f53 --- /dev/null +++ b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/QuantumSuiteOfferListResultTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quantum.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.quantum.implementation.models.QuantumSuiteOfferListResult; +import org.junit.jupiter.api.Assertions; + +public final class QuantumSuiteOfferListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + QuantumSuiteOfferListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"providerId\":\"eeh\",\"providerName\":\"zvypyqrimzinp\",\"companyName\":\"swjdkirso\",\"location\":\"dqxhcrmnohjtckwh\",\"description\":\"soifiyipjxsqw\",\"quotas\":{\"standardMinutesLifetime\":629629065,\"highMinutesLifetime\":1124714443}},\"id\":\"norcjxvsnbyxqab\",\"name\":\"mocpc\",\"type\":\"shurzafbljjgpbto\"},{\"properties\":{\"providerId\":\"jmkljavbqidtqajz\",\"providerName\":\"ulpkudjkrl\",\"companyName\":\"hbzhfepg\",\"location\":\"gqexzlocxs\",\"description\":\"paierh\",\"quotas\":{\"standardMinutesLifetime\":1404885770,\"highMinutesLifetime\":539678864}},\"id\":\"ummajtjaod\",\"name\":\"obnbdxkqpxokaj\",\"type\":\"onpimexgstxg\"}],\"nextLink\":\"odgmaajrmvdjwz\"}") + .toObject(QuantumSuiteOfferListResult.class); + Assertions.assertEquals("eeh", model.value().get(0).properties().providerId()); + Assertions.assertEquals("zvypyqrimzinp", model.value().get(0).properties().providerName()); + Assertions.assertEquals("swjdkirso", model.value().get(0).properties().companyName()); + Assertions.assertEquals("dqxhcrmnohjtckwh", model.value().get(0).properties().location()); + Assertions.assertEquals("soifiyipjxsqw", model.value().get(0).properties().description()); + Assertions.assertEquals(629629065, model.value().get(0).properties().quotas().standardMinutesLifetime()); + Assertions.assertEquals(1124714443, model.value().get(0).properties().quotas().highMinutesLifetime()); + Assertions.assertEquals("odgmaajrmvdjwz", model.nextLink()); + } +} diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/QuantumSuiteOfferPropertiesTests.java b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/QuantumSuiteOfferPropertiesTests.java new file mode 100644 index 000000000000..d5d8b4ac7357 --- /dev/null +++ b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/QuantumSuiteOfferPropertiesTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quantum.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.quantum.models.QuantumSuiteOfferProperties; +import org.junit.jupiter.api.Assertions; + +public final class QuantumSuiteOfferPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + QuantumSuiteOfferProperties model = BinaryData.fromString( + "{\"providerId\":\"bzv\",\"providerName\":\"dntwndeicbtw\",\"companyName\":\"pzaoqvuhr\",\"location\":\"cffcyddglmj\",\"description\":\"hjq\",\"quotas\":{\"standardMinutesLifetime\":1616692109,\"highMinutesLifetime\":1725264760}}") + .toObject(QuantumSuiteOfferProperties.class); + Assertions.assertEquals("bzv", model.providerId()); + Assertions.assertEquals("dntwndeicbtw", model.providerName()); + Assertions.assertEquals("pzaoqvuhr", model.companyName()); + Assertions.assertEquals("cffcyddglmj", model.location()); + Assertions.assertEquals("hjq", model.description()); + Assertions.assertEquals(1616692109, model.quotas().standardMinutesLifetime()); + Assertions.assertEquals(1725264760, model.quotas().highMinutesLifetime()); + } +} diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/QuantumWorkspaceIdentityTests.java b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/QuantumWorkspaceIdentityTests.java deleted file mode 100644 index 8bb2736853bd..000000000000 --- a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/QuantumWorkspaceIdentityTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.quantum.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quantum.models.QuantumWorkspaceIdentity; -import com.azure.resourcemanager.quantum.models.ResourceIdentityType; -import org.junit.jupiter.api.Assertions; - -public final class QuantumWorkspaceIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QuantumWorkspaceIdentity model - = BinaryData.fromString("{\"principalId\":\"nzwuxzd\",\"tenantId\":\"a\",\"type\":\"None\"}") - .toObject(QuantumWorkspaceIdentity.class); - Assertions.assertEquals(ResourceIdentityType.NONE, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QuantumWorkspaceIdentity model = new QuantumWorkspaceIdentity().withType(ResourceIdentityType.NONE); - model = BinaryData.fromObject(model).toObject(QuantumWorkspaceIdentity.class); - Assertions.assertEquals(ResourceIdentityType.NONE, model.type()); - } -} diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/TagsObjectTests.java b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/QuantumWorkspaceTagsUpdateTests.java similarity index 50% rename from sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/TagsObjectTests.java rename to sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/QuantumWorkspaceTagsUpdateTests.java index 9576ff221164..081515a15088 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/TagsObjectTests.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/QuantumWorkspaceTagsUpdateTests.java @@ -1,28 +1,30 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quantum.models.TagsObject; +import com.azure.resourcemanager.quantum.models.QuantumWorkspaceTagsUpdate; import java.util.HashMap; import java.util.Map; import org.junit.jupiter.api.Assertions; -public final class TagsObjectTests { +public final class QuantumWorkspaceTagsUpdateTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - TagsObject model - = BinaryData.fromString("{\"tags\":{\"knryrtihfxtij\":\"whfpmrqobmtu\"}}").toObject(TagsObject.class); - Assertions.assertEquals("whfpmrqobmtu", model.tags().get("knryrtihfxtij")); + QuantumWorkspaceTagsUpdate model + = BinaryData.fromString("{\"tags\":{\"gzjaoyfhrtxilne\":\"bquxigjy\",\"wrlyxwjkcprb\":\"kujysvlejuvfq\"}}") + .toObject(QuantumWorkspaceTagsUpdate.class); + Assertions.assertEquals("bquxigjy", model.tags().get("gzjaoyfhrtxilne")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - TagsObject model = new TagsObject().withTags(mapOf("knryrtihfxtij", "whfpmrqobmtu")); - model = BinaryData.fromObject(model).toObject(TagsObject.class); - Assertions.assertEquals("whfpmrqobmtu", model.tags().get("knryrtihfxtij")); + QuantumWorkspaceTagsUpdate model = new QuantumWorkspaceTagsUpdate() + .withTags(mapOf("gzjaoyfhrtxilne", "bquxigjy", "wrlyxwjkcprb", "kujysvlejuvfq")); + model = BinaryData.fromObject(model).toObject(QuantumWorkspaceTagsUpdate.class); + Assertions.assertEquals("bquxigjy", model.tags().get("gzjaoyfhrtxilne")); } // Use "Map.of" if available diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/QuotaAllocationsTests.java b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/QuotaAllocationsTests.java new file mode 100644 index 000000000000..57a24821766a --- /dev/null +++ b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/QuotaAllocationsTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quantum.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.quantum.models.QuotaAllocations; +import org.junit.jupiter.api.Assertions; + +public final class QuotaAllocationsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + QuotaAllocations model + = BinaryData.fromString("{\"standardMinutesLifetime\":1102727938,\"highMinutesLifetime\":1294203653}") + .toObject(QuotaAllocations.class); + Assertions.assertEquals(1102727938, model.standardMinutesLifetime()); + Assertions.assertEquals(1294203653, model.highMinutesLifetime()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + QuotaAllocations model + = new QuotaAllocations().withStandardMinutesLifetime(1102727938).withHighMinutesLifetime(1294203653); + model = BinaryData.fromObject(model).toObject(QuotaAllocations.class); + Assertions.assertEquals(1102727938, model.standardMinutesLifetime()); + Assertions.assertEquals(1294203653, model.highMinutesLifetime()); + } +} diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/QuotaDimensionTests.java b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/QuotaDimensionTests.java index 0570aea56d06..7bfa0c77d8ab 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/QuotaDimensionTests.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/QuotaDimensionTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.generated; @@ -12,36 +12,15 @@ public final class QuotaDimensionTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { QuotaDimension model = BinaryData.fromString( - "{\"id\":\"hzdxssadbzm\",\"scope\":\"dfznudaodv\",\"period\":\"bncblylpstdbhhx\",\"quota\":95.43601,\"name\":\"zucerscdntnev\",\"description\":\"wjmy\",\"unit\":\"dsslswt\",\"unitPlural\":\"eriofzpyqs\"}") + "{\"id\":\"puqujmqlgkfbtn\",\"scope\":\"aongbj\",\"period\":\"tujitcjedft\",\"quota\":10.631758,\"name\":\"zkoj\",\"description\":\"c\",\"unit\":\"foqouicybx\",\"unitPlural\":\"zg\"}") .toObject(QuotaDimension.class); - Assertions.assertEquals("hzdxssadbzm", model.id()); - Assertions.assertEquals("dfznudaodv", model.scope()); - Assertions.assertEquals("bncblylpstdbhhx", model.period()); - Assertions.assertEquals(95.43601F, model.quota()); - Assertions.assertEquals("zucerscdntnev", model.name()); - Assertions.assertEquals("wjmy", model.description()); - Assertions.assertEquals("dsslswt", model.unit()); - Assertions.assertEquals("eriofzpyqs", model.unitPlural()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QuotaDimension model = new QuotaDimension().withId("hzdxssadbzm") - .withScope("dfznudaodv") - .withPeriod("bncblylpstdbhhx") - .withQuota(95.43601F) - .withName("zucerscdntnev") - .withDescription("wjmy") - .withUnit("dsslswt") - .withUnitPlural("eriofzpyqs"); - model = BinaryData.fromObject(model).toObject(QuotaDimension.class); - Assertions.assertEquals("hzdxssadbzm", model.id()); - Assertions.assertEquals("dfznudaodv", model.scope()); - Assertions.assertEquals("bncblylpstdbhhx", model.period()); - Assertions.assertEquals(95.43601F, model.quota()); - Assertions.assertEquals("zucerscdntnev", model.name()); - Assertions.assertEquals("wjmy", model.description()); - Assertions.assertEquals("dsslswt", model.unit()); - Assertions.assertEquals("eriofzpyqs", model.unitPlural()); + Assertions.assertEquals("puqujmqlgkfbtn", model.id()); + Assertions.assertEquals("aongbj", model.scope()); + Assertions.assertEquals("tujitcjedft", model.period()); + Assertions.assertEquals(10.631758F, model.quota()); + Assertions.assertEquals("zkoj", model.name()); + Assertions.assertEquals("c", model.description()); + Assertions.assertEquals("foqouicybx", model.unit()); + Assertions.assertEquals("zg", model.unitPlural()); } } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/SkuDescriptionTests.java b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/SkuDescriptionTests.java index a59d9ab27415..28f890334045 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/SkuDescriptionTests.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/SkuDescriptionTests.java @@ -1,79 +1,35 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quantum.models.PricingDetail; -import com.azure.resourcemanager.quantum.models.QuotaDimension; import com.azure.resourcemanager.quantum.models.SkuDescription; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class SkuDescriptionTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SkuDescription model = BinaryData.fromString( - "{\"id\":\"mcbxvwvxysl\",\"name\":\"hsfxoblytkb\",\"version\":\"pe\",\"description\":\"wfbkrvrns\",\"restrictedAccessUri\":\"hqjohxcrsbfova\",\"autoAdd\":false,\"targets\":[\"wbhsqfsub\"],\"quotaDimensions\":[{\"id\":\"irx\",\"scope\":\"ybsrfbjfdtwss\",\"period\":\"ftpvjzbexil\",\"quota\":45.3637,\"name\":\"qqnvwpmq\",\"description\":\"ruoujmk\",\"unit\":\"hwqytj\",\"unitPlural\":\"bnw\"}],\"pricingDetails\":[{\"id\":\"drjervnaenqpehin\",\"value\":\"ygmi\"},{\"id\":\"hnzdndslgnayqi\",\"value\":\"nduhavhqlkthum\"},{\"id\":\"olbgycduiertgccy\",\"value\":\"aolps\"},{\"id\":\"qlfmmdnbb\",\"value\":\"zpswiydmc\"}]}") + "{\"id\":\"ewzsyyceuzsoib\",\"name\":\"dpfrxtrthzvaytdw\",\"version\":\"brqubp\",\"description\":\"h\",\"restrictedAccessUri\":\"iilivpdtiirqtd\",\"autoAdd\":true,\"targets\":[\"r\",\"zfgs\",\"uyfxrxxleptramxj\",\"zwl\"],\"quotaDimensions\":[{\"id\":\"uqlcvydy\",\"scope\":\"tdooaoj\",\"period\":\"iodkooebwnujhem\",\"quota\":70.84255,\"name\":\"dkcrodt\",\"description\":\"nfwjlfltkacjvefk\",\"unit\":\"foakgg\",\"unitPlural\":\"pagao\"},{\"id\":\"ulpqblylsyxkqjn\",\"scope\":\"ervtiagxs\",\"period\":\"zuempsbzkf\",\"quota\":82.35743,\"name\":\"v\",\"description\":\"qi\",\"unit\":\"invkjjxdxrbuu\",\"unitPlural\":\"clewyhm\"},{\"id\":\"paztzpofncck\",\"scope\":\"fz\",\"period\":\"hxx\",\"quota\":8.546048,\"name\":\"a\",\"description\":\"feqztppriol\",\"unit\":\"rjaltolmncw\",\"unitPlural\":\"bqwcsdbnwdcf\"},{\"id\":\"cqdpfuv\",\"scope\":\"sbjjc\",\"period\":\"vxb\",\"quota\":53.5392,\"name\":\"dut\",\"description\":\"ormrlxqtvcofudfl\",\"unit\":\"gj\",\"unitPlural\":\"gdknnqv\"}],\"pricingDetails\":[{\"id\":\"qntorudsgsahmkyc\",\"value\":\"auwjuetaebu\"},{\"id\":\"vdmovsmzlxwabm\",\"value\":\"efkifr\"}]}") .toObject(SkuDescription.class); - Assertions.assertEquals("mcbxvwvxysl", model.id()); - Assertions.assertEquals("hsfxoblytkb", model.name()); - Assertions.assertEquals("pe", model.version()); - Assertions.assertEquals("wfbkrvrns", model.description()); - Assertions.assertEquals("hqjohxcrsbfova", model.restrictedAccessUri()); - Assertions.assertEquals(false, model.autoAdd()); - Assertions.assertEquals("wbhsqfsub", model.targets().get(0)); - Assertions.assertEquals("irx", model.quotaDimensions().get(0).id()); - Assertions.assertEquals("ybsrfbjfdtwss", model.quotaDimensions().get(0).scope()); - Assertions.assertEquals("ftpvjzbexil", model.quotaDimensions().get(0).period()); - Assertions.assertEquals(45.3637F, model.quotaDimensions().get(0).quota()); - Assertions.assertEquals("qqnvwpmq", model.quotaDimensions().get(0).name()); - Assertions.assertEquals("ruoujmk", model.quotaDimensions().get(0).description()); - Assertions.assertEquals("hwqytj", model.quotaDimensions().get(0).unit()); - Assertions.assertEquals("bnw", model.quotaDimensions().get(0).unitPlural()); - Assertions.assertEquals("drjervnaenqpehin", model.pricingDetails().get(0).id()); - Assertions.assertEquals("ygmi", model.pricingDetails().get(0).value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuDescription model = new SkuDescription().withId("mcbxvwvxysl") - .withName("hsfxoblytkb") - .withVersion("pe") - .withDescription("wfbkrvrns") - .withRestrictedAccessUri("hqjohxcrsbfova") - .withAutoAdd(false) - .withTargets(Arrays.asList("wbhsqfsub")) - .withQuotaDimensions(Arrays.asList(new QuotaDimension().withId("irx") - .withScope("ybsrfbjfdtwss") - .withPeriod("ftpvjzbexil") - .withQuota(45.3637F) - .withName("qqnvwpmq") - .withDescription("ruoujmk") - .withUnit("hwqytj") - .withUnitPlural("bnw"))) - .withPricingDetails(Arrays.asList(new PricingDetail().withId("drjervnaenqpehin").withValue("ygmi"), - new PricingDetail().withId("hnzdndslgnayqi").withValue("nduhavhqlkthum"), - new PricingDetail().withId("olbgycduiertgccy").withValue("aolps"), - new PricingDetail().withId("qlfmmdnbb").withValue("zpswiydmc"))); - model = BinaryData.fromObject(model).toObject(SkuDescription.class); - Assertions.assertEquals("mcbxvwvxysl", model.id()); - Assertions.assertEquals("hsfxoblytkb", model.name()); - Assertions.assertEquals("pe", model.version()); - Assertions.assertEquals("wfbkrvrns", model.description()); - Assertions.assertEquals("hqjohxcrsbfova", model.restrictedAccessUri()); - Assertions.assertEquals(false, model.autoAdd()); - Assertions.assertEquals("wbhsqfsub", model.targets().get(0)); - Assertions.assertEquals("irx", model.quotaDimensions().get(0).id()); - Assertions.assertEquals("ybsrfbjfdtwss", model.quotaDimensions().get(0).scope()); - Assertions.assertEquals("ftpvjzbexil", model.quotaDimensions().get(0).period()); - Assertions.assertEquals(45.3637F, model.quotaDimensions().get(0).quota()); - Assertions.assertEquals("qqnvwpmq", model.quotaDimensions().get(0).name()); - Assertions.assertEquals("ruoujmk", model.quotaDimensions().get(0).description()); - Assertions.assertEquals("hwqytj", model.quotaDimensions().get(0).unit()); - Assertions.assertEquals("bnw", model.quotaDimensions().get(0).unitPlural()); - Assertions.assertEquals("drjervnaenqpehin", model.pricingDetails().get(0).id()); - Assertions.assertEquals("ygmi", model.pricingDetails().get(0).value()); + Assertions.assertEquals("ewzsyyceuzsoib", model.id()); + Assertions.assertEquals("dpfrxtrthzvaytdw", model.name()); + Assertions.assertEquals("brqubp", model.version()); + Assertions.assertEquals("h", model.description()); + Assertions.assertEquals("iilivpdtiirqtd", model.restrictedAccessUri()); + Assertions.assertTrue(model.autoAdd()); + Assertions.assertEquals("r", model.targets().get(0)); + Assertions.assertEquals("uqlcvydy", model.quotaDimensions().get(0).id()); + Assertions.assertEquals("tdooaoj", model.quotaDimensions().get(0).scope()); + Assertions.assertEquals("iodkooebwnujhem", model.quotaDimensions().get(0).period()); + Assertions.assertEquals(70.84255F, model.quotaDimensions().get(0).quota()); + Assertions.assertEquals("dkcrodt", model.quotaDimensions().get(0).name()); + Assertions.assertEquals("nfwjlfltkacjvefk", model.quotaDimensions().get(0).description()); + Assertions.assertEquals("foakgg", model.quotaDimensions().get(0).unit()); + Assertions.assertEquals("pagao", model.quotaDimensions().get(0).unitPlural()); + Assertions.assertEquals("qntorudsgsahmkyc", model.pricingDetails().get(0).id()); + Assertions.assertEquals("auwjuetaebu", model.pricingDetails().get(0).value()); } } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/SuiteOffersListMockTests.java b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/SuiteOffersListMockTests.java new file mode 100644 index 000000000000..9f32da17e01d --- /dev/null +++ b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/SuiteOffersListMockTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quantum.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.quantum.AzureQuantumManager; +import com.azure.resourcemanager.quantum.models.QuantumSuiteOffer; +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 SuiteOffersListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"providerId\":\"vtbvkayh\",\"providerName\":\"tnvyqiatkzwp\",\"companyName\":\"npwzcjaes\",\"location\":\"vvsccyajguq\",\"description\":\"hwyg\",\"quotas\":{\"standardMinutesLifetime\":376601626,\"highMinutesLifetime\":307379599}},\"id\":\"fxusemdwzr\",\"name\":\"uh\",\"type\":\"pfcqdp\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + AzureQuantumManager manager = AzureQuantumManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.suiteOffers().list(com.azure.core.util.Context.NONE); + + Assertions.assertEquals("vtbvkayh", response.iterator().next().properties().providerId()); + Assertions.assertEquals("tnvyqiatkzwp", response.iterator().next().properties().providerName()); + Assertions.assertEquals("npwzcjaes", response.iterator().next().properties().companyName()); + Assertions.assertEquals("vvsccyajguq", response.iterator().next().properties().location()); + Assertions.assertEquals("hwyg", response.iterator().next().properties().description()); + Assertions.assertEquals(376601626, response.iterator().next().properties().quotas().standardMinutesLifetime()); + Assertions.assertEquals(307379599, response.iterator().next().properties().quotas().highMinutesLifetime()); + } +} diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/TargetDescriptionTests.java b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/TargetDescriptionTests.java index 547f9a42d0e9..524318b94077 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/TargetDescriptionTests.java +++ b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/TargetDescriptionTests.java @@ -1,39 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.quantum.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.quantum.models.TargetDescription; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class TargetDescriptionTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { TargetDescription model = BinaryData.fromString( - "{\"id\":\"rmfqjhhkxbpvj\",\"name\":\"jhxxjyn\",\"description\":\"divkrt\",\"acceptedDataFormats\":[\"xqzvszjfa\"],\"acceptedContentEncodings\":[\"fdxxivetvtcqaqtd\"]}") + "{\"id\":\"ag\",\"name\":\"vimjwos\",\"description\":\"xitc\",\"acceptedDataFormats\":[\"cktqumiekkezzi\",\"hlyfjhdgqgg\",\"bdunygaeqid\"],\"acceptedContentEncodings\":[\"atpxl\",\"rxcyjmoad\",\"uvarmywdmjsjq\",\"jhhyxxrwlycoduhp\"],\"numQubits\":1622537719,\"targetProfile\":\"ymareqnajxqugj\",\"metadata\":{\"mzqa\":\"\\\"datacubeddgssofw\\\"\",\"nbyxbaaabjyv\":\"\\\"datakrmnjijpxacqqud\\\"\",\"xnevfdnwn\":\"\\\"datayffimrzrtuzqogs\\\"\"}}") .toObject(TargetDescription.class); - Assertions.assertEquals("rmfqjhhkxbpvj", model.id()); - Assertions.assertEquals("jhxxjyn", model.name()); - Assertions.assertEquals("divkrt", model.description()); - Assertions.assertEquals("xqzvszjfa", model.acceptedDataFormats().get(0)); - Assertions.assertEquals("fdxxivetvtcqaqtd", model.acceptedContentEncodings().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TargetDescription model = new TargetDescription().withId("rmfqjhhkxbpvj") - .withName("jhxxjyn") - .withDescription("divkrt") - .withAcceptedDataFormats(Arrays.asList("xqzvszjfa")) - .withAcceptedContentEncodings(Arrays.asList("fdxxivetvtcqaqtd")); - model = BinaryData.fromObject(model).toObject(TargetDescription.class); - Assertions.assertEquals("rmfqjhhkxbpvj", model.id()); - Assertions.assertEquals("jhxxjyn", model.name()); - Assertions.assertEquals("divkrt", model.description()); - Assertions.assertEquals("xqzvszjfa", model.acceptedDataFormats().get(0)); - Assertions.assertEquals("fdxxivetvtcqaqtd", model.acceptedContentEncodings().get(0)); + Assertions.assertEquals("ag", model.id()); + Assertions.assertEquals("vimjwos", model.name()); + Assertions.assertEquals("xitc", model.description()); + Assertions.assertEquals("cktqumiekkezzi", model.acceptedDataFormats().get(0)); + Assertions.assertEquals("atpxl", model.acceptedContentEncodings().get(0)); } } diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/UserAssignedIdentityTests.java b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/UserAssignedIdentityTests.java new file mode 100644 index 000000000000..39a81921989c --- /dev/null +++ b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/UserAssignedIdentityTests.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.quantum.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.quantum.models.UserAssignedIdentity; + +public final class UserAssignedIdentityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UserAssignedIdentity model = BinaryData.fromString("{\"principalId\":\"htqqrolfp\",\"clientId\":\"s\"}") + .toObject(UserAssignedIdentity.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UserAssignedIdentity model = new UserAssignedIdentity(); + model = BinaryData.fromObject(model).toObject(UserAssignedIdentity.class); + } +} diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/WorkspaceOperationsCheckNameAvailabilityWithResponseMockTests.java b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/WorkspaceOperationsCheckNameAvailabilityWithResponseMockTests.java deleted file mode 100644 index 695b9ef62684..000000000000 --- a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/WorkspaceOperationsCheckNameAvailabilityWithResponseMockTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.quantum.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.quantum.AzureQuantumManager; -import com.azure.resourcemanager.quantum.models.CheckNameAvailabilityParameters; -import com.azure.resourcemanager.quantum.models.CheckNameAvailabilityResult; -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 WorkspaceOperationsCheckNameAvailabilityWithResponseMockTests { - @Test - public void testCheckNameAvailabilityWithResponse() throws Exception { - String responseStr = "{\"nameAvailable\":true,\"reason\":\"ncckw\",\"message\":\"zqwhxxbuyqaxzfeq\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureQuantumManager manager = AzureQuantumManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CheckNameAvailabilityResult response = manager.workspaceOperations() - .checkNameAvailabilityWithResponse("beyvpnqicvinvkjj", - new CheckNameAvailabilityParameters().withName("xrbuukzclew").withType("mlwpazt"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(true, response.nameAvailable()); - Assertions.assertEquals("ncckw", response.reason()); - } -} diff --git a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/WorkspacesDeleteMockTests.java b/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/WorkspacesDeleteMockTests.java deleted file mode 100644 index 4c6f2f346cd2..000000000000 --- a/sdk/quantum/azure-resourcemanager-quantum/src/test/java/com/azure/resourcemanager/quantum/generated/WorkspacesDeleteMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.quantum.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.quantum.AzureQuantumManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class WorkspacesDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AzureQuantumManager manager = AzureQuantumManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.workspaces().delete("uxvypomgkopkwh", "jvp", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/quantum/azure-resourcemanager-quantum/tsp-location.yaml b/sdk/quantum/azure-resourcemanager-quantum/tsp-location.yaml new file mode 100644 index 000000000000..5607ad8225aa --- /dev/null +++ b/sdk/quantum/azure-resourcemanager-quantum/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/quantum/Microsoft.Quantum.Management +commit: b9f84851bcc14f356b1719575b89e2c85143619f +repo: Azure/azure-rest-api-specs +additionalDirectories: